History

treewide: Introduce kthread_run_worker[_on_cpu]()

kthread_create() creates a kthread without running it yet. kthread_run() creates a kthread and runs it. On the other hand, kthread_create_worker() creates a kthread worker and runs it. This difference in behaviours is confusing. Also there is no way to create a kthread worker and affine it using kthread_bind_mask() or kthread_affine_preferred() before starting it. Consolidate the behaviours and introduce kthread_run_worker[_on_cpu]() that behaves just like kthread_run(). kthread_create_worker[_on_cpu]() will now only create a kthread worker without starting it.

Frederic Weisbecker committed 2 years ago

Commit b04e3171 parent 41f70d833 files · +83 −66Browse files

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

Unified · Split

kernel/workqueue.c+1−1
@@ -7828,7 +7828,7 @@ static void __init wq_cpu_intensive_thresh_init(void) · 7827 unmodified lines
7828 unsigned long thresh;7828 unsigned long thresh;
7829 unsigned long bogo;7829 unsigned long bogo;
7830 7830
7831 pwq_release_worker = kthread_create_worker(0, "pool_workqueue_release");7831 pwq_release_worker = kthread_run_worker(0, "pool_workqueue_release");
7832 BUG_ON(IS_ERR(pwq_release_worker));7832 BUG_ON(IS_ERR(pwq_release_worker));
7833 7833
7834 /* if the user set it to a specific value, keep it */7834 /* if the user set it to a specific value, keep it */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t