Thanks to André for this post.
While watching some Divx, I noticed that my Pentium Mobile CPU was clocked on full speed, but only with constant 25% CPU usage. I think that the CPU-scaling threshold values are a bit wasteful by default. So I increased my battery life by using powernowd.
Please note that in general the ondemand governor is known as the best setting for an Intel CPU. Ubuntu uses the cpu-scaling_governor “ondemand” (if available) instead of powernowd.
I use powernowd because I can configure it the way I want it - with powernowd you can specify the cpu usage upper/lower limit percentages very nicely.
The Ubuntu 7.10 powernowd init script checks if it can set the cpu-scaling_governor to ondemand. If this is possible, it doesn't use powernowd. So I commented this check out by modifying /etc/init.d/powernowd to look like this:
start() {
log_begin_msg "Starting $DESC... "
#if use_ondemand
#then
# log_end_msg 0
# return 0
#fi
if check_kernel
then
# echo "Starting $DESC: "
start-stop-daemon --start --quiet --oknodo --exec $DAEMON -- $OPTIONS >/dev/null 2>&1 || {
status=$?
log_end_msg $status
return $status
}
else
If you are using Gnome, you also have to change the default-behavior of the gnome-power-manager, because it sets the scaling_governor to “ondemand” on startup.
I used the gconf-editor to change this.
You can find the appropriate setting in apps/gnome-power-manager/cpufreq. Set the policy_ac and the policy_battery to “nothing”.
In the gnome-gui for powermanagement, there is a checkbox for cpufreq_show under apps/gnome-power-manager/ui. Check that checkbox.
Your system should now use powernowd for cpu-scaling.
Powernowd lets you configure the cpu usage upper/lower limit percentages on the command line. So lets modify the default parameters of powernowd to use our threshold. Create the file /etc/default/powernowd with this content:
OPTIONS="-q <options_you_want>"
For example I use the following parameters: OPTIONS=”-q -m 3 -l 70 -u 90” With these options, the CPU is only changing to full speed if the cpu-usage gets over 90% and falls back to the lowest value when the cpu-usage gets below 70%.
With this I have great energy savings on my Laptop and the CPU is a bit cooler. Now my CPU only has 800Mhz while watching Divx or copying files instead of full speed.