From: "Emil Tsalapatis" <emil@etsalapatis.com>
To: "Alexei Starovoitov" <alexei.starovoitov@gmail.com>,
"Emil Tsalapatis" <emil@etsalapatis.com>, <bpf@vger.kernel.org>
Cc: <andrii@kernel.org>, <eddyz87@gmail.com>, <memxor@gmail.com>,
<daniel@iogearbox.net>
Subject: Re: [PATCH bpf v2 1/2] bpf: Add sleepable arena page allocation path
Date: Thu, 24 Sep 2026 22:03:57 +0000 [thread overview]
Message-ID: <DLNVXIS2M1DR.A0RIZCKWG1UN@etsalapatis.com> (raw)
In-Reply-To: <DLNVA9111IMS.2GQ5DERPDAH6I@gmail.com>
On Thu Sep 24, 2026 at 9:33 PM UTC, Alexei Starovoitov wrote:
> On Thu, Sep 24, 2026 at 05:36 AM Emil Tsalapatis <emil@etsalapatis.com> wrote:
>> Add a separate arena page allocation path just for sleepable callers.
>> The path preallocates the arena memory to be added to the tree before
>> taking the critical section.
>
> Another idea...
> can we drop pages[] and link the pages via page->pcp_llist
> the way apply_range_clear_cb() does on the free side ?
>
> Then both sleepable and non-sleepable allocate all pages before
> taking the lock and there is no need for kvcalloc vs kmalloc_nolock,
> batching, etc.
> The whole function will probably be much simpler.
That would be ideal. Most of the complexity of this has been shaping the
function around the fact we need these intermediate arrays that force us
to drop the lock to refill/possibly require significant memory allocations.
pcp_llist should be available to use after allocating the page. I'll adjust
and resend.
>
> pw-bot: cr
next prev parent reply other threads:[~2026-09-24 22:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-24 5:36 [PATCH bpf v2 0/2] Make sleepable arena paths use sleepable alloc_pages Emil Tsalapatis
2026-09-24 5:36 ` [PATCH bpf v2 1/2] bpf: Add sleepable arena page allocation path Emil Tsalapatis
2026-09-24 6:29 ` bot+bpf-ci
2026-09-24 18:29 ` Emil Tsalapatis
2026-09-24 10:11 ` Jiayuan Chen
2026-09-24 17:56 ` Emil Tsalapatis
2026-09-24 21:33 ` Alexei Starovoitov
2026-09-24 22:03 ` Emil Tsalapatis [this message]
2026-09-24 5:36 ` [PATCH bpf v2 2/2] selftests/bpf: Test large allocations for both sleepable/nonsleepable arena users Emil Tsalapatis
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=DLNVXIS2M1DR.A0RIZCKWG1UN@etsalapatis.com \
--to=emil@etsalapatis.com \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=memxor@gmail.com \
/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