workqueue: Move the code of waking a worker up in unbind_workers()
authorLai Jiangshan <laijs@linux.alibaba.com>
Tue, 7 Dec 2021 07:35:41 +0000 (15:35 +0800)
committerTejun Heo <tj@kernel.org>
Thu, 9 Dec 2021 22:23:15 +0000 (12:23 -1000)
commit989442d73757868118a73b92732b549a73c9ce35
tree011a5a3ff1483d46e9c8acb66770595f224d385e
parentb4ac9384ac057c5bf035fbe82fc162fa2f7b15a9
workqueue: Move the code of waking a worker up in unbind_workers()

In unbind_workers(), there are two pool->lock held sections separated
by the code of zapping nr_running.  wake_up_worker() needs to be in
pool->lock held section and after zapping nr_running.  And zapping
nr_running had to be after schedule() when the local wake up
functionality was in use.  Now, the call to schedule() has been removed
along with the local wake up functionality, so the code can be merged
into the same pool->lock held section.

The diffstat shows that it is other code moved down because the diff
tools can not know the meaning of merging lock sections by swapping
two code blocks.

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