Re: [PATCH 12/17] workqueue: Implement disable/enable for (delayed) work items

From: Tejun Heo
Date: Tue Feb 20 2024 - 13:38:15 EST


Hello,

On Tue, Feb 20, 2024 at 03:22:26PM +0800, Lai Jiangshan wrote:
> > - A work item carries 10bit disable count in work->data while not queued.
> > The access to the count is synchronized by the PENDING bit like all other
> > parts of work->data.
>
> It is 16bit disable count in the code.

Fixed.

> It misses the same handling at queue_work_node() and queue_rcu_work().

Oops, fixed queued_work_node() but I don't think the latter is an issue
given that calling work interface functions in the embedded work is not
supported and rcu_work can't even be canceled.

I'm not quite sure flush_delayed_work() is safe. Will think more about that.

> But it is bad idea to cancel or disable rcu work since it can be possibly
> in the rcu's waiting list.

Yeah, this isn't currently supported. If we want to add this, we'd have to
have a mechanism to shoot it down from RCU's pending list.

Thanks.

--
tejun