Search:  
Gentoo Wiki

CPU_Frequency_Scaling

Contents

Introduction

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.

Kernel

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

Governor

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

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

Scaling Driver

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

DriverSupported processors
ACPI Processor P-States driverIntel 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 ModulationNatSemi Geode
Intel Enhanced SpeedStepIntel Pentium M (Centrino)
Intel Speedstep on ICH-M chipsetsSome 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 chipsetsSome Mobile Intel Pentium III (Coppermine), Mobile Intel Pentium III-M (Tualatin), needs Intel 440BX/ZX/MX southbridge
Intel Pentium 4 clock modulationIntel Pentium 4, Intel XEON, Intel Celeron (built as module)
nVidia nForce2 FSB changingnVidia nForce2 mainboard
Transmeta LongRunTransmeta Crusoe and Efficeon
VIA Cyrix III LonghaulVIA Samuel/CyrixIII, VIA Cyrix Samuel/C3, VIA Cyrix Ezra, VIA Cyrix Ezra-T
VIA C7 Enhanced PowerSaverVIA 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

Userspace Software

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

emerge --ask --verbose 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

See also

Retrieved from "http://www.gentoo-wiki.info/CPU_Frequency_Scaling"

Last modified: Sat, 11 Oct 2008 01:53:00 +0000 Hits: 43,001