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

From: Alexei Starovoitov

Date: Mon Nov 02 2026 - 20:49:38 EST


On Mon, Nov 02, 2026 at 03:24 PM Mike Bazov <mikeba@xxxxxxxxxxxxxxx> wrote:
> To fix fentry/fexit while keeping preemption enabled, we'll need to:
> 1. Disable private stack for fentry/fexit (so each task uses its own
> kernel stack), and

Yes.
Then the stack limit covers the whole call chain instead of one frame.
It's 2 Kbytes on x86-64 and arm64 now.

> 2. Check recursion in __bpf_prog_enter_recur() per-task rather than via
> the per-CPU prog->active counter (still blocking same-task recursion
> and IRQ/NMI re-entry on the same CPU, while allowing a preempting
> Task B to run).

No. I don't think we can switch to per-task that easily.
For your use case try fsession. It was added specifically to match entry/exit.