x86_energy_perf_policy
as udev rule
Alternative to tuned
, tlp
, etc
Prerequisites
sudo zypper remove --clean-deps 'tuned'
sudo zypper addlock 'tuned'
sudo zypper install 'cpupower'
sudo x86_energy_perf_policy --all 'performance' --turbo-enable '1' --force
Scripts
AC
sudo mkdir -p '/etc/udev/scripts.d' && sudo -e '/etc/udev/scripts.d/ac-power.sh' && sudo chmod +x '/etc/udev/scripts.d/ac-power.sh'
#!/bin/bash
'/usr/bin/x86_energy_perf_policy' --all 'performance' --turbo-enable '1' --force
# End
Battery
sudo mkdir -p '/etc/udev/scripts.d' && sudo -e '/etc/udev/scripts.d/battery-power.sh' && sudo chmod +x '/etc/udev/scripts.d/battery-power.sh'
#!/bin/bash
'/usr/bin/x86_energy_perf_policy' --all 'balance-power' --turbo-enable '0' --force
# End
udev Rule
sudo -e '/etc/udev/rules.d/99-power.rules' && sudo udevadm control --reload
# AC
ACTION=="add|change", SUBSYSTEM=="power_supply", ATTRS{type}=="Mains", ATTRS{online}=="1", RUN+="/etc/udev/scripts.d/ac-power.sh"
# Battery
ACTION=="add|change", SUBSYSTEM=="power_supply", ATTRS{type}=="Mains", ATTRS{online}=="0", RUN+="/etc/udev/scripts.d/battery-power.sh"
# End
Check
sudo dmesg | grep 'MSR'
watch --interval '0.5' grep \'cpu MHz\' '/proc/cpuinfo'