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

Showing the changes to kernel/workqueue.c (1 of 1 file). Show all

Unified · Split

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