Re: [PATCHSET wq/for-3.10] workqueue: break up workqueue_lock intomultiple locks
From: Tejun Heo
Date: Wed Mar 20 2013 - 10:38:41 EST
On Wed, Mar 20, 2013 at 11:01:50PM +0900, JoonSoo Kim wrote:
> 2013/3/19 Tejun Heo <tj@xxxxxxxxxx>:
> > On Wed, Mar 13, 2013 at 07:57:18PM -0700, Tejun Heo wrote:
> >> and available in the following git branch.
> >> git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git review-finer-locking
> > Applied to wq/for-3.10.
> Hello, Tejun.
> I know I am late, but, please give me a change to ask a question.
> Finer locking for workqueue code is really needed?
> Is there a performance issue?
> I think that there is too many locks and locking rules,
> although the description about these are very nice.
It isn't about performance. So, workqueue_lock is broken into three
locks by this series - wq_mutex, pwq_lock and mayday_lock. The
primary reason for this patchset is wq_mutex. We want to do blocking
operations while excluding workqueue and pool modifications which
isn't possible with workqueue_lock and at the same time there are
things which can't be protected by a mutex (should be a irq-safe
lock), so we need break up the lock. After breaking off wq_mutex from
workqueue_lock. Most stuff covered by workqueue_lock was pwq related
and mayday was the only one-off thing left, so one more lock there,
which I think actually make things easier to digest.
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/