From patchwork Wed May 10 13:49:10 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: 92131 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3638959vqo; Wed, 10 May 2023 06:50:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6akwO394G+CqimLDqka4Nyp2cZ3xvZR/NPJ9hRctzNwZb7niX3d94tX9Q0BooaoAxhLdFW X-Received: by 2002:a05:6a00:188f:b0:63b:8eeb:77b8 with SMTP id x15-20020a056a00188f00b0063b8eeb77b8mr25546474pfh.13.1683726654004; Wed, 10 May 2023 06:50:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683726653; cv=none; d=google.com; s=arc-20160816; b=UZ3ATxaBDu7Wk4p8HNDwCKWTGRwlK3xmS1BVrGnR/yk3kMOpennRH53tYaq6YXSvCk uPrQaEWEuryH31kCjmtqIUprSVPOJYtv4HyEpzYtC1BbObeL1wp2DN8nwRr+PqYzHCey VTMC0wIcR3pILBE++HZeQv6q4wSwO8Ice9zCQ+JESKDgycN58B+Ad6CJQwwrMjeqZzmz XuCZmi93MMuBqN6effp2ASeW4JLyWjJc26W0xYBAkXJX6aTlAKSlFq5iuOqZtqRGihRZ ZxKStVScaeIwIQ7l8wraRN14vKEy/or3TcW5jgROtfGQ2DUU9qXMve5kt/j4LOlXVuCG D6AQ== 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=sHJS/7EoNzb+6ZuL9sAOr94pTTj6EYKfBFQrZhf/VNM=; b=x4bBAKA7tL4h3QAkOYMl0g5EZDbSUtTv0E3INOo53o8khwwMe9yXRwwH8iziOV/7A5 sbzOyWd/vh31cEMgOPdU0BLkMRvlYx3+yQBv0L2n9HtXcOSX+SRenZype/qUt/KbMqjh 5Gy1c5NSj+fBbF2Wr86u5WwjGpbVSD0S82RQ/IzdTBIAlf2cqS+ypBhChh2NplVryse8 7+hOnkdgHHS7WER7LYxTl2FT8+8BAgUTLpw00C3+uZe9j9pMmO+w/iW1j8IBHtuRxOW7 07T3UFdo0lfAjP8VBHfclsszhKHBjWX6THMlpEDhPBKHp6RugrKrSNRJ7sNNy7Bd+XQB 8bZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=iVN3X91V; dkim=neutral (no key) header.i=@linutronix.de header.b=U+7eppPQ; 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 a6-20020aa795a6000000b0063b68fa0807si5027315pfk.263.2023.05.10.06.50.40; Wed, 10 May 2023 06:50:53 -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=iVN3X91V; dkim=neutral (no key) header.i=@linutronix.de header.b=U+7eppPQ; 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 S237321AbjEJNtk (ORCPT + 99 others); Wed, 10 May 2023 09:49:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237266AbjEJNtT (ORCPT ); Wed, 10 May 2023 09:49:19 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7022E5FE9; Wed, 10 May 2023 06:49:12 -0700 (PDT) Date: Wed, 10 May 2023 13:49:10 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1683726551; 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=sHJS/7EoNzb+6ZuL9sAOr94pTTj6EYKfBFQrZhf/VNM=; b=iVN3X91VSPuCjWJO2SZd5Xy8TOoQllZ5oRTxeJ8kcEbg+GcEfBYWWWgY5ZAuAg8ar1P9Fg QLElCT0EEHI+9UdQkC+siE2BXmvoR7H/0BHlzOUB8Sn4G2L599fSUszXyiPmtunVOANYYX psAqO3wTQTZgHsGSixT+/E7075KjjtHiyqwMKfk0+JxJiQkf3Ii+whsO2Fea2Cd2A0WaPO trxlS8kcwcEZMqgxiUAb02TpuTXiKWR4tA/5Gj0SDHzQjxPneaypcTdYDdSbzdZafu4tru aGYlzNdbrcRHd0vjEWnf6XTiPl4iFb2EmrL9MoBc5E0V/qvm1xbmDlceuCIf1w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1683726551; 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=sHJS/7EoNzb+6ZuL9sAOr94pTTj6EYKfBFQrZhf/VNM=; b=U+7eppPQt8Vgv5TrJorYxO1goYPSh/HRPFxXhjPMJkoYxt3FUpsctTZ4OLLXXkULtEu/2R FaZK/KH0Gi2iqxAw== From: "tip-bot2 for Ricardo Neri" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] x86/sched/itmt: Give all SMT siblings of a core the same priority Cc: Ricardo Neri , "Peter Zijlstra (Intel)" , Len Brown , Zhang Rui , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230406203148.19182-12-ricardo.neri-calderon@linux.intel.com> References: <20230406203148.19182-12-ricardo.neri-calderon@linux.intel.com> MIME-Version: 1.0 Message-ID: <168372655068.404.6128574669002418339.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?1762461445634176505?= X-GMAIL-MSGID: =?utf-8?q?1765515359956096170?= The following commit has been merged into the sched/core branch of tip: Commit-ID: 046a5a95c3b0425cfe79e43021d8ee90c1c4f8c9 Gitweb: https://git.kernel.org/tip/046a5a95c3b0425cfe79e43021d8ee90c1c4f8c9 Author: Ricardo Neri AuthorDate: Thu, 06 Apr 2023 13:31:47 -07:00 Committer: Peter Zijlstra CommitterDate: Mon, 08 May 2023 10:58:38 +02:00 x86/sched/itmt: Give all SMT siblings of a core the same priority X86 does not have the SD_ASYM_PACKING flag in the SMT domain. The scheduler knows how to handle SMT and non-SMT cores of different priority. There is no reason for SMT siblings of a core to have different priorities. Signed-off-by: Ricardo Neri Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Len Brown Tested-by: Zhang Rui Link: https://lore.kernel.org/r/20230406203148.19182-12-ricardo.neri-calderon@linux.intel.com --- arch/x86/kernel/itmt.c | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/arch/x86/kernel/itmt.c b/arch/x86/kernel/itmt.c index 670eb08..ee4fe8c 100644 --- a/arch/x86/kernel/itmt.c +++ b/arch/x86/kernel/itmt.c @@ -165,32 +165,19 @@ int arch_asym_cpu_priority(int cpu) /** * sched_set_itmt_core_prio() - Set CPU priority based on ITMT - * @prio: Priority of cpu core - * @core_cpu: The cpu number associated with the core + * @prio: Priority of @cpu + * @cpu: The CPU number * * The pstate driver will find out the max boost frequency * and call this function to set a priority proportional - * to the max boost frequency. CPU with higher boost + * to the max boost frequency. CPUs with higher boost * frequency will receive higher priority. * * No need to rebuild sched domain after updating * the CPU priorities. The sched domains have no * dependency on CPU priorities. */ -void sched_set_itmt_core_prio(int prio, int core_cpu) +void sched_set_itmt_core_prio(int prio, int cpu) { - int cpu, i = 1; - - for_each_cpu(cpu, topology_sibling_cpumask(core_cpu)) { - int smt_prio; - - /* - * Ensure that the siblings are moved to the end - * of the priority chain and only used when - * all other high priority cpus are out of capacity. - */ - smt_prio = prio * smp_num_siblings / (i * i); - per_cpu(sched_core_priority, cpu) = smt_prio; - i++; - } + per_cpu(sched_core_priority, cpu) = prio; }