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

RE: [PATCH v1 08/11] x86/cpufreq: add "cpufreq=amd-pstate,active" para


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: "Penny, Zheng" <penny.zheng@xxxxxxx>
  • Date: Sun, 26 Jan 2025 06:31:22 +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=V95NOD/e1Nfta/zORbzw8yrPcqp45Uf6O2pBW0TPYEs=; b=Y/Ddvh1xwF798SLeFILNq8QkaJSkhvXKjrw0/qG9VPbc6K6XPQ9jnpNsNXEj4ClBp2rcYhZArPGqSzY82FFNxv1h8lt80Q7yINSYDyaOV+DmmTm9VOzV/O1hfHvLteF2kLXTeapMuJCEv0laGnMGjs+GAJLT+HvnmRCBlTHj9tRZZjQpOWCfks7jZXiz1dvIpQW90E8qyhQGNIn9vWGBSU+a3R4foYWmffb7azBY2Ah93lnhBxqbbi7yf0XDkYafWc5gofo7aANBqMrASYBLBW3A9+ksbU0eeY7z7Z9VZZICLQzQdyAjC6ZzfavRwrrTmLo52FvlJ5d+Q2RGg4E8Ew==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PcyxGe7qE89Lw1fwpUB5RFSdzrW1CKnUuyvi/PeSlFyvLkSylx/CWrJARF4cs78hpdUQyLJbidxEM4b7JvIYix0PYwAo6tUMIycGbKClxUWEQTteai0nZ6c2B8HHrwuSmVmMhLypWRGaYGSwoQQu1PV1/1OoyoZ19nCBBMDJfNHmuHh1fJPHkoAtdCpn4WOH+4398c7RntPddhDLr1ohS94C9I2Oq+jPMl+tkZGpl8IhYh8aw/9n1K/tCAaYdVm3r2D9+WeKCZ6jk8RxH0j7ypKLqBrdsUtNy+qVxDvtLg4nG+9rHWQ7VEIxAKCjRQFKeUO2P4emBNfNe9cfkx+NjA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: "Stabellini, Stefano" <stefano.stabellini@xxxxxxx>, "Huang, Ray" <Ray.Huang@xxxxxxx>, "Ragiadakou, Xenia" <Xenia.Ragiadakou@xxxxxxx>, "Andryuk, Jason" <Jason.Andryuk@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Sun, 26 Jan 2025 06:31:35 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Msip_labels: MSIP_Label_dce362fe-1558-4fb5-9f64-8a6240d76441_ActionId=12b1e095-db75-495f-88c8-b42dfce5c969;MSIP_Label_dce362fe-1558-4fb5-9f64-8a6240d76441_ContentBits=0;MSIP_Label_dce362fe-1558-4fb5-9f64-8a6240d76441_Enabled=true;MSIP_Label_dce362fe-1558-4fb5-9f64-8a6240d76441_Method=Standard;MSIP_Label_dce362fe-1558-4fb5-9f64-8a6240d76441_Name=AMD Internal Distribution Only;MSIP_Label_dce362fe-1558-4fb5-9f64-8a6240d76441_SetDate=2025-01-26T06:20:09Z;MSIP_Label_dce362fe-1558-4fb5-9f64-8a6240d76441_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d;
  • Thread-index: AQHbRVygzo/tK+M4KUarRbqVB0cwPLMOhysAgBpiznA=
  • Thread-topic: [PATCH v1 08/11] x86/cpufreq: add "cpufreq=amd-pstate,active" para

[AMD Official Use Only - AMD Internal Distribution Only]

Hi,

> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: Thursday, January 9, 2025 7:24 PM
> To: Penny, Zheng <penny.zheng@xxxxxxx>
> Cc: Stabellini, Stefano <stefano.stabellini@xxxxxxx>; Huang, Ray
> <Ray.Huang@xxxxxxx>; Ragiadakou, Xenia <Xenia.Ragiadakou@xxxxxxx>;
> Andryuk, Jason <Jason.Andryuk@xxxxxxx>; Andrew Cooper
> <andrew.cooper3@xxxxxxxxxx>; Julien Grall <julien@xxxxxxx>; Stefano Stabellini
> <sstabellini@xxxxxxxxxx>; Roger Pau Monné <roger.pau@xxxxxxxxxx>; xen-
> devel@xxxxxxxxxxxxxxxxxxxx
> Subject: Re: [PATCH v1 08/11] x86/cpufreq: add "cpufreq=amd-pstate,active" 
> para
>
> On 03.12.2024 09:11, Penny Zheng wrote:
> > From: Penny Zheng <penny.zheng@xxxxxxx>
> >
> > The amd-pstate driver may support multiple working modes, passive and 
> > active.
> >
> > Introduce a new variable to keep track of which mode is currently enabled.
> > This variable will also help to choose which cpufreq driver to be 
> > registered.
> >
> > Signed-off-by: Penny Zheng <Penny.Zheng@xxxxxxx>
> > ---
> >  docs/misc/xen-command-line.pandoc      |  9 ++++++++-
> >  xen/arch/x86/acpi/cpufreq/amd-pstate.c | 12 +++++++++++-
> >  2 files changed, 19 insertions(+), 2 deletions(-)
> >
> > diff --git a/docs/misc/xen-command-line.pandoc
> > b/docs/misc/xen-command-line.pandoc
> > index 30f855fa18..a9a3e0ef79 100644
> > --- a/docs/misc/xen-command-line.pandoc
> > +++ b/docs/misc/xen-command-line.pandoc
> > @@ -499,7 +499,8 @@ If set, force use of the performance counters for
> > oprofile, rather than detectin  available support.
> >
> >  ### cpufreq
> > -> `= none | {{ <boolean> | xen } {
> > -> [:[powersave|performance|ondemand|userspace][,[<maxfreq>]][,[<minfr
> > -> eq>]]] } [,verbose]} | dom0-kernel | hwp[:[<hdc>][,verbose]] |
> > -> amd-pstate[:[verbose]]`
> > +> `= none | {{ <boolean> | xen } {
> > +> [:[powersave|performance|ondemand|userspace][,[<maxfreq>]][,[<minfr
> > +> eq>]]] }
> > +[,verbose]} | dom0-kernel | hwp[:[<hdc>][,verbose]] |
> > +amd-pstate[:[active][,verbose]]`
> >
> >  > Default: `xen`
> >
> > @@ -522,6 +523,12 @@ choice of `dom0-kernel` is deprecated and not
> supported by all Dom0 kernels.
> >    on supported AMD hardware to provide a finer grained frequency control
> mechanism.
> >    The default is disabled. If `amd-pstate` is selected, but hardware 
> > support
> >    is not available, Xen will fallback to cpufreq=xen.
> > +* `active` is a boolean to enable amd-pstate driver in active(autonomous) 
> > mode.
> > +  In this mode, users could provide a hint with energy performance
> > +preference
> > +  register to the hardware if they want to bias toward
> > +performance(0x0) or
> > +  energy efficiency(0xff), then CPPC power algorithm will calculate
> > +the runtime
> > +  workload and adjust the realtime cores frequency according to the
> > +power supply
> > +  and themal, core voltage and some other hardware conditions.
>
> Nit: thermal
>
> > --- a/xen/arch/x86/acpi/cpufreq/amd-pstate.c
> > +++ b/xen/arch/x86/acpi/cpufreq/amd-pstate.c
> > @@ -27,6 +27,8 @@
> >  #define amd_pstate_warn(fmt, args...) \
> >      printk(XENLOG_WARNING "AMD_PSTATE: CPU%u warning: " fmt, cpu, ##
> > args)
> >
> > +static bool __ro_after_init opt_cpufreq_active = false;
>
> Pointless initializer.
>
> > @@ -398,5 +407,6 @@ int __init amd_pstate_register_driver(void)
> >      if ( !cpu_has_cppc )
> >          return -ENODEV;
> >
> > -    return cpufreq_register_driver(&amd_pstate_cpufreq_driver);
> > +    if ( !opt_cpufreq_active )
> > +        return cpufreq_register_driver(&amd_pstate_cpufreq_driver);
> >  }
>
> I'm afraid the description is of no help in determining why this is a correct 
> change to
> make (here). How would the user provided hint (see cmdline option 
> description) be
> communicated to hardware when the driver isn't even registered?
>

Maybe I shall combine this commit into the next one about implementing epp 
driver for active mode,
and the changes will be like:
  -    return cpufreq_register_driver(&amd_pstate_cpufreq_driver);
 +    if ( opt_cpufreq_active )
 +        return cpufreq_register_driver(&&amd_cppc_epp_driver);
 +    else
 +        return cpufreq_register_driver(&amd_cppc_cpufreq_driver);
Now, the description makes more sense.

> Finally I don't think the change above would build, as it leaves a return 
> from the
> function without return value.
>
> Jan

Many thanks
Penny

 


Rackspace

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