mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] workqueue: Upgrade queue_work_on() comment
@ 2021-12-01  1:00 Paul E. McKenney
  2021-12-01 16:49 ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Paul E. McKenney @ 2021-12-01  1:00 UTC (permalink / raw)
  To: tj, jiangshanlai; +Cc: linux-kernel, frederic

The current queue_work_on() docbook comment says that the caller must
ensure that the specified CPU can't go away, but does not spell out the
consequences, which turn out to be quite mild.  Therefore expand this
comment to explicitly say that the penalty for failing to nail down the
specified CPU is that the workqueue handler might find itself executing
on some other CPU.

Cc: Tejun Heo <tj@kernel.org>
Cc: Lai Jiangshan <jiangshanlai@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 613917bbc4e73..332361cf215fc 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -1531,7 +1531,8 @@ static void __queue_work(int cpu, struct workqueue_struct *wq,
  * @work: work to queue
  *
  * We queue the work to a specific CPU, the caller must ensure it
- * can't go away.
+ * can't go away.  Callers that fail to ensure that the specified
+ * CPU cannot go away will execute on a randomly chosen CPU.
  *
  * Return: %false if @work was already on a queue, %true otherwise.
  */

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] workqueue: Upgrade queue_work_on() comment
  2021-12-01  1:00 [PATCH] workqueue: Upgrade queue_work_on() comment Paul E. McKenney
@ 2021-12-01 16:49 ` Tejun Heo
  0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2021-12-01 16:49 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: jiangshanlai, linux-kernel, frederic

On Tue, Nov 30, 2021 at 05:00:30PM -0800, Paul E. McKenney wrote:
> The current queue_work_on() docbook comment says that the caller must
> ensure that the specified CPU can't go away, but does not spell out the
> consequences, which turn out to be quite mild.  Therefore expand this
> comment to explicitly say that the penalty for failing to nail down the
> specified CPU is that the workqueue handler might find itself executing
> on some other CPU.
> 
> Cc: Tejun Heo <tj@kernel.org>
> Cc: Lai Jiangshan <jiangshanlai@gmail.com>
> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>

Applied to wq/for-5.16-fixes.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-01 16:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-01  1:00 [PATCH] workqueue: Upgrade queue_work_on() comment Paul E. McKenney
2021-12-01 16:49 ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®