]> git.baikalelectronics.ru Git - kernel.git/commit
workqueue: fix unbound workqueue attrs hashing / comparison
authorTejun Heo <tj@kernel.org>
Mon, 1 Apr 2013 18:23:31 +0000 (11:23 -0700)
committerTejun Heo <tj@kernel.org>
Mon, 1 Apr 2013 18:23:31 +0000 (11:23 -0700)
commit4c75097912043a2201c03ff958ca3d542f48edd0
treeee1aefceeda27e8ede268ce74bd9faf53efbf95c
parentafb5ed259f071dab4e34a5ade949c5ea013446fd
workqueue: fix unbound workqueue attrs hashing / comparison

d5a98374399 ("workqueue: implement attribute-based unbound worker_pool
management") implemented attrs based worker_pool matching.  It tried
to avoid false negative when comparing cpumasks with custom hash
function; unfortunately, the hash and comparison functions fail to
ignore CPUs which are not possible.  It incorrectly assumed that
bitmap_copy() skips leftover bits in the last word of bitmap and
cpumask_equal() ignores impossible CPUs.

This patch updates attrs->cpumask handling such that impossible CPUs
are properly ignored.

* Hash and copy functions no longer do anything special.  They expect
  their callers to clear impossible CPUs.

* alloc_workqueue_attrs() initializes the cpumask to cpu_possible_mask
  instead of setting all bits and explicit cpumask_setall() for
  unbound_std_wq_attrs[] in init_workqueues() is dropped.

* apply_workqueue_attrs() is now responsible for ignoring impossible
  CPUs.  It makes a copy of @attrs and clears impossible CPUs before
  doing anything else.

Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/workqueue.c