Linux Power Management One Step Ahead!

Timo Hoenig Holger Macht

FOSDEM 2006, February 25th, Brussels

This document is licensed under the GNU Free Documentation License Power Management One Step Ahead!

➔ Linux Power Management

➔ The Powersave Architecture

➔ Runtime Device Power Management (RTD-PM)

➔ Live Demo

➔ What's Next?

© 2006 Inc. 2 Linux Power Management SSyyssttemem WWee ttaallkk Clients CCaalllsls --BBUUSS!!

Powersave Daemon

CPU Freq

Kernel

ACPI Device PM

HAL

3 Powersave Architecture Clients (KPowersave, wmpowersave, gkrellm-powersave)

Client implements: Auto-Suspend, Lock Screen, Event Notifications (...) Daemon interaction: Trigger Suspend, Set CPU frequency, Set Schemes

Powersave Libraries Battery D-BUS Helper HAL Helper Information HAL Helper Functions Functions

Powerssavve Daaeemoon Scripts ACPI Unload Suspend Handle APM Modules CPU Hotkeys Frequency RTD-PM Set Disk Batteries Settings

4 Scheme Architecture

CPU Freq.: CPU Freq.: dynamic High

Scheme Scheme Throttling »Powersave« »Performance« Throttling: 50 % 0 % Throttling IDE Disk CPU Freq.: 50 % Settings High

CPU Freq.: Throttling: RTD-PM Brightness: dynamic 0 % Brightness: Low High

Brightness: Brightness: Low High

IDE Disk RTD-PM Settings © 2006 Novell Inc. 5 Validated Distributions

● SUSE Linux

● Fedora Core

● ALT Linux

● Gentoo

© 2006 Novell Inc. 6 Runtime Device Power Management (RTD-PM)

• Today, we can: • switch the global system state and CPU frequency • adjust LCD brightness • What do we get? • Save time (suspend and resume cycle) • Save power consumption at the expense of performance • Next: • Runtime Device Power Management (RTD-PM) • What do we get? • Extend battery lifetime by switching off unnecessary subsystems or devices (LAN, WLAN, USB, Modem, ...)

© 2006 Novell Inc. 7 Runtime Device Power Management

• Power States According to ACPI • D0 (fully-on, mandatory) • D1, D2 (depending on device class, optional) • D3 (off, device context lost, mandatory) • Switch Device Power State 1. Identify (e.g. lspci) 2. echo -n [0-3] > $SYSFS_PATH $ lspci |grep Ethernet 02:0e.0 Ethernet controller: Broadcom Ethernet $ echo -n 3 > /sys/bus/pci/devices/0000:02:0e.0/power/state • We should not require users to use echo • UI required, enhance Powersave Daemon clients

© 2006 Novell Inc. 8 Test Environment

LLaappttoopp LLaappttoopp ((nnoo bbaatttteerryy)) rruunnnniingng QQttDDMMMM

[A]

© 2006 Novell Inc. 9 Example: IPW 2100

Set device to power state D3 0.825 A

Set device to Device fully powered power state D0

0.773 A Device in D3

© 2006 Novell Inc. 10 Live Demo

© 2006 Novell Inc. 11 What's Next?

12 Software Suspend

KKeernnel Intteerrfaace /dev/snapshot

I/O Coonntrroollss - SNAPSHOT_FREEZE - SNAPSHOT_AVAIL_SWAP - SNAPSHOT_*

Useerr SSppaaccee TToools Suspend Resume

Compression Bootsplash

13 Dynticks

• Skip timer ticks if CPU is idle

• Make HZ dynamic

• HZ is arch depending

➔ Allow the CPU to enter C3 more often

• Problems

• Losing interrupts

© 2006 Novell Inc. 14 Running Out of Time^w Battery.

Open Discussion

Thanks for coming! Resources of Interest

- http://powersave.sourceforge.net/pm-report/

- http://www.opensuse.org/Projects_Powersave

- http://powersave.sourceforge.net

- http://sourceforge.net/Projects/Powersave

- Mailing lists: - [email protected] - [email protected]

© 2006 Novell Inc. 16