Skip to content

Commit

Permalink
workqueue: Manually break affinity on hotplug
Browse files Browse the repository at this point in the history
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) <peterz@infradead.org>
Reviewed-by: Valentin Schneider <valentin.schneider@arm.com>
Acked-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Daniel Bristot de Oliveira <bristot@redhat.com>
Link: https://lkml.kernel.org/r/20201023102346.464718669@infradead.org
  • Loading branch information
Peter Zijlstra committed Nov 10, 2020
1 parent f2469a1 commit 0624973
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kernel/workqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -4908,6 +4908,10 @@ static void unbind_workers(int cpu)
pool->flags |= POOL_DISASSOCIATED;

raw_spin_unlock_irq(&pool->lock);

for_each_pool_worker(worker, pool)
WARN_ON_ONCE(set_cpus_allowed_ptr(worker->task, cpu_active_mask) < 0);

mutex_unlock(&wq_pool_attach_mutex);

/*
Expand Down

0 comments on commit 0624973

Please sign in to comment.