workqueue: WORKER_REBIND is no longer necessary for busy rebinding
authorLai Jiangshan <laijs@cn.fujitsu.com>
Tue, 18 Sep 2012 16:59:22 +0000 (09:59 -0700)
committerTejun Heo <tj@kernel.org>
Tue, 18 Sep 2012 16:59:22 +0000 (09:59 -0700)
commiteab6d82843ee1df244f8847d1bf8bb89160ec4aa
tree86a43e6ae1734779fe54ea5e62408395e6d0b36a
parentea1abd6197d5805655da1bb589929762f4b4aa08
workqueue: WORKER_REBIND is no longer necessary for busy rebinding

Because the old unbind/rebinding implementation wasn't atomic w.r.t.
GCWQ_DISASSOCIATED manipulation which is protected by
global_cwq->lock, we had to use two flags, WORKER_UNBOUND and
WORKER_REBIND, to avoid incorrectly losing all NOT_RUNNING bits with
back-to-back CPU hotplug operations; otherwise, completion of
rebinding while another unbinding is in progress could clear UNBIND
prematurely.

Now that both unbind/rebinding are atomic w.r.t. GCWQ_DISASSOCIATED,
there's no need to use two flags.  Just one is enough.  Don't use
WORKER_REBIND for busy rebinding.

tj: Updated description.

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