Skip to contentSkip to conversation

workqueue: Upgrade queue_work_on() comment

PATCH Applied Paul E. McKenney 2 participants 2 messages Dec 1, 2021 Workqueue

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 workqueue: Upgrade queue_work_on() comment

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.

kernel/workqueue.c +2 -1
index 613917bbc4e73..332361cf215fc 100644
@@ -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.
  */
maintainer Applied
#1 lore raw
Quoted 10 lines · Paul E. McKenney

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.

Applied to wq/for-5.16-fixes.

Thanks.

Signature · 1 line
tejun