CPU FREQUENCY SCALING BASICS
To reduce power consumption is essential for portable computers but there are no reason not to use on desktop machines. You can save power turning off not needed hardware components like WiFi, Bluetooth, turning off or reduce monitor backlight, spinning down HDD and to control CPU frequency.
CPU frequency scaling is built into 2.6 kernel and available with Tiny Core also, but you need few additional tools and you have to setup it yourself. Most of the modern CPU's and chipsets support frequency scaling, there is a high chance that you can use it.
It is a short introductory article how to enable and use it. There are plenty of additional recources on the net.
TOOLS REQUIREDYou need the
cpufreq.tczl extension and its dependencies from the repository.
CPU DRIVERNext you have to load the proper CPU kernel driver matching your CPU. To identify the CPU type in a terminal window:
cat /proc/cpuinfo
Depending on the CPU, load one of the following modules with the 'modprobe' command:
p4-clockmod (Intel)
powernow-k6 (AMD K6)
powernow-k7 (AMD K7)
powernow-k8 (AMD K8)
If you choose a wrong driver you will get an error message and module is not loaded, nothing goes wrong.
Alternatively you can try
acpi-cpufreq
It is not so efficient as CPU specific modules, but better than nothing.
There are drivers for certain chipsets not only for CPU's but it is out of the scope of this introduction.
VIEW CPU FREQUENCY INFORMATIONNow you can check actual CPU frequency and other information. Type in a terminal window:
cpufreq-info
and you will get a similar screen:
GOVERNORSGovernors are kernel modules changing the CPU frequency. There are different governors implementing different rules:
powersave - sets the lowest possible frequency constantly
performance - sets the possible highest frequency constantly
ondemand - changes frequency automatically based upon actual demand of programs
conservative - same as ondemand but with a different algorithm, better for notebook battery
use
userspace - allows userspace programs (or any process running as root) to set the frequency
Above governors are modules, loaded automatically when needed, but you can modprobe them before using. Default is performance.
For most systems, the Ondemand governor can provide the best compromise between heat emission, power consumption, performance, and manageability. When the system is only busy at specific times of the day, the Ondemand governor will automatically switch between maximum and minimum frequency depending on the load without any further intervention.
SELECT GOVERNORAt this point everything is prepared but no active governor selected and no running third party daemon installed, so no any power saving yet.
Use the 'cpufreq-set' command to activate one of the governors mentioned above, for example:
cpufreq-set -g ondemand
Please note, if you have a dual-core or multiple-core CPU, you must specify explicitely the CPU. There are CPU's where each core can run with different setting! Example for a dual-core CPU:
cpufreq-set -c 0 -g conservative
cpufreq-set -c 1 -g conservative
You can explicitely specify the frequency also.
MAN PAGESYou can read man pages here:
http://linux.die.net/man/1/cpufreq-infohttp://linux.die.net/man/1/cpufreq-setUSER SPACE PROGRAMSThere are user space programs to manage not only cpu frequency but other components also. One of those, cpufreqd is part of the cpufreq.tcel/tcpufreq.tczl extension installed.
For the curious there are many good articles on the net.
Hope it helps a bit to understand and use frequency scaling.