workqueue: void unneeded requeuing the pwq in rescuer thread
authorLai Jiangshan <laijs@linux.alibaba.com>
Fri, 29 May 2020 06:58:59 +0000 (06:58 +0000)
committerTejun Heo <tj@kernel.org>
Fri, 29 May 2020 14:22:10 +0000 (10:22 -0400)
commit4f3f4cf388f8fda7ee8ea7c6af0ff0ebb2d05fe4
tree5fc7fd3791176131cb4c8a6b01b47188cc723bd2
parenta9b8a985294debae00f6c087dfec8c384d30a3b9
workqueue: void unneeded requeuing the pwq in rescuer thread

008847f66c3 ("workqueue: allow rescuer thread to do more work.") made
the rescuer worker requeue the pwq immediately if there may be more
work items which need rescuing instead of waiting for the next mayday
timer expiration.  Unfortunately, it checks only whether the pool needs
help from rescuers, but it doesn't check whether the pwq has work items
in the pool (the real reason that this rescuer can help for the pool).

The patch adds the check and void unneeded requeuing.

Signed-off-by: Lai Jiangshan <laijs@linux.alibaba.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/workqueue.c