Tuesday, May 03, 2005

CPU freq stepping

Decided I'd like to have more than 40 minutes of battery from the Centrino laptop when unconnected and noticed that CPU throttling didn't seem to be active. So, here's what I did to enable it:
(main source of info: http://forums.gentoo.org/viewtopic.php?t=248572&highlight=)
1. emerged cpufreqd cpufrequtils

2. Had to update kernel .config:
#
# CPU Frequency scaling
#
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_DEBUG=y
CONFIG_CPU_FREQ_STAT=y
CONFIG_CPU_FREQ_STAT_DETAILS=y
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_TABLE=y

3.Rebuilt the kernel

4. Logged in as root, and then "cpufreq-set -f 600000" instantly dropped my clock to 600Mhz, "cpufreq-set -f 1700000" raised it back up. This nice for on-the-fly custom tweaking. "cpufreq-set -g ondemand" is the real beauty, because this governor manages only increments the clock when it's needed. Keeps it @600mhz when not needed.

Trick now is to add this to a startup script.

No comments: