33
Jin-Soo Kim ([email protected]) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Power Management

Power Management - AndroBenchcsl.skku.edu/uploads/ICE3028S13/16-power.pdfDevice Power States D-states: State Description D0 Fully powered-up, fully operational state. D1 Initial sleep

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Power Management - AndroBenchcsl.skku.edu/uploads/ICE3028S13/16-power.pdfDevice Power States D-states: State Description D0 Fully powered-up, fully operational state. D1 Initial sleep

Jin-Soo Kim ([email protected])

Computer Systems Laboratory

Sungkyunkwan University

http://csl.skku.edu

Power Management

Page 2: Power Management - AndroBenchcsl.skku.edu/uploads/ICE3028S13/16-power.pdfDevice Power States D-states: State Description D0 Fully powered-up, fully operational state. D1 Initial sleep

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim ([email protected]) 2

Why Low-Power?

▪ Battery life

▪ Thermal issues (cooling, reliability)

▪ Environment

Page 3: Power Management - AndroBenchcsl.skku.edu/uploads/ICE3028S13/16-power.pdfDevice Power States D-states: State Description D0 Fully powered-up, fully operational state. D1 Initial sleep

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim ([email protected]) 3

Power Basics (1)

▪ CMOS Power management fundamentals

𝐸 = 𝐶𝑉𝑑𝑑2𝑓𝑐 + 𝐼𝑠𝑐𝑉𝑑𝑑 + 𝐼𝑙𝑘𝑔𝑉𝑑𝑑 𝑑𝑡

𝑡

0

Total Energy Consumption

Capacitive Power Dissipation (dynamic) – most dominant

Leakage Power Dissipation (static)

Short-circuit Power Dissipation (dynamic)

Page 4: Power Management - AndroBenchcsl.skku.edu/uploads/ICE3028S13/16-power.pdfDevice Power States D-states: State Description D0 Fully powered-up, fully operational state. D1 Initial sleep

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim ([email protected]) 4

Power Basics (2)

To minimize 𝐼𝑠𝑤𝑖𝑡𝑐ℎ

To minimize 𝐼𝑙𝑘𝑔

• Reduce voltage • Reduce frequency • Clock gating • Reduce switched capacitance

• Reduce voltage • Power gating • Less leaky transistors

sc

To minimize 𝐼𝑠𝑐

• Reduce voltage • Reduce frequency • Clock gating • Transistors with

shorter rise/fall time

Page 5: Power Management - AndroBenchcsl.skku.edu/uploads/ICE3028S13/16-power.pdfDevice Power States D-states: State Description D0 Fully powered-up, fully operational state. D1 Initial sleep

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim ([email protected]) 5

Power Reduction Strategies

▪ Circuit-level

• Transistor technology that reduces power draw

▪ Architectural-level

• Hardware optimizations to make code execute more efficiently

▪ Software

• Compilers – optimize for more efficient code

• OS – dynamic voltage/frequency scaling

Page 6: Power Management - AndroBenchcsl.skku.edu/uploads/ICE3028S13/16-power.pdfDevice Power States D-states: State Description D0 Fully powered-up, fully operational state. D1 Initial sleep

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim ([email protected]) 6

Example

▪ CompuLab’s fit-PC2

• Intel 1.6GHz Atom Z530 CPU + US15W chipset

• 1GB DRAM, 60GB HDD

• Six USB ports, Gbit Ethernet, Wi-Fi, …

• 115x101x27 mm

Page 7: Power Management - AndroBenchcsl.skku.edu/uploads/ICE3028S13/16-power.pdfDevice Power States D-states: State Description D0 Fully powered-up, fully operational state. D1 Initial sleep

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim ([email protected]) 7

Example: Observations

▪ Gap b/w advertised vs. measured results

▪ Large constant power consumption

• 66%~81% of total system power consumption

• Less benefit of dynamic power management

▪ Substantial power consumption in non-CPU and non-chipset components

• Combined TDP (Thermal Design Power) for Intel Z530 and its US15W chipset is 5W

Page 8: Power Management - AndroBenchcsl.skku.edu/uploads/ICE3028S13/16-power.pdfDevice Power States D-states: State Description D0 Fully powered-up, fully operational state. D1 Initial sleep

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim ([email protected]) 8

Power Managed SoC Example

Source: ARM

Page 9: Power Management - AndroBenchcsl.skku.edu/uploads/ICE3028S13/16-power.pdfDevice Power States D-states: State Description D0 Fully powered-up, fully operational state. D1 Initial sleep

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim ([email protected]) 9

ARM big.LITTLE (1)

▪ Cortex-A7

• In-order, dual-issue processor

• 8 ~ 10 pipeline stages

• Low performance, but power efficient

Page 10: Power Management - AndroBenchcsl.skku.edu/uploads/ICE3028S13/16-power.pdfDevice Power States D-states: State Description D0 Fully powered-up, fully operational state. D1 Initial sleep

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim ([email protected]) 10

ARM big.LITTLE (2)

▪ Cortex-A15

• Out-of-order, triple-issue processor

• 15 ~ 24 pipeline stages

• High performance, high energy consumption

