All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alexei Starovoitov" <alexei.starovoitov@gmail.com>
To: "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 v3 3/7] bpf: Add sleepable arena page allocation path
Date: Fri, 25 Sep 2026 21:25:48 +0000	[thread overview]
Message-ID: <DLOPQUOW1A97.1KXFXSEUUNSFT@gmail.com> (raw)
In-Reply-To: <20260925203939.4105-4-emil@etsalapatis.com>

On Fri, Sep 25, 2026 at 08:39 PM Emil Tsalapatis <emil@etsalapatis.com> wrote:
> Since allocation now happens before range-tree arbitration, concurrent
> callers can allocate pages for competing requests. Bound the aggregate
> number of pages in this pre-arbitration window to the configured maximum
> size of the arena.

The pages are allocated with __GFP_ACCOUNT. memcg bounds them already.
Let's drop nr_pages_inflight. Seems like unnecessary complication.

> +out_unmap:
> +	if (sleepable)
> +		flush_vmap_cache(kern_vm_start + uaddr32, mapped << PAGE_SHIFT);
>  	range_tree_set(&arena->rt, pgoff + mapped, page_cnt - mapped);
>  	raw_res_spin_unlock_irqrestore(&arena->spinlock, flags);
> -	if (mapped) {
> -		flush_vmap_cache(kern_vm_start + uaddr32, mapped << PAGE_SHIFT);
> +	if (mapped || sleepable) {
> +		if (!sleepable)
> +			flush_vmap_cache(kern_vm_start + uaddr32, mapped << PAGE_SHIFT);
>  		arena_free_pages(arena, uaddr32, mapped, sleepable);
>  	}

v2 leftovers? It doesn't depend on sleepable ?

pw-bot: cr

  reply	other threads:[~2026-09-25 21:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-25 20:39 [PATCH bpf v3 0/7] Make sleepable arena paths use sleepable alloc_pages Emil Tsalapatis
2026-09-25 20:39 ` [PATCH bpf v3 1/7] bpf: Use an llist for page allocations Emil Tsalapatis
2026-09-25 20:39 ` [PATCH bpf v3 2/7] bpf: Add sleepable argument to bpf_alloc_pages() Emil Tsalapatis
2026-09-25 20:39 ` [PATCH bpf v3 3/7] bpf: Add sleepable arena page allocation path Emil Tsalapatis
2026-09-25 21:25   ` Alexei Starovoitov [this message]
2026-09-25 21:57     ` Emil Tsalapatis
2026-09-26  7:47       ` Alexei Starovoitov
2026-09-25 20:39 ` [PATCH bpf v3 4/7] selftests/bpf: Test large allocations for both sleepable/nonsleepable arena users Emil Tsalapatis
2026-09-25 20:39 ` [PATCH bpf v3 5/7] bpf: Support call-site kfunc specialization for near calls Emil Tsalapatis
2026-09-25 20:39 ` [PATCH bpf v3 6/7] bpf: Support call-site kfunc specialization for far calls Emil Tsalapatis
2026-09-25 20:39 ` [PATCH bpf v3 7/7] selftests/bpf: Test per-call site function specialization 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=DLOPQUOW1A97.1KXFXSEUUNSFT@gmail.com \
    --to=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=emil@etsalapatis.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.