]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
Further upgrade queue_work_on() comment
authorPaul E. McKenney <paulmck@kernel.org>
Fri, 28 Apr 2023 23:47:07 +0000 (16:47 -0700)
committerTejun Heo <tj@kernel.org>
Tue, 9 May 2023 15:37:42 +0000 (05:37 -1000)
The current queue_work_on() docbook comment says that the caller must
ensure that the specified CPU can't go away, and further says that the
penalty for failing to nail down the specified CPU is that the workqueue
handler might find itself executing on some other CPU.  This is true
as far as it goes, but fails to note what happens if the specified CPU
never was online.  Therefore, further expand this comment to say that
specifying a CPU that was never online will result in a splat.

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

index 4666a1a92a31b22a402de2ba86d1687d21999b19..36bccc1285b3f4e2950a47430dec1cb0f0bd9334 100644 (file)
@@ -1539,6 +1539,8 @@ out:
  * We queue the work to a specific CPU, the caller must ensure it
  * can't go away.  Callers that fail to ensure that the specified
  * CPU cannot go away will execute on a randomly chosen CPU.
+ * But note well that callers specifying a CPU that never has been
+ * online will get a splat.
  *
  * Return: %false if @work was already on a queue, %true otherwise.
  */