Skip to content

Commit 49584bb

Browse files
Waiman-Longhtejun
authored andcommitted
workqueue: Bind unbound workqueue rescuer to wq_unbound_cpumask
Commit 85f0ab4 ("kernel/workqueue: Bind rescuer to unbound cpumask for WQ_UNBOUND") modified init_rescuer() to bind rescuer of an unbound workqueue to the cpumask in wq->unbound_attrs. However unbound_attrs->cpumask's of all workqueues are initialized to cpu_possible_mask and will only be changed if it has the WQ_SYSFS flag to expose a cpumask sysfs file to be written by users. So this patch doesn't achieve what it is intended to do. If an unbound workqueue is created after wq_unbound_cpumask is modified and there is no more unbound cpumask update after that, the unbound rescuer will be bound to all CPUs unless the workqueue is created with the WQ_SYSFS flag and a user explicitly modified its cpumask sysfs file. Fix this problem by binding directly to wq_unbound_cpumask in init_rescuer(). Fixes: 85f0ab4 ("kernel/workqueue: Bind rescuer to unbound cpumask for WQ_UNBOUND") Signed-off-by: Waiman Long <longman@redhat.com> Signed-off-by: Tejun Heo <tj@kernel.org>
1 parent d64f2fa commit 49584bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/workqueue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5299,7 +5299,7 @@ static int init_rescuer(struct workqueue_struct *wq)
52995299

53005300
wq->rescuer = rescuer;
53015301
if (wq->flags & WQ_UNBOUND)
5302-
kthread_bind_mask(rescuer->task, wq->unbound_attrs->cpumask);
5302+
kthread_bind_mask(rescuer->task, wq_unbound_cpumask);
53035303
else
53045304
kthread_bind_mask(rescuer->task, cpu_possible_mask);
53055305
wake_up_process(rescuer->task);

0 commit comments

Comments
 (0)