Re: [PATCH bpf-next v12 2/2] selftests/bpf: Add memcg async reclaim test
From: Alexei Starovoitov
Date: Fri Sep 18 2026 - 11:44:08 EST
On Fri, Sep 18, 2026 at 02:58 PM Hui Zhu <hui.zhu@xxxxxxxxx> wrote:
> From: Hui Zhu <zhuhui@xxxxxxxxxx>
>
> Exercise BPF-driven async proactive reclaim. A BPF program watches the
> refault stats of a memory-pressured cgroup and, once they grow, reclaims
> a second cgroup from a bpf_wq callback through bpf_proactive_reclaim().
> Pass/fail rests on the reclaim counters. The workload timings are a
> benchmark, not a criterion, so they are logged only under
> TEST_MEMCG_ASYNC_RECLAIM_BENCH=1, which also runs a baseline without the
> BPF program, recreating the cgroups in between so both runs start cold.
[...]
> Signed-off-by: Hui Zhu <zhuhui@xxxxxxxxxx>
> ---
> tools/testing/selftests/bpf/config | 1 +
> .../bpf/prog_tests/memcg_async_reclaim.c | 890 ++++++++++++++++++
> .../selftests/bpf/progs/memcg_async_reclaim.c | 327 +++++++
> 3 files changed, 1218 insertions(+)
1200 lines of selftest for a 20 line kfunc ?
Sorry that's an overkill.
pw-
bot: cr