intel_pstate: allow setting manual EPP value
I have the same sentiments as this https://gitlab.freedesktop.org/hadess/power-profiles-daemon/-/issues/71#note_1259563
Intel allows setting the EPP value anywhere from 0
-255
:
https://www.kernel.org/doc/html/latest/admin-guide/pm/intel_pstate.html#energy-vs-performance-hints
On at least an Intel i7-1165G7, these values translate to:
Number | EPP |
---|---|
0 | performance |
128 | balance_performance |
192 | balance_power |
255 | power |
E.g. setting 0
in /sys/devices/system/cpu/cpu*/cpufreq/energy_performance_preference
automatically translates to performance
. Setting a value not in the above four, like 55
, translates to 55
. I've confirmed that seemingly any number between 0
-255
works, and on my system, these are roughly the frequency limits:
EPP | Number | Frequency Limit |
---|---|---|
performance | 0 | boosts to ~4.0GHz, then stays at ~2.8Ghz. Supposed to boost up to 4.7GHz per specs I think, but ignoring that |
balance_performance | 128 | boosts to ~3.8GHz, then stays at ~2.8GHz |
balance_power | 192 | boosts to ~3.1GHz, then stays at ~2.8GHz |
power | 255 | limits the CPU frequency to ~1.6GHz. This is noticeably laggy – good for reading, but not for compiling code/“multitasking” etc… |
It'd be nice to be able to manually set the EPP value within power-profiles-daemon that performs something like this:
echo "225" | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/energy_performance_preference
Something like powerprofilesctt set 225
. An EPP value of 225
on my system limits the CPU to ~2.3GHz, a nice balance between power
and balance_power
. A user could set the value best suited to their usecase.
This feature seems like it'd complicate a few things, and this would be specific to intel_pstate with HWP, but I think would allow for much greater optimization.
In the meantime, I've switched over to TLP which allows finer grained controls.
Thanks!