Arch Linux – how to use cpufreq for power saving

Posted in How To's by Shafkat Shahzad, M.Sc - Senior Technical Content Manager on November 28th, 2009

Before we learn about how to use cpufreq for power saving, let’s install the cpufreq package by running following command:

# pacman -S cpufrequtils

If you want scaling down the processor you need to load the p4_clockmod module and for that please insert it into your /etc/rc.conf MODULES array for loading it at startup.

MODULES=(… p4_clockmod …)
Add ‘cpufreq’ to the DAEMONS array in /etc/rc.conf to have it start on startup.
DAEMONS=(… cpufreq …)
Add the following into /etc/conf.d/cpufreq:
governor=”ondemand”
min_freq=”113MHz”
max_freq=”900MHz”

Please note that with enabled cpufreq it scales the processor between 113MHz up to max. frequency. The benefit is that you should be able to save a lot on battery power. The stated 900MHz will be never reached by the eeePC, the p4_clockmod reports a wrong frequency here.

If you followed the guidance and instructions then you would have successfully installed the cpufreq package.

More responsive system with ondemand governor
The default up_threshold (where it will bump to a faster speed) for the CPU governor is 80, which means it will increase the CPU speed when utilization is above 80%. This can make X applications have a bit of lag.
Try changing this value:
$ sudo bash -c “echo 40 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold”
With 40 it still leaves the majority of CPU cycles at the lowest available clock speed but increases responsiveness. You can add this line to one of your startup scripts (such as /etc/rc.local) if you wish to keep it, for example:
#!/bin/bash
#
# /etc/rc.local: Local multi-user startup script.
#

echo 40 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold
Also, following line is also reported to help makes system more responsive. You can use it by adding it to your /etc/rc.local:
echo 2000000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate.

If you followed the advise and guidance as provided in this tutorial guide then you would have successfully learnt about using cpufreq for power saving.

Bookmark Us
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • MisterWong
  • Netvouz
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • Wists

Leave a Comment