CPU Frequency Scaling

From Gentoo Linux Wiki

(Redirected from HOWTO CPU Throttling)
Jump to: navigation, search
This article is part of the HOWTO series.
Installation Kernel & Hardware Networks Portage Software System X Server Gaming Non-x86 Emulators Misc

Contents

[edit] What is Frequency Scaling?

If you have a very powerful machine and are not using all of the power the CPU provides, it may be using more power than you need. Side effects are raised power bills, reduced battery life on a notebook and increased heat output. I'm on a Pentium-4 right now and it's a very hot summer, it makes good sense to me to decrease the heat output to prevent crashing in the ambient heat.

[edit] Kernel Configuration

Linux Kernel Configuration: CPU frequency scaling
Power management options  --->
    ACPI (Advanced Configuration and Power Interface) Support  --->
        [*] ACPI Support
        <*>   Processor
    CPU Frequency scaling  --->
        [*] CPU Frequency scaling
        <*>   CPU frequency translation statistics
        [*]     CPU frequency translation statistics details


[edit] Governor

They decides at which frequency your processor will run. The most interesting ones are 'ondemand' and 'conservative'. Choose whatever suits your needs best:

  • Conservative drops it to lowest power and increases the frequency in steps as you need more power
  • Ondemand uses the lowest frequency and increases to maximum when you hit 100% at the lowest frequency
  • Powersave drops it to the lowest frequency
  • Performance keeps it at maximum
  • Userspace allows you to set the frequency manually

You can choose as many as you want and switch them anytime.

Linux Kernel Configuration: governor
Power management options  --->
    CPU Frequency scaling  --->
        # E.g. for ondemand
        <*>   'ondemand' cpufreq policy governor


[edit] Scaling Driver

You'll also need to enable your system's clock adjustment driver.

driver Supported processors
ACPI Processor P-States driver Intel Core Solo/Duo, Intel Core2 Solo/Duo
AMD Mobile K6-2/K6-3 PowerNow! AMD Mobile K6-2+, AMD Mobile K6-3+
AMD Mobile Athlon/Duron PowerNow! AMD Mobile K7
AMD Opteron/Athlon64 PowerNow! AMD Opteron, AMD Athlon64
Cyrix MediaGX/NatSemi Geode Suspend Modulation NatSemi Geode
Intel Enhanced SpeedStep Intel Pentium M (Centrino)
Intel Speedstep on ICH-M chipsets Some Mobile Intel Pentium III (Coppermine), Mobile Intel Pentium III-M (Tualatin), Mobile Intel Pentium 4 P4-M, needs Intel ICH2, ICH3 or ICH4 southbridge.
Intel SpeedStep on 440BX/ZX/MX chipsets Some Mobile Intel Pentium III (Coppermine), Mobile Intel Pentium III-M (Tualatin), needs Intel 440BX/ZX/MX southbridge
Intel Pentium 4 clock modulation Intel Pentium 4, Intel XEON, Intel Celeron (built as module)
nVidia nForce2 FSB changing nVidia nForce2 mainboard
Transmeta LongRun Transmeta Crusoe and Efficeon
VIA Cyrix III Longhaul VIA Samuel/CyrixIII, VIA Cyrix Samuel/C3, VIA Cyrix Ezra, VIA Cyrix Ezra-T
VIA C7 Enhanced PowerSaver VIA C7


Linux Kernel Configuration: CPU frequency scaling driver
Power management options  --->
    CPU Frequency scaling  --->
        # E.g. for Intel Core2 Duo
        <*>   ACPI Processor P-States driver

[edit] Userspace Software

Now, you need to install the programs that do the work.

# emerge -av cpufrequtils

To see which governors are available:

# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors

Now, knowing which one you want, edit the only worthwhile line in /etc/conf.d/cpufrequtils to state which governor you want to use, the default is ondemand. Powersave took mine from 2.4GHz to 300MHz (yes, that IS right, even though it doesn't look it)

Finally, activate the scaling:

# /etc/init.d/cpufrequtils start

To enable scaling at boot time:

# rc-update add cpufrequtils boot

[edit] See also

AMD PowerNow! - for AMD CPUs

Personal tools