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: 94560 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp284038vqo; Tue, 16 May 2023 02:12:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5lDkEfWiEbN3Sq2DRJa1N1LMhJCnIebeFqwXHQkluPg2zjFrxSgf7a7SPzDBD4GRYmzAlY X-Received: by 2002:a17:902:e549:b0:1a6:9f9b:1327 with SMTP id n9-20020a170902e54900b001a69f9b1327mr45282896plf.45.1684228342298; Tue, 16 May 2023 02:12:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684228342; cv=none; d=google.com; s=arc-20160816; b=t8RWOkoCSQJlS3neZszQBQyfaVJ6i29sIG2YZtUL0iHiDadu7P/R1GXc9ikcobzWSU jh2+bYthzG8FttYcDfF2WKkw0rubp4XKuLHtGmRC0IyyRNa1XtxFr+QvZ0WJe0mXCOQk rqH/crDNhuhZ/mPNGnKPvWBOztStaYqdltdomwqSe6YYQ7cDsC2uE1sU40/opA0nJK1+ HMU9/ZqvPyL6w/Nu+gUJ2ftL+k0Awtx+Wr4pcZnkA/oQdnVclJkgO5XSMpBNsfs+wau4 5HbOo91rJFw6HY01pOfhIxnr/8imW2d6UIDRkOXHr/LDMY+Ng1tkPB00ZrxqEFCdU67q /v+g== 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=UaP3IirQS29/nSRBGEvaWqpv53AEDPCueTjFwjsewdU=; b=s261aTgPaOCZfrFkC79Y/14//o3gh3ju9tkmw1t8tnRkbTMtJ/Uhuj3Cd5/Nhbd4R3 B/nENWnAbRReESWdn07bJVvvnpO42dcvf+QRW1CAER0tI2ZZDDVqR0i8sl0ptM7/pebH ZBY0Esww9ostkM2sERzzVNGfwzSGL8vT8FcvPd0EHKmPPYYlR8cILfbQnGAKlIOZ8s4m Ya8O8C/jRMDAZOoviBbOAH6V8OCX4wk5j+geCLLpgdXJQ3IVq59tdBOts7AdvjKlYqQE Z22fCyZNDctmHmk7q6GwuqvUDeC+8dAJUy5ZItNNXek95nGru5QZ0uqU1qza7pJ/taX5 BFKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=yYMXhxyw; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="hV/fvp5U"; 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 h11-20020a170902748b00b001aaec7031b5si17072136pll.182.2023.05.16.02.12.07; Tue, 16 May 2023 02:12:22 -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=yYMXhxyw; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="hV/fvp5U"; 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 S231665AbjEPJLF (ORCPT + 99 others); Tue, 16 May 2023 05:11:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231812AbjEPJKF (ORCPT ); Tue, 16 May 2023 05:10:05 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD28A2D7F; Tue, 16 May 2023 02:10:03 -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=1684228198; 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=UaP3IirQS29/nSRBGEvaWqpv53AEDPCueTjFwjsewdU=; b=yYMXhxyw1cZSdgPS9GRgRXxHEwwE0Q2foQtzhTHwRJfEslu2EcG1qguNDVLs9lKxak49sq EtfCsXV2ZLsvOX8n53uVsQCG4ckLLwm588joMplO/GPGktMFPcLwbZC7cw1W7ddAcxjZ28 1Sfb9iXGWbn8FNIM6MHYCQ7BKM5UKCZvOCGscSXJRV8Jac1N7ttTAiaqwwDYrQpBGZjdaG nFqE4UA2snPMycANAhSaPDsO8GPfAiryqDgqD5jjnaMjJHy5Aeli+FUHWhH1znpfIxCEiD EpjnCjY5UHoy5uzyh0Fu9Adwg78KEbBgNkZkM1pl8zaY8BZk51/zDH9T9Va2Wg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1684228198; 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=UaP3IirQS29/nSRBGEvaWqpv53AEDPCueTjFwjsewdU=; b=hV/fvp5UmC1dZ4ZtJhTYLv2Rk6mveoUPHZ2LhHIiCUJUNj7E1RHj/unQDv/dWL5YtZyyhl GeSJYRRzo0h/rtCA== 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] ARM: smp: Switch to hotplug core state synchronization Cc: Thomas Gleixner , "Peter Zijlstra (Intel)" , Michael Kelley , Oleksandr Natalenko , Helge Deller , "Guilherme G. Piccoli" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230512205256.635326070@linutronix.de> References: <20230512205256.635326070@linutronix.de> MIME-Version: 1.0 Message-ID: <168422819767.404.5002572577505730138.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?1765724877454452981?= X-GMAIL-MSGID: =?utf-8?q?1766041418617992738?= The following commit has been merged into the smp/core branch of tip: Commit-ID: 5490e769cdc7230cb93e804e656cce19d6c82253 Gitweb: https://git.kernel.org/tip/5490e769cdc7230cb93e804e656cce19d6c82253 Author: Thomas Gleixner AuthorDate: Fri, 12 May 2023 23:07:32 +02:00 Committer: Peter Zijlstra CommitterDate: Mon, 15 May 2023 13:44:57 +02:00 ARM: 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: 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.635326070@linutronix.de --- arch/arm/Kconfig | 1 + arch/arm/include/asm/smp.h | 2 +- arch/arm/kernel/smp.c | 18 +++++++----------- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 0fb4b21..775ce86 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -124,6 +124,7 @@ config ARM select HAVE_SYSCALL_TRACEPOINTS select HAVE_UID16 select HAVE_VIRT_CPU_ACCOUNTING_GEN + select HOTPLUG_CORE_SYNC_DEAD if HOTPLUG_CPU select IRQ_FORCED_THREADING select MODULES_USE_ELF_REL select NEED_DMA_MAP_STATE diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h index 7c1c90d..8c05a7f 100644 --- a/arch/arm/include/asm/smp.h +++ b/arch/arm/include/asm/smp.h @@ -64,7 +64,7 @@ extern void secondary_startup_arm(void); extern int __cpu_disable(void); -extern void __cpu_die(unsigned int cpu); +static inline void __cpu_die(unsigned int cpu) { } extern void arch_send_call_function_single_ipi(int cpu); extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 87f8d0e..6756203 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -288,15 +288,11 @@ int __cpu_disable(void) } /* - * 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) { - if (!cpu_wait_death(cpu, 5)) { - pr_err("CPU%u: cpu didn't die\n", cpu); - return; - } pr_debug("CPU%u: shutdown\n", cpu); clear_tasks_mm_cpumask(cpu); @@ -336,11 +332,11 @@ void __noreturn arch_cpu_idle_dead(void) flush_cache_louis(); /* - * Tell __cpu_die() that this CPU is now safe to dispose of. Once - * this returns, power and/or clocks can be removed at any point - * from this CPU and its cache by platform_cpu_kill(). + * Tell cpuhp_bp_sync_dead() that this CPU is now safe to dispose + * of. Once this returns, power and/or clocks can be removed at + * any point from this CPU and its cache by platform_cpu_kill(). */ - (void)cpu_report_death(); + cpuhp_ap_report_dead(); /* * Ensure that the cache lines associated with that completion are