Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2428531iob; Sun, 15 May 2022 19:18:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhrxm5gXKBBbcf7IkMd1ahMUlIgIoCJEN1nDNQVhJLHVdCVbzm7KjVCyySOoDCwalf6RVZ X-Received: by 2002:a05:600c:4e91:b0:394:8d30:d6dd with SMTP id f17-20020a05600c4e9100b003948d30d6ddmr14568269wmq.21.1652667488397; Sun, 15 May 2022 19:18:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652667488; cv=none; d=google.com; s=arc-20160816; b=y+NGtF0e/SkkBxp0HsYsnnzwvff081GCY6QoWRMpa9PDL2JkNgQvidno2CKn0oVXEK Lux0osV46QLQfio/ArXM/keMz2CR7ucsJniFNrZXdDaqB3/h5uUcnOyTFrzbWhrlKFa4 AS3A/6eqZM9CT874At1XYVHh/PawhjwqROqN6IEVdLm/6IMq5l8lM8T6YmrB3FydPy9B EyM7KSC59lFgtWMEpRoDBHlwTqocKNWNktyBl7Xs8IBEqGU8L8VjLNFP8V7RAiedHxYu UwA9zQ57cqPO5c+n8kcsJ5kttkELnHksl8k8HqhmD4yZ/1ckMBILT8G40YAgqtBeCbZ8 dM3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=wXD9nalX7iSrg1H71J164iHUY/4BNJd3rOgmtCQpj4Y=; b=cJdTFgP8bzFFsbU8vJ2qxGRxB8f3AvA7Y5yqAWVha/qKEKfzEjmkvRMtqYRE2UyFm/ piNL3/MwJsRFVqld8PejdtglTpWrFwR8UHAAScuh5JvbG0La+cSwOA7PigWTpu0ml93P 04cpCkuttugDNUgpavqUv9RIsncfOuTOeJObC9+D+m4CLPIoJJGKdwugfzImDolaqSym CVyYZLTaAFIqJ2zQri/H/ki9kh3Yvq56tEbK84un/pCjH9661ThY59EQ9TADnkomdYgR FCT5nb26NyLJL3Eehtb01lgFFlYP3bnlY93GCMduC60ZdF9nd9vb1Rrf/+jOjJtNuQCq pAfw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p5-20020a05600c204500b0038c991953d1si11537182wmg.166.2022.05.15.19.17.43; Sun, 15 May 2022 19:18:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236201AbiEOKD0 (ORCPT + 99 others); Sun, 15 May 2022 06:03:26 -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> X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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