[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 09/15] xen/x86: introduce a new amd cppc driver for cpufreq scaling
- To: Jan Beulich <jbeulich@xxxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>
- From: Jason Andryuk <jason.andryuk@xxxxxxx>
- Date: Tue, 25 Mar 2025 09:58:25 -0400
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=eUMPZCTEFXblxCYkyJrC1VgNbVD1w51DI+hmhmSZaH4=; b=ePwJ6nNdCBPCHJ+C4tM4K7KEZyWPnMYozX98zDuXBnszVe4PFpYSaNQw31OinJFSGpX3j3+EIUw0pAjsGFY11TguGdPtLB91jMUCcCxyayJAKknn1Q9rHo+3U7wMT19KX/FKdTosFDe2Pq/yCiNBVif7cKQ5c8Fqcbupd0D+MNDcVUfayWuIoSlIpfSZEZmK3LootGiPDmwHAnenADTR9uwAUwo5SlysaGNW2dgMa7jWwhiDuH2teBC/0xHMDu5fR2hApG1U/RMYX08cSi0VYoc9bi0zMN2MIYvGWJZ9dNNzm3rNJRLlTVL1+dK/gu3Yo5dcoxU4nBFpHg5B6fec5Q==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gk2Pd68if4EDPZ3H/nwDMJh/uIQgeYmgpDfRt071L4LDX9h3nh4syRUlzd3mjOp/wM8o6HymR4HSPw9XeRhnDt7YNVS7QTQ73vO1+0faurDdmnhSBm1r7hWPDJUJ/Uch33d+L2eswqUTrXIlslmNK7GYEnXZYXk+rlehOrzT687ofF6b68h0ZWrCSj740nnz/amJdeDGDMrwKr3pi0Lt+pW08MhJnVwaEOXToFUne7W0154dxAXWFmnyINosBxQGuLawdgzOQBXz3xV6JKIfA6MEPSy4su1svOTbZGd3Uq4lKFNm/5hDCUU5p13iIVEv1eZR0qVzWBGwDNlr+jtqcA==
- Cc: <ray.huang@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Jason Andryuk <jandryuk@xxxxxxxxx>
- Delivery-date: Tue, 25 Mar 2025 13:58:46 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 2025-03-25 05:57, Jan Beulich wrote:
On 06.03.2025 09:39, Penny Zheng wrote:
+static int cf_check amd_cppc_cpufreq_target(struct cpufreq_policy *policy,
+ unsigned int target_freq,
+ unsigned int relation)
+{
+ unsigned int cpu = policy->cpu;
+ const struct amd_cppc_drv_data *data = per_cpu(amd_cppc_drv_data, cpu);
+ uint8_t des_perf;
+ int res;
+
+ if ( unlikely(!target_freq) )
+ return 0;
Checking other *_cpufreq_target() functions, none would silently ignore
a zero input. (HWP's ignores the input altogether though; Cc-ing Jason
for possible clarification: I would have expected this driver here and
the HWP one to be similar in this regard.)
Yes, for HWP, the target and relation are ignored. All control is done
by writing MSR_HWP_REQUEST which are "continuous, abstract, unit-less
performance scale" values. Those are applied by set_hwp_para() from
`xenpm set-cpufreq-cppc`.
I think the difference is that this CPPC driver supports both autonomous
and active mode. The HWP driver I wrote only supports the equivalent of
autonomous mode - write the MSR and let the processor figure it out.
I think Penny's implementation also uses the existing governors, whereas
HWP only uses the dedicated hwp_governor.
Hopefully that gives some context.
Regards,
Jason
|