LAMP: Linux And Managed Power
LAMP is a simple user-level tool to
adapt CPU frequency to CPU load, to achieve a balance between
performance and battery life for laptops.
It runs on recent (post 2.4) versions of the Linux kernel.
Download
Tar.gz file (25 kb)
What you need
- Hardware: a processor that
supports multiple frequency states, such as the Pentium-M, or AMDs K6
- Software: your kernel
should have CPUFreq support
compiled-in, and should have the sysfs
filesystem mounted somewhere. (CPUFreq
documentation)
How to build and use it
- Untar it
- cd LAMP/src
- Change CPU_FREQ_PATH in lamp.h to reflect where you've
mounted you're sysfs
filesystem. By default, it assumes that its mounted under /sys.
- Change CPU_LOW_SPEED
and CPU_HIGH_SPEED in lamp.h to what your CPU
supports. The current values in there are for a Pentium-M 1.3GHz
(Centrino). These values can be seen in /sys/devices/system/cpu/cpu0/cpufreq/scaling_{max|min}_freq.
- Run make
- As root, run lamp
How it works
LAMP simply follows CPU load. It regularly monitors CPU load (every 1
second), and if this crosses a threshold (50%), it steps up to the
processor's maximum frequency. If the load falls below the threshold,
it steps down to a lower frequency.
Author
Vivek Haldar - vhaldar@uci.edu
Usage reports, bug reports (and patches!) and comments are most welcome.
History
- August 8, 2003: Initial
release
Acknowledgements
- The code for finding out CPU load from the information in /proc
is due to Tony D. (tonyd@sensis.com) from a
post on comp.os.linux.development.apps
- The cool name was suggested by Deepak Chandra