Running Linux 2.6 and Fedora Core 2 / 3 on the IBM ThinkPad T41
Alex Fedosov

[ overview ] [ video ] [ frequency scaling ] [ suspend ] [ ACPI ] [ TV out ] [ other ]

In order to get better power savings and thus longer battery life, it makes sense to dynamically lower CPU frequency when the CPU is idle or on battery. Intel calls this feature of the Pentium M CPU "Enhanced SpeedStep". To take advantage of this under Linux, you need two things: kernel support and any of the three available user-space daemons to dynamically adjust the clock frequency.

[ kernel driver ] [ cpuspeed ] [ cpufreqd ] [ cpudyn ]

Kernel support for CPU frequency scaling
For some reason, FC2 kernel does not come with speedstep-centrino module which you need for CPU frequency scaling. Thus you need to compile your own.

You need the following config options:
[*] CPU Frequency scaling
Default CPUFreq governor (userspace)
<M>   CPU frequency table helpers
<M> Intel Enhanced SpeedStep
[*] Use ACPI tables to decode valid frequency/voltage pairs


cpuspeed (included with FC2)
To use cpuspeed you need a configuration file, which lives under /etc/cpuspeed.conf:
DRIVER="speedstep-centrino"
OPTS="-i 10 -a /proc/acpi/ac_adapter/AC/state"
Note: for some reason, if I left the temperature parameter in the config, the CPU frequency was never scaled down. (I assume because the CPU was below the temperature threshold. Maybe this is a feature?)
You can monitor the current frequency by reading files in /sys/devices/system/cpu/cpu0/cpufreq (or /proc/cpuinfo).

With the above settings, I observed two things happening:
  1. When the CPU is idle (regardless of AC status), the frequency is automatically and incrementally decreased to the frequency specified in /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq. Conversely, when there is a load on the CPU, it is automatically increased to the value specified in /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq, UNLESS you are running on batteries, in which case it always stays at the min value.
  2. When you unplug from AC, the frequency is automatically set to the min value, regardless of load.
This seems to be the extent of frequency control that cpuspeed gives you. If you want anything more, you should use cpufreqd instead.


cpufreqd
Download the cpufreqd RPM from
Dag Apt Repository. If you want to specify percentages of CPU frequency rather than values in KHz, you should enable to the following option:
<M>   /proc/cpufreq interface (deprecated)
cpufreqd is more configurable than cpuspeed. Tailoring the configuration to your needs is a bit tricky. You can go with the default or take someone else's. I am using the config provided by Alexander Wagner on his T41p page.


CPU frequency scaling with cpudynd
Download the cpudynd RPM from
Dag Apt Repository. More to come.




Last modified Wednesday July 28, 2004
Alex Fedosov
Department of Computer Science, University of San Francisco