power-management-in-Ubuntu

Revision 8 as of 2007-07-07 17:53:57

Clear message

Please check the status of this specification in Launchpad before editing it. If it is Approved, contact the Assignee or another knowledgeable person before making changes.

Summary

The Ubuntu Mobile Distribution will run on battery-powered devices. This makes power management critical. This specification lists the things that need to be addressed.

Rationale

Currently, Ubuntu is popular on laptops. With the increasing interest in mobile computing with the advent of Nokia´s internet tablets, Microsoft-Intel UMPCs and Intel´s MID initiative, battery life is becoming increasingly important. To be successful on these mobile platforms, significant work needs to be addressed toward increasing battery life. This work spans the whole stack from kernel to user-space.

Use Cases

  • Be able to watch 3-4 hours of DVD on a flight without an extended battery

Scope

  • Any package in the default install which can cause excessive battery usage: accessing the harddrive, polling for WLAN AP, keeps HW awake, etc.
  • Fix drivers to automatically put hardware to increasing levels of power save states based on multiple timeouts
  • Fix bus drivers to automatically put buses into power save modes when no devices on the bus are active e.g. pci, usb, pcmcia
  • Improve Linux driver model to allow control power control of individual devices to allow userspace to override the default policy of the driver
  • Enable a tickless (dynamic tick) kernel to allow processor to stay sleep for longer periods
  • Profile userspace with a powertop from Intel that lists offending processes that poll or set frequent timers and get them fixed

  • Develop a library that allows timer wake ups to be synchronized for non-real time apps. Get KDE and Gnome communities to use these libraries

Design

Implementation

From https://wiki.ubuntu.com/ReducedPowerUsage so that we don't lose these optimizations.

acpi scripts

/etc/acpi/ac.d/10-vm_settings.sh

# Tweak virtual memory for running on AC.

echo 60 > /proc/sys/vm/swappiness
echo 3000 > /proc/sys/vm/dirty_expire_centisecs
echo 500  > /proc/sys/vm/dirty_writeback_centisecs
echo 10   > /proc/sys/vm/dirty_background_ratio
echo 40   > /proc/sys/vm/dirty_ratio

/etc/acpi/battery.d/10-vm_settings.sh

# Tweak virtual memory to conserve power when running on batteries.

echo 10 > /proc/sys/vm/swappiness
echo 0 > /proc/sys/vm/dirty_expire_centisecs
echo 0 > /proc/sys/vm/dirty_writeback_centisecs
echo 60 > /proc/sys/vm/dirty_background_ratio
echo 95 > /proc/sys/vm/dirty_ratio

/etc/acpi/ac.d/20-wireless_power.sh

# Change the wireless power mode to AC.
#   This works for ipw3945, not sure about other chipsets
#   Make sure eth1 is your wireless.

/sbin/iwpriv eth1 set_power 6

/etc/acpi/battery.d/20-wireless_power.sh

# Change the wireless power mode to Battery.

/sbin/iwpriv eth1 set_power 7

video card low power mode

The following is a nasty hack for the fglrx driver. It sets the video card to low power mode on boot.

https://help.ubuntu.com/community/BinaryDriverHowto/Fglrx_lowpower

The need for this hack points to the usefulness there would be of an acpi event generated upon user login/display activation. (perhaps this event already exists). The event could then trigger an acpi script which sets the video card to low power mode.

Outstanding Issues

  • laptop-mode
  • take care of these patches by Intel too!!! [http://www.linuxpowertop.org/known.php #patches-by-intel] <- yes, all of those should be checked that we either ship recent enough upstream version or add a patch

BoF agenda and discussion

  • Note http://lwn.net/Articles/240253/ and the tips for "Getting more from tickless", regarding usage of deferrable timers and hardware timers. Could the deferrable timers patch put in Ubuntu?


CategorySpec