Skip to contentSkip to conversation

workqueue fixes for v4.6-rc7

GIT PULL Tejun Heo 1 participant 1 message May 13, 2016 Workqueue

lore
Share & tools
lore

Tejun Heo

author maintainer
#0 lore raw

Hello, Linus.

CPU hotplug callbacks can invoke DOWN_FAILED w/o preceding DOWN_PREPARE which can trigger a WARN_ON() in workqueue. The bug has been there for a very long time. It only triggers if CPU down fails at a specific point and I don't think it has adverse effects other than the warning messages. The fix is very low impact.

Thanks.

The following changes since commit 346c09f80459a3ad97df1816d6d606169a51001a:

workqueue: fix ghost PENDING flag while doing MQ IO (2016-04-26 11:23:22 -0400)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git for-4.6-fixes

for you to fetch changes up to f7c17d26f43d5cc1b7a6b896cd2fa24a079739b9:

workqueue: fix rebind bound workers warning (2016-05-12 12:00:23 -0400)

----------------------------------------------------------------
Wanpeng Li (1):
workqueue: fix rebind bound workers warning

 kernel/workqueue.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
kernel/workqueue.c +11 -0
index 801a698..1b2e36b 100644
@@ -4555,6 +4555,17 @@ static void rebind_workers(struct worker_pool *pool)
 						  pool->attrs->cpumask) < 0);
 
 	spin_lock_irq(&pool->lock);
+
+	/*
+	 * XXX: CPU hotplug notifiers are weird and can call DOWN_FAILED
+	 * w/o preceding DOWN_PREPARE.  Work around it.  CPU hotplug is
+	 * being reworked and this can go away in time.
+	 */
+	if (!(pool->flags & POOL_DISASSOCIATED)) {
+		spin_unlock_irq(&pool->lock);
+		return;
+	}
+
 	pool->flags &= ~POOL_DISASSOCIATED;
 
 	for_each_pool_worker(worker, pool) {