mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: bot+bpf-ci@kernel.org
To: jiayuan.chen@linux.dev,bpf@vger.kernel.org
Cc: jiayuan.chen@linux.dev,emil@etsalapatis.com,ast@kernel.org,daniel@iogearbox.net,andrii@kernel.org,eddyz87@gmail.com,memxor@gmail.com,martin.lau@linux.dev,song@kernel.org,yonghong.song@linux.dev,jolsa@kernel.org,ihor.solodrai@linux.dev,shuah@kernel.org,linux-kernel@vger.kernel.org,linux-kselftest@vger.kernel.org,ast@kernel.org,andrii@kernel.org,daniel@iogearbox.net,martin.lau@kernel.org,eddyz87@gmail.com,yonghong.song@linux.dev,mason@kernel.org,ihor.solodrai@linux.dev
Subject: Re: [PATCH bpf-next v9 3/3] selftests/bpf: Add a test for arena fault-in under memory.max
Date: Tue, 22 Sep 2026 11:28:01 +0000 (UTC)	[thread overview]
Message-ID: <971df1084475a7ffc9cb1863fb28d7031a56fad62bafc23656dd3a727c92ef30@mail.kernel.org> (raw)
In-Reply-To: <20260922101831.192102-4-jiayuan.chen@linux.dev>

[-- Attachment #1: Type: text/plain, Size: 2315 bytes --]

> diff --git a/tools/testing/selftests/bpf/prog_tests/arena_memcg.c b/tools/testing/selftests/bpf/prog_tests/arena_memcg.c
> new file mode 100644
> index 0000000000000..c76a7eb2f01d9
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/prog_tests/arena_memcg.c

[ ... ]

> +	/*
> +	 * Step 5: fault ARENA_FAULT of arena in, much more than
> +	 * HEADROOM. Once it hits memory.max every further page has to
> +	 * come from reclaiming the page cache. With the fix the
> +	 * fault-in reclaims and all of it succeeds; without it the
> +	 * allocation cannot reclaim and we die on a valid address.
> +	 */
> +	for (i = 0; i < npages; i++)
> +		base[(size_t)i * ps] = 1;
> +	_exit(0); /* fd deliberately kept open until here */
> +}
> +
> +	if (!ASSERT_EQ(waitpid(pid, &status, 0), pid, "waitpid"))
> +		goto out;
> +
> +	/* The working directory cannot hold a reclaimable page cache. */
> +	if (WIFEXITED(status) && WEXITSTATUS(status) == CHILD_UNSUPPORTED) {
> +		fprintf(stderr, "%s:SKIP:no disk-backed O_TMPFILE in cwd\n", __func__);
> +		test__skip();
> +		goto out;
> +	}
> +
> +	/* A non-zero exit means the child failed to set up; the code says where. */
> +	if (WIFEXITED(status) && WEXITSTATUS(status)) {
> +		ASSERT_OK(WEXITSTATUS(status), "child setup");
> +		goto out;
> +	}
> +
> +	/*
> +	 * With the fix the arena fault-in reclaims the page cache and every
> +	 * fault succeeds, so the child exits 0. Without it the allocation
> +	 * cannot reclaim, fails once the headroom is used up, and the child
> +	 * dies with SIGSEGV on a valid arena address.
> +	 */

This isn't a bug, but since the Step 5 comment 25 lines above already
explains the fixed vs. unfixed outcome (fault-in reclaims and succeeds vs.
allocation cannot reclaim and dies on valid address), would it read better
to keep just one of the two explanations?

> +	if (!ASSERT_TRUE(WIFEXITED(status) && !WEXITSTATUS(status),
> +			 "child faulted the arena in")) {
> +		if (WIFSIGNALED(status))
> +			fprintf(stderr, "child killed by signal %d\n", WTERMSIG(status));
> +		dump_memcg();
> +	}

[ ... ]


---
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/35716612692

      reply	other threads:[~2026-09-22 11:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-22 10:17 [PATCH bpf-next v9 0/3] bpf: arena: handle memory.max on fault-in with reclaim Jiayuan Chen
2026-09-22 10:17 ` [PATCH bpf-next v9 1/3] bpf: arena: allocate the fault-in page outside the lock Jiayuan Chen
2026-09-22 10:17 ` [PATCH bpf-next v9 2/3] selftests/bpf: Add read_cgroup_file() to cgroup_helpers Jiayuan Chen
2026-09-22 10:17 ` [PATCH bpf-next v9 3/3] selftests/bpf: Add a test for arena fault-in under memory.max Jiayuan Chen
2026-09-22 11:28   ` bot+bpf-ci [this message]

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=971df1084475a7ffc9cb1863fb28d7031a56fad62bafc23656dd3a727c92ef30@mail.kernel.org \
    --to=bot+bpf-ci@kernel.org \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=emil@etsalapatis.com \
    --cc=ihor.solodrai@linux.dev \
    --cc=jiayuan.chen@linux.dev \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=martin.lau@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=mason@kernel.org \
    --cc=memxor@gmail.com \
    --cc=shuah@kernel.org \
    --cc=song@kernel.org \
    --cc=yonghong.song@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

all inboxes | Powered by JetHome®