[PATCH v2 3/4] smp: Don't wait for remote work done if not needed in smp_call_function_many_cond()

From: Yury Norov
Date: Sun Jun 22 2025 - 20:01:07 EST


From: "Yury Norov [NVIDIA]" <yury.norov@xxxxxxxxx>

If we don't actually send any IPIs, there's no need to wait for a job
completion.

Signed-off-by: Yury Norov [NVIDIA] <yury.norov@xxxxxxxxx>
---
kernel/smp.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/kernel/smp.c b/kernel/smp.c
index 5871acf3cd45..715190669e94 100644
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -849,6 +849,8 @@ static void smp_call_function_many_cond(const struct cpumask *mask,
send_call_function_single_ipi(last_cpu);
else if (likely(nr_cpus > 1))
send_call_function_ipi_mask(cfd->cpumask_ipi);
+ else
+ run_remote = false;
}

if (run_local) {
--
2.43.0