linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] workqueue: Fix missed pwq_release_worker creation in wq_cpu_intensive_thresh_init()
@ 2023-09-11  8:27 Zqiang
  2023-09-18 18:53 ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Zqiang @ 2023-09-11  8:27 UTC (permalink / raw)
  To: tj, jiangshanlai, qiang.zhang1211; +Cc: linux-kernel

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.

Signed-off-by: Zqiang <qiang.zhang1211@gmail.com>
---
 kernel/workqueue.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index c85825e17df8..fd3988583c8b 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -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
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] workqueue: Fix missed pwq_release_worker creation in wq_cpu_intensive_thresh_init()
  2023-09-11  8:27 [PATCH] workqueue: Fix missed pwq_release_worker creation in wq_cpu_intensive_thresh_init() Zqiang
@ 2023-09-18 18:53 ` Tejun Heo
  0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2023-09-18 18:53 UTC (permalink / raw)
  To: Zqiang; +Cc: jiangshanlai, linux-kernel

On Mon, Sep 11, 2023 at 04:27:22PM +0800, Zqiang wrote:
> 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.
> 
> Signed-off-by: Zqiang <qiang.zhang1211@gmail.com>

Applied to wq/for-6.6-fixes.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-09-18 18:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-11  8:27 [PATCH] workqueue: Fix missed pwq_release_worker creation in wq_cpu_intensive_thresh_init() Zqiang
2023-09-18 18:53 ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).