Re: [PATCH v2 2/4] selftests/cgroup: add memcg_stat_cross_cpu correctness test for flush
From: JP Kobryn
Date: Wed Jul 22 2026 - 14:43:44 EST
On 7/21/26 10:48 AM, Ziyang Men wrote:
Add a test_progs selftest that verifies the memory-cgroup BPF kfuncsCan you extend the existing test instead of adding a new one?
return values that agree with what userspace reads from cgroupfs, across
a whole cgroup subtree that has been charged on many CPUs.
It complements the existing cgroup_iter_memcg test. cgroup_iter_memcg
calls the memcg kfuncs on a single cgroup (BPF_CGROUP_ITER_SELF_ONLY) and
only asserts each value is greater than zero, so it never checks that a
value is actually correct. This test compares the kfunc values against
what userspace reads from memory.stat, and checks every node in the
cgroup tree.