Bug 206307

Summary: AMD Ryzen CPU frequency monitoring subsystem is insufficient
Product: Power Management Reporter: Artem S. Tashkinov (aros)
Component: cpufreqAssignee: linux-pm (linux-pm)
Status: RESOLVED CODE_FIX    
Severity: high CC: kim.phillips, liquid.acid, suravee.suthikulpanit, trenn
Priority: P1    
Hardware: x86-64   
OS: Linux   
Kernel Version: All Subsystem:
Regression: No Bisected commit-id:

Description Artem S. Tashkinov 2020-01-25 23:39:53 UTC
These are the features which are available under Windows but not possible under Linux in any shape or form:

1) You cannot set the desired CPU frequency except for predefined values (in my case 3600000 2800000 2200000Hz). In Windows you can set any desired frequency between base and boost.

2) time_in_state is extremely coarse and shows neither boost, nor CPU sleep. At least with Intel CPUs there's an additional CPU frequency MAX + 100KHz which indicates boost. There's no such thing for AMD Ryzen CPUs.

3) Reported frequencies values in /proc/cpuinfo and /sys/devices/system/cpu/cpufreq/policy*/cpuinfo_cur_freq are again limited to the predefined values.

/cpu/cpufreq/policy*/scaling_cur_freq contains a lot more varied values but again, CPU sleeping or boosting are not reported.
Comment 1 Artem S. Tashkinov 2020-01-25 23:53:03 UTC
I really don't know who to CC to this bug report, so I'd be glad if you could CC the relevant people.

I am perfectly aware that Ryzen CPUs can change their frequency millions of times per seconds. I hope that still allows to aggregate data and manage the CPU the way we want (and the way it's already possible under Windows).
Comment 2 Thomas Renninger 2020-01-28 05:53:38 UTC
This would need another cpufreq driver.
acpi_cpufreq is fixed in the amount of frequency states and the passed array is not that big (not sure what max supported freqs with acpi_cpufreq is, it should be fixed around 15-20).

A driver similar to intel_pstate driver is needed.
Who is going to write this one?
Comment 3 Tobias Jakobi 2020-02-23 14:39:50 UTC
That driver already exists:
https://patchwork.kernel.org/cover/11038797/

It just hasn't landed upstream yet.
Comment 4 Artem S. Tashkinov 2022-04-11 07:23:59 UTC
amd-pstate does that.