From: Paul E. McKenney Date: Fri, 28 Apr 2023 23:47:07 +0000 (-0700) Subject: Further upgrade queue_work_on() comment X-Git-Tag: v6.6.17~4581^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=854f5cc5b7355ceebf2bdfed97ea8f3c5d47a0c3;p=platform%2Fkernel%2Flinux-rpi.git Further 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, 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 Cc: Lai Jiangshan Cc: Tejun Heo Signed-off-by: Tejun Heo --- diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 4666a1a9..36bccc1 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -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. */