Re: [PATCH v2] sched_ext: Fix NULL sched deref in kfunc sub-sched error paths
From: Tejun Heo
Date: Wed Sep 02 2026 - 16:38:03 EST
On Wed, Sep 02, 2026 at 09:37:39AM -1000, Tejun Heo wrote:
> > + scx_error(scx_task_sched_rcu(p) ?: sch,
> > + "__scx_bpf_select_cpu_and() must be used");
>
> As the fallback only triggers for tasks already past sched_ext_dead() (or
> idle tasks), tearing down the root scheduler doesn't make sense. How about
> adding a flag to the root sched and printing a warning once instead?
It'd be fine to just ignore it too. The scx_error() is there to flag cases
where things went obviously wrong. I don't think we'd lose anything
meaningful by just ignoring it when sch can't be determined.
Thanks.
--
tejun