Page 11: Power Management - AndroBenchcsl.skku.edu/uploads/ICE3028S13/16-power.pdfDevice Power States D-states: State Description D0 Fully powered-up, fully operational state. D1 Initial sleep

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim ([email protected]) 11

ARM big.LITTLE (3)

Page 12: Power Management - AndroBenchcsl.skku.edu/uploads/ICE3028S13/16-power.pdfDevice Power States D-states: State Description D0 Fully powered-up, fully operational state. D1 Initial sleep

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim ([email protected]) 12

ARM big.LITTLE (4)

▪ Cortex-A7 vs. Cortex-A15

Page 13: Power Management - AndroBenchcsl.skku.edu/uploads/ICE3028S13/16-power.pdfDevice Power States D-states: State Description D0 Fully powered-up, fully operational state. D1 Initial sleep

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim ([email protected]) 13

ARM big.LITTLE (5)

Page 14: Power Management - AndroBenchcsl.skku.edu/uploads/ICE3028S13/16-power.pdfDevice Power States D-states: State Description D0 Fully powered-up, fully operational state. D1 Initial sleep

ACPI

Page 15: Power Management - AndroBenchcsl.skku.edu/uploads/ICE3028S13/16-power.pdfDevice Power States D-states: State Description D0 Fully powered-up, fully operational state. D1 Initial sleep

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim ([email protected]) 15

ACPI

▪ Advanced Configuration & Power Interface

▪ First released in 1996 by Compaq/HP, Intel, Microsoft, Phoenix, and Toshiba

▪ A standard interface for computer system power and configuration management

▪ Decisions managed through the OS

Page 16: Power Management - AndroBenchcsl.skku.edu/uploads/ICE3028S13/16-power.pdfDevice Power States D-states: State Description D0 Fully powered-up, fully operational state. D1 Initial sleep

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim ([email protected]) 16

ACPI Power State Transition

Page 17: Power Management - AndroBenchcsl.skku.edu/uploads/ICE3028S13/16-power.pdfDevice Power States D-states: State Description D0 Fully powered-up, fully operational state. D1 Initial sleep

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim ([email protected]) 17

Global System States

▪ G-states:

State Name Description

G0 Working Normal operating mode. The performance state of CPUs (Px) and power state of devices (Dx) can be managed.

G1 Sleeping No applications executed. Several sleep states (Sx) available.

G2 Soft Off Power-off state

G3 Mechanical Off Power-off with electrical disconnection

Page 18: Power Management - AndroBenchcsl.skku.edu/uploads/ICE3028S13/16-power.pdfDevice Power States D-states: State Description D0 Fully powered-up, fully operational state. D1 Initial sleep

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim ([email protected]) 18

Sleep States

▪ S-states:

State Description

S0 Full On: Processor operating. Individual devices may be shut down or be placed into lower power states to save power.

S1 Lowest waking latency. All system context is maintained by hardware.

S2 CPU and cache state is lost. The OS is responsible for storing and restoring them.

S3 Suspend-to-Ram: Power down more internal units. Some I/O paths are unavailable. DRAM state is still maintained.

S4 Suspend-to-Disk: “Hibernate mode” All system states are stored to nonvolatile storage.

S5 Soft Off: Same as G2 state. No system context is stored.

Page 19: Power Management - AndroBenchcsl.skku.edu/uploads/ICE3028S13/16-power.pdfDevice Power States D-states: State Description D0 Fully powered-up, fully operational state. D1 Initial sleep

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim ([email protected]) 19

Device Power States

▪ D-states:

State Description

D0 Fully powered-up, fully operational state.

D1 Initial sleep state for a device. Capable of waking itself or the entire system in response to an external event.

D2 Operate at a lower power, requiring a greater waking latency. More likely to lose its device context. Still capable of waking itself or the rest of the system.

D3hot Save a device-specific state so that it can be awakened without a complete reboot.

D3cold Complete power down of the device.

Page 20: Power Management - AndroBenchcsl.skku.edu/uploads/ICE3028S13/16-power.pdfDevice Power States D-states: State Description D0 Fully powered-up, fully operational state. D1 Initial sleep

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim ([email protected]) 20

Processor Power States

▪ C-states: a sub-state of the S0 state

• Offer reduced power consumption while the system is fully on

State Description

C0 The processor executes instructions and operates normally.

C1 The sleep state where the transition latency is negligible.

C2 (optional)

Lower-power sleep state. The OS must consider the transition latency.

C3 (optional)

Great power reduction at the cost of an increased transition latency. Processor caches do not emit coherence traffic.

C4..Cn (optional)

Additional power states.

Page 21: Power Management - AndroBenchcsl.skku.edu/uploads/ICE3028S13/16-power.pdfDevice Power States D-states: State Description D0 Fully powered-up, fully operational state. D1 Initial sleep

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim ([email protected]) 21

C-states Example

Page 22: Power Management - AndroBenchcsl.skku.edu/uploads/ICE3028S13/16-power.pdfDevice Power States D-states: State Description D0 Fully powered-up, fully operational state. D1 Initial sleep

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim ([email protected]) 22

Processor Performance States

