Add utilities to read and write to energy_performance_preferences file if available.
This only works on Intel systems with the intel_pstate driver.
The available energy preferences may differ from system to system but usually are:
default
performance
balance_performance
balance_power
power
They represent different energy vs performance hints and should be self-explanatory, except that default represents whatever hint value was set by the platform firmware.
After some testing, it seems that changing the governor of the CPU automatically changes the energy preference.
For powersave it defaulted to balance_power and for performance to performance.
If the energy profile is explicitly set, changing the governor will not set the profile back.
To switch to an "automatic" preference, that changes with the governor, set the value back to default.
Add utilities to read and write to
energy_performance_preferences
file if available. This only works on Intel systems with theintel_pstate
driver.The available energy preferences may differ from system to system but usually are:
They represent different energy vs performance hints and should be self-explanatory, except that default represents whatever hint value was set by the platform firmware.
After some testing, it seems that changing the governor of the CPU automatically changes the energy preference. For
powersave
it defaulted tobalance_power
and forperformance
toperformance
.If the energy profile is explicitly set, changing the governor will not set the profile back. To switch to an "automatic" preference, that changes with the governor, set the value back to default.