Kernel 6.11 ignores fixed CPU frequency

Issue persists, even with boost disabled.

Thanks

❯ git bisect bad
26d8b4e51e233458715bd483e665cf877a1393e0 is the first bad commit
commit 26d8b4e51e233458715bd483e665cf877a1393e0 (HEAD)
Author: Mario Limonciello <mario.limonciello@amd.com>
Date:   Thu Sep 5 11:30:04 2024 -0500

    cpufreq: amd-pstate: Merge amd_pstate_highest_perf_set() into amd_get_boost_ratio_numerator()
    
    The special case in amd_pstate_highest_perf_set() is the value used
    for calculating the boost numerator.  Merge this into
    amd_get_boost_ratio_numerator() and then use that to calculate boost
    ratio.
    
    This allows dropping more special casing of the highest perf value.
    
    Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
    Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
    Reviewed-by: Gautham R. Shenoy <gautham.sheoy@amd.com>

 Documentation/admin-guide/pm/amd-pstate.rst |  3 ++-
 arch/x86/kernel/acpi/cppc.c                 | 16 ++++++++++++++++
 drivers/cpufreq/amd-pstate.c                | 52 ++++++++++------------------------------------------
 3 files changed, 28 insertions(+), 43 deletions(-)

I’ll provide another test kernel once there’s a fix from AMD. Thank you again for helping with the bisect :smile:

@axra If you set the limits above the nominal frequency (you can check via cpupower frequency-info), does it respect the limits or does the issue persist? If you can also give an accurate steps-to-reproduce, it would help in fixing the issue, thanks.

If I set the limits above nominal frequency, than the max limit is respected.
Steps to reproduce:
Amd_pstate in active mode, boost enabled.
Set a fixed Min/Max Cpu Frequency below nominal frequency (e.g.2000MHz). The Max value isn’t respected. Some Cores go periodically beyond (e.g.2400Mhz)

Does it work if boost is disabled before setting the max limit? And for clarity, limits are respected if boost is off in active, but not with passive right?

Not sure what you mean with “does it work” before setting max limit.
Issue only occurs if I set a max limit, so I have to set one to check.
Yes, limits are respected if boost is off in active, but not with passive.

I’ve tried tlp-gui, but it look totally different. I believe it is cpupower-gui

@Okona

1 Like

@axra do tools like htop also go beyond set maximum? (I wonder if it could be a bug in the tool you use. Probably not tho, it would make sens that the dev of the tool use numbers reported by the kernel)

I’m using cpupower-gui for setting min/max values.
htop doesn’t show cpu frequency, right?

Are the limits respected if boost is disabled before setting the limits or does it not matter, i.e.

  1. Boot into active, boost enabled → set limits → disable boost → limits are limiting
  2. Boot into active, boost enabled → disable boost → set limits → limits are limiting

It does not matter.

1 Like

It does, but it may not be the default, I carry my config files every times I reinstall so I’ve forgotten what default looks like.

Open htop > press F2 for setup > select Metets under Categories > under Available meters, select one who start with CPUs.

Some have frequency, others don’t.

Anyway, I’m out! I don’t think I can help here and I don’t want to add noise! Good luck guys!

@axra Hello :smile: after a month it seems like there’s a fix now. Nginx Directory Can you try this kernel?

Yes, working. Issue finally seems to be fixed. :+1:

Great! Thank you so much.

cpufreq/amd-pstate: Store the boost numerator as highest perf again · CachyOS/linux@9695bf9 · GitHub will be included in 6.12.3 or 6.12.4.

Working in 6.13.0-rc2-1, not working in 6.12.4-2.

Yeah 6.12.4 doesn’t include the patch yet unfortunately. We don’t want to include the whole amd-pstate patchset for 6.12 but only backporting that 1 patch doesn’t seem to be guarantee stability.

FYI, this should be fixed in 6.12.6, I’ve cherrypicked them already but they should also be backported by upstream.

1 Like

This problem somehow come back in 6.12.8-2-cachyos

Maybe open a new thread? What CPU?
I have no issues on AMD Ryzen 9 7940HS.