xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* AMD Ryzen 4000 (Mobile) cpufreq issues
@ 2021-03-16  3:02 Dylanger Daly
  2021-03-16 11:57 ` Jason Andryuk
  2021-03-16 14:30 ` Jan Beulich
  0 siblings, 2 replies; 5+ messages in thread
From: Dylanger Daly @ 2021-03-16  3:02 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 780 bytes --]

Hi Xen Developers,

It appears AMD Ryzen 4000 based CPUs are not supported by `xenpm`, running `xenpm get-cpufreq-states` returns nothing and `get-cpufreq-para` returns `failed to get cpufreq parameter`

This was somewhat expected as Ryzen 4000 series CPUs are quite new, so as a workaround I tried putting `cpufreq=dom0-kernel dom0_max_vcpus=8 dom0_vcpus_pin` onto CMDLINE, from what I've read this should essentially pass control for CPU frequency scaling down to dom0's kernel (5.11.4).

However acpi-cpufreq doesn't load, when trying to insmod it I get the following error `insmod: ERROR: could not insert module acpi-cpufreq.ko: No such device`

I can't seem to see anything related to Xen relinquishing control to dom0 in Xen's console, any help would be appreciated

Cheers

[-- Attachment #2: Type: text/html, Size: 935 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: AMD Ryzen 4000 (Mobile) cpufreq issues
  2021-03-16  3:02 AMD Ryzen 4000 (Mobile) cpufreq issues Dylanger Daly
@ 2021-03-16 11:57 ` Jason Andryuk
  2021-03-16 13:13   ` Dylanger Daly
  2021-03-16 14:30 ` Jan Beulich
  1 sibling, 1 reply; 5+ messages in thread
From: Jason Andryuk @ 2021-03-16 11:57 UTC (permalink / raw)
  To: Dylanger Daly; +Cc: xen-devel

On Mon, Mar 15, 2021 at 11:03 PM Dylanger Daly
<dylangerdaly@protonmail.com> wrote:
>
> Hi Xen Developers,
>
> It appears AMD Ryzen 4000 based CPUs are not supported by `xenpm`, running `xenpm get-cpufreq-states` returns nothing and `get-cpufreq-para` returns `failed to get cpufreq parameter`

In dom0, do `modprobe xen-acpi-processor`  and see if `xenpm
get-cpufreq-para` works.  Xen needs Dom0 to load some ACPI info before
xenpm can work.

Are you running Qubes?  For some reason xen-acpi-processor doesn't
load there automatically.

> This was somewhat expected as Ryzen 4000 series CPUs are quite new, so as a workaround I tried putting `cpufreq=dom0-kernel dom0_max_vcpus=8 dom0_vcpus_pin` onto CMDLINE, from what I've read this should essentially pass control for CPU frequency scaling down to dom0's kernel (5.11.4).
>
> However acpi-cpufreq doesn't load, when trying to insmod it I get the following error `insmod: ERROR: could not insert module acpi-cpufreq.ko: No such device`
>
> I can't seem to see anything related to Xen relinquishing control to dom0 in Xen's console, any help would be appreciated

I haven't tried using cpufreq=dom0-kernel, so I can't help here.

Regards,
Jason


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: AMD Ryzen 4000 (Mobile) cpufreq issues
  2021-03-16 11:57 ` Jason Andryuk
@ 2021-03-16 13:13   ` Dylanger Daly
  0 siblings, 0 replies; 5+ messages in thread
From: Dylanger Daly @ 2021-03-16 13:13 UTC (permalink / raw)
  To: Jason Andryuk; +Cc: xen-devel

On Tuesday, March 16th, 2021 at 10:57 PM, Jason Andryuk <jandryuk@gmail.com> wrote:

> On Mon, Mar 15, 2021 at 11:03 PM Dylanger Daly
>
> dylangerdaly@protonmail.com wrote:
>
> > Hi Xen Developers,
> >
> > It appears AMD Ryzen 4000 based CPUs are not supported by `xenpm`, running `xenpm get-cpufreq-states` returns nothing and `get-cpufreq-para` returns `failed to get cpufreq parameter`
>
> In dom0, do `modprobe xen-acpi-processor` and see if `xenpm get-cpufreq-para` works. Xen needs Dom0 to load some ACPI info before
>
> xenpm can work.

Thanks for your reply Jason :)

Nice, indeed modprobing produces the following:

```
[   84.055724] xen_acpi_processor: Uploading Xen processor PM info
```

```
[user@dom0 ~]$ sudo xenpm get-cpufreq-states
cpu id               : 0
total P-states       : 3
usable P-states      : 3
current frequency    : 1400 MHz
P0         [1700 MHz]: transition [                 133]
                       residency  [                5350 ms]
P1         [1600 MHz]: transition [                  17]
                       residency  [                  98 ms]
*P2        [1400 MHz]: transition [                 130]
                       residency  [                4205 ms]

cpu id               : 2
total P-states       : 3
usable P-states      : 3
current frequency    : 1400 MHz
P0         [1700 MHz]: transition [                 128]
                       residency  [                4604 ms]
P1         [1600 MHz]: transition [                  13]
                       residency  [                 110 ms]
*P2        [1400 MHz]: transition [                 122]
                       residency  [                4030 ms]

cpu id               : 4
total P-states       : 3
usable P-states      : 3
current frequency    : 1400 MHz
P0         [1700 MHz]: transition [                 135]
                       residency  [                3785 ms]
P1         [1600 MHz]: transition [                  19]
                       residency  [                 124 ms]
*P2        [1400 MHz]: transition [                 131]
                       residency  [                4175 ms]

cpu id               : 6
total P-states       : 3
usable P-states      : 3
current frequency    : 1400 MHz
P0         [1700 MHz]: transition [                 131]
                       residency  [                4726 ms]
P1         [1600 MHz]: transition [                  11]
                       residency  [                  80 ms]
*P2        [1400 MHz]: transition [                 128]
                       residency  [                4125 ms]

cpu id               : 8
total P-states       : 3
usable P-states      : 3
current frequency    : 1400 MHz
P0         [1700 MHz]: transition [                 122]
                       residency  [                4237 ms]
P1         [1600 MHz]: transition [                  14]
                       residency  [                 151 ms]
*P2        [1400 MHz]: transition [                 115]
                       residency  [                4155 ms]

cpu id               : 10
total P-states       : 3
usable P-states      : 3
current frequency    : 1700 MHz
*P0        [1700 MHz]: transition [                 123]
                       residency  [                3897 ms]
P1         [1600 MHz]: transition [                  15]
                       residency  [                 125 ms]
P2         [1400 MHz]: transition [                 115]
                       residency  [                4146 ms]

cpu id               : 12
total P-states       : 3
usable P-states      : 3
current frequency    : 1400 MHz
P0         [1700 MHz]: transition [                 122]
                       residency  [                4625 ms]
P1         [1600 MHz]: transition [                  13]
                       residency  [                 127 ms]
*P2        [1400 MHz]: transition [                 116]
                       residency  [                4328 ms]

cpu id               : 14
total P-states       : 3
usable P-states      : 3
current frequency    : 1400 MHz
P0         [1700 MHz]: transition [                 119]
                       residency  [                3430 ms]
P1         [1600 MHz]: transition [                  11]
                       residency  [                 119 ms]
*P2        [1400 MHz]: transition [                 114]
                       residency  [                4065 ms]

[user@dom0 ~]$ sudo xenpm get-cpufreq-para
cpu id               : 0
affected_cpus        : 0
cpuinfo frequency    : max [1700000] min [1400000] cur [1400000]
scaling_driver       : powernow
scaling_avail_gov    : userspace performance powersave ondemand
current_governor     : ondemand
  ondemand specific  :
    sampling_rate    : max [10000000] min [10000] cur [20000]
    up_threshold     : 80
scaling_avail_freq   : 1700000 1600000 *1400000
scaling frequency    : max [1700000] min [1400000] cur [1400000]
turbo mode           : enabled

[CPU1] failed to get cpufreq parameter
cpu id               : 2
affected_cpus        : 2
cpuinfo frequency    : max [1700000] min [1400000] cur [1400000]
scaling_driver       : powernow
scaling_avail_gov    : userspace performance powersave ondemand
current_governor     : ondemand
  ondemand specific  :
    sampling_rate    : max [10000000] min [10000] cur [20000]
    up_threshold     : 80
scaling_avail_freq   : 1700000 1600000 *1400000
scaling frequency    : max [1700000] min [1400000] cur [1400000]
turbo mode           : enabled

[CPU3] failed to get cpufreq parameter
cpu id               : 4
affected_cpus        : 4
cpuinfo frequency    : max [1700000] min [1400000] cur [1400000]
scaling_driver       : powernow
scaling_avail_gov    : userspace performance powersave ondemand
current_governor     : ondemand
  ondemand specific  :
    sampling_rate    : max [10000000] min [10000] cur [20000]
    up_threshold     : 80
scaling_avail_freq   : 1700000 1600000 *1400000
scaling frequency    : max [1700000] min [1400000] cur [1400000]
turbo mode           : enabled

[CPU5] failed to get cpufreq parameter
cpu id               : 6
affected_cpus        : 6
cpuinfo frequency    : max [1700000] min [1400000] cur [1400000]
scaling_driver       : powernow
scaling_avail_gov    : userspace performance powersave ondemand
current_governor     : ondemand
  ondemand specific  :
    sampling_rate    : max [10000000] min [10000] cur [20000]
    up_threshold     : 80
scaling_avail_freq   : 1700000 1600000 *1400000
scaling frequency    : max [1700000] min [1400000] cur [1400000]
turbo mode           : enabled

[CPU7] failed to get cpufreq parameter
cpu id               : 8
affected_cpus        : 8
cpuinfo frequency    : max [1700000] min [1400000] cur [1400000]
scaling_driver       : powernow
scaling_avail_gov    : userspace performance powersave ondemand
current_governor     : ondemand
  ondemand specific  :
    sampling_rate    : max [10000000] min [10000] cur [20000]
    up_threshold     : 80
scaling_avail_freq   : 1700000 1600000 *1400000
scaling frequency    : max [1700000] min [1400000] cur [1400000]
turbo mode           : enabled

[CPU9] failed to get cpufreq parameter
cpu id               : 10
affected_cpus        : 10
cpuinfo frequency    : max [1700000] min [1400000] cur [1400000]
scaling_driver       : powernow
scaling_avail_gov    : userspace performance powersave ondemand
current_governor     : ondemand
  ondemand specific  :
    sampling_rate    : max [10000000] min [10000] cur [20000]
    up_threshold     : 80
scaling_avail_freq   : 1700000 1600000 *1400000
scaling frequency    : max [1700000] min [1400000] cur [1400000]
turbo mode           : enabled

[CPU11] failed to get cpufreq parameter
cpu id               : 12
affected_cpus        : 12
cpuinfo frequency    : max [1700000] min [1400000] cur [1700000]
scaling_driver       : powernow
scaling_avail_gov    : userspace performance powersave ondemand
current_governor     : ondemand
  ondemand specific  :
    sampling_rate    : max [10000000] min [10000] cur [20000]
    up_threshold     : 80
scaling_avail_freq   : *1700000 1600000 1400000
scaling frequency    : max [1700000] min [1400000] cur [1700000]
turbo mode           : enabled

[CPU13] failed to get cpufreq parameter
cpu id               : 14
affected_cpus        : 14
cpuinfo frequency    : max [1700000] min [1400000] cur [1400000]
scaling_driver       : powernow
scaling_avail_gov    : userspace performance powersave ondemand
current_governor     : ondemand
  ondemand specific  :
    sampling_rate    : max [10000000] min [10000] cur [20000]
    up_threshold     : 80
scaling_avail_freq   : 1700000 1600000 *1400000
scaling frequency    : max [1700000] min [1400000] cur [1400000]
turbo mode           : enabled

[CPU15] failed to get cpufreq parameter
```

There's a lot more going on there then before, I'm noticing I'm now boosting ~3Ghz! :tada:

```
[user@dom0 ~]$ xenpm start 1|grep Avg freq
  Avg freq2975000KHz
  Avg freq2975000KHz
  Avg freq3009000KHz
  Avg freq3009000KHz
  Avg freq3179000KHz
  Avg freq3179000KHz
  Avg freq3179000KHz
  Avg freq3179000KHz
  Avg freq2771000KHz
  Avg freq2771000KHz
  Avg freq2839000KHz
  Avg freq2839000KHz
  Avg freq2873000KHz
  Avg freq2873000KHz
  Avg freq2924000KHz
  Avg freq2924000KHz
```

>
> Are you running Qubes? For some reason xen-acpi-processor doesn't
>
> load there automatically.

Yeah I'm running Qubes 4.1 (Xen 4.14), interesting it's not auto loading, I'll create an issue.

>
> > This was somewhat expected as Ryzen 4000 series CPUs are quite new, so as a workaround I tried putting `cpufreq=dom0-kernel dom0_max_vcpus=8 dom0_vcpus_pin` onto CMDLINE, from what I've read this should essentially pass control for CPU frequency scaling down to dom0's kernel (5.11.4).
> >
> > However acpi-cpufreq doesn't load, when trying to insmod it I get the following error `insmod: ERROR: could not insert module acpi-cpufreq.ko: No such device`
> >
> > I can't seem to see anything related to Xen relinquishing control to dom0 in Xen's console, any help would be appreciated
>
> I haven't tried using cpufreq=dom0-kernel, so I can't help here.

No worries, I think it maybe a depreciated option now.

>
> Regards,
>
> Jason

Cheers, Dylanger


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: AMD Ryzen 4000 (Mobile) cpufreq issues
  2021-03-16  3:02 AMD Ryzen 4000 (Mobile) cpufreq issues Dylanger Daly
  2021-03-16 11:57 ` Jason Andryuk
@ 2021-03-16 14:30 ` Jan Beulich
  2021-03-16 14:44   ` Andrew Cooper
  1 sibling, 1 reply; 5+ messages in thread
From: Jan Beulich @ 2021-03-16 14:30 UTC (permalink / raw)
  To: Dylanger Daly; +Cc: xen-devel

On 16.03.2021 04:02, Dylanger Daly wrote:
> It appears AMD Ryzen 4000 based CPUs are not supported by `xenpm`, running `xenpm get-cpufreq-states` returns nothing and `get-cpufreq-para` returns `failed to get cpufreq parameter`
> 
> This was somewhat expected as Ryzen 4000 series CPUs are quite new, so as a workaround I tried putting `cpufreq=dom0-kernel dom0_max_vcpus=8 dom0_vcpus_pin` onto CMDLINE, from what I've read this should essentially pass control for CPU frequency scaling down to dom0's kernel (5.11.4).

Just fyi, seeing that you found a solution for your problem: I
firmly believe "cpufreq=dom0-kernel" should never have been
introduced. I'm not surprised at all if, as it looks, it stopped
working at some point.

Jan


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: AMD Ryzen 4000 (Mobile) cpufreq issues
  2021-03-16 14:30 ` Jan Beulich
@ 2021-03-16 14:44   ` Andrew Cooper
  0 siblings, 0 replies; 5+ messages in thread
From: Andrew Cooper @ 2021-03-16 14:44 UTC (permalink / raw)
  To: Jan Beulich, Dylanger Daly; +Cc: xen-devel

On 16/03/2021 14:30, Jan Beulich wrote:
> On 16.03.2021 04:02, Dylanger Daly wrote:
>> It appears AMD Ryzen 4000 based CPUs are not supported by `xenpm`, running `xenpm get-cpufreq-states` returns nothing and `get-cpufreq-para` returns `failed to get cpufreq parameter`
>>
>> This was somewhat expected as Ryzen 4000 series CPUs are quite new, so as a workaround I tried putting `cpufreq=dom0-kernel dom0_max_vcpus=8 dom0_vcpus_pin` onto CMDLINE, from what I've read this should essentially pass control for CPU frequency scaling down to dom0's kernel (5.11.4).
> Just fyi, seeing that you found a solution for your problem: I
> firmly believe "cpufreq=dom0-kernel" should never have been
> introduced. I'm not surprised at all if, as it looks, it stopped
> working at some point.

I agree that cpufreq=dom0-kernel can't reasonably work.

Lets just take it out - it doesn't serve any good tricking people into
thinking it might plausibly work.

~Andrew


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-03-16 14:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-16  3:02 AMD Ryzen 4000 (Mobile) cpufreq issues Dylanger Daly
2021-03-16 11:57 ` Jason Andryuk
2021-03-16 13:13   ` Dylanger Daly
2021-03-16 14:30 ` Jan Beulich
2021-03-16 14:44   ` Andrew Cooper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).