From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7E66C433EF for ; Sun, 15 May 2022 10:03:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236205AbiEOKD1 (ORCPT ); Sun, 15 May 2022 06:03:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236193AbiEOKDZ (ORCPT ); Sun, 15 May 2022 06:03:25 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E73D3D1E2; Sun, 15 May 2022 03:03:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id ED4A160EF4; Sun, 15 May 2022 10:03:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2EC45C385B8; Sun, 15 May 2022 10:03:17 +0000 (UTC) Date: Sun, 15 May 2022 11:03:13 +0100 From: Catalin Marinas 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 Subject: Re: [PATCHv4 2/2] cpu/hotplug: Remove the input parameter primary_cpu of smp_shutdown_nonboot_cpus() Message-ID: References: <20220512030619.13426-1-kernelfans@gmail.com> <20220512030619.13426-3-kernelfans@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220512030619.13426-3-kernelfans@gmail.com> Precedence: bulk List-ID: X-Mailing-List: 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