This topic was published by DevynCJohnson and viewed 720 times since "". The last page revision was "".
- Topics - 444
CPU frequency scaling governors are a set of rules for the CPU that determine whether to save power or make the CPUs perform better. Only one governor can be active at any given moment per processor core. However, multiple governors can be included in the operating system's kernel and the active governor can be changed. When using a governor to reduce power-consumption, the processors will not operate as fast. However, if the processors are set to operate with higher perform, then more power will be used.
There are multiple types of CPU governors. However, not every operating system may support them and some Linux kernels may be compiled without them.
- conservative - The processor's frequency is set based on the CPU usage. Like the "ondemand" governor, this governor tries to take advantage of both power-saving and performance. However, unlike the "ondemand" governor, "conservative" sets the frequency in transitions. In other words, the frequency is not set to the maximum immediately, rather the frequency shifts to the desired frequency in steps. However, when setting a lower frequency, there are no smooth transitions. This governor is better for power-consumption than "performance".
- conservativex - An updated form of "conservative" with various fixes and better support for multiple cores.
- interactive - The processor's frequency is set based on the CPU usage. This governor is like the "conservative" governor. However, transitions are used when lowering the frequency but not when raising the frequency. This results in better performance and less power-saving than "conservative" or "ondemand".
- interactivex - An updated form of "interactive" with various fixes and better support for multiple cores.
- lagfree - Similar to "smartass", but uses algorithms similar to "conservative" instead of "interactive".
- performance - Power-consumption is not a concern, so run the CPUs at maximum frequency for the best performance. The CPUs are statically set to operate at the highest allowed frequency (without over-clocking the CPU). On laptop and mobile systems, the battery will drain faster than when using a different governor. The CPUs will also generate more heat at high frequencies than at lower frequencies.
- powersave - Reduce power-consumption and run the CPUs at minimum frequency. The processor's frequency is set to the lowest value allowed between scaling_min_freq and scaling_max_freq (found under /sys/devices/system/cpu/cpu*/cpufreq/). The system will save more power, but will not be utilizing maximum processing performance.
- ondemand - The processor's frequency is set based on the CPU usage. This governor tries to take advantage of both power-saving and performance. However, it takes time to shift between frequencies. Unlike the "conservative" governor, "ondemand" may set the frequency to the maximum when the CPU usage increases. "ondemand" may use more power than a set static frequency if the governor is changing the frequency often.
- ondemandx - An updated form of "ondemand" with various fixes and better support for multiple cores.
- smartass - Utilizes the advantages of "ondemand" and "interactive". The CPU's frequency is reduced when the system is idle or asleep, but sets an ideal frequency when the CPU is active. This saves more power than "ondemand" or "interactive" and has better performance than "ondemand". However, the CPU frequency may lower too much when asleep thus, causing apps to malfunction.
- smartassv2 - An improved re-write of "smartass" with similar advantages and disadvantages, but with better performance and battery life than "smartass".
- smoothass - Similar to "smartass". However, frequencies are quickly changed up and down. This governor saves more power than "smartass".
- userspace - Userspace programs with the proper privileges (like the "Root" user in Linux) can set the CPU frequency by making a SysFS file titled "scaling_setspeed" in the CPU-device directory. The userspace programs may change the frequency according to the program's needs or a user (with the proper privileges) may change the frequency.
Manually Changing the Governor
On Linux systems, the Root user (or another user with Root-privileges) can change the active governor using one of the listed commands below.
cpupower frequency-set -g GOVERNOR
echo GOVERNOR | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor >/dev/null
To view the CPU frequencies and watch their changes (on Linux systems), execute
watch grep \"cpu MHz\" /proc/cpuinfoin a terminal.
The "scaling_max_freq" for a particular CPU core can be seen and set in /sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq (on Linux systems). Be sure to change the asterisk (*) to the desired CPU core.
Various information and settings concerning the CPUs can be found under /sys/devices/system/cpu/ (on Linux systems).
- Linux Kernel CPU Governors - https://www.kernel.org/doc/Documentation/cpu-freq/governors.txt