Re: [PATCH] sched_ext: Close the pre-enable ops error claim window
From: Tejun Heo
Date: Thu Sep 10 2026 - 17:40:43 EST
Hello, Qiurong.
On Thu, Sep 10, 2026 at 04:45:33PM +0800, Qiurong Fang wrote:
> + if (scx_tryset_enable_state(SCX_DISABLED, SCX_DISABLING))
> + goto done;
> + break;
Please drop this hunk. Once SCX_ENABLING precedes ops->priv publication,
scx_tryset_enable_state() cannot fail here.
> + if (!scx_tryset_enable_state(SCX_ENABLING, SCX_DISABLED)) {
> + pr_warn("sched_ext: enable raced with a state transition, aborting\n");
> + ret = -EBUSY;
This failure path is also unreachable. The state was checked as SCX_DISABLED
under scx_enable_mutex, and no disable can start before publication. Please
move the existing transition and retain the reset on allocation failure.
Thanks.
--
tejun