Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

module: replace use of system_wq with system_dfl_wq

Currently if a user enqueues a work item using schedule_delayed_work() the
used wq is "system_wq" (per-cpu wq) while queue_delayed_work() use
WORK_CPU_UNBOUND (used when a cpu is not specified). The same applies to
schedule_work() that is using system_wq and queue_work(), that makes use
again of WORK_CPU_UNBOUND.

This lack of consistency cannot be addressed without refactoring the API.

This continues the effort to refactor workqueue APIs, which began with
the introduction of new workqueues and a new alloc_workqueue flag in:

commit 128ea9f6ccfb ("workqueue: Add system_percpu_wq and system_dfl_wq")
commit 930c2ea566af ("workqueue: Add new WQ_PERCPU flag")

Switch to using system_dfl_wq, the new unbound workqueue, because the
users do not benefit from a per-cpu workqueue.

Suggested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Marco Crivellari <marco.crivellari@suse.com>
Reviewed-by: Petr Pavlu <petr.pavlu@suse.com>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>

authored by

Marco Crivellari and committed by
Sami Tolvanen
581ac2d4 3cb0c3bd

+2 -2
+2 -2
kernel/module/dups.c
··· 113 113 * let this linger forever as this is just a boot optimization for 114 114 * possible abuses of vmalloc() incurred by finit_module() thrashing. 115 115 */ 116 - queue_delayed_work(system_wq, &kmod_req->delete_work, 60 * HZ); 116 + queue_delayed_work(system_dfl_wq, &kmod_req->delete_work, 60 * HZ); 117 117 } 118 118 119 119 bool kmod_dup_request_exists_wait(char *module_name, bool wait, int *dup_ret) ··· 240 240 * There is no rush. But we also don't want to hold the 241 241 * caller up forever or introduce any boot delays. 242 242 */ 243 - queue_work(system_wq, &kmod_req->complete_work); 243 + queue_work(system_dfl_wq, &kmod_req->complete_work); 244 244 245 245 out: 246 246 mutex_unlock(&kmod_dup_mutex);