public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: laijs@cn.fujitsu.com
Subject: [PATCHSET wq/for-3.10] workqueue: break up workqueue_lock into multiple locks
Date: Wed, 13 Mar 2013 19:57:18 -0700	[thread overview]
Message-ID: <1363229845-6831-1-git-send-email-tj@kernel.org> (raw)

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

             reply	other threads:[~2013-03-14  2:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-14  2:57 Tejun Heo [this message]
2013-03-14  2:57 ` [PATCH 1/7] workqueue: rename worker_pool->assoc_mutex to ->manager_mutex Tejun Heo
2013-03-14 16:00   ` Lai Jiangshan
2013-03-14 16:41     ` Tejun Heo
2013-03-14  2:57 ` [PATCH 2/7] workqueue: factor out initial worker creation into create_and_start_worker() Tejun Heo
2013-03-14  2:57 ` [PATCH 3/7] workqueue: better define locking rules around worker creation / destruction Tejun Heo
2013-03-14  2:57 ` [PATCH 4/7] workqueue: relocate global variable defs and function decls in workqueue.c Tejun Heo
2013-03-14  2:57 ` [PATCH 5/7] workqueue: separate out pool and workqueue locking into wq_mutex Tejun Heo
2013-03-14  2:57 ` [PATCH 6/7] workqueue: separate out pool_workqueue locking into pwq_lock Tejun Heo
2013-03-14  2:57 ` [PATCH 7/7] workqueue: rename workqueue_lock to wq_mayday_lock Tejun Heo
2013-03-18 19:51 ` [PATCHSET wq/for-3.10] workqueue: break up workqueue_lock into multiple locks Tejun Heo
2013-03-20 14:01   ` JoonSoo Kim
2013-03-20 14:38     ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1363229845-6831-1-git-send-email-tj@kernel.org \
    --to=tj@kernel.org \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox