Commit 8f174b11 authored by Joonsoo Kim's avatar Joonsoo Kim Committed by Tejun Heo

workqueue: correct handling of the pool spin_lock

When we fail to mutex_trylock(), we release the pool spin_lock and do
mutex_lock(). After that, we should regrab the pool spin_lock, but,
regrabbing is missed in current code. So correct it.

Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: default avatarJoonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent d3251859
...@@ -2059,6 +2059,7 @@ static bool manage_workers(struct worker *worker) ...@@ -2059,6 +2059,7 @@ static bool manage_workers(struct worker *worker)
if (unlikely(!mutex_trylock(&pool->manager_mutex))) { if (unlikely(!mutex_trylock(&pool->manager_mutex))) {
spin_unlock_irq(&pool->lock); spin_unlock_irq(&pool->lock);
mutex_lock(&pool->manager_mutex); mutex_lock(&pool->manager_mutex);
spin_lock_irq(&pool->lock);
ret = true; ret = true;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment