Translation(s): none


CPU frequency scaling

Dynamic CPU frequency scaling (also known as CPU throttling) is a technique in computer architecture where a processor is run at a less-than-maximum frequency in order to conserve power (src: Wikipedia).

The Linux kernel CPUfreq subsystem provides this ability on Debian Linux systems.

Enabling

Note: In most cases, this should be enabled automatically during Debian installation.

Install the cpufrequtils package:

aptitude install cpufrequtils

Troubleshooting

Check how CPU is configured

Either add "CPU Frequency Scaling Monitor" to your GNOME panel, or run the command cpufreq-info, which prints one block like this per core:

analyzing CPU 0:
  driver: acpi-cpufreq
  CPUs which need to switch frequency at the same time: 0
  hardware limits: 1000 MHz - 1.83 GHz
  available frequency steps: 1.83 GHz, 1.33 GHz, 1000 MHz
  available cpufreq governors: userspace, powersave, conservative, ondemand, performance
  current policy: frequency should be within 1000 MHz and 1.83 GHz.
                  The governor "ondemand" may decide which speed to use
                  within this range.
  current CPU frequency is 1000 MHz (asserted by call to hardware).
  cpufreq stats: 1.83 GHz:10.34%, 1.33 GHz:0.62%, 1000 MHz:89.04%  (1068280)

There are two important pieces of information:

Governor ??

The governor decides what frequency should be used (it uses the CPUFreq driver to actually switch the CPU's policy). As explained above, since Lenny, the CPUFreq modules should be loaded using cpufrequtils.

In most cases, ondemand is the recommended governor. CPUFreq governors are actually modules (even though governors are modules, you should use cpufreq-info to know if the governors are loaded, and which one is active).

For more information about governors, read governors.txt (available in /usr/share/doc/linux-doc-2.6.32/Documentation/cpu-freq/ from the package linux-doc-2.6, you can read the latest version from kernel.org).

Userland governors

The userland-based governors (cpufreqd, cpudyn, powersaved, powernowd ...) are usually not needed any more.

Drivers

As explained above, the governor defines the frequency scaling policy, but it doesn't instruct the CPU to change the speed directly... it needs a driver for that. cpufrequtils has an init script that should load the appropriate driver at boot time.

The list of CPUFreq drivers available on your system can be obtained by running:

/sbin/modinfo /lib/modules/$(uname -r)/kernel/arch/*/kernel/cpu/cpufreq/* | grep "^[fd]"

For more information about governors, read cpu-drivers.txt (available in /usr/share/doc/linux-doc-2.6.32/Documentation/cpu-freq/ from the package linux-doc-2.6, you can read the latest version from kernel.org).

See Also


CategoryHardware