Skip to contentSkip to conversation

workqueue: Fix missed pwq_release_worker creation in wq_cpu_intensive_thresh_init()

PATCH Applied Zqiang 2 participants 2 messages Sep 11, 2023 – Sep 18, 2023 Workqueue

lore
Share & tools
lore

Zqiang

author
#0 lore raw

PATCH 1/1 workqueue: Fix missed pwq_release_worker creation in wq_cpu_intensive_thresh_init()

Currently, if the wq_cpu_intensive_thresh_us is set to specific value, will cause the wq_cpu_intensive_thresh_init() early exit and missed creation of pwq_release_worker. this commit therefore create the pwq_release_worker in advance before checking the wq_cpu_intensive_thresh_us.

---
 kernel/workqueue.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
kernel/workqueue.c +3 -3
index c85825e17df8..fd3988583c8b 100644
@@ -6605,13 +6605,13 @@ static void __init wq_cpu_intensive_thresh_init(void)
 	unsigned long thresh;
 	unsigned long bogo;
 
+	pwq_release_worker = kthread_create_worker(0, "pool_workqueue_release");
+	BUG_ON(IS_ERR(pwq_release_worker));
+
 	/* if the user set it to a specific value, keep it */
 	if (wq_cpu_intensive_thresh_us != ULONG_MAX)
 		return;
 
-	pwq_release_worker = kthread_create_worker(0, "pool_workqueue_release");
-	BUG_ON(IS_ERR(pwq_release_worker));
-
 	/*
 	 * The default of 10ms is derived from the fact that most modern (as of
 	 * 2023) processors can do a lot in 10ms and that it's just below what
Signature · 1 line
2.17.1
maintainer Applied
#1 lore raw
Quoted 7 lines · Zqiang

Currently, if the wq_cpu_intensive_thresh_us is set to specific value, will cause the wq_cpu_intensive_thresh_init() early exit and missed creation of pwq_release_worker. this commit therefore create the pwq_release_worker in advance before checking the wq_cpu_intensive_thresh_us.

Applied to wq/for-6.6-fixes.

Thanks.

Signature · 1 line
tejun