From patchwork Tue May 16 09:09:59 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: 94561 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp284240vqo; Tue, 16 May 2023 02:12:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ76E5cmIkkX9eG58a8r8WYqVSNhnrcWki09sbK4fhU7DfwIH0JIXKrRU+qxBslu7OwVl6oV X-Received: by 2002:a05:6a00:2346:b0:63f:2f00:c6d with SMTP id j6-20020a056a00234600b0063f2f000c6dmr48899962pfj.2.1684228368175; Tue, 16 May 2023 02:12:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684228368; cv=none; d=google.com; s=arc-20160816; b=EKjGh6Ig897PgfsOEQa/BrKPi/qWiXlSt21+fgzXU/foQjNG/l3oNQWXAmb1V1hS62 56u9Ap9Z4bAXUhzy4G2W6EFEInOsICsZJZU0phR69QdKhPvTEJRXNn+trLRjW06gcpYo 3X1jey5FnSyJPs/wevJ4XL+MQuZ3fM8Wv2zsMTwKI4oNroMPxs0XAxh2VteoH2t9Nbun f+mgRyXjJVT7lGnKxdGVa+dc4sKmtuAK/0VizHoFSLTe2dsgl7kCLVOhb9VeT/CZePni FoqATjhIXpqtshBd9otuWag/yBcnpy5mYlX/D11W7xl68Y0eBgB6SSTCtRU3aJfuAo6N dNxg== 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=BVk9My4DLgcAs6qBcIJAUiGEG+aQrBL9FHQdkLIbdsA=; b=PmaNLiEMWARdi2qtJq8cl4dPbJC2sKgUdPP0xjm0KztoHM7n21MWgzVPo4cvtJceO9 z4JvZm0N/vhxGj8ZA+FhTM1KkJ4ZJPmNNl6m4IU3LXx8gL/cKN+MqUi49PHobx/HQtvx wd6xLa53eUdrUhtMRc1dDe9OXrf6/9UEdTGi3skQPbgQ5uom/XiEJHh0O3V5xPR7ZZEt CoVKQNwLrQ/0EX7BveEukJqdgD7dnflbatipWAOq1Qe1UyHQcfK2ie/erisd4W5HTf/I 2bciwcUGY+UYG1azeFzU9pHK5IjWnHIi0XVnkFX47FJqVIaG21uG1YQfdmwTsEBhR6fe mhfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=i90SHFhh; 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 b125-20020a621b83000000b0063d6708d1c9si18344646pfb.105.2023.05.16.02.12.33; Tue, 16 May 2023 02:12:48 -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=i90SHFhh; 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 S231983AbjEPJLd (ORCPT + 99 others); Tue, 16 May 2023 05:11:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231823AbjEPJKH (ORCPT ); Tue, 16 May 2023 05:10:07 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C97F2359D; Tue, 16 May 2023 02:10:04 -0700 (PDT) Date: Tue, 16 May 2023 09:09:59 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1684228199; 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=BVk9My4DLgcAs6qBcIJAUiGEG+aQrBL9FHQdkLIbdsA=; b=i90SHFhhIwzNyEHj1aw3/TK74v8N9L2mD/skmZIPzB9k2B0dc2Of3/uAt4OKSNB5ltwbjc zPTPfz5qoyYWakNBz2vh3cZLrIQXoijMWofXZTt1cp9Ra6qxrS9YpE0Zb2hUtroqQ5cOHt btQMjxXgcvXstEpCH6YnEQWr9aMQRAfbTe+mlng9uxaJg4lc+ZSAQ91JiI+2aMh3j5e8VY oxhUEXXV7Ej6xnbCScgBrPBW556BaJCyNaHlQrcSU6HlAcQ78Y07WrkaKRcLveCoBU679/ 5IbnPXnANLHOv6fMPbgYyHfUjwvDm6AmtTiu3rUoAw9asqr5v7+tfYjTDnJxOA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1684228199; 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=BVk9My4DLgcAs6qBcIJAUiGEG+aQrBL9FHQdkLIbdsA=; b=VgJCr3gZXfhFPYCrnQOmY62+awqoNNYXOJS7egAo0tQsLM6Z50/lmnROj2wVnKWpzJs42/ b6b++bB5aEON0TDw== 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] x86/smpboot: Remove wait for cpu_online() 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.316417181@linutronix.de> References: <20230512205256.316417181@linutronix.de> MIME-Version: 1.0 Message-ID: <168422819946.404.17515488991384731626.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?1765724137527445315?= X-GMAIL-MSGID: =?utf-8?q?1766041445226183054?= The following commit has been merged into the smp/core branch of tip: Commit-ID: e464640cf7af12f3c2748065936b95eae1f735ba Gitweb: https://git.kernel.org/tip/e464640cf7af12f3c2748065936b95eae1f735ba Author: Thomas Gleixner AuthorDate: Fri, 12 May 2023 23:07:22 +02:00 Committer: Peter Zijlstra CommitterDate: Mon, 15 May 2023 13:44:54 +02:00 x86/smpboot: Remove wait for cpu_online() 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 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.316417181@linutronix.de --- arch/x86/kernel/smpboot.c | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 3f731be..4349e8a 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -275,7 +275,6 @@ static void notrace start_secondary(void *unused) * 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(); @@ -1104,20 +1103,6 @@ static int wait_cpu_initialized(unsigned int cpu) 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); @@ -1164,16 +1149,9 @@ int native_cpu_up(unsigned int cpu, struct task_struct *tidle) 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();