History

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.

Zqiang committed 3 years ago

Commit dd64c871 parent a6828211 file · +3 −3Browse files

Unified · Split

kernel/workqueue.c+3−3
@@ -6602,13 +6602,13 @@ static void __init wq_cpu_intensive_thresh_init(void) · 6601 unmodified lines
66026602 unsigned long thresh;
66036603 unsigned long bogo;
66046604
6605+ pwq_release_worker = kthread_create_worker(0, "pool_workqueue_release");
6606+ BUG_ON(IS_ERR(pwq_release_worker));
6607+
66056608 /* if the user set it to a specific value, keep it */
66066609 if (wq_cpu_intensive_thresh_us != ULONG_MAX)
66076610 return;
66086611
6609− pwq_release_worker = kthread_create_worker(0, "pool_workqueue_release");
6610− BUG_ON(IS_ERR(pwq_release_worker));
6611−
66126612 /*
66136613 * The default of 10ms is derived from the fact that most modern (as of
66146614 * 2023) processors can do a lot in 10ms and that it's just below what