Red Hat Training

A Red Hat training course is available for Red Hat Enterprise Linux

3.2.3. Tuning CPUfreq Policy and Speed

Once you have chosen an appropriate CPUfreq governor, you can view CPU speed and policy information with the cpupower frequency-info command and further tune the speed of each CPU with options for cpupower frequency-set.
For 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, refer to Procedure 3.2, “Enabling a CPUfreq Governor” in Section 3.2.2, “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.
For cpupower frequency-set, the following options are available:
  • --min <freq> and --max <freq> — Set the policy limits of the CPU, in KHz.

    Important

    When setting policy limits, you should set --max before --min.
  • --freq <freq> — Set a specific clock speed for the CPU, in KHz. You can only set a speed within the policy limits of the CPU (as per --min and --max).
  • --governor <gov> — Set a new CPUfreq governor.

Note

If you do not have the cpupowerutils package installed, CPUfreq settings can be viewed in the tunables found in /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