power-management-in-Ubuntu

Differences between revisions 11 and 12
Revision 11 as of 2007-07-14 13:26:50
Size: 6070
Editor: mx2
Comment: move relevant links on a new "Reference/See also" section
Revision 12 as of 2007-07-24 10:42:45
Size: 4575
Editor: a81-197-135-210
Comment: More focused agenda for Gutsy
Deletions are marked like this. Additions are marked like this.
Line 18: Line 18:
=== Gutsy ===
 * 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
 * Includes patches from powertop website that fix application issues
Line 19: Line 23:

=== Gutsy + 1 ===
 * Use ''cpuidle'' infrastructure to idle processors
 * 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
Line 22: Line 30:
 * 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
Line 25: Line 31:
 * 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
Line 31: Line 35:

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

'''acpi scripts'''

'''/etc/acpi/ac.d/10-vm_settings.sh'''
{{{
#!/bin/bash
# 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'''
{{{
#!/bin/bash
# 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'''
{{{
#!/bin/bash
# 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'''
{{{
#!/bin/bash
# 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.

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

Gutsy

  • 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

  • Includes patches from powertop website that fix application issues
  • Any package in the default install which can cause excessive battery usage: accessing the harddrive, polling for WLAN AP, keeps HW awake, etc.

Gutsy + 1

  • Use cpuidle infrastructure to idle processors

  • 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
  • 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
  • Profile userspace for unexpected block I/O accesses while idling. Those wakes the block devices and ATA buses from power saving modes, but PowerTOP don't tracks I/O. Tools : sysctl vm.block_dump=1 (then dmesg will show every block access), blktrace, systemtap.

Design

Implementation

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

  • other relevant patches to look at is Gleixner and Molnar hrtimers (esp. the "force enable HPET" set) [http://www.tglx.de/projects/hrtimers/ #here]

  • evaluate the best frequency scaling method (which userspace governor is best presently, is the recently reworked in kernel cpuidle/ondemand better than an userland daemon, ...)
  • detect and disable hardware when not needed (ie. NetworkManager could be made to kill wireless radio when running on ethernet, we may disable Wake-on-Lan by default, ensure xorg 7.3 detects and disable TV-out or CRT outputs when no external monitor is plugged, etc.)

  • ensure other (non-CPU) hardware power saving modes are really activated when on battery (like AC97's /sys/module/snd_ac97_codec/parameters/power_save, hard drives APM and spindown timeouts, fglrx, ...)

References and See also

BoF agenda and discussion


CategorySpec CategoryLaptop

power-management-in-Ubuntu (last edited 2008-08-06 16:22:27 by localhost)