Re: [PATCH] bpf: add KF_SPIN_LOCK flag for kfuncs under bpf_spin_lock
From: Leon Hwang
Date: Tue Aug 04 2026 - 08:50:33 EST
On 2026/8/4 18:22, Kumar Kartikeya Dwivedi wrote:
> On Tue Aug 4, 2026 at 12:09 PM CEST, Kaitao Cheng wrote:
[...]
>>
>> Alternatively, following the naming of GFP_ATOMIC, could we call it KF_ATOMIC?
>
> I think that is also confusing, every kfunc is allowed in atomic context in
> general. E.g. bpf_map_update_elem() in spin lock critical section would be
> problematic (due to embedded bpf_spin_lock in map value surfacing a deadlock
> opportunity). KF_OK_IN_SPIN_LOCK_CS is another option, but slightly longer than
> the previous proposal.
>
> In any case, let's choose this or the former one, and not fret too much about
> the naming. We can also choose a better name later on.
>
KF_LOCK_SAFE? Since other kfuncs are lock-unsafe for verifier.
Thanks,
Leon