Re: [PATCH bpf-next 1/3] selftests/bpf: Check bpf_mem_cgroup_page_state return value
From: hui . zhu
Date: Thu Feb 12 2026 - 04:23:22 EST
2026年2月12日 16:50, bot+bpf-ci@xxxxxxxxxx mailto:bot+bpf-ci@xxxxxxxxxx 写到:
>
> >
> > diff --git a/tools/testing/selftests/bpf/prog_tests/cgroup_iter_memcg.c b/tools/testing/selftests/bpf/prog_tests/cgroup_iter_memcg.c
> > --- a/tools/testing/selftests/bpf/prog_tests/cgroup_iter_memcg.c
> > +++ b/tools/testing/selftests/bpf/prog_tests/cgroup_iter_memcg.c
> >
> [ ... ]
>
> >
> > @@ -170,6 +180,8 @@ static void test_pgfault(struct bpf_link *link, struct memcg_query *memcg_query)
> > if (!ASSERT_OK(read_stats(link), "read stats"))
> > goto cleanup;
> >
> > + ASSERT_NEQ(memcg_query->pgfault, (unsigned long)-1,
> > + "bpf_mem_cgroup_page_state PGFAULT");
> >
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> The assertion message references bpf_mem_cgroup_page_state(), but the BPF
> program actually uses bpf_mem_cgroup_vm_events() to retrieve the pgfault
> value:
>
> tools/testing/selftests/bpf/progs/cgroup_iter_memcg.c:
> memcg_query.pgfault = bpf_mem_cgroup_vm_events(memcg, PGFAULT);
>
> Should the message be "bpf_mem_cgroup_vm_events PGFAULT" instead?
Good catch! I will fix it in the next version.
Best,
Hui
>
> ---
> AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
> See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
>
> CI run summary: https://github.com/kernel-patches/bpf/actions/runs/21939182103
>
> AI-authorship-score: low
> AI-authorship-explanation: The commit message uses first-person narrative describing a real back-porting scenario, and the code changes are simple repetitive assertions typical of human-written test improvements.
> issues-found: 1
> issue-severity-score: low
> issue-severity-explanation: Minor documentation issue where an assertion message references the wrong BPF function name; does not affect test correctness or system behavior.
>