No, this is basically the same patch + re-check-cwq-after-lock,
the latter is mostly needed to prevent racing with CPU-hotplug.
The slowdown is small, changelog mentions it just to be "fair".
I am not happy with the complication this patch adds, mostly
I hate this smb_wmb() in insert_work(). I have an idea how to
remove it later, but this needs another patch not related to
workqueue.c.
It would be very strange to do wait_on_work() only in case
when del_timer() failed. This way we still need to do
cancel_work_sync() after cancel_rearming_delayed_work(),
but only when del_timer() failed, ugly. Note also that
wait_on_work() does not sleep if work->func() is not running.
Also, consider this callback:
void work_handler(struct work_struct *w)
{
struct delayed_work dw = container_of(...);
queue_delayed_work(dw, delay);
// <------------- cancel_rearming_delayed_work()
cancel_delayed_work(dw);
queue_delayed_work(dw, another_delay);
}
Yes, this is strange and ugly. But correct! The current version
(before this patch) can't cancel this delayed_work. The new
implementation works correctly. So I think it is far better to
do wait_on_work() unconditionally.
Yes, please!
Oleg.
-