workqueue: use generic attach/detach routine for rescuers
authorLai Jiangshan <laijs@cn.fujitsu.com>
Tue, 20 May 2014 09:46:36 +0000 (17:46 +0800)
committerTejun Heo <tj@kernel.org>
Tue, 20 May 2014 14:59:32 +0000 (10:59 -0400)
commit51697d393922eb643e78ac5db86e8fa5a45b469a
treeb8571bd6f9b64b72d1ed668879815d53fd3891d4
parent4736cbf7a4b2a6bbb50a809a6933fb7eb29dc38f
workqueue: use generic attach/detach routine for rescuers

There are several problems with the code that rescuers use to bind
themselve to the target pool's cpumask.

  1) It is very different from how the normal workers bind to cpumask,
     increasing code complexity and maintenance overhead.

  2) The code of cpu-binding for rescuers is complicated.

  3) If one or more cpu hotplugs happen while a rescuer is processing
     its scheduled work items, the rescuer may not stay bound to the
     cpumask of the pool. This is an allowed behavior, but is still
     hairy. It will be better if the cpumask of the rescuer is always
     kept synchronized with the pool across cpu hotplugs.

Using generic attach/detach routine will solve the above problems and
results in much simpler code.

tj: Minor description updates.

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