From patchwork Tue May 16 09:09:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 94555 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp283879vqo; Tue, 16 May 2023 02:12:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4+lpzfVnceFMlaN4oyIqWs55J9h0ZrnfoaNhI0YHzLDB8lW7VWKsS+N4WWEfxZ06hTlSSD X-Received: by 2002:a17:902:7617:b0:1ad:f26e:3a2e with SMTP id k23-20020a170902761700b001adf26e3a2emr10261542pll.50.1684228322525; Tue, 16 May 2023 02:12:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684228322; cv=none; d=google.com; s=arc-20160816; b=SHx6l0OrvaoSt02sp3lDVoqswoBKqjpyOWvQ6KEPD9i9zE1yeSz+PA21qUIi0PROFN IH1hlIjs4sAlRzjXD5dXbWi/HSPJwTl39LtarhCMsElzJ3MYjrYHt8h0iLH3ZhOQHOBs dJGbFRu7rGcw1bc3M/+DZfl7MAB0Z9K9p3wDK5Ohy0NcQGXnR2tgyvqgKRwFfwDUr3EC LVTkdAXXhhlpMRuSCiSKwVx78S/X3sz16FF1B7k1/i+vfLSz3qYTOzvi1hQIAyYilyZ9 VrU5G0NJajXSXtPqk2uSuqwPJqW5Q3AQGdqmorr4ClF9k6BDy8K2dmjj53KLr8ap9vje jHQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=Xtsc3QMq8abgtUkGI84p9HLSUWmPJubMFXi/P9/1NSM=; b=w/pbUJxBSgiFLeBLVMviayaAczyy2jYbUXJjHzmMh7OCg5c1FVj++UuicgrxehJC1U 5nLxd4rAFbqo3j3I/4PGEb1QOa6PCzlhq2RNiBh2UgaJmDdSBx9lboyJMASz9uTT5nYB frO4e0GkYUy+nQtzfYoeCXU755VZKEdcfVZqPuo26Z9lMh7XZn7tRWq5+3bTANQ92RoO E0r0voMvskzrGgFU0YcQrocRUc9cHYmZzXTlyBsKmlgdBEXwdgAlSdT3yOBH+YPFiloZ Qc17vQJH1wyOYKQG5s6rLghuCYnzwHWS94TK0gKg8mWP5FVAYeGuHA0vJbhjkaKjL0xP xT6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ovj1DmAT; dkim=neutral (no key) header.i=@linutronix.de; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k21-20020a170902ba9500b001ae469c1c3fsi11764pls.635.2023.05.16.02.11.44; Tue, 16 May 2023 02:12:02 -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; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ovj1DmAT; dkim=neutral (no key) header.i=@linutronix.de; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231437AbjEPJKo (ORCPT + 99 others); Tue, 16 May 2023 05:10:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231783AbjEPJKE (ORCPT ); Tue, 16 May 2023 05:10:04 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A328249EC; Tue, 16 May 2023 02:10:01 -0700 (PDT) Date: Tue, 16 May 2023 09:09:57 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1684228197; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Xtsc3QMq8abgtUkGI84p9HLSUWmPJubMFXi/P9/1NSM=; b=ovj1DmATjCmMdQ29dXsLG1sF6YCPlYOiB/djY7HMySqF2dtIgAw9/LYOFMZqwN+sQCbk4u 0LchI/IU6aZUmoGg4qD+Ffy0xvc4NM0Qv82sqBVnogqeZyN75795b8zhzK+994KcuV+Kq+ QmmObrevb2H7ftX7NdXfxAePPCUca87y9WeYt3/zxvDjrKWcZIbkZtOEpQMbnt9BeHJgHN LwxBNckAskkVkRadZlzw1EFPmOGSX7vWdT11YK3OjJQ/YGSdZtAq92MX9q3INGGSrvw6DN 1oyX4lECYaxBSCPeyz/HMMNxMiHLht/c52umh8RtY2Wvg0iqVHVmowZ9rp0BtA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1684228197; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Xtsc3QMq8abgtUkGI84p9HLSUWmPJubMFXi/P9/1NSM=; b=sYQAPLhLFG/gdHrikvezY2t/zGdf632TgXhG8tIKW/pqINDsa5zy5RwywdQskPDSGs2MdO T7UGwjBO87unhhBQ== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: smp/core] arm64: smp: Switch to hotplug core state synchronization Cc: Thomas Gleixner , "Peter Zijlstra (Intel)" , Mark Rutland , Michael Kelley , Oleksandr Natalenko , Helge Deller , "Guilherme G. Piccoli" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230512205256.690926018@linutronix.de> References: <20230512205256.690926018@linutronix.de> MIME-Version: 1.0 Message-ID: <168422819737.404.15725341721545451300.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765724702442808045?= X-GMAIL-MSGID: =?utf-8?q?1766041397557230846?= The following commit has been merged into the smp/core branch of tip: Commit-ID: b3091f172fed63ee59d1746f088bdcc76a79a79c Gitweb: https://git.kernel.org/tip/b3091f172fed63ee59d1746f088bdcc76a79a79c Author: Thomas Gleixner AuthorDate: Fri, 12 May 2023 23:07:33 +02:00 Committer: Peter Zijlstra CommitterDate: Mon, 15 May 2023 13:44:57 +02:00 arm64: smp: Switch to hotplug core state synchronization Switch to the CPU hotplug core state tracking and synchronization mechanim. No functional change intended. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Mark Rutland Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205256.690926018@linutronix.de --- arch/arm64/Kconfig | 1 + arch/arm64/include/asm/smp.h | 2 +- arch/arm64/kernel/smp.c | 14 +++++--------- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index b1201d2..fcb945b 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -222,6 +222,7 @@ config ARM64 select HAVE_KPROBES select HAVE_KRETPROBES select HAVE_GENERIC_VDSO + select HOTPLUG_CORE_SYNC_DEAD if HOTPLUG_CPU select IRQ_DOMAIN select IRQ_FORCED_THREADING select KASAN_VMALLOC if KASAN diff --git a/arch/arm64/include/asm/smp.h b/arch/arm64/include/asm/smp.h index f2d2623..9b31e6d 100644 --- a/arch/arm64/include/asm/smp.h +++ b/arch/arm64/include/asm/smp.h @@ -99,7 +99,7 @@ static inline void arch_send_wakeup_ipi_mask(const struct cpumask *mask) extern int __cpu_disable(void); -extern void __cpu_die(unsigned int cpu); +static inline void __cpu_die(unsigned int cpu) { } extern void __noreturn cpu_die(void); extern void __noreturn cpu_die_early(void); diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index d00d4cb..edd6389 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -332,17 +332,13 @@ static int op_cpu_kill(unsigned int cpu) } /* - * called on the thread which is asking for a CPU to be shutdown - - * waits until shutdown has completed, or it is timed out. + * Called on the thread which is asking for a CPU to be shutdown after the + * shutdown completed. */ -void __cpu_die(unsigned int cpu) +void arch_cpuhp_cleanup_dead_cpu(unsigned int cpu) { int err; - if (!cpu_wait_death(cpu, 5)) { - pr_crit("CPU%u: cpu didn't die\n", cpu); - return; - } pr_debug("CPU%u: shutdown\n", cpu); /* @@ -369,8 +365,8 @@ void __noreturn cpu_die(void) local_daif_mask(); - /* Tell __cpu_die() that this CPU is now safe to dispose of */ - (void)cpu_report_death(); + /* Tell cpuhp_bp_sync_dead() that this CPU is now safe to dispose of */ + cpuhp_ap_report_dead(); /* * Actually shutdown the CPU. This must never fail. The specific hotplug