Ubuntu – how to make cpugovernor intel_pstate stable

14.04cpugovernor

I am trying to set to a specific frequency in cpu governor. However, I am not being able to do so. My processor is
12*Intel(R) Xeon (R) CPU E5-2620 v3 @2.40 GHz

With intel_pstate driver it gives freq range of 1.20 GHz -3.20 GHz. The current freq scaling, I can not set to a specific freq. I set the governor to performance. But it does not help.
cpufreq-set -r -f 3.2GHz –does not work;

I tried to set the lower freq; cpufreq-set -r -d 3.2GHz; does not show any error, but even then the freq keeps on varying with time.

I disabled intel_pstate (on boot) and activated acpi driver. But with acpi, the max I can get is 2.4 GHz at 12 cores. This 2.4 GHz, I can make stable all the time with cpufreq-set -r -f. But I can not set it to 3.2 GHz.

Could anyone please tell me how to set use the cpugovernor, so I can set frequency to 3.2 GHz? My OS is ubuntu 14.4.3 LTS and kernel version is 3.19.0-25-generic.

The cpufreq-info shows the following result.

analyzing CPU 0:
  driver: intel_pstate
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 0.97 ms.
  hardware limits: 1.20 GHz - 3.20 GHz
  available cpufreq governors: performance, powersave
  current policy: frequency should be within 3.20 GHz and 3.20 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency is 2.85 GHz.

For other cores also, the results are like this and current freq varies with time.

screenshot_i7z

pstate freq screenshot

Best Answer

It is not possible for your processor to always be at your max turbo rate of 3200MHz all the time. If you have many cores active at once, then the max frequency will be only 2.6Ghz, and that limit is fundamental within the processor itself (see also your i7z screenshot - Max Turbo Multiplier line). However you can easily pretty much have all CPUs always at 2.6 GHz by setting the min and max percent numbers accordingly. However, note that you will still observe sometimes less frequency, as the processor can back off by itself under very low load conditions. Even easier would be to set turbo to off and performance mode, effectively makes all CPU run at 2.4 GHz all the time (but again, the processor itself can back off under extremely low load).

Example for setting 2.6Ghz (if I did my math properly):

echo "81" | sudo tee /sys/devices/system/cpu/intel_pstate/max_perf_pct
echo "81" | sudo tee /sys/devices/system/cpu/intel_pstate/min_perf_pct

Example for the non-turbo method:

echo "1" | sudo tee /sys/devices/system/cpu/intel_pstate/no_turbo
$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
powersave
powersave
powersave
powersave
powersave
powersave
powersave
powersave
$ sudo su
# for file in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do echo "performance" > $file; done
# exit
exit
$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
performance
performance
performance
performance
performance
performance
performance
performance