3.2. CPUfreq
3.2.1. CPUfreq drivers
ACPI CPUfreq
Intel P-state
max_perf_pct
: Limits the maximum P-state requested by the driver, expressed in a percentage of available performance. The available P-state performance can be reduced by the no_turbo setting (see below).min_perf_pct
: min_perf_pct: Limits the minimum P-state requested by the driver, expressed in a percentage of the maximum (no-turbo) performance level.no_turbo
: Limits the driver to selecting P-state below the turbo frequency range.turbo_pct
: Displays the percentage of the total performance supported by hardware that is in the turbo range. This number is independent of whether turbo has been disabled or not.num_pstates
: Displays the number of P-states that are supported by hardware. This number is independent of whether turbo has been disabled or not.
intel_pstate=disable
3.2.2. CPUfreq Governors
Warning
3.2.2.1. Core CPUfreq Governors
The Performance governor forces the CPU to use the highest possible clock frequency. This frequency will be statically set, and will not change. As such, this particular governor offers no power saving benefit. It is only suitable for hours of heavy workload, and even then only during times wherein the CPU is rarely (or never) idle.
By contrast, the Powersave governor forces the CPU to use the lowest possible clock frequency. This frequency will be statically set, and will not change. As such, this particular governor offers maximum power savings, but at the cost of the lowest CPU performance.
The Ondemand governor is a dynamic governor that allows the CPU to achieve maximum clock frequency when system load is high, and also minimum clock frequency when the system is idle. While this allows the system to adjust power consumption accordingly with respect to system load, it does so at the expense of latency between frequency switching. As such, latency can offset any performance/power saving benefits offered by the Ondemand governor if the system switches between idle and heavy workloads too often.
The Userspace governor allows user-space programs, or any process running as root, to set the frequency. Of all the governors, Userspace is the most customizable; and depending on how it is configured, it can offer the best balance between performance and consumption for your system.
Like the Ondemand governor, the Conservative governor also adjusts the clock frequency according to usage (like the Ondemand governor). However, while the Ondemand governor does so in a more aggressive manner (that is from maximum to minimum and back), the Conservative governor switches between frequencies more gradually.
Note
cron
jobs. This allows you to automatically set specific governors during specific times of the day. As such, you can specify a low-frequency governor during idle times (for example after work hours) and return to a higher-frequency governor during hours of heavy workload.
3.2.2.2. Intel P-state CPUfreq Governors
- Active mode with hardware-managed P-states (HWP)
- Active mode without hardware-managed P-states (HWP)
- Passive mode
Active mode with hardware-managed P-states
- Performance
- Powersave
Active mode without hardware-managed P-states
- Performance
- Powersave
Passive mode
3.2.3. CPUfreq Setup
~]# cpupower frequency-info --governors
~]# cpupower frequency-set --governor [governor]
-c
with a range or comma-separated list of CPU numbers. For example, to enable the Userspace governor for CPUs 1-3 and 5, the command would be:
~]# cpupower -c 1-3,5 frequency-set --governor cpufreq_userspace
3.2.4. Tuning CPUfreq Policy and Speed
cpupower frequency-info
command and further tune the speed of each CPU with options for cpupower frequency-set
.
cpupower frequency-info
, the following options are available:
--freq
— Shows the current speed of the CPU according to the CPUfreq core, in KHz.--hwfreq
— Shows the current speed of the CPU according to the hardware, in KHz (only available as root).--driver
— Shows what CPUfreq driver is used to set the frequency on this CPU.--governors
— Shows the CPUfreq governors available in this kernel. If you wish to use a CPUfreq governor that is not listed in this file, see Section 3.2.3, “CPUfreq Setup” for instructions on how to do so.--affected-cpus
— Lists CPUs that require frequency coordination software.--policy
— Shows the range of the current CPUfreq policy, in KHz, and the currently active governor.--hwlimits
— Lists available frequencies for the CPU, in KHz.
cpupower frequency-set
, the following options are available:
Note
/sys/devices/system/cpu/[cpuid]/cpufreq/
. Settings and values can be changed by writing to these tunables. For example, to set the minimum clock speed of cpu0 to 360 KHz, use:
echo 360000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq