Skip to content

Commit c5178e6

Browse files
Lai Jiangshanhtejun
authored andcommitted
workqueue: Make rescuer initialization as the last step of the creation of a new wq
For early wq allocation, rescuer initialization is the last step of the creation of a new wq. Make the behavior the same for all allocations. Prepare for initializing rescuer's affinities with the default pwq's affinities. Prepare for moving the whole workqueue initializing procedure into wq_pool_mutex and cpu hotplug locks. Cc: Juri Lelli <[email protected]> Cc: Waiman Long <[email protected]> Signed-off-by: Lai Jiangshan <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent c3138f3 commit c5178e6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

kernel/workqueue.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5681,9 +5681,6 @@ struct workqueue_struct *alloc_workqueue(const char *fmt,
56815681
if (alloc_and_link_pwqs(wq) < 0)
56825682
goto err_free_node_nr_active;
56835683

5684-
if (wq_online && init_rescuer(wq) < 0)
5685-
goto err_destroy;
5686-
56875684
/*
56885685
* wq_pool_mutex protects global freeze state and workqueues list.
56895686
* Grab it, adjust max_active and add the new @wq to workqueues
@@ -5699,6 +5696,9 @@ struct workqueue_struct *alloc_workqueue(const char *fmt,
56995696

57005697
mutex_unlock(&wq_pool_mutex);
57015698

5699+
if (wq_online && init_rescuer(wq) < 0)
5700+
goto err_destroy;
5701+
57025702
if ((wq->flags & WQ_SYSFS) && workqueue_sysfs_register(wq))
57035703
goto err_destroy;
57045704

0 commit comments

Comments
 (0)