Re: [PATCH v2] stop_machine: Make stop_one_cpu_nowait() return void
From: Peter Zijlstra
Date: Wed Jul 29 2026 - 09:28:25 EST
On Tue, Jul 28, 2026 at 10:23:54PM -0400, Yury Norov wrote:
> No caller checks the return value from stop_one_cpu_nowait(). All
> callers require the callback to run and arrange for the target CPU's
> stopper to remain enabled while queuing the work. In particular, commit
> f0498d2a54e7 ("sched: Fix stop_one_cpu_nowait() vs hotplug") added
> preemption protection to the scheduler callers so that queuing must
> succeed once the target CPU has been observed online.
>
> Therefore, a failure is an unrecoverable violation rather than a condition
> individual callers can recover from. Diagnose it with WARN_ON_ONCE() in
> stop_one_cpu_nowait(). A check in the common helper covers current and
> future callers consistently, while individual checks would duplicate
> the same non-recoverable handling at every call site.
>
> Make the function return void because there is no longer a meaningful
> result for callers to consume.
>
> On UP, warn if the supplied CPU is not the current CPU because the work
> cannot be scheduled in that case.
>
> CC: Bradley Morgan <include@xxxxxxxxx>
> Signed-off-by: Yury Norov <ynorov@xxxxxxxxxx>
I suppose; you want me to take this through the scheduler tree?