From mboxrd@z Thu Jan 1 00:00:00 1970 From: Catalin Marinas Date: Sun, 15 May 2022 10:03:13 +0000 Subject: Re: [PATCHv4 2/2] cpu/hotplug: Remove the input parameter primary_cpu of smp_shutdown_nonboot_cpus() Message-Id: List-Id: References: <20220512030619.13426-1-kernelfans@gmail.com> <20220512030619.13426-3-kernelfans@gmail.com> In-Reply-To: <20220512030619.13426-3-kernelfans@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Pingfan Liu Cc: linux-ia64@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Thomas Gleixner , Geert Uytterhoeven , Peter Zijlstra , Kees Cook , Jens Axboe , Russell King , Guenter Roeck , Arnd Bergmann , Wolfram Sang , Lee Jones , Will Deacon , Mark Rutland , Peter Collingbourne , Marc Zyngier , linux-kernel@vger.kernel.org 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 > Cc: Thomas Gleixner > Cc: Geert Uytterhoeven > Cc: Peter Zijlstra > Cc: Kees Cook > Cc: Jens Axboe > To: linux-ia64@vger.kernel.org > Cc: Russell King > Cc: Guenter Roeck > Cc: Arnd Bergmann > Cc: Wolfram Sang > Cc: Lee Jones > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Mark Rutland > Cc: Peter Collingbourne > Cc: Marc Zyngier > To: linux-arm-kernel@lists.infradead.org > Cc: linux-kernel@vger.kernel.org For arm64: Acked-by: Catalin Marinas