mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-11 08:14:27 +08:00
933dc80ec2
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>
19 lines
538 B
Makefile
19 lines
538 B
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
CFLAGS += -Wall -pthread
|
|
|
|
all:
|
|
|
|
TEST_FILES := with_stress.sh
|
|
TEST_PROGS := test_stress.sh
|
|
TEST_GEN_PROGS = test_memcontrol
|
|
TEST_GEN_PROGS += test_kmem
|
|
TEST_GEN_PROGS += test_core
|
|
TEST_GEN_PROGS += test_freezer
|
|
|
|
include ../lib.mk
|
|
|
|
$(OUTPUT)/test_memcontrol: cgroup_util.c ../clone3/clone3_selftests.h
|
|
$(OUTPUT)/test_kmem: cgroup_util.c ../clone3/clone3_selftests.h
|
|
$(OUTPUT)/test_core: cgroup_util.c ../clone3/clone3_selftests.h
|
|
$(OUTPUT)/test_freezer: cgroup_util.c ../clone3/clone3_selftests.h
|