Skip to content

Commit 0624973

Browse files
author
Peter Zijlstra
committed
workqueue: Manually break affinity on hotplug
Don't rely on the scheduler to force break affinity for us -- it will stop doing that for per-cpu-kthreads. Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Valentin Schneider <[email protected]> Acked-by: Tejun Heo <[email protected]> Reviewed-by: Daniel Bristot de Oliveira <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent f2469a1 commit 0624973

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

kernel/workqueue.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4908,6 +4908,10 @@ static void unbind_workers(int cpu)
49084908
pool->flags |= POOL_DISASSOCIATED;
49094909

49104910
raw_spin_unlock_irq(&pool->lock);
4911+
4912+
for_each_pool_worker(worker, pool)
4913+
WARN_ON_ONCE(set_cpus_allowed_ptr(worker->task, cpu_active_mask) < 0);
4914+
49114915
mutex_unlock(&wq_pool_attach_mutex);
49124916

49134917
/*

0 commit comments

Comments
 (0)