Bug 225782 - Ryzen: unable to set cpu freq
Summary: Ryzen: unable to set cpu freq
Status: Closed Works As Intended
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 11.1-STABLE
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-08 23:54 UTC by Ivan Rozhuk
Modified: 2018-02-10 07:22 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Rozhuk 2018-02-08 23:54:17 UTC
After boot was:
dev.hwpstate.0.freq_settings: 3500/-1 3500/-1 1550/-1
dev.cpu.0.freq_levels: 3500/-1 3500/-1 1550/-1
dev.cpu.0.freq: 1550

After set:
dev.cpu.0.freq=3500
perfomance degraded to ~50%

Returning dev.cpu.0.freq=1550 does not help with performance.
11.1-STABLE FreeBSD 11.1-STABLE  r328439M  amd64
Ryzen 1300X, no overclock, fixed freq and Voltage in BIOS.
Comment 1 Conrad Meyer freebsd_committer freebsd_triage 2018-02-09 00:04:02 UTC
If this is also true on CURRENT, it looks like a buggy BIOS.  Your BIOS isn't reporting P-states via ACPI or you would see a second positive number instead of "/-1".  It's possible the BIOS bug also breaks P-state setting.  If a BIOS update is available from your vendor, consider applying it.

If this works on CURRENT, great.  I don't support stable branches, so I would just unsubscribe from this bug in that case.

In either case, I'd suggest rebooting and just not setting dev.cpu.0.freq (leaving the machine in P0).  At idle, FreeBSD enters power-saving C-states and won't consume any more power than if you were also downclocked.
Comment 2 Ivan Rozhuk 2018-02-10 02:02:31 UTC
(In reply to Conrad Meyer from comment #1)
Update BIOS, remove fixed freq in BIOS.
dev.hwpstate.0.freq_settings: 3500/4331 3000/3450 1550/1331
dev.cpu.0.freq_levels: 3500/4331 3000/3450 1550/1331
on latest 11.1

sorry for noise.

PS: probably proper thing to not set freq if xxxx/-1 in dev.hwpstate.0.freq_settings to prevent performance degradation.
Comment 3 Conrad Meyer freebsd_committer freebsd_triage 2018-02-10 07:22:11 UTC
(In reply to rozhuk.im from comment #2)
> PS: probably proper thing to not set freq if xxxx/-1 in
> dev.hwpstate.0.freq_settings to prevent performance degradation.

This should still work.  I think the problem was buggy BIOS.