On Wed, Jun 14, 2023 at 1:32 PM Barret Rhoden <brho@xxxxxxxxxx> wrote: > > Hi - > > Would it be possible to add logic to the verifier to handle calling > functions within my program (subprograms?) while holding a bpf_spin_lock? > > Some of my functions are large enough that the compiler won't inline > them, so I'll get a BPF_CALL to PC + offset (relative call within my > program). Whenever this pops up, I force the compiler to inline the > function, but that's brittle. I'd rather just have the ability to call > a function. always_inline works as a workaround, right? And it's guaranteed to work, no? I'm not sure why you're saying it's brittle. It probably generates less performant code, so it would be good to add such support. It wasn't done earlier, because spin_lock-ed section supposed to be short. So the restriction was kinda forcing program authors to minimize the lock time. Could you please share the example code where you want to use it? Just to make sure we're talking about calling bpf subprograms only and you're not requesting to call arbitrary helpers and kfuncs while holding the lock. Some of the kfuncs can be allowed under lock if there is a real need.