[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YoDP4aYg7vdUg4sO@arm.com>
Date: Sun, 15 May 2022 11:03:13 +0100
From: Catalin Marinas <catalin.marinas@....com>
To: Pingfan Liu <kernelfans@...il.com>
Cc: linux-ia64@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
Thomas Gleixner <tglx@...utronix.de>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Peter Zijlstra <peterz@...radead.org>,
Kees Cook <keescook@...omium.org>,
Jens Axboe <axboe@...nel.dk>,
Russell King <linux@...linux.org.uk>,
Guenter Roeck <linux@...ck-us.net>,
Arnd Bergmann <arnd@...db.de>,
Wolfram Sang <wsa+renesas@...g-engineering.com>,
Lee Jones <lee.jones@...aro.org>,
Will Deacon <will@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Peter Collingbourne <pcc@...gle.com>,
Marc Zyngier <maz@...nel.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCHv4 2/2] cpu/hotplug: Remove the input parameter
primary_cpu of smp_shutdown_nonboot_cpus()
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@...il.com>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: Geert Uytterhoeven <geert@...ux-m68k.org>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Kees Cook <keescook@...omium.org>
> Cc: Jens Axboe <axboe@...nel.dk>
> To: linux-ia64@...r.kernel.org
> Cc: Russell King <linux@...linux.org.uk>
> Cc: Guenter Roeck <linux@...ck-us.net>
> Cc: Arnd Bergmann <arnd@...db.de>
> Cc: Wolfram Sang <wsa+renesas@...g-engineering.com>
> Cc: Lee Jones <lee.jones@...aro.org>
> Cc: Catalin Marinas <catalin.marinas@....com>
> Cc: Will Deacon <will@...nel.org>
> Cc: Mark Rutland <mark.rutland@....com>
> Cc: Peter Collingbourne <pcc@...gle.com>
> Cc: Marc Zyngier <maz@...nel.org>
> To: linux-arm-kernel@...ts.infradead.org
> Cc: linux-kernel@...r.kernel.org
For arm64:
Acked-by: Catalin Marinas <catalin.marinas@....com>
Powered by blists - more mailing lists