Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp3807286rdb; Wed, 27 Dec 2023 23:57:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IHrNaV0rEBeKeHsEcxARGQOuL4nWfQReOFxIeb7+IB+7WFgOB8Y//1p6LeFu1gXJded7svr X-Received: by 2002:a17:906:4554:b0:a26:d98d:74d7 with SMTP id s20-20020a170906455400b00a26d98d74d7mr6998285ejq.33.1703750252879; Wed, 27 Dec 2023 23:57:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703750252; cv=none; d=google.com; s=arc-20160816; b=Eer4iWnnzdCCWo3sCLD44bjtQee+koUT1eFhqgCVXH9ie5lnlFMvLdglIqpOy0B4O9 hLd28xZRnIFh5OCozxz6ruJm152oyRwP7lGMRl6ZM8XUdWOnhE9trOnBOgnnOT/B8BKb ooVsnWje51IWRgbIKG0iNSZgW98/21Pee6TOJxMLl4NxI1yQ9iylm+115yPuyWdlEPEw 2Qyl/osHNL0DYy5uO6p2QbjeaGn8zl7T8icxPWNTEknIW7uqEAwRxAROPO2jeUYOUPSn 5md4NPh/p/wcwlt7QkOfkLB9C034feYo6FUvJpKSh503ZTPmWJj4bSD4taIKhP5dogVS Y88A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=hNzCFRKr5ZbG2z4wuH8OqHXsSYTGx9Z4LVHcBtmHeu4=; fh=aRZZFfYpFsbONXxr7ZI6QaRKfYRbAmgYyJx4zno9nrw=; b=eD4/u7fqTo1ZcHPAPl8M+tmxRQVo04Gl9r7jwhcjMmZUAbRO7+6UpvdcKITpuzE/jB e6it/sAaJct7TJ9mopz5sr19zPtURlhbmEkfACI0OnLr5JeVRwbRGDMWx4wqUCNjhD5R S0NadgXirqb1IWbvt5ChBgvQVsY4ECvWIpvHHo6HNQpA3HPVeFv5r8E9tp85E1IOEqqb 9bjfT2TATs/5dOObxCR1shrl5FE95llhpc/o7TZpXV1d3+fe7qc/zb+zRD1I8RIccg5w ZighggnQAponv5XcrTb3Xyb/DhQJOFUmisdMQ3vofI6Ix3mcExFjLDxIQDATkmZ5AliM tSGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12499-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12499-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id z22-20020a170906241600b009fd1b090555si6706948eja.931.2023.12.27.23.57.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 23:57:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12499-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12499-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12499-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A1EA81F226A2 for ; Thu, 28 Dec 2023 07:57:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 351BE53B4; Thu, 28 Dec 2023 07:57:22 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from mx2.zhaoxin.com (mx2.zhaoxin.com [203.110.167.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C5F8C63B1 for ; Thu, 28 Dec 2023 07:57:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=zhaoxin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zhaoxin.com X-ASG-Debug-ID: 1703750229-1eb14e0c7d074c0001-xx1T2L Received: from ZXSHMBX1.zhaoxin.com (ZXSHMBX1.zhaoxin.com [10.28.252.163]) by mx2.zhaoxin.com with ESMTP id blxFhhqhkdOaVL6N (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Thu, 28 Dec 2023 15:57:09 +0800 (CST) X-Barracuda-Envelope-From: TonyWWang-oc@zhaoxin.com X-Barracuda-RBL-Trusted-Forwarder: 10.28.252.163 Received: from zxbjmbx1.zhaoxin.com (10.29.252.163) by ZXSHMBX1.zhaoxin.com (10.28.252.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 28 Dec 2023 15:57:09 +0800 Received: from tony.zhaoxin.com (10.32.65.162) by zxbjmbx1.zhaoxin.com (10.29.252.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 28 Dec 2023 15:57:06 +0800 X-Barracuda-RBL-Trusted-Forwarder: 10.28.252.163 From: Tony W Wang-oc X-Barracuda-RBL-Trusted-Forwarder: 10.29.252.163 To: , , , , , , , , , , , , , , , , , , CC: , , , Subject: [PATCH 0/3] Add Zhaoxin preferred core support in acpi-cpufreq Date: Thu, 28 Dec 2023 15:57:02 +0800 X-ASG-Orig-Subj: [PATCH 0/3] Add Zhaoxin preferred core support in acpi-cpufreq Message-ID: <20231228075705.26652-1-TonyWWang-oc@zhaoxin.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: zxbjmbx1.zhaoxin.com (10.29.252.163) To zxbjmbx1.zhaoxin.com (10.29.252.163) X-Barracuda-Connect: ZXSHMBX1.zhaoxin.com[10.28.252.163] X-Barracuda-Start-Time: 1703750229 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://10.28.252.36:4443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at zhaoxin.com X-Barracuda-Scan-Msg-Size: 1474 X-Barracuda-BRTS-Status: 0 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.118665 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- For Zhaoxin CPUs, the cores' highest frequencies may be different, which means that cores may run at different max frequencies, According to ACPI-spec6 chapter 8.4.7, the per-core highest frequency value can be obtained via cppc. The core with the higher frequency have better performance, which can be called as preferred core. And better performance can be achieved by making the scheduler to run tasks on these preferred cores. The cpufreq driver can use the highest frequency value as the prioriy of core to make the scheduler try to get better performace. More specifically: Add cppc_get_highest_perf function in CPPC driver. Export two funcions which will be used in acpi-cpufreq drvier. In the acpi-cpufreq driver use cppc_get_highest_perf() to get highest frequency value of each core, use sched_set_itmt_core_prio() to set highest frequency value as core priority, and use sched_set_itmt_support() provided by ITMT to tell the scheduler to favor on the preferred cores. Tony W Wang-oc (3): ACPI: CPPC: Add get the highest perf register value support x86/sched/itmt: Export two API symbols ACPI: cpufreq: Add ITMT support when CPPC enabled for Zhaoxin CPUs arch/x86/kernel/itmt.c | 2 ++ drivers/acpi/cppc_acpi.c | 13 ++++++++ drivers/cpufreq/acpi-cpufreq.c | 56 +++++++++++++++++++++++++++++++++- include/acpi/cppc_acpi.h | 5 +++ 4 files changed, 75 insertions(+), 1 deletion(-) -- 2.25.1