Re: [PATCH] sched_ext: sync disable_irq_work in bpf_scx_unreg()

From: Richard Cheng

Date: Thu Apr 23 2026 - 23:32:07 EST


On Wed, Apr 22, 2026 at 07:24:07AM +0800, Tejun Heo wrote:
> Hello,
>
> On Wed, Apr 22, 2026 at 06:51:13PM +0800, Cheng-Yang Chou wrote:
> > Also, scx_root_enable_workfn() has the same pattern in its error path:
> >
> > scx_error(sch, "scx_root_enable() failed (%d)", ret);
> > kthread_flush_work(&sch->disable_work);
>
> Yeah, can you please add a helper - e.g. flush_disable_work() - to package
> sync and flush and use that in both places?

Hello Tejun,

No problem I'll add this part in v2.

>
> > > + /*
> > > + * sch->disable_work might still not queued, causing kthread_flush_work()
> > > + * as a noop. Syncing the irq_work first is required to guarantee the
> >
> > Perhaps s/noop/no-op/? Though it's just a matter of taste. ^_^
>
> noop is used widely in the kernel. In general, I don't think we need this
> level of language policing.
>
> Thanks.
>
> --
> tejun

Thanks.

- Richard