Skip to content

Commit

Permalink
kernel/workqueue: Bind rescuer to unbound cpumask for WQ_UNBOUND
Browse files Browse the repository at this point in the history
At the time they are created unbound workqueues rescuers currently use
cpu_possible_mask as their affinity, but this can be too wide in case a
workqueue unbound mask has been set as a subset of cpu_possible_mask.

Make new rescuers use their associated workqueue unbound cpumask from
the start.

Signed-off-by: Juri Lelli <juri.lelli@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
  • Loading branch information
Juri Lelli authored and Tejun Heo committed Jan 16, 2024
1 parent ab5e5b9 commit 85f0ab4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kernel/workqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -4652,7 +4652,10 @@ static int init_rescuer(struct workqueue_struct *wq)
}

wq->rescuer = rescuer;
kthread_bind_mask(rescuer->task, cpu_possible_mask);
if (wq->flags & WQ_UNBOUND)
kthread_bind_mask(rescuer->task, wq->unbound_attrs->cpumask);
else
kthread_bind_mask(rescuer->task, cpu_possible_mask);
wake_up_process(rescuer->task);

return 0;
Expand Down

0 comments on commit 85f0ab4

Please sign in to comment.