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

RE: [PATCH v9 0/8] amd-cppc CPU Performance Scaling Driver


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: "Penny, Zheng" <penny.zheng@xxxxxxx>
  • Date: Wed, 10 Sep 2025 09:27:36 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none
  • 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=DGXHiE8g5bVKV4cF/SsCihL+O9WUEvnQ2BN8kxq5k3o=; b=bvVMszrzC1V2gXgZp1dr1pS97ZABpPXb+RK+PpGYbWm+gRidgTztrOGM1JxpxW9vgFwiJthG/9e9/uzXSuVT5gvKURYF7649YZbyzHCaZO+QDZqXY34uXoYhKyfuizUv7dpjrz69MVbum12pFzm8ewEvBh3jnpJE/x53PHigyO3NcdhSiWt6gIroYDaLr+GKHFfC4RvnwJP0gyPPX8NJk5lsFtYEAFRI3T+E/eDiDW3MlyoWag4WS1Qf0Ah2t4xdoj2PwTzWh2lwgI4/6Gy07mfjTeuF1zr16AAbGgQ3YQCqaBoGqKALWqddn6WGHhnLJfmN94R4f+dMyiMxZn0x+g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=AQIRySiVnWN9Pf6I7zdHZ/XEz82Q3m4gH7T7IyTO1tBciSNrBOnoH8wJXJhzkAwOFt63kxYuVN9nb8fAAtXdlpZMmbYhDza05VUrUDo7kNiNHjnrGod8hVNnGe6Qs04B87bN7KkEbV4WAIuhu78dq9XXIS71zTVu+KS+uUI9uUVirVglSne3MvC2vYIEhkBnPd1ZTvOjYeNwhySKsvFQjoZTU1i8ulvxs24vPLQYd462QVz1AwenMU7/BF1ZlR0rBU+03Zb0//7vy+2ePJb77A/89SfaXToNty01feYCFrQxCGwyC8Jz6U7GfgrHflNcoViQjaWczIbNd1DIxlq2oQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, "Orzel, Michal" <Michal.Orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, Community Manager <community.manager@xxxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 10 Sep 2025 09:27:45 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Msip_labels: MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Enabled=True;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_SetDate=2025-09-10T09:23:04.0000000Z;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Name=Open Source;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_ContentBits=3;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Method=Privileged
  • Thread-index: AQHcHWYmANxehc4TY0iF4B3xrysaNrSLDcCAgAEffUA=
  • Thread-topic: [PATCH v9 0/8] amd-cppc CPU Performance Scaling Driver

[Public]

> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: Wednesday, September 10, 2025 12:11 AM
> To: Penny, Zheng <penny.zheng@xxxxxxx>
> Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>; Roger Pau Monné
> <roger.pau@xxxxxxxxxx>; Anthony PERARD <anthony.perard@xxxxxxxxxx>; Orzel,
> Michal <Michal.Orzel@xxxxxxx>; Julien Grall <julien@xxxxxxx>; Stefano
> Stabellini <sstabellini@xxxxxxxxxx>; Juergen Gross <jgross@xxxxxxxx>; Oleksii
> Kurochko <oleksii.kurochko@xxxxxxxxx>; Community Manager
> <community.manager@xxxxxxxxxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx
> Subject: Re: [PATCH v9 0/8] amd-cppc CPU Performance Scaling Driver
>
> On 04.09.2025 08:35, Penny Zheng wrote:
> > amd-cppc is the AMD CPU performance scaling driver that introduces a
> > new CPU frequency control mechanism on modern AMD APU and CPU series
> > in Xen. The new mechanism is based on Collaborative Processor
> > Performance Control (CPPC) which provides finer grain frequency
> > management than legacy ACPI hardware P-States. Current AMD CPU/APU
> > platforms are using the ACPI P-states driver to manage CPU frequency
> > and clocks with switching only in 3 P-states. CPPC replaces the ACPI
> > P-states controls and allows a flexible, low-latency interface for Xen
> > to directly communicate the performance hints to hardware.
> >
> > amd_cppc driver has 2 operation modes: autonomous (active) mode, and
> > non-autonomous (passive) mode. We register different CPUFreq driver
> > for different modes, "amd-cppc" for passive mode and "amd-cppc-epp"
> > for active mode.
> >
> > The passive mode leverages common governors such as *ondemand*,
> > *performance*, etc, to manage the performance tuning. While the active
> > mode uses epp to provides a hint to the hardware if software wants to
> > bias toward performance (0x0) or energy efficiency (0xff). CPPC power
> > algorithm in hardware will automatically calculate the runtime
> > workload and adjust the realtime cpu cores frequency according to the
> > power supply and thermal, core voltage and some other hardware conditions.
> >
> > amd-cppc is enabled on passive mode with a top-level
> > `cpufreq=amd-cppc` option, while users add extra `active` flag to select 
> > active
> mode.
> >
> > With `cpufreq=amd-cppc,active`, we did a 60s sampling test to see the
> > CPU frequency change, through tweaking the energy_perf preference from
> > `xenpm set-cpufreq-cppc powersave` to `xenpm set-cpufreq-cppc performance`.
> > The outputs are as follows:
> > ```
> > Setting CPU in powersave mode
> > Sampling and Outputs:
> >   Avg freq      580000 KHz
> >   Avg freq      580000 KHz
> >   Avg freq      580000 KHz
> > Setting CPU in performance mode
> > Sampling and Outputs:
> >   Avg freq      4640000 KHz
> >   Avg freq      4220000 KHz
> >   Avg freq      4640000 KHz
> > ```
> >
> > Penny Zheng (8):
> >   xen/cpufreq: embed hwp into struct cpufreq_policy{}
> >   xen/cpufreq: implement amd-cppc driver for CPPC in passive mode
> >   xen/cpufreq: implement amd-cppc-epp driver for CPPC in active mode
> >   xen/cpufreq: get performance policy from governor set via xenpm
> >   tools/cpufreq: extract CPPC para from cpufreq para
> >   xen/cpufreq: bypass governor-related para for amd-cppc-epp
> >   xen/cpufreq: Adapt SET/GET_CPUFREQ_CPPC xen_sysctl_pm_op for amd-
> cppc
> >     driver
> >   CHANGELOG.md: add amd-cppc/amd-cppc-epp cpufreq driver support
> >
> >  CHANGELOG.md                         |   1 +
> >  docs/misc/xen-command-line.pandoc    |   9 +-
> >  tools/include/xenctrl.h              |   3 +-
> >  tools/libs/ctrl/xc_pm.c              |  25 +-
> >  tools/misc/xenpm.c                   |  94 ++--
> >  xen/arch/x86/acpi/cpufreq/amd-cppc.c | 703 ++++++++++++++++++++++++++-
> >  xen/arch/x86/acpi/cpufreq/hwp.c      |  32 +-
> >  xen/arch/x86/cpu/amd.c               |   8 +-
> >  xen/arch/x86/include/asm/amd.h       |   2 +
> >  xen/arch/x86/include/asm/msr-index.h |   6 +
> >  xen/drivers/acpi/pm-op.c             |  58 ++-
> >  xen/drivers/cpufreq/utility.c        |  15 +
> >  xen/include/acpi/cpufreq/cpufreq.h   |  44 ++
> >  xen/include/public/sysctl.h          |   5 +-
> >  14 files changed, 936 insertions(+), 69 deletions(-)
>
> As we're considering our options towards getting this work in, can you 
> clarify two
> things please:
> (1) In v9, the sole changes were related to the use of per-CPU data and the
>     adding of a ChangeLog entry?

Yes, also in commit of "xen/cpufreq: Adapt SET/GET_CPUFREQ_CPPC". I added 
description of "moving the copying of the governor name"

> (2) The driver is inactive by default, i.e. requires use of the command line
>     option to come into play?
>

Yes, only with specific command line to turn on the driver

> If the answer to both is yes, we're leaning towards committing v8 plus the
> ChangeLog entry.
>
> Jan

 


Rackspace

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