[Discuss] linux cpu governors
Matthew Gillen
me at mattgillen.net
Tue Jan 12 10:00:18 EST 2016
Recent kernels (not sure exactly when this started) have been driving me
crazy.
For reference: Machine: Dell Precision with Intel Core i5
OS: Fedora 23 (kernel 4.2.8-300.fc23.x86_64)
When running on battery, everything is fine when using the default
"powersave" governor. Lately though, if I don't use the 180W power
supply that came with the computer (e.g. because I don't want that beast
in my travel bag), the kernel seems to be restricting CPU speeds to
something outside of what the governor claims to be managing.
Here's what I mean:
$cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 60
model name : Intel(R) Core(TM) i5-4340M CPU @ 2.90GHz
cpu MHz : 365.332
...
$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver
intel_pstate
$cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
powersave
$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
3600000
$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
800000
$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
367257
So you can see that the governor is supposed to scale the frequencies
between 800MHz and 3.6GHz, but the actual frequency in use is 365 MHz
(which, as you might imagine, is UNBEARABLY slow), and it does not scale
up "on demand" like the powersave driver is supposed to.
When running on battery or the super beefy power supply, the scaling
driver does what it claims to do and smoothly transitions from
800MHz-3GHz based on load.
If I manually switch the governor to "performance", then it gets usable:
$ cat /proc/cpuinfo | grep MHz
cpu MHz : 1641.785
cpu MHz : 2048.464
cpu MHz : 1793.242
cpu MHz : 1728.558
Note that this is not BIOS-related: putting the machine to sleep
(suspend-to-RAM) and waking up on battery will produce "correct"
behavior, but as soon as I plug it into the wall with an older power
supply the system sets itself back to the 360Mhz speed, which is
unusable for anything.
This is frustrating: why does it only work correctly on battery? I
dislike having to carry power bricks, so I have some old ones that I
leave in various locations. Plus 180W is just kind of ridiculous.
My question is: anyone know how to return some sanity to the kernel's
power management? Older kernels ( maybe as recently as 3 months ago) I
used to be able to trick: if you weren't plugged into an underpowered
power supply at boot time, then it would be fine and never go to "360MHz
mode". Something changed recently, and it's making my linux laptops
overly difficult to use. I don't want to have to manually manage the
governor, because when I'm on battery I do not want the "performance"
driver. I just want the normal governor to do what it is supposed to do.
Thanks,
Matt
More information about the Discuss
mailing list