Re: [PATCH bpf-next v1 1/4] bpf: Add call for selecting kmalloc or kmalloc_nolock at call time

From: Alexei Starovoitov

Date: Thu Nov 26 2026 - 16:04:15 EST


On Thu, Nov 26, 2026 at 12:45 PM David Hildenbrand (Arm) <david@xxxxxxxxxx> wrote:
>> Which part?
>
> kmalloc_nolock :)

lol. Agree. I guess it is in some ways :)

>> I don't see any new concepts of failure modes vs existing code.
>
> I hope we can sort out the rough edges.

100%
That's the goal of this diff. It removes one of this rough edges
for user's of kmalloc_nolock().
Today it can return NULL when another CPU holds zone->lock
or n->list_lock. It took long time to debug in production,
since it didn't look like lock contention at all.
With this short diff that rouge edge/corner case goes away
and spurious NULL returns disappear.