Re: [PATCH] workqueue: Implement delayed_work_busy()

From: Alex Naidis
Date: Wed May 24 2017 - 16:16:51 EST


Hello,

2017-05-24 22:01 GMT+02:00 Tejun Heo <tj@xxxxxxxxxx>:
> Hello, Alex.
>
> On Wed, May 24, 2017 at 09:58:19PM +0200, Alex Naidis wrote:
>> Yeah, I agree, it is wrong to rely on work_busy() providing correct data.
>> However sometimes it is useful to have an indicator like this to at least
>> catch some cases where requeuing work would be obsolete.
>> This applies for delayed work too.
>
> Can you elaborage on "requeueing work would be obsolate" a bit?
Sure.
The case that I mean is represented well by the usage of work_busy here:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/acpi/bus.c#n534
It checks work_busy() before requeuing the work, since in some cases
it is obsolete
to requeue the work if it is already pending or running.
>
> Thanks.
>
> --
> tejun

Alex