diff options
author | Tejun Heo <tj@kernel.org> | 2014-12-08 12:39:16 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2014-12-08 12:39:16 -0500 |
commit | b2d829096bee7eaf7be31b6229bf722e503adfd8 (patch) | |
tree | 292d3cc7a790a667e7b8d7175b83886f6c6eeec2 | |
parent | 0479c8c54983765085536c9463591548b45ad0a1 (diff) |
workqueue: invert the order between pool->lock and wq_mayday_lock
Currently, pool->lock nests inside pool->lock. There's no inherent
reason for this order. The only place where the two locks are held
together is pool_mayday_timeout() and it just got decided that way.
This nesting order turns out to complicate things with the planned
rescuer_thread() update. Let's invert them. This doesn't cause any
behavior differences.
Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: NeilBrown <neilb@suse.de>
Cc: Dongsu Park <dongsu.park@profitbricks.com>
-rw-r--r-- | kernel/workqueue.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 5fcd8179e681..3992cf6c3ee3 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
@@ -1804,8 +1804,8 @@ static void pool_mayday_timeout(unsigned long __pool) | |||
1804 | struct worker_pool *pool = (void *)__pool; | 1804 | struct worker_pool *pool = (void *)__pool; |
1805 | struct work_struct *work; | 1805 | struct work_struct *work; |
1806 | 1806 | ||
1807 | spin_lock_irq(&wq_mayday_lock); /* for wq->maydays */ | 1807 | spin_lock_irq(&pool->lock); |
1808 | spin_lock(&pool->lock); | 1808 | spin_lock(&wq_mayday_lock); /* for wq->maydays */ |
1809 | 1809 | ||
1810 | if (need_to_create_worker(pool)) { | 1810 | if (need_to_create_worker(pool)) { |
1811 | /* | 1811 | /* |
@@ -1818,8 +1818,8 @@ static void pool_mayday_timeout(unsigned long __pool) | |||
1818 | send_mayday(work); | 1818 | send_mayday(work); |
1819 | } | 1819 | } |
1820 | 1820 | ||
1821 | spin_unlock(&pool->lock); | 1821 | spin_unlock(&wq_mayday_lock); |
1822 | spin_unlock_irq(&wq_mayday_lock); | 1822 | spin_unlock_irq(&pool->lock); |
1823 | 1823 | ||
1824 | mod_timer(&pool->mayday_timer, jiffies + MAYDAY_INTERVAL); | 1824 | mod_timer(&pool->mayday_timer, jiffies + MAYDAY_INTERVAL); |
1825 | } | 1825 | } |