BPF List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Hui Zhu" <hui.zhu@linux.dev>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v2] selftests/bpf: Add bpf_proactive_reclaim test
Date: Mon, 28 Sep 2026 06:45:35 +0000	[thread overview]
Message-ID: <20260928064535.C68A31F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260928063724.24008-1-hui.zhu@linux.dev>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] selftests/bpf: memcg_proactive_reclaim test fails instead of skipping when regular fs is missing
--

commit 8a730887084ae177532f166fce0611c868fe9578
Author: Hui Zhu <zhuhui@kylinos.cn>

selftests/bpf: Add bpf_proactive_reclaim test

This commit adds a selftest for the bpf_proactive_reclaim() kfunc. It charges
page cache to a cgroup and issues a bounded reclaim pass using the BPF helper,
verifying that the result is capped correctly.

> diff --git a/tools/testing/selftests/bpf/prog_tests/memcg_proactive_reclaim.c b/tools/testing/selftests/bpf/prog_tests/memcg_proactive_reclaim.c
> new file mode 100644
> index 0000000000000..d642658a21981
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/prog_tests/memcg_proactive_reclaim.c
[ ... ]
> +static const char *workload_dir(void)
> +{
> +	static const char * const dirs[] = { "/tmp", "." };
> +	struct statfs st;
> +	int i;
> +
> +	for (i = 0; i < ARRAY_SIZE(dirs); i++)
> +		if (!statfs(dirs[i], &st) && st.f_type != TMPFS_MAGIC &&
> +		    st.f_type != RAMFS_MAGIC)
> +			return dirs[i];
> +
> +	return NULL;
> +}
> +
> +void test_memcg_proactive_reclaim(void)
> +{
[ ... ]
> +	dir = workload_dir();
> +	if (!ASSERT_OK_PTR(dir, "workload dir on a regular filesystem"))
> +		return;

[Severity: Medium]
Will this cause the test suite to incorrectly report a failure rather than a
skip when a regular filesystem is missing?

If workload_dir() returns NULL when both /tmp and . are tmpfs or ramfs (which
is common in CI or initramfs environments), using ASSERT_OK_PTR(dir) here
will fail the test suite explicitly. Should this skip the test instead?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260928063724.24008-1-hui.zhu@linux.dev?part=1

  reply	other threads:[~2026-09-28  6:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-28  6:37 [PATCH bpf-next v2] selftests/bpf: Add bpf_proactive_reclaim test Hui Zhu
2026-09-28  6:45 ` sashiko-bot [this message]
2026-09-28  6:50 ` Barry Song
2026-09-28  7:31 ` bot+bpf-ci

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=20260928064535.C68A31F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=hui.zhu@linux.dev \
    --cc=sashiko-reviews@lists.linux.dev \
    /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