linux power management one step ahead! - opensuse · 3 linux power management cpu freq acpi hal...

16
Linux Power Management One Step Ahead! Timo Hoenig <[email protected]> Holger Macht<[email protected]> FOSDEM 2006, February 25th, Brussels This document is licensed under the GNU Free Documentation License

Upload: ngodung

Post on 22-Jul-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Linux Power Management One Step Ahead! - openSUSE · 3 Linux Power Management CPU Freq ACPI HAL Powersave Daemon Clients Kernel System Calls Device PM We talk D-BUS!

Linux Power ManagementOne Step Ahead!

Timo Hoenig <[email protected]>Holger Macht<[email protected]>

FOSDEM 2006, February 25th, Brussels

This document is licensed under the GNU Free Documentation License

Page 2: Linux Power Management One Step Ahead! - openSUSE · 3 Linux Power Management CPU Freq ACPI HAL Powersave Daemon Clients Kernel System Calls Device PM We talk D-BUS!

© 2006 Novell Inc.2

Linux Power ManagementOne Step Ahead!

➔ Linux Power Management

➔ The Powersave Architecture

➔ Runtime Device Power Management (RTD-PM)

➔ Live Demo

➔ What's Next?

Page 3: Linux Power Management One Step Ahead! - openSUSE · 3 Linux Power Management CPU Freq ACPI HAL Powersave Daemon Clients Kernel System Calls Device PM We talk D-BUS!

3

Linux Power Management

CPU FreqCPU Freq

ACPIACPI

HALHAL

Powersave DaemonPowersave Daemon

ClientsClients

KernelKernel

SystemSystemCallsCalls

Device PMDevice PM

We talkWe talkD-BUS!D-BUS!

Page 4: Linux Power Management One Step Ahead! - openSUSE · 3 Linux Power Management CPU Freq ACPI HAL Powersave Daemon Clients Kernel System Calls Device PM We talk D-BUS!

4

Powersave DaemonPowersave Daemon

APMAPMACPIACPI

BatteriesBatteries

CPUCPUFrequencyFrequency

RTD-PMRTD-PM

SuspendSuspend

ScriptsScriptsUnloadUnloadModulesModules HandleHandle

HotkeysHotkeys

Set DiskSet DiskSettingsSettings

Daemon interaction: Trigger Suspend, Set CPU frequency, Set Schemes

Client implements: Auto-Suspend, Lock Screen, Event Notifications (...)

Clients (KPowersave, wmpowersave, gkrellm-powersave)

Powersave LibrariesPowersave LibrariesD-BUS HelperD-BUS Helper

FunctionsFunctionsHAL HelperHAL HelperFunctionsFunctions

BatteryBatteryInformationInformation

Powersave Architecture

Page 5: Linux Power Management One Step Ahead! - openSUSE · 3 Linux Power Management CPU Freq ACPI HAL Powersave Daemon Clients Kernel System Calls Device PM We talk D-BUS!

© 2006 Novell Inc.5

Scheme »Powersave«

Scheme »Performance«

Throttling50 %

CPU Freq.:dynamic

CPU Freq.:High

IDE DiskSettings

RTD-PM

Brightness:High

Brightness:Low

Throttling:0 %

Scheme Architecture

Throttling50 %

CPU Freq.:dynamic

IDE DiskSettings

RTD-PM

Brightness:Low

CPU Freq.:High

Throttling:0 %

Brightness:High

Page 6: Linux Power Management One Step Ahead! - openSUSE · 3 Linux Power Management CPU Freq ACPI HAL Powersave Daemon Clients Kernel System Calls Device PM We talk D-BUS!

© 2006 Novell Inc.6

● SUSE Linux

● Fedora Core

● ALT Linux

● Debian

● Ubuntu

● Kubuntu

● Gentoo

Validated Distributions

Page 7: Linux Power Management One Step Ahead! - openSUSE · 3 Linux Power Management CPU Freq ACPI HAL Powersave Daemon Clients Kernel System Calls Device PM We talk D-BUS!

© 2006 Novell Inc.7

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

Page 8: Linux Power Management One Step Ahead! - openSUSE · 3 Linux Power Management CPU Freq ACPI HAL Powersave Daemon Clients Kernel System Calls Device PM We talk D-BUS!

© 2006 Novell Inc.8

• 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 State1. 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

Runtime Device Power Management

Page 9: Linux Power Management One Step Ahead! - openSUSE · 3 Linux Power Management CPU Freq ACPI HAL Powersave Daemon Clients Kernel System Calls Device PM We talk D-BUS!

© 2006 Novell Inc.9

[A]

Test Environment

LaptopLaptop((nono battery) battery)

LaptopLaptoprunning QtDMMrunning QtDMM

Page 10: Linux Power Management One Step Ahead! - openSUSE · 3 Linux Power Management CPU Freq ACPI HAL Powersave Daemon Clients Kernel System Calls Device PM We talk D-BUS!

© 2006 Novell Inc.10

Example: IPW 2100

Set device to power state D3

Device fully powered

Device in D3

Set device to power state D0

0.825 A

0.773 A

Page 11: Linux Power Management One Step Ahead! - openSUSE · 3 Linux Power Management CPU Freq ACPI HAL Powersave Daemon Clients Kernel System Calls Device PM We talk D-BUS!

© 2006 Novell Inc.11

Live Demo

Page 12: Linux Power Management One Step Ahead! - openSUSE · 3 Linux Power Management CPU Freq ACPI HAL Powersave Daemon Clients Kernel System Calls Device PM We talk D-BUS!

12

What's Next?

Page 13: Linux Power Management One Step Ahead! - openSUSE · 3 Linux Power Management CPU Freq ACPI HAL Powersave Daemon Clients Kernel System Calls Device PM We talk D-BUS!

13

I/O ControlsI/O Controls- SNAPSHOT_FREEZE- SNAPSHOT_FREEZE- SNAPSHOT_AVAIL_SWAP- SNAPSHOT_AVAIL_SWAP- SNAPSHOT_*- SNAPSHOT_*

User Space ToolsUser Space ToolsSuspend ResumeSuspend Resume

Compression BootsplashCompression Bootsplash

Kernel InterfaceKernel Interface/dev/snapshot/dev/snapshot

User Space Software Suspend

Page 14: Linux Power Management One Step Ahead! - openSUSE · 3 Linux Power Management CPU Freq ACPI HAL Powersave Daemon Clients Kernel System Calls Device PM We talk D-BUS!

© 2006 Novell Inc.14

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

Page 15: Linux Power Management One Step Ahead! - openSUSE · 3 Linux Power Management CPU Freq ACPI HAL Powersave Daemon Clients Kernel System Calls Device PM We talk D-BUS!

Running Out of Time^w Battery.

Open Discussion

Thanks for coming!

Page 16: Linux Power Management One Step Ahead! - openSUSE · 3 Linux Power Management CPU Freq ACPI HAL Powersave Daemon Clients Kernel System Calls Device PM We talk D-BUS!

© 2006 Novell Inc.16

- 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]

Resources of Interest