linux/tools/testing/selftests/cgroup
Roman Gushchin 933dc80ec2 kselftests: cgroup: add kernel memory accounting tests
Add some tests to cover the kernel memory accounting functionality.  These
are covering some issues (and changes) we had recently.

1) A test which allocates a lot of negative dentries, checks memcg slab
   statistics, creates memory pressure by setting memory.max to some low
   value and checks that some number of slabs was reclaimed.

2) A test which covers side effects of memcg destruction: it creates
   and destroys a large number of sub-cgroups, each containing a
   multi-threaded workload which allocates and releases some kernel
   memory.  Then it checks that the charge ans memory.stats do add up on
   the parent level.

3) A test which reads /proc/kpagecgroup and implicitly checks that it
   doesn't crash the system.

4) A test which spawns a large number of threads and checks that the
   kernel stacks accounting works as expected.

5) A test which checks that living charged slab objects are not
   preventing the memory cgroup from being released after being deleted by
   a user.

Signed-off-by: Roman Gushchin <guro@fb.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Christoph Lameter <cl@linux.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Shakeel Butt <shakeelb@google.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Link: http://lkml.kernel.org/r/20200623174037.3951353-19-guro@fb.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-08-07 11:33:25 -07:00
..
.gitignore kselftests: cgroup: add kernel memory accounting tests 2020-08-07 11:33:25 -07:00
cgroup_util.c tools/testing/selftests/cgroup/cgroup_util.c: cg_read_strcmp: fix null pointer dereference 2020-08-07 11:33:21 -07:00
cgroup_util.h selftests/cgroup: add tests for cloning into cgroups 2020-02-12 17:57:51 -05:00
Makefile kselftests: cgroup: add kernel memory accounting tests 2020-08-07 11:33:25 -07:00
test_core.c selftests/cgroup: add tests for cloning into cgroups 2020-02-12 17:57:51 -05:00
test_freezer.c kselftests: cgroup: Avoid the reuse of fd after it is deallocated 2019-11-12 07:33:59 -08:00
test_kmem.c kselftests: cgroup: add kernel memory accounting tests 2020-08-07 11:33:25 -07:00
test_memcontrol.c kselftest/cgroup: fix unexpected testing failure on test_memcontrol 2019-05-30 08:19:17 -06:00
test_stress.sh selftests: cgroup: Run test_core under interfering stress 2019-10-07 07:11:54 -07:00
with_stress.sh selftests: cgroup: Run test_core under interfering stress 2019-10-07 07:11:54 -07:00