[PATCHv4 2/2] cpu/hotplug: Remove the input parameter primary_cpu of smp_shutdown_nonboot_cpus()

Catalin Marinas catalin.marinas at arm.com
Sun May 15 03:03:13 PDT 2022


On Thu, May 12, 2022 at 11:06:19AM +0800, Pingfan Liu wrote:
> For all call sites of smp_shutdown_nonboot_cpus(),
> 
> $git grep smp_shutdown_nonboot_cpus -- arch | grep -v \*
> arch/arm/kernel/reboot.c:94:    smp_shutdown_nonboot_cpus(reboot_cpu);
> arch/arm64/kernel/process.c:89: smp_shutdown_nonboot_cpus(reboot_cpu);
> arch/ia64/kernel/process.c:578: smp_shutdown_nonboot_cpus(reboot_cpu);
> arch/riscv/kernel/machine_kexec.c:135:  smp_shutdown_nonboot_cpus(smp_processor_id());
> 
> As it shows, the input parameter seems a little arbitrary.
> 
> Since kernel_kexec()->migrate_to_reboot_cpu() has already pinned the
> rebooting thread on the selected CPU and the CPU hotplug keeps disabled
> before smp_shutdown_nonboot_cpus(). Let smp_shutdown_nonboot_cpus()
> deduce the rebooting CPU by smp_processor_id(), instead of passing the
> parameter primary_cpu to it.
> 
> As a result, all call sites look consistent.
> 
> Signed-off-by: Pingfan Liu <kernelfans at gmail.com>
> Cc: Thomas Gleixner <tglx at linutronix.de>
> Cc: Geert Uytterhoeven <geert at linux-m68k.org>
> Cc: Peter Zijlstra <peterz at infradead.org>
> Cc: Kees Cook <keescook at chromium.org>
> Cc: Jens Axboe <axboe at kernel.dk>
> To: linux-ia64 at vger.kernel.org
> Cc: Russell King <linux at armlinux.org.uk>
> Cc: Guenter Roeck <linux at roeck-us.net>
> Cc: Arnd Bergmann <arnd at arndb.de>
> Cc: Wolfram Sang <wsa+renesas at sang-engineering.com>
> Cc: Lee Jones <lee.jones at linaro.org>
> Cc: Catalin Marinas <catalin.marinas at arm.com>
> Cc: Will Deacon <will at kernel.org>
> Cc: Mark Rutland <mark.rutland at arm.com>
> Cc: Peter Collingbourne <pcc at google.com>
> Cc: Marc Zyngier <maz at kernel.org>
> To: linux-arm-kernel at lists.infradead.org
> Cc: linux-kernel at vger.kernel.org

For arm64:

Acked-by: Catalin Marinas <catalin.marinas at arm.com>



More information about the linux-arm-kernel mailing list