mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [PATCH] sched_ext: Close the pre-enable ops error claim window
       [not found] <20260910084533.2420199-1-fangqiurong@kylinos.cn>
@ 2026-09-10 21:40 ` Tejun Heo
       [not found] ` <20260911024256.125287-1-fangqiurong@kylinos.cn>
  1 sibling, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2026-09-10 21:40 UTC (permalink / raw)
  To: Qiurong Fang
  Cc: sched-ext, David Vernet, Andrea Righi, Changwoo Min,
	Emil Tsalapatis, linux-kernel, tj

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] sched_ext: Close the pre-enable ops error claim window
       [not found] ` <20260911024256.125287-1-fangqiurong@kylinos.cn>
@ 2026-09-11 15:24   ` Tejun Heo
  0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2026-09-11 15:24 UTC (permalink / raw)
  To: Qiurong Fang
  Cc: sched-ext, David Vernet, Andrea Righi, Changwoo Min,
	Emil Tsalapatis, linux-kernel, tj

Hello, Qiurong.

On Fri, Sep 11, 2026 at 10:42:56AM +0800, Qiurong Fang wrote:
> +		scx_tryset_enable_state(SCX_DISABLED, SCX_ENABLING);

All allocation failures precede ops->priv publication, so no disable can
race here and the state must still be SCX_ENABLING. Please use:

        WARN_ON_ONCE(scx_set_enable_state(SCX_DISABLED) != SCX_ENABLING);

Please also update the moved comment. Allocation failure still unwinds
locally. Full disabling on failure applies only after
scx_alloc_and_add_sched() succeeds.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-11 15:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20260910084533.2420199-1-fangqiurong@kylinos.cn>
2026-09-10 21:40 ` [PATCH] sched_ext: Close the pre-enable ops error claim window Tejun Heo
     [not found] ` <20260911024256.125287-1-fangqiurong@kylinos.cn>
2026-09-11 15:24   ` [PATCH v2] " Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®