Re: [PATCH v4 1/9] stop_machine: Refactor multi-CPU stop glue code

From: Borislav Petkov

Date: Mon Nov 09 2026 - 20:32:55 EST


On Wed, Nov 04, 2026 at 06:23:14PM +0000, Chang S. Bae wrote:
> stop_machine_cpuslocked() currently configures struct multi_stop_data and
> invokes the multi-stop operation. An upcoming stop_machine() variant will
> have different configurations but the latter part will be shareable.
>
> Extract the common part into stop_multi_cpus() to highlight each unique
> front-end.
>
> No functional change.
>
> Signed-off-by: Chang S. Bae <chang.seok.bae@xxxxxxxxx>
> ---
> kernel/stop_machine.c | 35 ++++++++++++++++++++---------------
> 1 file changed, 20 insertions(+), 15 deletions(-)
>
> diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c
> index d085ba1f4b44..8dcd5be67b85 100644
> --- a/kernel/stop_machine.c
> +++ b/kernel/stop_machine.c
> @@ -582,18 +582,8 @@ static int __init cpu_stop_init(void)
> }
> early_initcall(cpu_stop_init);
>
> -int stop_machine_cpuslocked(cpu_stop_fn_t fn, void *data,
> - const struct cpumask *cpus)
> +static int stop_multi_cpus(struct multi_stop_data *msdata)

Waay too many combinations of "stop", "multi" and "cpus" in this file, with
different ordering, causing me a headache.

Call that function __stop_machine() instead as it looks like it is going to be
the naked, no-locking, version which is internal only.

--
Regards/Gruss,
Boris.

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