Note

This document is about Linux & ACPI on an Acer Travelmate 800. Most of it should apply to other computers as well, though.

Controlling ACPI Centrino features / enhanced speedstep via software in Linux

Why the hell would anyone want to run their cpu at a lower speed than it is made for? Two reasons: 1. save energy, 2. prevent the noisy cpu fan from turning on during periods of higher load (provided speed is not that important), e.g. while watching a movie.
You can easily control the CPU clock when ACPI is enabled. Simply try the following:

Kernel 2.4

cat /proc/acpi/processor/CPU0/performance

This should output something like

state count: 5
active state: P0
states:
*P0: 1300 MHz, 24000 mW, 10 uS
P1: 1200 MHz, 20000 mW, 10 uS
P2: 1000 MHz, 18000 mW, 10 uS
P3: 800 MHz, 16000 mW, 10 uS
P4: 600 MHz, 12000 mW, 10 uS

which are the possible clock levels your CPU can run at. The star indicates that it is currently running at 1300 MHz. If you want to change this, you can simply do something like

su
echo 4 > /proc/acpi/processor/CPU0/performance

where the "4" would put you in state "P4" (600 MHz). These lower states have the advantages of less power consumption and less heat production, which can be good if a noisy fan gets on your nerves. I tested all levels and noticed that when you stay in P3 or P4 (800 or 600 MHz) the CPU fan _never_ comes on, even when having full CPU usage for a long period. During normal usage (internet, office, programming) I was hardly able to notice the speed decrease. Subjectively, the machine feels just as fast as with double the clock speed. Another indicator that cpu frequency really doesn't play that much a role.

Kernel 2.6

If you're running a 2.6 kernel (check uname -a), you need to have cpu frequency scaling enabled. Check this by doing:

grep CPUFREQ /usr/src/linux-2.6.x/.config

It should return CONFIG_X86_ACPI_CPUFREQ=y or CONFIG_X86_ACPI_CPUFREQ=m.
To be able to control the cpu frequency from userspace, you should also choose USERSPACE as the cpu frequency governor:

grep USERSPACE /usr/src/linux-2.6.x/.config
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
CONFIG_CPU_FREQ_GOV_USERSPACE=y

Then you can use the cpufreq interface in /sys/ to change the speed:

cd /sys/devices/system/cpu/cpu0/cpufreq/

There you will find some files. You can control the cpu frequency by echoing a value in kHz to the file scaling_setspeed:

echo 600000 > scaling_setspeed

This will set your cpu to 600MHz.

You can also install a userspace daemon to dynamically change the cpu speed according to your power/acpi status and performance needs: cpufrqd, speedfreqd.

Controlling cpu performance states without the command line

I enhanced a program called wmthrottle (a dockapp) to be able to control (Pentium M / Centrino / Enhanced Speedstep) cpu performance states through a GUI. Download my version of wmthrottle supporting acpi/performance. This is a "prerelease" and not yet fully endorsed by the original author. It does work though. Features:
  • changing cpu performance / throttle states using the mouse
  • avoiding fan noise by automatically downclocking / throttling / speedstepping your cpu according to its temperature
  • configurable temperature threshold to start downclocking
  • can be used in most windowmanagers, maybe use the -bw (--broken-wm) switch
Screenshot: Screenshot of wmthrottle
You can toggle dynamic/automatic state switching by clicking the T. If set to manual mode, you can click the state numbers to switch to a cpu performance/throttle state manually. Please read the README. If you have any questions, please send me an email.

Norbert wrote this TCL/TK script which allows setting the ACPI cpu performance state using a graphical interface under Linux. The .tgz contains the script and a readme. The script itself needs to be run as root of course. If you have any questions concerning it, send either me or Norbert an email.

Some links