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

From: Tejun Heo

Date: Sun Apr 19 2026 - 15:15:56 EST


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.

Thanks.

--
tejun