April 20, 2014
 
 
RSSRSS feed

Power Management on Linux, Part 2 - page 3

Five Degrees of Laptop Off

  • April 17, 2008
  • By Carla Schroder
If you need easy, reliable power management for your laptop then I officially recommend using a Linux distribution that does it correctly out of the box, because trying to set it up from scratch is a heroic undertaking. This includes recent releases of Fedora, Ubuntu, SUSE, and Mandriva, and I'm sure there are more. Fedora has a good configuration menu in the Preferences menu, and the shutdown command includes Suspend and Hibernate. It also suspends or hibernates when you close the lid, and wakes up reliably. Nice and easy just like it should be.

Most modern Linux distributions default to ACPI. You can check your own distribution; this command shows you if your kernel supports ACPI:

$ grep -i acpi_sleep  /boot/config-'uname -r'
CONFIG_ACPI_SLEEP=y
CONFIG_ACPI_SLEEP_PROC_FS=y
CONFIG_ACPI_SLEEP_PROC_SLEEP=y
Or check which daemon is running:
$ ps ax|egrep "apmd|acpi"
 4720 ?   S      0:00 hald-addon-acpi: listening \
               on acpid socket /var/run/acpid.socket
 5239 ?   Ss     0:00 /usr/sbin/acpid -c \
               /etc/acpi/events -s /var/run/acpid.socket

These examples show that ACPI is supported and running.

The laptop-mode-tools package is an interesting tool for configuring your laptop hard drive to save power, plus a few other devices as well, but its main claim to fame is controlling hard drive spin-down. The Linux kernel likes a nice balanced I/O, so your hard drive works at a fairly steady pace. laptop-mode-tools changes this behavior by caching writes for longer periods in memory, then committing writes in bursts. So your hard drive can spin down between bursts, which saves a bit of power. You only want to do this with laptop hard disks, which are built to survive 600,000 or more spinups. Desktop hard drives are rated for up to 50,000 spinups, so using laptop-mode-tools will kill them quickly. 30 seconds to a minute are optimal spindown intervals; anything greater than that doesn't save more power.

laptop-mode-tools is included in Debian and Ubuntu, and packages for other distributions are at Laptop Mode. It integrates itself with ACPI, so it already knows to go to work only when you're on battery power.

Resources

LessWatts.org, everything you'll ever want to know about ACPI
Laptops, power management, and Ubuntu
Battery Powered Linux Mini-HOWTO is a bit dated, but still informative

Carla Schroder is the author of the Linux Cookbook and the newly-released Linux Networking Cookbook, and is a regular contributor to LinuxPlanet.

Sitemap | Contact Us