linux/tools/testing/selftests/cgroup
Nhat Pham b93c28ff72 selftests: add zswapin and no zswap tests
Add a selftest to cover the zswapin code path, allocating more memory than
the cgroup limit to trigger swapout/zswapout, then reading the pages back
in memory several times.  This is inspired by a recently encountered
kernel crash on the zswapin path in our internal kernel, which went
undetected because of a lack of test coverage for this path.

Add a selftest to verify that when memory.zswap.max = 0, no pages can go
to the zswap pool for the cgroup.

[nphamcs@gmail.com: remove redundant comment, add success checks]
  Link: https://lkml.kernel.org/r/20240222043132.616320-1-nphamcs@gmail.com
Link: https://lkml.kernel.org/r/20240205225608.3083251-4-nphamcs@gmail.com
Signed-off-by: Nhat Pham <nphamcs@gmail.com>
Suggested-by: Rik van Riel <riel@surriel.com>
Suggested-by: Yosry Ahmed <yosryahmed@google.com>
Acked-by: Yosry Ahmed <yosryahmed@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: Zefan Li <lizefan.x@bytedance.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2024-02-22 15:27:16 -08:00
..
.gitignore selftests: add a selftest to verify hugetlb usage in memcg 2023-10-18 14:34:18 -07:00
cgroup_util.c selftests: cgroup: Minor code reorganizations 2023-07-10 10:29:23 -10:00
cgroup_util.h selftests: cgroup: Minor code reorganizations 2023-07-10 10:29:23 -10:00
config mm: memcontrol: drop dead CONFIG_MEMCG_SWAP config symbol 2022-10-03 14:03:36 -07:00
Makefile selftests: add a selftest to verify hugetlb usage in memcg 2023-10-18 14:34:18 -07:00
memcg_protection.m selftests: memcg: adjust expected reclaim values of protected cgroups 2022-05-27 09:33:45 -07:00
test_core.c selftests: cgroup: Minor code reorganizations 2023-07-10 10:29:23 -10:00
test_cpu.c cgroup: Add test_cpucg_max_nested() testcase 2022-04-25 07:27:31 -10:00
test_cpuset_prs.sh cgroup/cpuset: Expose cpuset.cpus.isolated 2023-11-28 06:45:11 -10:00
test_cpuset.c selftests: cgroup: Add cpuset migrations testcase 2023-07-10 10:29:53 -10:00
test_freezer.c selftests: cgroup: Fixes a typo in a comment 2023-11-12 09:29:59 -10:00
test_hugetlb_memcg.c selftests: add a selftest to verify hugetlb usage in memcg 2023-10-18 14:34:18 -07:00
test_kill.c tests/cgroup: test cgroup.kill 2021-05-10 10:41:11 -04:00
test_kmem.c selftests: cgroup: fix test_kmem_memcg_deletion kernel mem check 2023-08-24 16:20:27 -07:00
test_memcontrol.c selftests: cgroup: fix unexpected failure on test_memcg_sock 2023-06-23 16:59:26 -07:00
test_stress.sh kseltest/cgroup: Make test_stress.sh work if run interactively 2022-05-13 09:33:21 -10:00
test_zswap.c selftests: add zswapin and no zswap tests 2024-02-22 15:27:16 -08:00
wait_inotify.c kselftest/cgroup: Add cpuset v2 partition root state test 2022-09-04 10:47:28 -10:00
with_stress.sh selftests: cgroup: Run test_core under interfering stress 2019-10-07 07:11:54 -07:00