From patchwork Tue Feb 7 04:58:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Neri X-Patchwork-Id: 53666 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2651379wrn; Mon, 6 Feb 2023 20:59:14 -0800 (PST) X-Google-Smtp-Source: AK7set90JjXBrubXs2vDUTvtzlFfiq99cXR/1uZ5Cdl9JPGJivGbv0nXaRCMVjsozZD++d8VyY+O X-Received: by 2002:a17:90a:1a52:b0:22c:1b3:b72b with SMTP id 18-20020a17090a1a5200b0022c01b3b72bmr2628406pjl.14.1675745954087; Mon, 06 Feb 2023 20:59:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675745954; cv=none; d=google.com; s=arc-20160816; b=m4XkUwHQ3sOFj83rfdse7px1sNteJwUoGcFKpaaAxx0aFxSgzoVBhCgY7um3eYn5+J 4ObqQgr99X3s1jnvg6cVimtLAPPgrpQ1dYS7H9xap/8wT8ZWVrRJDZEUGByNrKLVZsGo X8+wPZk04atqx+Krr9XGH8GcvWmxNH3ccOPdyO1XXijTL3euaYS3s0UeFf1EDiuzzwf6 kuLGMygG4N8GCgUrNnNrJ/WEfElAtUcOLCKIa+KtuNWlK6Igm0Dpk0SDcuTM0Oj81sCM MtPAWyLpd23XeGd1/Wam3WasLcgBSc2o1DqSJ1pVZLzJgHkrqurA2tg+JdQ1z/R/I3E3 nDiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=EZvvdlOEyRJ0EwVSISNqydnTDZXTfN+iRHqLHoIVyIQ=; b=qqXhtFV7EiYm+XJnsgymnKKMdeRz5uRlIs7hLWKEiqQV8Qe4wOf4c82yqzzOhWA3tz dQi+/IqO2WuE+SnNZNmxPq06f4QGtamOTn+zRoYgdcWqLEEyfxuv19KmLAKsIGzYUgZC wSRfEVyHtdn1wC0fM/oDa2rJOfztjDhmak9gFUskHIPLVkuOSaXlrsvkjCpsTGHoLfS6 gI13wNvpwJEF4wLl5ErFOxl8oSQaxEnhM/LWWDSh9zjjceD6MO6g6KlCEHpMQ3La7Fr3 H/b6nWS/24gX3ulTkUUNW7LUF/j5oeKPcxxLD252j81HEDR9CTo1V9KTxeQpQ0bOvz79 oz+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bItoG2aA; 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=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ls11-20020a17090b350b00b0023082ccac58si13467579pjb.7.2023.02.06.20.59.01; Mon, 06 Feb 2023 20:59:14 -0800 (PST) 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=@intel.com header.s=Intel header.b=bItoG2aA; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230010AbjBGEva (ORCPT + 99 others); Mon, 6 Feb 2023 23:51:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229953AbjBGEuv (ORCPT ); Mon, 6 Feb 2023 23:50:51 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2B384224 for ; Mon, 6 Feb 2023 20:50:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675745450; x=1707281450; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=V6FYmmT4588dHQyb2k4T7y1sGWHIXNL1S/nAV83f7Kc=; b=bItoG2aADFROUGdSb2VH4jrC46brvF3ikHNj8OPk60rTl3tqoRZqr/Zr /9Dj4KrZpwmDCPPG4jx+l/OHLJoEGLQhC8HmNTRYFEekfFJEeEJtS6xtY EIObkfX+FqfjbP3AUrAR8XTSlEX8P95FceKsYlrnAp0lJSblV9gsupVet jWz/1aViJVasfUOQPGJKoy17irsWgdfPGgiuF/ZAY4h2hCmQgaj9U5KxQ i+JB29OenZssRNAk+prtey3McNTeVtDbKGJcPhtGLI7bm/F7Kx5+YHiRa elPdtxUIFvt5qVD0xZwYKswhNe1rpK11rGtFgQ/tLvK1B1HzG/MN9dI7r g==; X-IronPort-AV: E=McAfee;i="6500,9779,10613"; a="415624062" X-IronPort-AV: E=Sophos;i="5.97,278,1669104000"; d="scan'208";a="415624062" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2023 20:50:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10613"; a="668653808" X-IronPort-AV: E=Sophos;i="5.97,278,1669104000"; d="scan'208";a="668653808" Received: from ranerica-svr.sc.intel.com ([172.25.110.23]) by fmsmga007.fm.intel.com with ESMTP; 06 Feb 2023 20:50:48 -0800 From: Ricardo Neri To: "Peter Zijlstra (Intel)" , Juri Lelli , Vincent Guittot Cc: Ricardo Neri , "Ravi V. Shankar" , Ben Segall , Daniel Bristot de Oliveira , Dietmar Eggemann , Len Brown , Mel Gorman , "Rafael J. Wysocki" , Srinivas Pandruvada , Steven Rostedt , Tim Chen , Valentin Schneider , Ionela Voinescu , x86@kernel.org, linux-kernel@vger.kernel.org, Ricardo Neri , "Tim C . Chen" Subject: [PATCH v3 10/10] x86/sched/itmt: Give all SMT siblings of a core the same priority Date: Mon, 6 Feb 2023 20:58:38 -0800 Message-Id: <20230207045838.11243-11-ricardo.neri-calderon@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230207045838.11243-1-ricardo.neri-calderon@linux.intel.com> References: <20230207045838.11243-1-ricardo.neri-calderon@linux.intel.com> X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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?1757146989766267970?= X-GMAIL-MSGID: =?utf-8?q?1757146989766267970?= 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. Cc: Ben Segall Cc: Daniel Bristot de Oliveira Cc: Dietmar Eggemann Cc: Len Brown Cc: Mel Gorman Cc: Rafael J. Wysocki Cc: Srinivas Pandruvada Cc: Steven Rostedt Cc: Tim C. Chen Cc: Valentin Schneider Cc: x86@kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Len Brown Signed-off-by: Ricardo Neri --- Changes since v2: * None. Changes since v1: * Reworded commit message for clarity. --- 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 9ff480e94511..6510883c5e81 100644 --- a/arch/x86/kernel/itmt.c +++ b/arch/x86/kernel/itmt.c @@ -174,32 +174,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; }