Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp914866rwb; Fri, 28 Jul 2023 01:34:52 -0700 (PDT) X-Google-Smtp-Source: APBJJlHuXON+PtevLkVS5zuZCKFO2dVQPMOM5ymqrXeKRZbrm47v8H0RC6dAHK9YtXWuzJfGSQWD X-Received: by 2002:a17:907:a0c6:b0:99b:bf82:75fc with SMTP id hw6-20020a170907a0c600b0099bbf8275fcmr1372292ejc.32.1690533291915; Fri, 28 Jul 2023 01:34:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690533291; cv=none; d=google.com; s=arc-20160816; b=aztTndauqflnejloW6z20+UA7sCBL04bCnyVnFsdPY4ry4pGAVUunPY2/GIYy9RZSp xZ0GgYoKCOoXQKrTfT+eGagq/q+yar+AYfZc8fuTnZ78pFWhGqqqZRgSX2tkjqV6KzOA mPXuaXcKOb7+zMOvQrAm1B7+O9iZdTQChVToiJX/IsmtiGO55kkQmOZUinOvimhqmCbF Cf3Kc37z3bGv7FN25kivGinrPDAf8ZKfxRdU09HOII9mzovxjSmBnj/zs7fSnckSuo6D 9s2/vwEI9lYv80xbi4th39RaAcV3RylcySEC63HHyg3RuJ+ktRBNqVQhCkcSgcqlUHh5 Sb9g== 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=FVvxUXWn/TUtSBpKuX4qV5akrpnLYTnw5GQvQ+pw/2M=; fh=Ro8hkxqjXqPLBYitCoTRRW5SbPcWraESHrqdzi9QfwI=; b=YL9oINXSsrvPQg3PRpCAhIbiD/gx6CDNquYeX7XX+kPCbHXbDHPD8ka3+24pX2Ktqj RfVaITMLGLYbepQdaX8RkPwUPhO/7H58odcb3KsV6hQJ1KDB0hyqP4A/jHTH6xxt0ADu ggeIPDZw6zypwPz7jBtvETjJJxIByV4Cg5XzhlOWDaZ9pujTl1oZMBUPRF3nUS7VhdYB TOB4dwYA7CboYyvU50rci8E796qw92zq83JWCziIJWZuufhvH3KZgbtSr5U5oawpOm9V KSysaOKt+0lyMdNZiMPbBNgQEu5iAQTfTYhmlPepQmlNLZSA7cERcshZ/h9DmWrv1xBu OKzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=wZwB09rv; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=ufcRcceQ; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x14-20020a1709064a8e00b0099207b3bc46si2405809eju.322.2023.07.28.01.34.26; Fri, 28 Jul 2023 01:34: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=wZwB09rv; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=ufcRcceQ; 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 S234550AbjG1H6R (ORCPT + 99 others); Fri, 28 Jul 2023 03:58:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234548AbjG1H55 (ORCPT ); Fri, 28 Jul 2023 03:57:57 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D2C4173F; Fri, 28 Jul 2023 00:57:56 -0700 (PDT) Date: Fri, 28 Jul 2023 07:57:54 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1690531074; 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=FVvxUXWn/TUtSBpKuX4qV5akrpnLYTnw5GQvQ+pw/2M=; b=wZwB09rvqV6Xvwti8DrLJqeTT1zSYF+qJUBIpwUCH9zo8hiAD6gAiLyT43Rj75rDHCor9K r+qyY3b4R+LVGXV4e7E6GJMSHjoouVKRvZLAO7liIHvnRp7OT5XQ5zkP7ruUsrbAYGMfpI Q4RN6AMaGSj/QeAUHRazTjh4cvPTGulni+E3a5bYL4q+fmseCGvPqRr6Uqa8BuBu/c0Fn8 aLfxLL4Z1n5zXUHKGBQXHOX+HDTKYS+J2x6RN/JrPeGI4VqslrGbX2gvsy+EUQU7dWtInS j8WfpqaRFp34Zm731l4/ZOhEBRyTEhjn8TP4C9iY3tUD/mKbWaKkcKy5ZDU0ZA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1690531074; 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=FVvxUXWn/TUtSBpKuX4qV5akrpnLYTnw5GQvQ+pw/2M=; b=ufcRcceQ4HuhEku4E7Mvb2/0ZMUPgHnta3QZHWP2udbQi8yx93cGY1/x93mClxh2YKHJS7 5GnukH1Abqz2eqDg== From: "tip-bot2 for Laurent Dufour" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: smp/core] cpu/SMT: Remove topology_smt_supported() Cc: Thomas Gleixner , Laurent Dufour , Zhang Rui , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230705145143.40545-6-ldufour@linux.ibm.com> References: <20230705145143.40545-6-ldufour@linux.ibm.com> MIME-Version: 1.0 Message-ID: <169053107408.28540.17386853558326393812.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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 The following commit has been merged into the smp/core branch of tip: Commit-ID: 91b4a7dbfe05ddb6fd3cf78cc11fb5ed64d3af90 Gitweb: https://git.kernel.org/tip/91b4a7dbfe05ddb6fd3cf78cc11fb5ed64d3af90 Author: Laurent Dufour AuthorDate: Wed, 05 Jul 2023 16:51:38 +02:00 Committer: Thomas Gleixner CommitterDate: Fri, 28 Jul 2023 09:53:37 +02:00 cpu/SMT: Remove topology_smt_supported() Since the maximum number of threads is now passed to cpu_smt_set_num_threads(), checking that value is enough to know whether SMT is supported. Suggested-by: Thomas Gleixner Signed-off-by: Laurent Dufour Signed-off-by: Thomas Gleixner Tested-by: Zhang Rui Link: https://lore.kernel.org/r/20230705145143.40545-6-ldufour@linux.ibm.com --- arch/x86/include/asm/topology.h | 2 -- arch/x86/kernel/smpboot.c | 8 -------- kernel/cpu.c | 4 ++-- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h index ae49ed4..3235ba1 100644 --- a/arch/x86/include/asm/topology.h +++ b/arch/x86/include/asm/topology.h @@ -141,7 +141,6 @@ static inline int topology_max_smt_threads(void) int topology_update_package_map(unsigned int apicid, unsigned int cpu); int topology_update_die_map(unsigned int dieid, unsigned int cpu); int topology_phys_to_logical_pkg(unsigned int pkg); -bool topology_smt_supported(void); extern struct cpumask __cpu_primary_thread_mask; #define cpu_primary_thread_mask ((const struct cpumask *)&__cpu_primary_thread_mask) @@ -164,7 +163,6 @@ static inline int topology_phys_to_logical_pkg(unsigned int pkg) { return 0; } static inline int topology_max_die_per_package(void) { return 1; } static inline int topology_max_smt_threads(void) { return 1; } static inline bool topology_is_primary_thread(unsigned int cpu) { return true; } -static inline bool topology_smt_supported(void) { return false; } #endif /* !CONFIG_SMP */ static inline void arch_fix_phys_package_id(int num, u32 slot) diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index e1aa2cd..d4e897b 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -327,14 +327,6 @@ static void notrace start_secondary(void *unused) } /** - * topology_smt_supported - Check whether SMT is supported by the CPUs - */ -bool topology_smt_supported(void) -{ - return smp_num_siblings > 1; -} - -/** * topology_phys_to_logical_pkg - Map a physical package id to a logical * @phys_pkg: The physical package id to map * diff --git a/kernel/cpu.c b/kernel/cpu.c index d7dd535..70add05 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -621,7 +621,7 @@ void __init cpu_smt_set_num_threads(unsigned int num_threads, { WARN_ON(!num_threads || (num_threads > max_threads)); - if (!topology_smt_supported()) + if (max_threads == 1) cpu_smt_control = CPU_SMT_NOT_SUPPORTED; cpu_smt_max_threads = max_threads; @@ -1801,7 +1801,7 @@ early_param("cpuhp.parallel", parallel_bringup_parse_param); static inline bool cpuhp_smt_aware(void) { - return topology_smt_supported(); + return cpu_smt_max_threads > 1; } static inline const struct cpumask *cpuhp_get_primary_thread_mask(void)