summaryrefslogtreecommitdiff
path: root/kernel/workqueue.c
diff options
context:
space:
mode:
authorLai Jiangshan <jiangshan.ljs@antgroup.com>2024-07-04 06:49:10 +0300
committerTejun Heo <tj@kernel.org>2024-07-05 22:14:40 +0300
commitc3138f3881920d1391e435aa4144b929d5237617 (patch)
tree4aaf97ff7a37f7d193d283565ac6c98fbc0a7202 /kernel/workqueue.c
parentb3d209164dc0aca115057b00d6b466793a747c87 (diff)
downloadlinux-c3138f3881920d1391e435aa4144b929d5237617.tar.xz
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 <jiangshan.ljs@antgroup.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r--kernel/workqueue.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 32ac6f1e94a8..5cb1dd0a49fb 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -5684,9 +5684,6 @@ struct workqueue_struct *alloc_workqueue(const char *fmt,
if (wq_online && init_rescuer(wq) < 0)
goto err_destroy;
- if ((wq->flags & WQ_SYSFS) && workqueue_sysfs_register(wq))
- goto err_destroy;
-
/*
* wq_pool_mutex protects global freeze state and workqueues list.
* Grab it, adjust max_active and add the new @wq to workqueues
@@ -5702,6 +5699,9 @@ struct workqueue_struct *alloc_workqueue(const char *fmt,
mutex_unlock(&wq_pool_mutex);
+ if ((wq->flags & WQ_SYSFS) && workqueue_sysfs_register(wq))
+ goto err_destroy;
+
return wq;
err_free_node_nr_active: