Re: [PATCH RFC bpf-next 0/2] bpf: Do not let preemption cause false recursion drops in trampoline progs
From: Alexei Starovoitov
Date: Tue Nov 03 2026 - 21:22:15 EST
On Tue Nov 3, 2026 at 11:46 PM UTC, JP Kobryn wrote:
> On 10/30/26 3:22 PM, Alexei Starovoitov wrote:
>> On Sun, Oct 25, 2026 at 04:02 AM Mike Bazov via B4 Relay <devnull+mikeba.sentinelone.com@xxxxxxxxxx> wrote:
>>
>>> Is disabling preemption in __bpf_prog_enter_recur() on !PREEMPT_RT the
>>> preferred fix for fentry/fexit, or would you prefer a different
>>> mechanism for reconciling preemptible execution with prog->active and
>>> the per-CPU private stack?
>>
>> No.
>> We cannot disable preemption, since progs are not short
>> with may_goto they can take 1/4 sec.
>
>
> Seeing this issue as well. This patch opts in ALL non-sleepable programs
> with trampolines. Alexei, would your thoughts be the same if there was
> an opt-in approach, like a libbpf annotation "fentry.nonpreempt", for
> select programs? A patch like this could then check if
> program->nonpreempt is set.
I don't think it's a good idea. Try bpf_preemt_disable(), as I mentioned
in the other reply.