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

Jane wants to be able to watch a couple of DVD movies on a cross-Atlantic flight

Robert wants to be able to attend one full day of a conference taking notes on his laptop without having to carry a power supply and searching for power sockets.

Scope

Hardy

Tickless on x64

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 e.g. gtimeout_at_secs in glib, deferred timers in kernel,

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. This wakes up the block devices and ATA buses from power saving modes, but PowerTOP doesn't track I/O. Tools : sysctl vm.block_dump=1 (then dmesg will show every block access), blktrace, systemtap.

Profile userspace with powertop from Intel (www.linuxpowertop.org) that lists offending processes that poll or set frequent timers and get them fixed

Outstanding Issues

take care of these patches by Intel too!!! #patches-by-intel <- yes, all of those should be checked that we either ship recent enough upstream version or add a patch

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, ...)

Start a whitelist for USB devices that support autosuspend (for already supported in kernel, grep supports_autosuspend in kernel sources)

AHCI link level PM to be pulled in - will lose hotswap support on desktop and server.

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.)

NetworkManager keeps eth0 up even when no cable is plugged in. Needs syncing with kernel about up/down states for the interface.

If NIC disappears, should accept that rather than going AWOL.

Switch to NM 0.7 as 0.6 (Ubuntu is shipping) has been dropped by upstream.

Scan on event (screen unlock, icon-click) rather than on timer (which is too slow for user-experience and too fast for good power saving).

MID: Nokia routes all network connection through a connection tracker. So they can disable network interface and when an application tries to access the network, they can start a new connection quickly. It needs to be reimplemented in open source.

BoF agenda and discussion

FAQs

Some important aspects (mostly: available and supported hardware power saving features) has been somehow tested, but may need a larger scale testing before we can confidently choose to use or not use them by default in a released Ubuntu version. So it'd make sense to have this soon enabled during Gutsy+1 testing phase. On the other hand, some of those features had just been merged in 2.6.24-rc1, therefore may not be released soon enough (if we wait for 2.6.24 official release). Some power saving related decisions to be made ASAP:

Enable Alsa's AC97 and HDA codec power saving features on by default?

Enable laptop mode by default when running on battery? (ie. are the suspend/resume problems been fixed as of now (let alone the "hdparm -B" thinggy) ? or would more exposure help to finally fix them ?).

Enable "hpet=force" by default? Would enable hpet for supported but undocumented hpet timers, ie. on ICH4, VT8235/8237, nVidia chipsets. 2.6.24 upstream only enables it officially documented (ICH5 upwards) platforms, but it would be also supported on eg. the mentioned chipsets in 2.6.24.

Enable Intel's "ondemand" kernel scaling governor by default? Done (Why is the CPU still attributed to the setter---powernowd.sh).

Running Ubuntu desktop is down to ~40 wake ups per second, which is acceptable for the moment.

This really depends on the hardware and drivers (and setup, launched softwares, ...), and could still be much more than 40 for many users.

Uhci_hcd still causes 100 wakeups per second on many computers, effectively disabling deeper sleep states

Vertical refresh causes eg. 60 wakeups per second on many chipsets, also effectively disabling deeper sleep states. Intel is going to be fixed, but should be made sure it makes to hardy (drm kernel driver). ATI drm driver has a vblank branch but it's not merged yet, should be considered for hardy. Nouveau?

kernel's round_jiffies and gnome's g_timeout_add_seconds() already round to next plain second (so gnome and kernel grouped timers are already in sync)