Re: [PATCH v3 sched_ext/for-7.2] sched_ext: add p->scx.tid and SCX_OPS_TID_TO_TASK lookup

Andrea Righi
2026-04-19T19:24:28Z

On Sun, Apr 19, 2026 at 09:15:16AM -1000, Tejun Heo wrote:
> Hello,
>
> On Sun, Apr 19, 2026 at 09:02:11PM +0200, Andrea Righi wrote:
> > Hm... WARN_ON_ONCE() only fires once, it can be hard to catch subsequent errors,
> > especially in case of -ENOMEM.
> >
> > How about triggering WARN_ON_ONCE(ret == -EEXIST), which should be considered a
> > real sched_ext core bug, and use scx_error() for insert failures (ENOMEM).
> > In this way the error is more obvious for the BPF scheduler and can immediately
> > exit if it happens (even if scx_error() is probably a bit of a semantic stretch
> > in this case)?
>
> It can't fail with ENOMEM with insecure_elasticity set. It should never
> fail. If it ever triggers, it's a bug that we need to fix.

Oh I see, that's related to the other thread about restoring
insecure_elasticity. Ok, then I have no more complain. :)

Reviewed-by: Andrea Righi <arighi@nvidia.com>

Thanks,
-Andrea