Re: [PATCH bpf-next v3 0/4] bpf: Check recursion per task for preemptible programs

From: Alexei Starovoitov

Date: Wed Nov 25 2026 - 21:48:29 EST


On Wed, Nov 25, 2026 at 04:03 AM Mike Bazov <mikeba@xxxxxxxxxxxxxxx> wrote:
> i tried it, it works when the run that preempts finishes first, as
> with bpf_timer_cb(). With preemption it can be preempted too, and the
> preempted run can go on before it ends:

ohh right. save/restore works only when the runs nest.

> A fix for all of them has to change how may_goto keeps its budget:
> lsm, cgroup and sk_msg progs never go through bpf_prog_enter_run_ctx().
> I'd rather split it out of this series: v4 takes may_goto out of the
> mark, so tracing progs behave like lsm ones today, and a separate
> series fixes the budget for all prog types. Does that work for you?

Makes sense. Let's split.