▪ P-states: a sub-state of the C0 state

• Offer reduced power consumption while the processor is executing code

• Useful for non-critical workloads, longer battery life, or waiting for user inputs

State Description

P0 The maximum performance, maximum power consumption state

P1 The next-highest-performing processor performance state and is expected to have the second-greatest power consumption.

P2..Pn Optional (up to a maximum of 16 distinct states)

Page 23: Power Management - AndroBenchcsl.skku.edu/uploads/ICE3028S13/16-power.pdfDevice Power States D-states: State Description D0 Fully powered-up, fully operational state. D1 Initial sleep

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim ([email protected]) 23

C-states vs. P-states

Page 24: Power Management - AndroBenchcsl.skku.edu/uploads/ICE3028S13/16-power.pdfDevice Power States D-states: State Description D0 Fully powered-up, fully operational state. D1 Initial sleep

Linux/Android Power Management

Page 25: Power Management - AndroBenchcsl.skku.edu/uploads/ICE3028S13/16-power.pdfDevice Power States D-states: State Description D0 Fully powered-up, fully operational state. D1 Initial sleep

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim ([email protected]) 25

CPUfreq (1)

▪ The generic infrastructure to handle processors with P-state capability

Page 26: Power Management - AndroBenchcsl.skku.edu/uploads/ICE3028S13/16-power.pdfDevice Power States D-states: State Description D0 Fully powered-up, fully operational state. D1 Initial sleep

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim ([email protected]) 26

CPUfreq (2)

▪ Governors decide how and when to change operating points

Governor Description

Performance Sets the CPU statically to the highest frequency

Powersave Sets the CPU statically to the lowest frequency

Userspace Allows any userspace program running with “root” to set the CPU to a specific frequency

Ondemand Changes the CPU frequency depending on CPU utilization

Page 27: Power Management - AndroBenchcsl.skku.edu/uploads/ICE3028S13/16-power.pdfDevice Power States D-states: State Description D0 Fully powered-up, fully operational state. D1 Initial sleep

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim ([email protected]) 27

CPUfreq Example

▪ On Samsung Galaxy S II

$ cat /sys/power/cpufreq_table 1200000 1000000 800000 500000 200000 $ cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state 1200000 787609 1000000 44696 800000 3122770 500000 652736 200000 26890016 $ cat /sys/devices/system/cpu/cpu0/cpufreq/stats/total_trans 171342 $ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver exynos_cpufreq

Page 28: Power Management - AndroBenchcsl.skku.edu/uploads/ICE3028S13/16-power.pdfDevice Power States D-states: State Description D0 Fully powered-up, fully operational state. D1 Initial sleep

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim ([email protected]) 28

CPUidle (1)

▪ A generic infrastructure that puts idle CPUs into low-power states (C-states)

Page 29: Power Management - AndroBenchcsl.skku.edu/uploads/ICE3028S13/16-power.pdfDevice Power States D-states: State Description D0 Fully powered-up, fully operational state. D1 Initial sleep

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim ([email protected]) 29

CPUidle (2)

▪ Governors decide what state to go for:

Governor Description

ladder

Takes a step-wise approach to selecting an idle state. Mostly applicable to ACPI platform Not work very well with tickless kernels

menu Picks the deepest possible idle state straight away. Considers the expected sleep time, latency requirements, previous C-state residency, etc.

Page 30: Power Management - AndroBenchcsl.skku.edu/uploads/ICE3028S13/16-power.pdfDevice Power States D-states: State Description D0 Fully powered-up, fully operational state. D1 Initial sleep

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim ([email protected]) 30

Tickless Idle

▪ Eliminates the periodic timer tick when the CPU is idle.

▪ This allows the CPU to remain in power saving states for a longer period of time, reducing the overall system power consumption

▪ Benefits of tickless idle will be lost if the CPU is frequently awakened by unnecessary timer events.

Page 31: Power Management - AndroBenchcsl.skku.edu/uploads/ICE3028S13/16-power.pdfDevice Power States D-states: State Description D0 Fully powered-up, fully operational state. D1 Initial sleep

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim ([email protected]) 31

PowerTOP

▪ Show how well your system is using the various hardware power-saving features

▪ Show you the culprit software components that are preventing optimal usage of your hardware power savings

▪ Help Linux developers test their application and achieve optimal behavior

▪ Provide you with tuning suggestions to achieve low power consumption

Page 32: Power Management - AndroBenchcsl.skku.edu/uploads/ICE3028S13/16-power.pdfDevice Power States D-states: State Description D0 Fully powered-up, fully operational state. D1 Initial sleep

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim ([email protected]) 32

PowerTop Example

Page 33: Power Management - AndroBenchcsl.skku.edu/uploads/ICE3028S13/16-power.pdfDevice Power States D-states: State Description D0 Fully powered-up, fully operational state. D1 Initial sleep

ICE3028: Embedded Systems Design (Spring 2013) – Jin-Soo Kim ([email protected]) 33

Android Wake Locks

▪ Components make requests to keep the power on through “wake locks”

▪ Forces the device to remain on

▪ Can lead to greatly poor battery life if not properly used