Skip to content

Commit 85f0ab4

Browse files
jlellihtejun
authored andcommitted
kernel/workqueue: Bind rescuer to unbound cpumask for WQ_UNBOUND
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>
1 parent ab5e5b9 commit 85f0ab4

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

kernel/workqueue.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4652,7 +4652,10 @@ static int init_rescuer(struct workqueue_struct *wq)
46524652
}
46534653

46544654
wq->rescuer = rescuer;
4655-
kthread_bind_mask(rescuer->task, cpu_possible_mask);
4655+
if (wq->flags & WQ_UNBOUND)
4656+
kthread_bind_mask(rescuer->task, wq->unbound_attrs->cpumask);
4657+
else
4658+
kthread_bind_mask(rescuer->task, cpu_possible_mask);
46564659
wake_up_process(rescuer->task);
46574660

46584661
return 0;

0 commit comments

Comments
 (0)