From: sashiko-bot@kernel.org
To: "Zhen Ni" <zhen.ni@easystack.cn>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH v2 6/6] selftests/bpf: add tests for the page_owner bpf_iter target
Date: Tue, 13 Oct 2026 12:38:04 +0000 [thread overview]
Message-ID: <sashiko-outbox-169725@kernel.org> (raw)
In-Reply-To: <20261013122125.843451-7-zhen.ni@easystack.cn>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] bpf/selftests: hardcoded errno values break architecture portability
--
commit d63d4254b64f243f696e8d9b4ca8b07f371d8139
Author: Zhen Ni <zhen.ni@easystack.cn>
selftests/bpf: add tests for the page_owner bpf_iter target
This commit adds a sleepable BPF program and a userspace runner to test
the seq_file and open-coded page_owner iterators. It verifies iterator
parity, output matching, and kfunc contracts including memcg classification.
> diff --git a/tools/testing/selftests/bpf/progs/bpf_iter_page_owner.c b/tools/testing/selftests/bpf/progs/bpf_iter_page_owner.c
> new file mode 100644
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/progs/bpf_iter_page_owner.c
[ ... ]
> +char memcg_pathbuf[4096];
> +char memcg_first_path[4096];
> +char memcg_first_name[80];
> +
> +#define MEMCG_ENODATA 61
> +#define MEMCG_EOPNOTSUPP 95
> +
> +#define MEMCG_F_ONLINE (1 << 0)
> +#define MEMCG_F_OBJCG (1 << 1)
[Severity: Medium]
Will these hardcoded errno values cause a regression in the selftests on
certain architectures?
The bpf_page_owner_get_memcg_info() kfunc returns standard kernel error
codes like -ENODATA and -EOPNOTSUPP. However, these error codes vary by
architecture. For example, ENODATA is 111 on SPARC and 86 on Alpha, while
EOPNOTSUPP is 122 on MIPS.
When the test runs on these architectures, the kfunc will return the
architecture-specific error code. This will fail the hardcoded comparison
in check_memcg(), incorrectly incrementing memcg_bad and causing the
selftest to fail.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261013122125.843451-1-zhen.ni@easystack.cn?part=6
next prev parent reply other threads:[~2026-10-13 12:38 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-13 12:21 [PATCH v2 0/6] mm/page_owner: add bpf_iter and kfuncs Zhen Ni
2026-10-13 12:21 ` [PATCH v2 1/6] mm/page_owner: extract page_owner_next_eligible() from read loop Zhen Ni
2026-10-13 12:21 ` [PATCH v2 2/6] mm/page_owner: add bpf_iter target "page_owner" Zhen Ni
2026-10-13 13:51 ` bot+bpf-ci
2026-10-13 12:21 ` [PATCH v2 3/6] mm/page_owner: add open-coded page_owner iterator Zhen Ni
2026-10-13 12:49 ` sashiko-bot
2026-10-13 13:51 ` bot+bpf-ci
2026-10-13 12:21 ` [PATCH v2 4/6] mm/page_owner: record the NUMA node in the scan cursor Zhen Ni
2026-10-13 12:36 ` sashiko-bot
2026-10-13 12:21 ` [PATCH v2 5/6] mm/page_owner: add bpf_page_owner_get_memcg_info() kfunc Zhen Ni
2026-10-13 12:49 ` sashiko-bot
2026-10-13 12:21 ` [PATCH v2 6/6] selftests/bpf: add tests for the page_owner bpf_iter target Zhen Ni
2026-10-13 12:38 ` sashiko-bot [this message]
2026-10-13 17:17 ` [PATCH v2 0/6] mm/page_owner: add bpf_iter and kfuncs Zi Yan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-169725@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=zhen.ni@easystack.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox