The Arch Wiki page on CPU frequency scaling suggests a couple of different ways to make changes performed in cpupower
persistent.
- One of those, as you mentioned, is adding a kernel module. But there are other simpler options that should be easier. The simpler is just to enable
cpufreq
's systemd
service, as suggested in the Arch Wiki. Just run
sudo systemctl enable cpupower
and the service will be started every time you boot up the machine. I am not running in a machine with systemd
right now, so I cannot perform any tests.
- The second option is to add a
udev
rule. I've tested this one right now and it works perfectly. Just edit the file named /etc/udev/rules.d/50-scaling-governor.rules
or similar (create it if it does not exist) and add the following content to it:
SUBSYSTEM=="module", ACTION=="add", KERNEL=="acpi_cpufreq", RUN+="/bin/sh -c 'echo 2000000 | tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq'"
This will change the maximum frequency of CPU0 to the value written. In your case, 2000000
, or 2.0 GHz. To do the same for every CPU in your machine, just change the previous command to
SUBSYSTEM=="module", ACTION=="add", KERNEL=="acpi_cpufreq", RUN+="/bin/sh -c 'echo 2000000 | tee /sys/devices/system/cpu/cpu*[0-9]/cpufreq/scaling_max_freq'"
and this will change the maximum frequency for every CPU in your system.