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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 08559C433F5 for ; Sun, 15 May 2022 10:04:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Sq3N+AvyViFB8YfxRSvq1R9TJhCouPCkx4oe1yQwZPo=; b=dPYmBBwRcJeZ2v B/zX/6KMuQbcnShQu/YC6C8i53rb7TFzcuorviFOGILSYDX/jOR14FSL4a+S1nqrBt3Je1b4dzRkc aUNGHTanOd6MgysxLNocqsHIRvuD0i92xUM6RE8cSWv0CGa1NS1G/haZOiJQaPRJBf9yMY5laPB0x Fv516Se0ShCIaw0kNIyp0fbF4Geyye2WtPy868RQjFoDDOESZCWXK9lyYR+DGs8C12q9NMhp7c4h7 JaKQThnSbHU1HpHPJkExsQG0Hfj09N/Z6Wg+Eoy+TDk4jo4A2uofBOiA5gtZ6bvTr0pHtAoshs4RO 5BTPEtiZSV4DO2Yvkibg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nqB5x-003h8Y-In; Sun, 15 May 2022 10:03:25 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nqB5t-003h7k-Tq for linux-arm-kernel@lists.infradead.org; Sun, 15 May 2022 10:03:23 +0000 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 EC02F60E8B; 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-Disposition: inline In-Reply-To: <20220512030619.13426-3-kernelfans@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220515_030322_041212_513E5ECE X-CRM114-Status: GOOD ( 17.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel