Message ID | 20230508185218.070008578@linutronix.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2387554vqo; Mon, 8 May 2023 12:45:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6+kt2CNxQGT1YxtRYEy1qcY9SyVgq70TOelzizGifRiSu1kXAKto1KCxlWmirei2jz8u62 X-Received: by 2002:a05:6a00:16cf:b0:63a:75a4:b2d4 with SMTP id l15-20020a056a0016cf00b0063a75a4b2d4mr16746238pfc.24.1683575151670; Mon, 08 May 2023 12:45:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683575151; cv=none; d=google.com; s=arc-20160816; b=xZGYerCn8wNUWsJi7CI3esINWKQD3iM81OQRCHPlwHkXtqgIziSbNnnNDoGGpf9UBE vRxY5zC8AWHiEb5lvSoDDinag0Ik66Ff8CVp0mkjPU6ksSm4lkbZrTT7dLZihmU0zND8 pJATCDghnRIbAvUTgT7H504nfhDr2ecAuLHuLD5nN9FO5QEa87CkInJT5/pq4rASP5B/ 5ZRqXNWSYqyey7QlgiFxWQu7ofefKZKVAYaa4DUObHqns6mWY/41Gmmhl4OyPen5tciW WciIwvG6UEm9xWmSgQbwwYfx79FV1NBKNjDB/1gr4Jw6O7OlIq1I2Py6KVj4FRnVt1Kg GLGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:mime-version:references:subject:cc:to:from :dkim-signature:dkim-signature:message-id; bh=DpwezFnftgf/NwnjaJYg18wbFoZRAK6UuAmlsWmBJR4=; b=aDUDtRGOJnRSieg1ZapdOe/oKGpyoYkitMhcYwmiHYW19nsu9hLN9HsMl4Sg4cOVLF zysAYFjCkB0EISqGrpEFxv3lpRxFBh5e0jCtaSuw0w4wWxxsW2Q7xRfXkxoiG9iWHF6L 574CxvrKu4Eb7F/JuYXg/fPn/rbaStLFWp3MKeA1BD2thtXikbUDxpPVmXbap1ZNKnTy bHnG+bgGFf4T+25RAaxX7t6VYXRRUGohoR4PUyRiBvl6CbRvgI7cWPm1zg8ezRfzUdYu ASE7NcnGOHkMJatojrl8P9a35TMXMTJslxT4YcUe/ao9jOno6w3HZwEKnrujnyssZqa5 Mfxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=i1TFZjgC; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=p4MipbJW; 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 g193-20020a636bca000000b00528d90d40d9si3517183pgc.763.2023.05.08.12.45.37; Mon, 08 May 2023 12:45:51 -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=i1TFZjgC; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=p4MipbJW; 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 S233761AbjEHTpE (ORCPT <rfc822;jeantsuru.cumc.mandola@gmail.com> + 99 others); Mon, 8 May 2023 15:45:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232779AbjEHTo1 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 8 May 2023 15:44:27 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFEE361BD; Mon, 8 May 2023 12:43:56 -0700 (PDT) Message-ID: <20230508185218.070008578@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1683575031; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=DpwezFnftgf/NwnjaJYg18wbFoZRAK6UuAmlsWmBJR4=; b=i1TFZjgCtddkAakfxkISXw55XmrEJvUVPuQTFOFgS+oTTKVcNGhuqDExhfxWr3kSGXHZ9h Q+ujpZNUZEK3gioXPoyRZ+NzfuV4aL+sQupa7bIw509g00exAtAYyYGseE5+d40Ye/9iSn kyYz5rdl/ounEY4O9wO7ubw04Cyxxy6DTnoJB2oO2RietlbB/OitKYLkOQ8iHZAyHbfy1W bv+Q2OEIWcacTVCd+tTm0xqwTwSoZ8e7RLxQJArbSe8S99eF/7jfVItjSmrC275mG9pAip lscg+orwTig3a1iTNLS2jmVzL558VHIKrCz5q1WCRCIfLCf1r3Xa3vOeSE+ulQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1683575031; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=DpwezFnftgf/NwnjaJYg18wbFoZRAK6UuAmlsWmBJR4=; b=p4MipbJWjxb6AbwUz07UF9If0ACyXBwES1Mx0lUk9qi+e9Q63raPnhjjqmne+YvfK1SUP6 eRiNkcZ4g3zeVxBg== From: Thomas Gleixner <tglx@linutronix.de> To: LKML <linux-kernel@vger.kernel.org> Cc: x86@kernel.org, David Woodhouse <dwmw2@infradead.org>, Andrew Cooper <andrew.cooper3@citrix.com>, Brian Gerst <brgerst@gmail.com>, Arjan van de Veen <arjan@linux.intel.com>, Paolo Bonzini <pbonzini@redhat.com>, Paul McKenney <paulmck@kernel.org>, Tom Lendacky <thomas.lendacky@amd.com>, Sean Christopherson <seanjc@google.com>, Oleksandr Natalenko <oleksandr@natalenko.name>, Paul Menzel <pmenzel@molgen.mpg.de>, "Guilherme G. Piccoli" <gpiccoli@igalia.com>, Piotr Gorski <lucjan.lucjanov@gmail.com>, Usama Arif <usama.arif@bytedance.com>, Juergen Gross <jgross@suse.com>, Boris Ostrovsky <boris.ostrovsky@oracle.com>, xen-devel@lists.xenproject.org, Russell King <linux@armlinux.org.uk>, Arnd Bergmann <arnd@arndb.de>, linux-arm-kernel@lists.infradead.org, Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>, Guo Ren <guoren@kernel.org>, linux-csky@vger.kernel.org, Thomas Bogendoerfer <tsbogend@alpha.franken.de>, linux-mips@vger.kernel.org, "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>, Helge Deller <deller@gmx.de>, linux-parisc@vger.kernel.org, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, linux-riscv@lists.infradead.org, Mark Rutland <mark.rutland@arm.com>, Sabin Rapan <sabrapan@amazon.com>, "Michael Kelley (LINUX)" <mikelley@microsoft.com> Subject: [patch v3 15/36] x86/smpboot: Remove wait for cpu_online() References: <20230508181633.089804905@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Date: Mon, 8 May 2023 21:43:51 +0200 (CEST) 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 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765356498200774248?= X-GMAIL-MSGID: =?utf-8?q?1765356498200774248?= |
Series |
cpu/hotplug, x86: Reworked parallel CPU bringup
|
|
Commit Message
Thomas Gleixner
May 8, 2023, 7:43 p.m. UTC
From: Thomas Gleixner <tglx@linutronix.de> Now that the core code drops sparse_irq_lock after the idle thread synchronized, it's pointless to wait for the AP to mark itself online. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Michael Kelley <mikelley@microsoft.com> --- arch/x86/kernel/smpboot.c | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) ---
--- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -281,7 +281,6 @@ static void notrace start_secondary(void * half valid vector space. */ lock_vector_lock(); - /* Sync point with do_wait_cpu_online() */ set_cpu_online(smp_processor_id(), true); lapic_online(); unlock_vector_lock(); @@ -1110,20 +1109,6 @@ static int wait_cpu_initialized(unsigned return 0; } -/* - * Bringup step three: Wait for the target AP to reach set_cpu_online() in - * start_secondary(). - */ -static void wait_cpu_online(unsigned int cpu) -{ - /* - * Wait for the AP to mark itself online, so the core caller - * can drop sparse_irq_lock. - */ - while (!cpu_online(cpu)) - schedule(); -} - static int native_kick_ap(unsigned int cpu, struct task_struct *tidle) { int apicid = apic->cpu_present_to_apicid(cpu); @@ -1170,16 +1155,9 @@ int native_cpu_up(unsigned int cpu, stru int ret; ret = native_kick_ap(cpu, tidle); - if (ret) - goto out; - - ret = wait_cpu_initialized(cpu); - if (ret) - goto out; - - wait_cpu_online(cpu); + if (!ret) + ret = wait_cpu_initialized(cpu); -out: /* Cleanup possible dangling ends... */ if (x86_platform.legacy.warm_reset) smpboot_restore_warm_reset_vector();