Skip to contentSkip to conversation

workqueue: correct handling of the pool spin_lock

PATCH Applied Joonsoo Kim 2 participants 2 messages Apr 30, 2013 – May 14, 2013 Workqueue

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

kernel/workqueue.c +1 -0
index 154aa12..e02994f 100644
@@ -2058,6 +2058,7 @@ static bool manage_workers(struct worker *worker)
 	if (unlikely(!mutex_trylock(&pool->manager_mutex))) {
 		spin_unlock_irq(&pool->lock);
 		mutex_lock(&pool->manager_mutex);
+		spin_lock_irq(&pool->lock);
 		ret = true;
 	}
 
Signature · 1 line
1.7.9.5
maintainer Applied
#1 lore raw
Quoted 6 lines · Joonsoo Kim

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.

Applied to wq/for-3.10-fixes.

Thanks.

Signature · 1 line
tejun