====== x86_energy_perf_policy ======
watch --interval '0.5' grep \'cpu MHz\' '/proc/cpuinfo'
* Check
sudo x86_energy_perf_policy
* Max Performance
sudo x86_energy_perf_policy --all 'performance' --turbo-enable '1' --force
====== Scripts ======
* [[linux:distros:fedora_workstation_gnome|Fedora Workstation]]
===== TuneD =====
* Automatic power-management like ''tlp''
* Required to remove ''tuned'' so it doesn't override below udev rule
sudo dnf remove 'tuned'
===== AC =====
sudo mkdir -p '/etc/udev/scripts.d' && sudo -e '/etc/udev/scripts.d/ac-power.sh' && sudo restorecon -F -I -v '/etc/udev/scripts.d/ac-power.sh' && sudo chmod +x '/etc/udev/scripts.d/ac-power.sh'
#!/bin/bash
# AC
x86_energy_perf_policy --all 'performance' --turbo-enable '1' --force
# End
'/etc/udev/scripts.d/ac-power.sh'
===== Battery =====
sudo mkdir -p '/etc/udev/scripts.d' && sudo -e '/etc/udev/scripts.d/battery-power.sh' && sudo restorecon -F -I -v '/etc/udev/scripts.d/battery-power.sh' && sudo chmod +x '/etc/udev/scripts.d/battery-power.sh'
#!/bin/bash
# Battery
x86_energy_perf_policy --all 'balance-power' --turbo-enable '0' --force
# End
'/etc/udev/scripts.d/battery-power.sh'
===== udev Rule =====
sudo -e '/etc/udev/rules.d/99-power.rules' && sudo restorecon -F -I -v '/etc/udev/rules.d/99-power.rules' && sudo udevadm control --reload
# AC
SUBSYSTEM=="power_supply", ATTR{online}=="1", RUN+="/etc/udev/scripts.d/ac-power.sh"
# Battery
SUBSYSTEM=="power_supply", ATTR{online}=="0", RUN+="/etc/udev/scripts.d/battery-power.sh"
# End
===== Check =====
* If plugged-in, should report something like ''Write to unrecognized MSR 0x770 by x86_energy_perf'' 1-second/early boot
sudo dmesg | grep 'MSR'