workqueue: move busy_hash from global_cwq to worker_pool
authorTejun Heo <tj@kernel.org>
Thu, 24 Jan 2013 19:01:33 +0000 (11:01 -0800)
committerTejun Heo <tj@kernel.org>
Thu, 24 Jan 2013 19:01:33 +0000 (11:01 -0800)
commitc9e7cf273fa1876dee8effdb201a6f65eefab3a7
treefab0d36f4cd595d1d4bc9fb091d323ea66a692e1
parent7c3eed5cd60d0f736516e6ade77d90c6255860bd
workqueue: move busy_hash from global_cwq to worker_pool

There's no functional necessity for the two pools on the same CPU to
share the busy hash table.  It's also likely to be a bottleneck when
implementing pools with user-specified attributes.

This patch makes busy_hash per-pool.  The conversion is mostly
straight-forward.  Changes worth noting are,

* Large block of changes in rebind_workers() is moving the block
  inside for_each_worker_pool() as now there are separate hash tables
  for each pool.  This changes the order of operations but doesn't
  break anything.

* Thre for_each_worker_pool() loops in gcwq_unbind_fn() are combined
  into one.  This again changes the order of operaitons but doesn't
  break anything.

This is part of an effort to remove global_cwq and make worker_pool
the top level abstraction, which in turn will help implementing worker
pools with user-specified attributes.

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