Before we go on to look at optimizing the CPU frequency on Power systems, it is important to know what frequency you are running at. For this make sure you have powerpc-utils package installed.
On Fedora
dnf install powerpc-utils
On CentOS
yum install powerpc-utils
On Ubuntu:
apt-get install powerpc-utils
Once you install this package, you can run the following command to know the frequency your CPU can run at:
sudo ppc64_cpu --frequency
STEP 1 of Optimization:
To optimize CPU frequency for OpenPOWER distributions for ppc64le we first need install the kernel module specific to POWER-PC Architecture and then change the governor to “performance” enhancing mode.
On Fedora and some other openPOWER distributions this kernel module is not installed by default. For example: On Barreleye server, because of absence of this module on Fedora 23, Kernel doesn’t have enough info to scale the CPU very well. And hence puts CPU at a defensive “2.0 Ghz” instead of full “3.5 Ghz”.
Here is how you load the kernel module specific to PPC64LE to make sure CPU scales.
sudo modprobe powernv-cpufreq
STEP 2:
Next step is to Change the governor to the one that gives you best performance . Here is the list of default governors for different OS and what it can to be changed to for best performance. Please note the performance governor may not necessarily be needed for your workload, but is good to to have for getting best performance out of the system.
OS / Distribution |
DEFAULT CPU Frequency scaling Governor on PPC |
BEST CPU governor for performance on PPC |
Linux Package needed to set governer |
Linux command for setting governor to performance |
Fedora |
None (since builds are missing kernel module for frequency scaling) |
performance |
cpufrequtils |
cpufreq-set -g performance |
CentOS |
conservative |
performance |
cpufrequtils |
cpupower frequency-set -g performance |
Ubuntu |
ondemand |
performance |
cpufrequtils |
cpupower frequency-set -g performance |
In my specific example, once we load this module on Fedora, and set the governor to “performance” Barreleye (openPOWER server) starts to run at the full frequency.
Before loading the module:
[root@localhost ~]# sudo ppc64_cpu –frequency
min: 2.063 GHz (cpu 126)
max: 2.063 GHz (cpu 0)
avg: 2.063 GHz
After loading the module:
[live@localhost ~]$ sudo ppc64_cpu –frequency
min: 3.494 GHz (cpu 120)
max: 3.494 GHz (cpu 7)
avg: 3.494 GHz