Re: [PATCH v3] workqueue: introduce queue_delayed_work_on_offline_safe

From: Tejun Heo
Date: Tue Feb 04 2025 - 14:18:13 EST


On Tue, Feb 04, 2025 at 10:36:35PM +1100, Imran Khan wrote:
> Currently users of queue_delayed_work_on, need to ensure
> that specified cpu is and remains online. The failure to
> do so may result in delayed_work getting queued on an
> offlined cpu and hence never getting executed.
>
> The current users of queue_delayed_work_on, seem to ensure
> the above mentioned criteria but for those, unknown amongst
> current users or new users, who can't confirm to this
> we need another interface.
>
> So introduce queue_delayed_work_on_offline_safe, which
> is a wrapper around queue_delayed_work_on to ensure that
> the specified cpu is and remains online.
>
> Signed-off-by: Imran Khan <imran.f.khan@xxxxxxxxxx>
> Acked-by: Haakon Bugge <haakon.bugge@xxxxxxxxxx>

So, idk, do we really need this? Can't we just add a debug warning which
triggers when CPU goes down with delayed works queued on it?

Thanks.

--
tejun