Re: [PATCH v2 01/11] stop_machine: Clarify @cpus == NULL semantics

From: Borislav Petkov

Date: Thu Jul 23 2026 - 00:38:12 EST


On Tue, Mar 31, 2026 at 01:42:39AM +0000, Chang S. Bae wrote:
> The stop-machine API description currently mentions that @cpus == NULL
> means running on "each cpu_online_mask". Previously, it was described as
> "any cpu_online_mask" before commit:
>
> fc6f89dc707 ("stop_machine: Improve kernel-doc function-header comments")
>
> In fact, multi_cpu_stop() selects the first CPU in cpu_online_mask when
> @cpus is NULL. Right now cpumask_any() is defined as cpumask_first(). So
> the previous description was closer but apparently it was not clear
> enough either.
>
> Fix those comments for clarity.
>
> Signed-off-by: Chang S. Bae <chang.seok.bae@xxxxxxxxx>
> ---
> V1 -> V2: New patch
>
> Considering stop_machine_nmi_cpuslocked() and its another cpumask, I
> could realize this nullptr implication is not clear enough. Then, it
> ended up with this fix.
>
> I also considered just saying CPU0, but still 'cpumask_first(cpu_online_mask)'
> are there. So, leave it like that, instead of converting them
> aggressively.
> ---
> include/linux/stop_machine.h | 6 ++++--
> kernel/stop_machine.c | 4 +++-
> 2 files changed, 7 insertions(+), 3 deletions(-)

That got fixed differently:

48f7a50c027d ("stop_machine: Fix the documentation for a NULL cpus argument")

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette