Re: [PATCH RFC bpf-next 0/2] bpf: Do not let preemption cause false recursion drops in trampoline progs

From: JP Kobryn

Date: Tue Nov 03 2026 - 18:53:42 EST


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.