Re: [PATCH v2 2/4] selftests/cgroup: add memcg_stat_cross_cpu correctness test for flush

JP Kobryn <[email protected]> Wed, 22 Jul 2026 11:42:58 -0700
Newsgroups dev.linux.lists.sched-ext,dev.linux.lists.llvm,org.kernel.vger.bpf,org.kernel.vger.cgroups,org.kernel.vger.linux-input,org.kernel.vger.linux-kernel,org.kernel.vger.linux-kselftest,org.kvack.linux-mm
Message-ID <[email protected]>
On 7/21/26 10:48 AM, Ziyang Men wrote:
> Add a test_progs selftest that verifies the memory-cgroup BPF kfuncs
> 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.
>
Can you extend the existing test instead of adding a new one?