workqueue: Update schedule_work() documentation to reflect per-CPU nature
PATCH 1/1 workqueue: Update schedule_work() documentation to reflect per-CPU nature
The function documentation for schedule_work(), schedule_delayed_work(), and schedule_delayed_work_on() still described them as using "global" or "kernel-global" workqueues, which is misleading after commit a2be943b46b4 ("workqueue: replace use of system_wq with system_percpu_wq").
These functions now use system_percpu_wq, which is a per-CPU workqueue where work items are executed on the CPU where they were queued. Update the documentation to accurately reflect this CPU affinity behavior.
--- include/linux/workqueue.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
include/linux/workqueue.h +8 -8
@@ -712,14 +712,14 @@ static inline bool schedule_work_on(int cpu, struct work_struct *work) }/** -* schedule_work - put work task in global workqueue +* schedule_work - put work task in per-CPU workqueue * @work: job to be done * -* Returns %false if @work was already on the kernel-global workqueue and +* Returns %false if @work was already on the system per-CPU workqueue and * %true otherwise. * -* This puts a job in the kernel-global workqueue if it was not already -* queued and leaves it in the same position on the kernel-global +* This puts a job in the system per-CPU workqueue if it was not already +* queued and leaves it in the same position on the system per-CPU * workqueue otherwise. * * Shares the same memory-ordering properties of queue_work(), cf. the
@@ -796,12 +796,12 @@ extern void __warn_flushing_systemwide_wq(void) })/** -* schedule_delayed_work_on - queue work in global workqueue on CPU after delay +* schedule_delayed_work_on - queue work in per-CPU workqueue on CPU after delay * @cpu: cpu to use * @dwork: job to be done * @delay: number of jiffies to wait * -* After waiting for a given time this puts a job in the kernel-global +* After waiting for a given time this puts a job in the system per-CPU * workqueue on the specified CPU. */ static inline bool schedule_delayed_work_on(int cpu, struct delayed_work *dwork,
@@ -811,11 +811,11 @@ static inline bool schedule_delayed_work_on(int cpu, struct delayed_work *dwork, }/** -* schedule_delayed_work - put work task in global workqueue after delay +* schedule_delayed_work - put work task in per-CPU workqueue after delay * @dwork: job to be done * @delay: number of jiffies to wait or 0 for immediate execution * -* After waiting for a given time this puts a job in the kernel-global +* After waiting for a given time this puts a job in the system per-CPU * workqueue. */ static inline bool schedule_delayed_work(struct delayed_work *dwork,
Signature · 1 line
2.34.1
Tejun Heo
maintainerQuoted 8 lines · Mallesh Koujalagi
The function documentation for
schedule_work(),schedule_delayed_work(), andschedule_delayed_work_on()still described them as using "global" or "kernel-global" workqueues, which is misleading after commita2be943b46b4("workqueue: replace use ofsystem_wqwithsystem_percpu_wq").These functions now use
system_percpu_wq, which is a per-CPU workqueue where work items are executed on the CPU where they were queued. Update the documentation to accurately reflect this CPU affinity behavior.
Note that system_wq has always been a percpu workqueue. We've been just renaming things. Nothing wrong with updating documentation but the commit message is misleading.
Thanks.
Signature · 1 line
tejun