Frequency scaling

Processors are often underused: the most common tasks like web surfing, chatting, etc don’t demand much CPU power. Even multimedia applications like photo editing don’t push processors to the limit. Using Gentoo allows you however to use 100% of your processor when updating world for example…

But apart of that, why would you let your processor running at its maximal frequency clock? Configuring your kernel the right way, and performing a simple command make frequency scaling a reality on your computer. The following applies to a “PowerNow!” capable CPU, like an AMD64 for example.

First check for the following options in your kernel config:

Power management options  --->
 CPU Frequency scaling  --->
  [*] CPU Frequency scaling
   <*> 'conservative' cpufreq governor
   <*> AMD Opteron/Athlon64 PowerNow!
   [*] ACPI Processor P-States driver

That should add the support for scaling your processor frequency. If you want your processor to scale its frequency depending on the demand, simply do (as root):

echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

To put it back at its maximal frequency, no matter the demand, do:

echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

To make this permanent (i.e. upon each reboot), simply add this line to the /etc/conf.d/local.start file.

That’s it! Of course, it’s just a part of the whole story, but that’s just enough for me to remember how I shall do it if things screw up…

Comments are closed.