History

smp: Use system_percpu_wq instead of system_wq

When a caller enqueues a work item using schedule_delayed_work() the used wq is "system_wq" (per-cpu wq) while queue_delayed_work() uses WORK_CPU_UNBOUND (used when no target CPU is specified). The same applies to schedule_work() that is using system_wq and queue_work(), which again makes use of WORK_CPU_UNBOUND. This lack of consistency cannot be addressed without refactoring the API. Continue 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") and switch smp_call_on_cpu() to use system_percpu_wq because system_wq is going away once the ongoing workqueue restructuring is done.

Marco Crivellari committed 1 year ago

Commit 7eb28031 parent b0473dc1 file · +1 −1Browse files

Unified · Split

kernel/smp.c+1−1
@@ -1185,7 +1185,7 @@ int smp_call_on_cpu(unsigned int cpu, int (*func)(void *), void *par, bool phys) · 1184 unmodified lines
1185 if (cpu >= nr_cpu_ids || !cpu_online(cpu))1185 if (cpu >= nr_cpu_ids || !cpu_online(cpu))
1186 return -ENXIO;1186 return -ENXIO;
1187 1187
1188 queue_work_on(cpu, system_wq, &sscs.work);1188 queue_work_on(cpu, system_percpu_wq, &sscs.work);
1189 wait_for_completion(&sscs.done);1189 wait_for_completion(&sscs.done);
1190 destroy_work_on_stack(&sscs.work);1190 destroy_work_on_stack(&sscs.work);
1191 1191

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