[PATCH 0/2] kselftests: cgroup: fix test_kmem false failures
From: ranxiaokai627
Date: Tue Apr 14 2026 - 07:09:54 EST
From: Ran Xiaokai <ran.xiaokai@xxxxxxxxxx>
This patchset fixes two issues in testing/selftests/cgroup/test_kmem.c
that cause false test failures under certain system configurations.
Patch 1/2 updates the MAX_VMSTAT_ERROR tolerance to account for the
multi-memcg percpu charge cache introduced by commit f735eebe55f8
("memcg: multi-memcg percpu charge cache") with NR_MEMCG_STOCK
(currently 7) slots per CPU, the worst-case discrepancy between
memory.current and memory.stat.percpu has increased.
Patch 2/2 fixes the test_percpu_basic test to account for slab memory
overhead. On systems with few CPUs (<= 4), slab consumption exceeds
percpu usage, causing the test to fail even when the percpu accounting
is working correctly.
Ran Xiaokai (2):
kselftests: cgroup: update kmem test tolerance for multi-memcg stock
kselftests: cgroup: account for slab memory in test_percpu_basic
tools/testing/selftests/cgroup/test_kmem.c | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
--
2.25.1