Skip to content

Commit c3138f3

Browse files
Lai Jiangshanhtejun
authored andcommitted
workqueue: Register sysfs after the whole creation of the new wq
workqueue creation includes adding it to the workqueue list. Prepare for moving the whole workqueue initializing procedure into wq_pool_mutex and cpu hotplug locks. Signed-off-by: Lai Jiangshan <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent b3d2091 commit c3138f3

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
@@ -5684,9 +5684,6 @@ struct workqueue_struct *alloc_workqueue(const char *fmt,
56845684
if (wq_online && init_rescuer(wq) < 0)
56855685
goto err_destroy;
56865686

5687-
if ((wq->flags & WQ_SYSFS) && workqueue_sysfs_register(wq))
5688-
goto err_destroy;
5689-
56905687
/*
56915688
* wq_pool_mutex protects global freeze state and workqueues list.
56925689
* Grab it, adjust max_active and add the new @wq to workqueues
@@ -5702,6 +5699,9 @@ struct workqueue_struct *alloc_workqueue(const char *fmt,
57025699

57035700
mutex_unlock(&wq_pool_mutex);
57045701

5702+
if ((wq->flags & WQ_SYSFS) && workqueue_sysfs_register(wq))
5703+
goto err_destroy;
5704+
57055705
return wq;
57065706

57075707
err_free_node_nr_active:

0 commit comments

Comments
 (0)