From: Vlastimil Babka <vbabka@suse.cz>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>,
Harry Yoo <harry.yoo@oracle.com>
Cc: bpf <bpf@vger.kernel.org>, Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Martin KaFai Lau <martin.lau@kernel.org>,
Shakeel Butt <shakeel.butt@linux.dev>,
Peilin Ye <yepeilin@google.com>, linux-mm <linux-mm@kvack.org>,
Kernel Team <kernel-team@fb.com>
Subject: Re: [PATCH v2 bpf] bpf: Replace bpf_map_kmalloc_node() with kmalloc_nolock() to allocate bpf_async_cb structures.
Date: Wed, 15 Oct 2025 12:06:08 +0200 [thread overview]
Message-ID: <7b83d4e3-f18e-4c0d-91ad-bf1512f68600@suse.cz> (raw)
In-Reply-To: <CAADnVQLJ33_az3qK49PDwjh5aeSirUOuiJax+-7p2S3MKziaoA@mail.gmail.com>
On 10/15/25 04:12, Alexei Starovoitov wrote:
> On Tue, Oct 14, 2025 at 6:59 PM Harry Yoo <harry.yoo@oracle.com> wrote:
>>
>> >
>> > Fixes: 6d78b4473cdb ("bpf: Tell memcg to use allow_spinning=false path in bpf_timer_init()")
>> > Reviewed-by: Shakeel Butt <shakeel.butt@linux.dev>
>> > Signed-off-by: Alexei Starovoitov <ast@kernel.org>
>> > ---
>>
>> LGTM,
>> Acked-by: Harry Yoo <harry.yoo@oracle.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
>>
>> So we're losing benefit of batch-processing via kfree_rcu() and
>> instead using call_rcu(), and I guess it's fine since it's not very
>> performance critical
>
> yes. Here freeing is not in critical path.
>
>> so we don't have to make kfree_rcu() work with
>> objects that are allocated via kmalloc_nolock()?
>
> Not quite :) It's on the todo list.
> Something like kfree_nolock_rcu() is needed, and
> also SLAB_TYPESAFE_BY_RCU-like and new SLAB_TYPESAFE_BY_SRCU_FAST flag.
> The plan for the upcoming merge window is to delete rcu tasks trace
> and replace with srcu_fast. It will clarify next steps.
I'm a bit afraid if this approach of stricly matching kmalloc_nolock() with
kfree_nolock() is going to be a neverending whack-a-mole. Let's see...
next prev parent reply other threads:[~2025-10-15 10:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-15 0:07 Alexei Starovoitov
2025-10-15 1:59 ` Harry Yoo
2025-10-15 2:12 ` Alexei Starovoitov
2025-10-15 10:06 ` Vlastimil Babka [this message]
2025-10-15 10:31 ` patchwork-bot+netdevbpf
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=7b83d4e3-f18e-4c0d-91ad-bf1512f68600@suse.cz \
--to=vbabka@suse.cz \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=harry.yoo@oracle.com \
--cc=kernel-team@fb.com \
--cc=linux-mm@kvack.org \
--cc=martin.lau@kernel.org \
--cc=shakeel.butt@linux.dev \
--cc=yepeilin@google.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