This guide explains an easy way to disable frequency scaling.
First thing to do is to check the number of CPUs in the system with the command:
The provided output will be something like this:
cpu0 cpu2 cpuidle kernel_max modalias online power uevent cpu1 cpu3 intel_pstate microcode offline possible present
and in this case the number of physical CPUs for which we can disable frequency scaling is four, namely
With the following script executed by with the root privilege:
for i in $(seq 0 3) ; do echo "performance" > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor; done
we can set the
performance governator policy, which disable frequency scaling. We used
$(seq 0 3) because we have 4 CPUs, from
cpu3. In a system with 8 physical cores, the correct command would have been
$(seq 0 7). Remember that the script must be re-executed each time the system is restarted.
To check that frequency scaling is effectively disabled, you can type many times the following command checking that the frequencies of your CPUs are fixed to the highest values: