]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
smp: Wait only if work was enqueued
authorRik van Riel <riel@surriel.com>
Wed, 2 Jul 2025 17:52:54 +0000 (13:52 -0400)
committerThomas Gleixner <tglx@linutronix.de>
Sun, 6 Jul 2025 09:57:39 +0000 (11:57 +0200)
commit946a7281982530d333eaee62bd1726f25908b3a9
tree0b742ecc393a925eb41d7fbb9f787a2ada4d1168
parente0e9506523fea415e0d5abaa103fd67dc8a39696
smp: Wait only if work was enqueued

Whenever work is enqueued for a remote CPU, smp_call_function_many_cond()
may need to wait for that work to be completed. However, if no work is
enqueued for a remote CPU, because the condition func() evaluated to false
for all CPUs, there is no need to wait.

Set run_remote only if work was enqueued on remote CPUs.

Document the difference between "work enqueued", and "CPU needs to be
woken up"

Suggested-by: Jann Horn <jannh@google.com>
Signed-off-by: Rik van Riel <riel@surriel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>
Link: https://lore.kernel.org/all/20250703203019.11331ac3@fangorn
kernel/smp.c