[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v8 8/8] xen/cpufreq: Adapt SET/GET_CPUFREQ_CPPC xen_sysctl_pm_op for amd-cppc driver


  • To: "Penny, Zheng" <penny.zheng@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Wed, 3 Sep 2025 14:17:39 -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=LVR4KN/qTSmiKDA1hftFzD4YihUfYSCWsMeEvYvgLRQ=; b=xf5vzeVpEblkdZtRf5jMG0j8xBOQLvJNlWVkWe7e0pStK9b02B5vRqGSnyz475E1ujU2O7BhNq4hWTgJ0g6fNT4EnFOpjmBVZplLBpXRvRAP4IU4LsofaDKGdnZBipTiIsdAx+IUfo7aXm8zWJtje1dHsjF6MPMTWyl+q+f3WJkD5UNzKF8zhDwr0ckqL40X1cHmgaAKd7XYx7CBJ2shsgL3dOjM7Gg51ahmuuiTaHjUegaP0kfq8JmldES6B7AIs644nJqjBT+t/gzzHHLt6GfKLMChtpNTt8r4WqugBhq07PdOxYIZdrCY6oTxEXOw90HTLZLPZ04jLcSTghdMjg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=s6Nhg/ZPY0ZXFZosz4rJzzM7bquv3KbfbTzpuzJK93tVw1PAUKbKGSQettrTsk/oMi2jPn9ocDjvpCGOoVMs8MXCpM5pG+SLB1m9ABMDO2vqvcwq08Pw5aLO3/dz3bEOWRygOByZd/Q+mq1OTIjdXIqesZ8Q7GYy1w2CFCAWM7C60XTOyWjAUjT+j1gJncGGIjWcffJhHMocw/FKhBl5uZjGSl63LNNZuXhCvxxVRT8gzu+K0waah8TiCz8pPa/aGkHFbVvFNiPy3UU2z5K8oy3s1CoweZRZeNQLQ6cenp36K5X1L5ZsjhUrJfxnK7RdXXMGLyQRkZm1zPwi1PqYcw==
  • Cc: "Huang, Ray" <Ray.Huang@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 03 Sep 2025 18:17:56 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2025-09-02 23:14, Penny, Zheng wrote:
[Public]

-----Original Message-----
From: Jan Beulich <jbeulich@xxxxxxxx>
Sent: Thursday, August 28, 2025 7:07 PM
To: Penny, Zheng <penny.zheng@xxxxxxx>
Cc: Huang, Ray <Ray.Huang@xxxxxxx>; Anthony PERARD
<anthony.perard@xxxxxxxxxx>; Andrew Cooper <andrew.cooper3@xxxxxxxxxx>;
Roger Pau Monné <roger.pau@xxxxxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx
Subject: Re: [PATCH v8 8/8] xen/cpufreq: Adapt SET/GET_CPUFREQ_CPPC
xen_sysctl_pm_op for amd-cppc driver

On 28.08.2025 12:06, Penny Zheng wrote:
@@ -154,6 +156,17 @@ static int get_cpufreq_para(struct xen_sysctl_pm_op
*op)
      else
          strlcpy(op->u.get_para.scaling_driver, "Unknown",
CPUFREQ_NAME_LEN);

+    /*
+     * In CPPC active mode, we are borrowing governor field to indicate
+     * policy info.
+     */
+    if ( policy->governor->name[0] )
+        strlcpy(op->u.get_para.u.s.scaling_governor,
+                policy->governor->name, CPUFREQ_NAME_LEN);
+    else
+        strlcpy(op->u.get_para.u.s.scaling_governor, "Unknown",
+                CPUFREQ_NAME_LEN);

Isn't pulling this ...

      if ( !cpufreq_is_governorless(op->cpuid) )
      {
          if ( !(scaling_available_governors =

... out of this if()'s body going to affect HWP? It's not clear to me whether 
that would
be entirely benign.


HWP has its own unique "hwp" governor. So, imo, it may not affect.

get_hwp_para() writes into the same union:
op->u.get_para.u.cppc_para
op->u.get_para.u.s.scaling_governor

Which is why I avoided it for hwp.

I guess writing scaling_governor first and then overwriting it still ends up with the same data in cppc_para. Seems a little messy though.

Penny, I'm confused by this comment:
+    /*
+     * In CPPC active mode, we are borrowing governor field to indicate
+     * policy info.
+     */

You have CPPC active and passive modes - which uses a governor and which uses get_cppc?

It seems like only writing the scaling governor inside
if ( !cpufreq_is_governorless )

should be correct since it's using the union.  Am I missing something?

Thanks,
Jason



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.