[PATCHSET wq/for-3.10] workqueue: break up workqueue_lock into multiple locks
From: Tejun Heo
Date: Wed Mar 13 2013 - 22:57:39 EST
Hello,
Currently, workqueue_lock protects most shared workqueue resources -
the pools, workqueues, pool_workqueues, draining, ID assignments,
mayday handling and so on. The coverage has grown organically and
there is no identified bottleneck coming from workqueue_lock, but it
has grown a bit too much and scheduled rebinding changes need the
pools and workqueues to be protected by a mutex instead of a spinlock.
The following seven patches break out workqueue_lock into three locks
- wq_mutex, pwq_lock and wq_mayday_lock - so that we get to have a
mutex for pools and workqueues, and the overall locking scheme is
easier to follow.
0001-workqueue-rename-worker_pool-assoc_mutex-to-manager_.patch
0002-workqueue-factor-out-initial-worker-creation-into-cr.patch
0003-workqueue-better-define-locking-rules-around-worker-.patch
0004-workqueue-relocate-global-variable-defs-and-function.patch
0005-workqueue-separate-out-pool-and-workqueue-locking-in.patch
0006-workqueue-separate-out-pool_workqueue-locking-into-p.patch
0007-workqueue-rename-workqueue_lock-to-wq_mayday_lock.patch
0001-0004 are prep / cleanup patches.
0005 separates out pool and workqueue locking into wq_mutex.
0006 separates out pool_workqueue locking into pwq_lock.
0007 renames workqueue_lock to wq_mayday_lock as that's the only left
user of the lock.
This patchset is on top of
wq/for-3.10 e626761691 ("workqueue: implement current_is_workqueue_rescuer()")
+ "workqueue: misc cleanups" patchset [1]
and available in the following git branch.
git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git review-finer-locking
diffstat follows. Thanks.
kernel/workqueue.c | 355 +++++++++++++++++++++++++++++------------------------
1 file changed, 195 insertions(+), 160 deletions(-)
--
tejun
[1] http://thread.gmane.org/gmane.linux.kernel/1456511
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/