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

RE: [PATCH v3 03/15] xen/cpufreq: refactor cmdline "cpufreq=xxx"


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: "Penny, Zheng" <penny.zheng@xxxxxxx>
  • Date: Wed, 26 Mar 2025 07:20:20 +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=d0cwQu4/dPKVtrbGHat3sN92/3SGSORK/kDXetrBkk8=; b=ce/7CVulLk6wN4Htq7KutzFlxkKHiihXQeZYuQu0zH4PoOFtktC9muHLfGVm4qL5qSWycs837tg4tds2tM0671ED8fforor2Wz31OVCVO1smIlTcaaDK/AmO5KrC84adM78ZzkaIu5QulHgQxN0ZhjzHSodOFPBbyoviVJrJ7TXeVW0GV38apCRb8HspCnMLJVJB/EyG2/TxA41wWe8bByiPifz3XPxjFGC6ktCMm/xG1QZLniX1zJaZedUm7KHpRR2/E/vdqxdnb5zF8ansmyCpLofaDE9xKbC+qsM7OzEjNvtm27PKeDhgm696MGIo2yw6bPJ1uifu0xuZmcLHBw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mRzVY2cSGppaEBq9LL1KxdhrKizGMgw9wXUzoJT2dtJeml9xymk3DxPrdYaekrPBeZriGaymaLWO2CbjVhdi11+EEYenoE58QXBA8srZDWF1WASY2LqoydLHFUXpD/vXwzCIWQDVC7uiQ2Mva3bBnM8AqwXI1iMOqCoiYyGDCpSo/TFg1U9cIIs+slobErxZrn5FK27Mp+gHgEuLwG+tcJlHvvaKZ8cHPxoned6D2fAp5EoOSLfnpjZHznVp8UAU9zR78lQZ/RxdvlCM9FEdFtIod1u/nCohhYB4g8q9/QKVuiOKEQcj323t8xzR0UM35iUajDzVo2jwGRFVi/VQ/A==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: "Huang, Ray" <Ray.Huang@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, "Orzel, Michal" <Michal.Orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 26 Mar 2025 07:20:41 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Msip_labels: MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_ActionId=0ebebc57-47ab-4935-8b26-85397151d6b8;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_ContentBits=0;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Enabled=true;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Method=Privileged;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Name=Open Source;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_SetDate=2025-03-26T07:19:37Z;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Tag=10, 0, 1, 1;
  • Thread-index: AQHbjnNpEkvZJyYnHka7avkYmH1MUrOCfisAgAKWJuA=
  • Thread-topic: [PATCH v3 03/15] xen/cpufreq: refactor cmdline "cpufreq=xxx"

[Public]

Hi,

> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: Monday, March 24, 2025 11:01 PM
> To: Penny, Zheng <penny.zheng@xxxxxxx>
> Cc: Huang, Ray <Ray.Huang@xxxxxxx>; Andrew Cooper
> <andrew.cooper3@xxxxxxxxxx>; Anthony PERARD <anthony.perard@xxxxxxxxxx>;
> Orzel, Michal <Michal.Orzel@xxxxxxx>; Julien Grall <julien@xxxxxxx>; Roger Pau
> Monné <roger.pau@xxxxxxxxxx>; Stefano Stabellini <sstabellini@xxxxxxxxxx>; 
> xen-
> devel@xxxxxxxxxxxxxxxxxxxx
> Subject: Re: [PATCH v3 03/15] xen/cpufreq: refactor cmdline "cpufreq=xxx"
>
> On 06.03.2025 09:39, Penny Zheng wrote:
> > --- a/docs/misc/xen-command-line.pandoc
> > +++ b/docs/misc/xen-command-line.pandoc
> > @@ -535,7 +535,8 @@ choice of `dom0-kernel` is deprecated and not supported
> by all Dom0 kernels.
> >    processor to autonomously force physical package components into idle 
> > state.
> >    The default is enabled, but the option only applies when `hwp` is 
> > enabled.
> >
> > -There is also support for `;`-separated fallback options:
> > +User could use `;`-separated options to support universal options
> > +which they would like to try on any agnostic platform, *but* under
> > +priority order, like
> >  `cpufreq=hwp;xen,verbose`.  This first tries `hwp` and falls back to
> > `xen` if  unavailable.  Note: The `verbose` suboption is handled
> > globally.  Setting it  for either the primary or fallback option
> > applies to both irrespective of where
>
> What does "support" here mean? I fear I can't even suggest what else to use, 
> as I
> don't follow what additional information you mean to add here. Is a change 
> here
> really needed?
>

There are two changes I'd like to address:
1) ";" is not designed for fallback options anymore, like we discussed before, 
we would
like to support something like "cpufreq=hwp;amd-cppc;xen" for users to define 
all universal options
they would like to try.
2) Must under *priority* order. As in cpufreq_driver_init(), we are using loop 
to decide which driver to
try firstly. If user defines "cpufreq=xen;amd-cppc", which leads legacy P-state 
set before amd-cppc in cpufreq_xen_opts[],
then in the loop, we will try to register legacy P-state firstly, once it gets 
registered successfully, we will not try to register amd-cppc at all.

> > --- a/xen/drivers/cpufreq/cpufreq.c
> > +++ b/xen/drivers/cpufreq/cpufreq.c
> > +    if ( arg[0] && arg[1] )
> > +        ret = cpufreq_cmdline_parse(arg + 1, end);
> > +
> > +    return ret;
> > +}
> > +
> > +static int __init cpufreq_cmdline_parse_hwp(const char *arg, const
> > +char *end) {
> > +    int ret = 0;
> > +
> > +    xen_processor_pmbits |= XEN_PROCESSOR_PM_PX;
> > +    cpufreq_controller = FREQCTL_xen;
> > +    cpufreq_xen_opts[cpufreq_xen_cnt++] = CPUFREQ_hwp;
> > +    if ( arg[0] && arg[1] )
> > +        ret = hwp_cmdline_parse(arg + 1, end);
> > +
> > +    return ret;
> > +}
>
> For both of the helpers may I suggest s/parse/process/ or some such ("handle"
> might be another possible term to use), as themselves they don't do any 
> parsing?
>

Maybe I mis-understood the previous comment you said
```
        >          else if ( IS_ENABLED(CONFIG_INTEL) && choice < 0 &&
        > ```

        For the rest of this, I guess I'd prefer to see this in context. Also 
with
        regard to the helper function's name.
```
I thought you suggested to introduce helper function to wrap the conditional 
codes...
Or may you were suggesting something like:
```
#ifdef CONFIG_INTEL
else if ( choice < 0 && !cmdline_strcmp(str, "hwp") )
{
    xen_processor_pmbits |= XEN_PROCES
    ...
}
#endif
```

> In the end I'm also not entirely convinced that we need these two almost 
> identical
> helpers (with a 3rd likely appearing in a later patch).
>

> Jan

 


Rackspace

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