workqueue: separate out and refactor the locking of applying attrs
authorLai Jiangshan <laijs@cn.fujitsu.com>
Tue, 19 May 2015 10:03:47 +0000 (18:03 +0800)
committerTejun Heo <tj@kernel.org>
Tue, 19 May 2015 21:37:00 +0000 (17:37 -0400)
Applying attrs requires two locks: get_online_cpus() and wq_pool_mutex,
and this code is duplicated at two places (apply_workqueue_attrs() and
workqueue_set_unbound_cpumask()).  So we separate out this locking
code into apply_wqattrs_[un]lock() and do a minor refactor on
apply_workqueue_attrs().

The apply_wqattrs_[un]lock() will be also used on later patch for
ensuring attrs changes are properly synchronized.

tj: minor updates to comments

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

Simple merge