RFC Add queue_*() functions and prefer per-cpu workqueue and flag
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest2 patches 11 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | workqueue: Add queue_*() functions, future schedule_*() replacementinclude/ | +101 | 0 replies | |
| 2/2 | workqueue: Add WQ_PREFER_PERCPU and system_prefer_percpu_wqinclude/ kernel/ | +12 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC PATCH 0/2] Add queue_*() functions and prefer per-cpu workqueue and flag
Hi,
The following is part of the Workqueue refactoring, and a first RFC about the rename of the schedule_*() interfaces along with the introduction of the "wq prefer per-cpu" workqueue and workqueue flag.
Any feedback is more then welcome!
~~~
More information about the reasons behind the workqueue refactoring can be found at:
https://lore.kernel.org/all/[email protected]/
Actually schedule_work() and schedule_work_on() enqueue works using system_percpu_wq. The function name doesn't suggest it, on top of that, only the per-cpu version is present.
Because of that, the following changes are introduced:
- queue_{bound|unbound}_work() as future replacement of schedule_work()
- queue_bound_work_on() as future replacement of schedule_work_on()
- queue_bound_delayed_work() as future replacement of schedule_delayed_work()
- queue_unbound_delayed_work() to offer the unbound version
- queue_bound_delayed_work_on() as future replacement of schedule_delayed_work_on()
The addition of queue_unbound_delayed_work() is because "delayed" functions make use of a global timer and that means the work will be executed on the CPU where the timer fired.
The Workqueue API currently do not distinguish between use case where locality is important for correctness and where is important for efficiency. So introduce WQ_PREFER_PERCPU and wq_prefer_percpu_wq, so that works who need to be per-cpu but don't strictly require it, can use such workqueue / workqueue flag.
Thanks!
Marco Crivellari (2):
workqueue: Add queue_*() functions, future schedule_*() replacement
workqueue: Add WQ_PREFER_PERCPU and system_prefer_percpu_wq
include/linux/workqueue.h | 108 ++++++++++++++++++++++++++++++++++++++ kernel/workqueue.c | 6 ++- 2 files changed, 113 insertions(+), 1 deletion(-)
Signature · 1 line
2.53.0