constrained power management

57
Introduction Motivations Proposal Conclusions Constrained Power Management an holistic approach to power management Patrick Bellasi PhD Student Dipartimento di Elettronica e Informazione Politecnico di Milano, Italy ELC-E - October, 15-16 2009

Upload: patrick-bellasi

Post on 01-Jun-2015

403 views

Category:

Technology


1 download

DESCRIPTION

The general purpose of operating systems like Linux, thanks to their predisposition to adapt easily to different application contexts, is a common choice for many new generation mobile devices. Being a key feature to improve mobility, energy efficiency has become a high priority design goal, and the implementation of the necessary mechanisms to optimize both power and performances can no longer be separated from the requirements of ease of development, portability and adaptability.This work presents a formal model to define the problem of power vs performance control. We have proven that a distributed control is particularly suited to meet the goals of both adaptability and portability, without unduly compromising the effectiveness of control and its efficiency.Starting from the current Linux solution we will advance the proposal for an extension that is better tailored to embedded mobile systems. The proposed solution has been implemented in a new Linux kernel framework named CPM which is competitive in adaptability and ensures better control on performances while still not affecting ease of implementation.

TRANSCRIPT

Page 1: Constrained Power Management

Introduction Motivations Proposal Conclusions

Constrained Power Managementan holistic approach to power management

Patrick BellasiPhD Student

Dipartimento di Elettronica e InformazionePolitecnico di Milano, Italy

ELC-E - October, 15-16 2009

Page 2: Constrained Power Management

Introduction Motivations Proposal Conclusions

Focusing the presentation’s topic

Outline

• Highlight some issues of current Linux kernel PM support

• Advance a proposal to tackle these problems◦ not a finale solution◦ try to focus attention on the topic◦ trigger a discussion to improve this kind of support

Page 3: Constrained Power Management

Introduction Motivations Proposal Conclusions

Multiple sub-system specific policies

Power Management Techniques

• Focusing on devices andinterconnections◦ almost any direct

applications input

• Device specific’s policies◦ multiple policies for

single device

• System-wide Policies◦ tracks subsystem’s

specific dependencies◦ dependency tree

LCD ACodec WiFi

BUSA BUSB

BUSC

SYS

BUS

MEM

CPU

Simple representation of a complex system

Page 4: Constrained Power Management

Introduction Motivations Proposal Conclusions

Multiple sub-system specific policies

Power Management Techniques

• Focusing on devices andinterconnections◦ almost any direct

applications input

• Device specific’s policies◦ multiple policies for

single device

• System-wide Policies◦ tracks subsystem’s

specific dependencies◦ dependency tree

LCD ACodec WiFi

BUSA BUSB

BUSC

SYS

BUS

MEM

CPU

AP NegotiationBacklight

PASR

Simple representation of a complex system

Page 5: Constrained Power Management

Introduction Motivations Proposal Conclusions

Multiple sub-system specific policies

Power Management Techniques

• Focusing on devices andinterconnections◦ almost any direct

applications input

• Device specific’s policies◦ multiple policies for

single device

• System-wide Policies◦ tracks subsystem’s

specific dependencies◦ dependency tree

LCD ACodec WiFi

BUSA BUSB

BUSC

SYS

BUS

MEM

CPU

CPUfreq CPUidle

AP NegotiationBacklight

PASR

Simple representation of a complex system

Page 6: Constrained Power Management

Introduction Motivations Proposal Conclusions

Multiple sub-system specific policies

Power Management Techniques

• Focusing on devices andinterconnections◦ almost any direct

applications input

• Device specific’s policies◦ multiple policies for

single device

• System-wide Policies◦ tracks subsystem’s

specific dependencies◦ dependency tree

LCD ACodec WiFi

BUSA BUSB

BUSC

SYS

BUS

MEM

CPU

V/I

Framework

Clk

Framework

S/R

Framework

CPUfreq CPUidle

AP NegotiationBacklight

PASR

Simple representation of a complex system

Page 7: Constrained Power Management

Introduction Motivations Proposal Conclusions

Multiple sub-system specific policies

Power Management Techniques

• Focusing on devices andinterconnections◦ almost any direct

applications input

• Device specific’s policies◦ multiple policies for

single device

• System-wide Policies◦ tracks subsystem’s

specific dependencies◦ dependency tree

LCD ACodec WiFi

BUSA BUSB

BUSC

SYS

BUS

MEM

CPU

V/I

Framework

Clk

Framework

S/R

Framework

CPUfreq CPUidle

AP NegotiationBacklight

PASR

Simple representation of a complex system

Page 8: Constrained Power Management

Introduction Motivations Proposal Conclusions

Multiple sub-system specific policies

Power Management Techniques

• Focusing on devices andinterconnections◦ almost any direct

applications input

• Device specific’s policies◦ multiple policies for

single device

• System-wide Policies◦ tracks subsystem’s

specific dependencies◦ dependency tree

LCD ACodec WiFi

BUSA BUSB

BUSC

SYS

BUS

MEM

CPU

V/I

Framework

Clk

Framework

S/R

Framework

CPUfreq CPUidle

AP NegotiationBacklight

PASR

Simple representation of a complex system

Page 9: Constrained Power Management

Introduction Motivations Proposal Conclusions

Multiple sub-system specific policies

Power Management Techniques

• Focusing on devices andinterconnections◦ almost any direct

applications input

• Device specific’s policies◦ multiple policies for

single device

• System-wide Policies◦ tracks subsystem’s

specific dependencies◦ dependency tree

LCD ACodec WiFi

BUSA BUSB

BUSC

SYS

BUS

MEM

CPU

V/I

Framework

Clk

Framework

S/R

Framework

CPUfreq CPUidle

AP NegotiationBacklight

PASR

Simple representation of a complex system

Page 10: Constrained Power Management

Introduction Motivations Proposal Conclusions

Multiple sub-system specific policies

Power Management Techniques

• Focusing on devices andinterconnections◦ almost any direct

applications input

• Device specific’s policies◦ multiple policies for

single device

• System-wide Policies◦ tracks subsystem’s

specific dependencies◦ dependency tree

Multiple disjoint policies

LCD ACodec WiFi

BUSA BUSB

BUSC

SYS

BUS

MEM

CPU

V/I

Framework

Clk

Framework

S/R

Framework

CPUfreq CPUidle

AP NegotiationBacklight

PASR

Simple representation of a complex system

Page 11: Constrained Power Management

Introduction Motivations Proposal Conclusions

Multiple sub-system specific policies

Power Management Techniques

• Focusing on devices andinterconnections◦ almost any direct

applications input

• Device specific’s policies◦ multiple policies for

single device

• System-wide Policies◦ tracks subsystem’s

specific dependencies◦ dependency tree

Multiple disjoint policies

LCD ACodec WiFi

BUSA BUSB

BUSC

SYS

BUS

MEM

CPU

V/I

Framework

Clk

Framework

S/R

Framework

CPUfreq CPUidle

AP NegotiationBacklight

PASR

Simple representation of a complex system

How can we achieve system-wide optimization?

Page 12: Constrained Power Management

Introduction Motivations Proposal Conclusions

Multiple sub-system specific policies

Multiple-Policy Approach: Potential Issues

• Multiple decision points◦ difficult inter-dependencies tracking◦ risk of conflicting decisions

• Only indirect info about applications QoS requirements◦ user-space know the requirements, kernel should support them◦ application requirements should drive kernel frameworks tuning

• No proper aggregation on applications requirements◦ only some frameworks provide it (e.g V/I fw, “new” clock fw)◦ risk of code duplication

• No feed-back on resources availability◦ applications could require resources from multiple devices◦ behavior depends on effective availability of all the required resources

The composition of almost independent optimization policies cannotgrant a system-wide optimization

Page 13: Constrained Power Management

Introduction Motivations Proposal Conclusions

Emerging system-wide optimization support

Constrained Power Management

• drivers’ local policies◦ targeted to power reduction◦ fine-details, low-overhead

• coordination entity◦ exploit system-wide view◦ track resource availability and

devices’ inter-dependencies

• global optimization policy◦ multi-objective, low-frequency

• single user-space interface◦ collects QoS requirements◦ feedback on resource availability

• constraint assertion

QoS requirementsset constraint on local policies

DriversLocal

policies

Distributed control model

Page 14: Constrained Power Management

Introduction Motivations Proposal Conclusions

Emerging system-wide optimization support

Constrained Power Management

• drivers’ local policies◦ targeted to power reduction◦ fine-details, low-overhead

• coordination entity◦ exploit system-wide view◦ track resource availability and

devices’ inter-dependencies

• global optimization policy◦ multi-objective, low-frequency

• single user-space interface◦ collects QoS requirements◦ feedback on resource availability

• constraint assertion

QoS requirementsset constraint on local policies

resource availability

inter−dependency

Coordination

Entity

DriversLocal

policies

Distributed control model

Page 15: Constrained Power Management

Introduction Motivations Proposal Conclusions

Emerging system-wide optimization support

Constrained Power Management

• drivers’ local policies◦ targeted to power reduction◦ fine-details, low-overhead

• coordination entity◦ exploit system-wide view◦ track resource availability and

devices’ inter-dependencies

• global optimization policy◦ multi-objective, low-frequency

• single user-space interface◦ collects QoS requirements◦ feedback on resource availability

• constraint assertion

QoS requirementsset constraint on local policies

Global

policy

resource availability

inter−dependency

Coordination

Entity

DriversLocal

policies

Distributed control model

Page 16: Constrained Power Management

Introduction Motivations Proposal Conclusions

Emerging system-wide optimization support

Constrained Power Management

• drivers’ local policies◦ targeted to power reduction◦ fine-details, low-overhead

• coordination entity◦ exploit system-wide view◦ track resource availability and

devices’ inter-dependencies

• global optimization policy◦ multi-objective, low-frequency

• single user-space interface◦ collects QoS requirements◦ feedback on resource availability

• constraint assertion

QoS requirementsset constraint on local policies

QoS

requirements

User−space

user−space

Global

policy

resource availability

inter−dependency

Coordination

Entity

DriversLocal

policies

Distributed control model

Page 17: Constrained Power Management

Introduction Motivations Proposal Conclusions

Emerging system-wide optimization support

Constrained Power Management

• drivers’ local policies◦ targeted to power reduction◦ fine-details, low-overhead

• coordination entity◦ exploit system-wide view◦ track resource availability and

devices’ inter-dependencies

• global optimization policy◦ multi-objective, low-frequency

• single user-space interface◦ collects QoS requirements◦ feedback on resource availability

• constraint assertion

QoS requirementsset constraint on local policies

tuning

Constraint

Aggregation

QoS

requirements

User−space

user−space

Global

policy

resource availability

inter−dependency

Coordination

Entity

DriversLocal

policies

Distributed control model

Page 18: Constrained Power Management

Introduction Motivations Proposal Conclusions

Emerging system-wide optimization support

The PM QoS interface

Linux kernel infrastructure to implement a coordination mechanismamong drivers (capabilities) and application (QoS requirements)

• Developed by Intel for iwl4965 WiFi driver on x86◦ since Linux 2.6.25 (linux/pm qos params.h)

• Defines a (limited) set of “abstract” QoS parameters◦ i.e. latencies, timeouts and throughput◦ maintains a list of QoS requests and aggregate requirements

• restrictive aggregation only, i.e. Min/Max• this aggregation generates a constraint

◦ provides notification chain for constraint update

• drivers subscribe to parameters of interestse.g. CPUidle is constrained by ’system latency’

◦ Drivers’ local policies should grant required constraints

• no failures handling on notify chain calls

Page 19: Constrained Power Management

Introduction Motivations Proposal Conclusions

Emerging system-wide optimization support

Limitations of the PM QoS Interface

“The notion of constraint based PM has been rattling around for a whilenow. PMQoS is just an early application of it. I think a lot more could

be done in this area.” M. Gross

◦ Missing support for platform-specific parameters◦ No additive constraints concepts support◦ Only best-effort approach

current

pm_qos

MAX54Mb/s

Additive

Constraint

value

20Mb/s

OPTIMAL

E1 QoSE2

Page 20: Constrained Power Management

Introduction Motivations Proposal Conclusions

Emerging system-wide optimization support

Limitations of the PM QoS Interface

“The notion of constraint based PM has been rattling around for a whilenow. PMQoS is just an early application of it. I think a lot more could

be done in this area.” M. Gross

◦ Missing support for platform-specific parameters◦ No additive constraints concepts support◦ Only best-effort approach

current

pm_qos

MAX54Mb/s

Additive

Constraint

value

20Mb/s

OPTIMAL

E1 QoSE2

20+18 Mb/s

38Mb/s

pm_qos_update_requirement(bw,18)

max(18,20)

Page 21: Constrained Power Management

Introduction Motivations Proposal Conclusions

Emerging system-wide optimization support

Limitations of the PM QoS Interface

“The notion of constraint based PM has been rattling around for a whilenow. PMQoS is just an early application of it. I think a lot more could

be done in this area.” M. Gross

◦ Missing support for platform-specific parameters◦ No additive constraints concepts support◦ Only best-effort approach

current

pm_qos

MAX54Mb/s

Additive

Constraint

value

20Mb/s

OPTIMAL

E1 QoSE2

20+18 Mb/s

38Mb/s

pm_qos_update_requirement(bw,18)

max(18,20)

32Mb/s

38+32 Mb/s

70Mb/s

20+18 Mb/s

38Mb/s

max(20,32)

pm_qos_update_requirement(bw,32)

Page 22: Constrained Power Management

Introduction Motivations Proposal Conclusions

Emerging system-wide optimization support

Limitations of the PM QoS Interface

“The notion of constraint based PM has been rattling around for a whilenow. PMQoS is just an early application of it. I think a lot more could

be done in this area.” M. Gross

◦ Missing support for platform-specific parameters◦ No additive constraints concepts support◦ Only best-effort approach

current

pm_qos

MAX54Mb/s

Additive

Constraint

value

20Mb/s

OPTIMAL

E1 QoSE2

20+18 Mb/s

38Mb/s

pm_qos_update_requirement(bw,18)

max(18,20)

32Mb/s

38+32 Mb/s

70Mb/s

20+18 Mb/s

38Mb/s

max(20,32)

pm_qos_update_requirement(bw,32)

current

E1 QoS

Constraint

value

pm_qos

E2

Page 23: Constrained Power Management

Introduction Motivations Proposal Conclusions

Emerging system-wide optimization support

Limitations of the PM QoS Interface

“The notion of constraint based PM has been rattling around for a whilenow. PMQoS is just an early application of it. I think a lot more could

be done in this area.” M. Gross

◦ Missing support for platform-specific parameters◦ No additive constraints concepts support◦ Only best-effort approach

current

pm_qos

MAX54Mb/s

Additive

Constraint

value

20Mb/s

OPTIMAL

E1 QoSE2

20+18 Mb/s

38Mb/s

pm_qos_update_requirement(bw,18)

max(18,20)

32Mb/s

38+32 Mb/s

70Mb/s

20+18 Mb/s

38Mb/s

max(20,32)

pm_qos_update_requirement(bw,32)

E1 QoS

Constraint

value

pm_qos

E2

pm_qos_update_requirement

notification

Page 24: Constrained Power Management

Introduction Motivations Proposal Conclusions

Emerging system-wide optimization support

Limitations of the PM QoS Interface

“The notion of constraint based PM has been rattling around for a whilenow. PMQoS is just an early application of it. I think a lot more could

be done in this area.” M. Gross

◦ Missing support for platform-specific parameters◦ No additive constraints concepts support◦ Only best-effort approach

current

pm_qos

MAX54Mb/s

Additive

Constraint

value

20Mb/s

OPTIMAL

E1 QoSE2

20+18 Mb/s

38Mb/s

pm_qos_update_requirement(bw,18)

max(18,20)

32Mb/s

38+32 Mb/s

70Mb/s

20+18 Mb/s

38Mb/s

max(20,32)

pm_qos_update_requirement(bw,32)

E1 QoS

Constraint

value

E2

pm_qos

pm_qos_update_requirement

notification

"grant"

unuseful restrictive setting granted value

Page 25: Constrained Power Management

Introduction Motivations Proposal Conclusions

Where are we going?

Our Goals

• Define a formal model for system-wide performance vs powercontrol◦ based on constraints-based approach◦ drivers could collaborate to find the optimal system-wide

configuration

with respect to all QoS requirements

◦ support multi-objective optimizations

• Implementation based on latest Linux kernel◦ overcoming current QoSPM limitations

• Validate the model and the implementation on real hardware◦ STM’s Nomadik platform◦ evaluate overheads and performances

Page 26: Constrained Power Management

Introduction Motivations Proposal Conclusions

CPM in a Nutshell - Architecture

Abstracting the Reality, Modeling the Abstraction

Hierarchical DistributedControl

• Devices’ local control

• Abstracting reality

• Modeling Abstraction

• Model optimization

• Considering QoSrequirements

• Constraint local policies

Framework

Device

Local

Control

Platform Code

Device

Driver

local

policy

Device

Driver

local

policy

Key: information flowabstractiondevice/toolpiece of information

Page 27: Constrained Power Management

Introduction Motivations Proposal Conclusions

CPM in a Nutshell - Architecture

Abstracting the Reality, Modeling the Abstraction

Hierarchical DistributedControl

• Devices’ local control

• Abstracting reality

• Modeling Abstraction

• Model optimization

• Considering QoSrequirements

• Constraint local policies

Framework

PSM/ASMDWR DWRAbstraction Layer

Device

Local

Control

Platform Code

Device

Driver

local

policy

Device

Driver

local

policy

Key: information flowabstractiondevice/toolpiece of information

Page 28: Constrained Power Management

Introduction Motivations Proposal Conclusions

CPM in a Nutshell - Architecture

Abstracting the Reality, Modeling the Abstraction

Hierarchical DistributedControl

• Devices’ local control

• Abstracting reality

• Modeling Abstraction

• Model optimization

• Considering QoSrequirements

• Constraint local policies

Framework

FSCModelling Layer

PSM/ASMDWR DWRAbstraction Layer

Device

Local

Control

Platform Code

Device

Driver

local

policy

Device

Driver

local

policy

Key: information flowabstractiondevice/toolpiece of information

Page 29: Constrained Power Management

Introduction Motivations Proposal Conclusions

CPM in a Nutshell - Architecture

Abstracting the Reality, Modeling the Abstraction

Hierarchical DistributedControl

• Devices’ local control

• Abstracting reality

• Modeling Abstraction

• Model optimization

• Considering QoSrequirements

• Constraint local policies

Framework

global

policyOptimization Layer

FSCModelling Layer

PSM/ASMDWR DWRAbstraction Layer

Device

Local

Control

Platform Code

Device

Driver

local

policy

Device

Driver

local

policy

Key: information flowabstractiondevice/toolpiece of information

Page 30: Constrained Power Management

Introduction Motivations Proposal Conclusions

CPM in a Nutshell - Architecture

Abstracting the Reality, Modeling the Abstraction

Hierarchical DistributedControl

• Devices’ local control

• Abstracting reality

• Modeling Abstraction

• Model optimization

• Considering QoSrequirements

• Constraint local policies

Framework

QoS Requirements

Execution

Context Applications

Libraries Buses

global

policyOptimization Layer

FSCModelling Layer

PSM/ASMDWR DWRAbstraction Layer

Device

Local

Control

Platform Code

Device

Driver

local

policy

Device

Driver

local

policy

Key: information flowabstractiondevice/toolpiece of information

Page 31: Constrained Power Management

Introduction Motivations Proposal Conclusions

CPM in a Nutshell - Architecture

Abstracting the Reality, Modeling the Abstraction

Hierarchical DistributedControl

• Devices’ local control

• Abstracting reality

• Modeling Abstraction

• Model optimization

• Considering QoSrequirements

• Constraint local policies

Framework

Distributed

Agreement

Manager

QoS Requirements

Execution

Context Applications

Libraries Buses

global

policyOptimization Layer

FSCModelling Layer

PSM/ASMDWR DWRAbstraction Layer

Device

Local

Control

Key: information flowabstractiondevice/toolpiece of information

Platform Code

Device

Driver

local

policy

Device

Driver

local

policy

Page 32: Constrained Power Management

Introduction Motivations Proposal Conclusions

CPM in a Nutshell - The Abstraction Layer

System-Wide Metric (SWM)

A parameter describing the behaviors of a running system and usedto track resources availability

• QoS requirements: are expressed as validity ranges on SWMmainly upper/lower bounds

• Different abstraction levels◦ Abstract System-wide Metric (ASM), platform independent

exposed to user-lande.g. ambient light/noise, power source, specific application requirements

◦ Platform System-wide Metric (PSM), platform dependentprivate to platform code and platform driverse.g. bus bandwidth, devices’ latency

• Allow to track QoS inter-dependencies◦ platform drivers and code can translate ASM’s requirements into

PSM’s constraints

Code Example

Page 33: Constrained Power Management

Introduction Motivations Proposal Conclusions

CPM in a Nutshell - The Abstraction Layer

Device Working Region (DWR)

The mapping on SWMs’ range ofa device operating mode

• A device could have differentworking modes◦ different QoS => different

SWM range

• Defined by the device driver

• Implicitly allows devicesdependencies tracking

• Graphic representation

π21

π24

π25

π26

π23

π22

π12π11 π13 π14

d3

working

regions

C31

C32

C33

p1

p2

A device with 3 DWR (cdm) mapping 2 SWM (pi )

Code Example

Page 34: Constrained Power Management

Introduction Motivations Proposal Conclusions

CPM in a Nutshell - The Modelling Layer

Feasible System-wide Configurations (FSC)

The intersection of a least a DWRfor each device

• QoS requirements within a FSC◦ all devices can support the

required QoS level◦ no conflicts

• identify all and only the feasiblesystem’s working modes◦ all the possible solutions for the

PM optimization problem◦ define an abstract model for

system-wide optimizations

d1

C11 C12

d2

C22

C21

C23

d3

working

regions

C31

C32

C33

p1

p2

FSC 3

FSC 2

FSC 1

The 3 FSCs existing on this system

Page 35: Constrained Power Management

Introduction Motivations Proposal Conclusions

CPM in a Nutshell - The Optimization Layer

A Formal Optimization Framework

• Using Linear Programming (LP)◦ well known mathematical multi-objective optimization framework

• Two-fold goal◦ formally justify the proposal

• through the equivalence with a well known exact method for optimalsolution search

◦ guide the design of an efficient implementation• we don’t want to solve an LP problem• identify possible simplifications• exploit problem specificities

Use LP formulation to identify a solution-equivalent and efficientoptimization strategy

Go to Formulation

Page 36: Constrained Power Management

Introduction Motivations Proposal Conclusions

CPM in a Nutshell - The Optimization Layer

Putting it All Together

1. DWRs registration

2. FSC identification

3. Constraint aggregation

4. FSC validation

5. FSC selection◦ optimization policy −→og

• Different time domains◦ boot-time: steps 1-2◦ run-time: steps 3-5

• step 5 can be simplifiedby FSC pre-ordering◦ policy defined

e.g. FSC3, FSC1, FSC2

d1

C11 C12

d2

C22

C21

C23

d3

working

regions

C31

C32

C33

p1

p2

Page 37: Constrained Power Management

Introduction Motivations Proposal Conclusions

CPM in a Nutshell - The Optimization Layer

Putting it All Together

1. DWRs registration

2. FSC identification

3. Constraint aggregation

4. FSC validation

5. FSC selection◦ optimization policy −→og

• Different time domains◦ boot-time: steps 1-2◦ run-time: steps 3-5

• step 5 can be simplifiedby FSC pre-ordering◦ policy defined

e.g. FSC3, FSC1, FSC2

d1

C11 C12

d2

C22

C21

C23

d3

working

regions

C31

C32

C33

p1

p2

FSC 3

FSC 2

FSC 1

Page 38: Constrained Power Management

Introduction Motivations Proposal Conclusions

CPM in a Nutshell - The Optimization Layer

Putting it All Together

1. DWRs registration

2. FSC identification

3. Constraint aggregation

4. FSC validation

5. FSC selection◦ optimization policy −→og

• Different time domains◦ boot-time: steps 1-2◦ run-time: steps 3-5

• step 5 can be simplifiedby FSC pre-ordering◦ policy defined

e.g. FSC3, FSC1, FSC2

d1

C11 C12

d2

C22

C21

C23

d3

working

regions

C32

C33

C31

π1M

π2M

π1c

v1

v3

v3

p1

p2

FSC 3

FSC 2

FSC 1

Page 39: Constrained Power Management

Introduction Motivations Proposal Conclusions

CPM in a Nutshell - The Optimization Layer

Putting it All Together

1. DWRs registration

2. FSC identification

3. Constraint aggregation

4. FSC validation

5. FSC selection◦ optimization policy −→og

• Different time domains◦ boot-time: steps 1-2◦ run-time: steps 3-5

• step 5 can be simplifiedby FSC pre-ordering◦ policy defined

e.g. FSC3, FSC1, FSC2

d1

C11 C12

d2

C22

C21

C23

d3

working

regions

C32

C33

C31

π1M

π2M

π1c

v1

v3

v3

p1

p2

Convex−Hall

FSC 3

FSC 2

FSC 1

Page 40: Constrained Power Management

Introduction Motivations Proposal Conclusions

CPM in a Nutshell - The Optimization Layer

Putting it All Together

1. DWRs registration

2. FSC identification

3. Constraint aggregation

4. FSC validation

5. FSC selection◦ optimization policy −→og

• Different time domains◦ boot-time: steps 1-2◦ run-time: steps 3-5

• step 5 can be simplifiedby FSC pre-ordering◦ policy defined

e.g. FSC3, FSC1, FSC2

d1

C12C11

d2

C22

C21

C23

d3

working

regions

C32

C33

C31

π1M

π2M

π1c

v1

v3

v3

p1

p2

Convex−Hallog

o2

o1

O

O’

FSC 3

FSC 2

FSC 1

Page 41: Constrained Power Management

Introduction Motivations Proposal Conclusions

CPM in a Nutshell - The Optimization Layer

Putting it All Together

1. DWRs registration

2. FSC identification

3. Constraint aggregation

4. FSC validation

5. FSC selection◦ optimization policy −→og

• Different time domains◦ boot-time: steps 1-2◦ run-time: steps 3-5

• step 5 can be simplifiedby FSC pre-ordering◦ policy defined

e.g. FSC3, FSC1, FSC2

d1

C12C11

d2

C22

C21

C23

d3

working

regions

C32

C33

C31

π1M

π2M

π1c

v1

v3

v3

p1

p2

Convex−Hallog

o2

o1

O

O’

FSC 3

FSC 2

FSC 1

Page 42: Constrained Power Management

Introduction Motivations Proposal Conclusions

CPM in a Nutshell - The Optimization Layer

Putting it All Together

1. DWRs registration

2. FSC identification

3. Constraint aggregation

4. FSC validation

5. FSC selection◦ optimization policy −→og

• Different time domains◦ boot-time: steps 1-2◦ run-time: steps 3-5

• step 5 can be simplifiedby FSC pre-ordering◦ policy defined

e.g. FSC3, FSC1, FSC2

d1

C12C11

d2

C22

C21

C23

d3

working

regions

C32

C33

C31

π1M

π2M

π1c

v1

v3

v3

p1

p2

Convex−Hallog

o2

o1

O

O’

FSC 3

FSC 2

FSC 1

Page 43: Constrained Power Management

Introduction Motivations Proposal Conclusions

CPM in a Nutshell - Proof-of-Concepts

A Real Optimization Framework

• Translate the formal (LP) model into an efficient implementation

• Exploit tree different time domains◦ boot time => FSC Identification (FI)◦ policy update time => FSC Ordering (FO)◦ constraint assertion time => FSC Selection (FS)

• Support complexity partitioning◦ high-overhead operations (FI) are executed once

• Modular design◦ split operations on “governor” and policy◦ better support operation optimization

• off-line computation (FI)• HW acceleration, e.g. look-up based implementation (FO, FS)

Go to Overheads Graph

Page 44: Constrained Power Management

Introduction Motivations Proposal Conclusions

CPM in a Nutshell - Proof-of-Concepts

Framework Design

• framework core◦ data types, ASM◦ glue code◦ user-space API

• platform code◦ PSM definition

• device drivers◦ DWR definition◦ constraints auth.

• governor◦ FSC identification

• policy◦ FSC ordering◦ constraints auth.

cpm_core

cpm_sysfs

cpm_policy

cpm_governor

platform_code

cpm_data

4 update

2 register

7 monitor

1 register 3 subscribe

driver

5 update_request

6 notify

Device Drivers

export framework

data

require framework

integration

provide framework

implementation

indirect calldirect callfunctional dependency

Legend

Platform Code

CPM Framework

CPM Policies

Main framework components and their relationship

Page 45: Constrained Power Management

Introduction Motivations Proposal Conclusions

CPM in a Nutshell - Proof-of-Concepts

Framework Design

• framework core◦ data types, ASM◦ glue code◦ user-space API

• platform code◦ PSM definition

• device drivers◦ DWR definition◦ constraints auth.

• governor◦ FSC identification

• policy◦ FSC ordering◦ constraints auth.

cpm_core

cpm_sysfs

cpm_policy

cpm_governor

platform_code

cpm_data

4 update

2 register

7 monitor

1 register 3 subscribe

driver

5 update_request

6 notify

Device Drivers

export framework

data

require framework

integration

provide framework

implementation

indirect calldirect callfunctional dependency

Legend

Platform Code

CPM Framework

CPM Policies

Main framework components and their relationship

Page 46: Constrained Power Management

Introduction Motivations Proposal Conclusions

CPM in a Nutshell - Proof-of-Concepts

Framework Design

• framework core◦ data types, ASM◦ glue code◦ user-space API

• platform code◦ PSM definition

• device drivers◦ DWR definition◦ constraints auth.

• governor◦ FSC identification

• policy◦ FSC ordering◦ constraints auth.

cpm_core

cpm_sysfs

cpm_policy

cpm_governor

platform_code

cpm_data

4 update

2 register

7 monitor

1 register 3 subscribe

driver

5 update_request

6 notify

Device Drivers

export framework

data

require framework

integration

provide framework

implementation

indirect calldirect callfunctional dependency

Legend

Platform Code

CPM Framework

CPM Policies

Main framework components and their relationship

Page 47: Constrained Power Management

Introduction Motivations Proposal Conclusions

CPM in a Nutshell - Proof-of-Concepts

Framework Design

• framework core◦ data types, ASM◦ glue code◦ user-space API

• platform code◦ PSM definition

• device drivers◦ DWR definition◦ constraints auth.

• governor◦ FSC identification

• policy◦ FSC ordering◦ constraints auth.

cpm_core

cpm_sysfs

cpm_policy

cpm_governor

platform_code

cpm_data

4 update

2 register

7 monitor

1 register 3 subscribe

driver

5 update_request

6 notify

Device Drivers

export framework

data

require framework

integration

provide framework

implementation

indirect calldirect callfunctional dependency

Legend

Platform Code

CPM Framework

CPM Policies

Main framework components and their relationship

Page 48: Constrained Power Management

Introduction Motivations Proposal Conclusions

CPM in a Nutshell - Proof-of-Concepts

Framework Design

• framework core◦ data types, ASM◦ glue code◦ user-space API

• platform code◦ PSM definition

• device drivers◦ DWR definition◦ constraints auth.

• governor◦ FSC identification

• policy◦ FSC ordering◦ constraints auth.

cpm_core

cpm_sysfs

cpm_policy

cpm_governor

platform_code

cpm_data

4 update

2 register

7 monitor

1 register 3 subscribe

driver

5 update_request

6 notify

Device Drivers

export framework

data

require framework

integration

provide framework

implementation

indirect calldirect callfunctional dependency

Legend

Platform Code

CPM Framework

CPM Policies

Main framework components and their relationship

Page 49: Constrained Power Management

Introduction Motivations Proposal Conclusions

Conclusions and Future Work

Resuming the Proposal

• Distributed approach for performances vs power trade-off control◦ supports constraint based PM◦ scalable on upcoming more and more complex architectures◦ provides multi-objective optimizations

• Layered design◦ optimization layer on top of an abstraction layer◦ improved code reuse and portability

• Simple platform code and drivers interface◦ few modifications required◦ easily exploits platform and devices fine-details

• Validated using a formal optimization model

• Up-to-date implementation, rebased on mainline Linux kernel◦ providing a sysfs interface and some dummy test modules to support

testing and benchmarking

Page 50: Constrained Power Management

Introduction Motivations Proposal Conclusions

Conclusions and Future Work

Looking Forward

• The implementation is going to be released in ML for RFC◦ basic implementation of the designed software architecture◦ public GIT repository: still missing!◦ discuss, review, rework. . . community feedbacks are welcome!

• Find real-world applications◦ the constrained PM concept should be pushed

. . . the QoS PM interface is almost unused

◦ try it: it’s free!

• Provide guidelines for DWR definition◦ distributed control assign different target to different levels◦ local policies should fit well within the model

• Improve the user-space interface◦ integration within a resource management system framework◦ automate constraint assertion

• Investigate on HW acceleration possibilities

Page 51: Constrained Power Management

Add-ons

Q&A

Page 52: Constrained Power Management

Add-ons

Linear Programming (LP) Formulation

• The PM optimization problem can be formulated as an LP problem

• LP elements:◦ solution space – SWMs Domain◦ objective function – vector representing QoS optimization directions◦ constraints – QoS requirements

• dynamically reduce the number of valid FSCs

◦ convex hall – the smallest convex polygon including all valid FSCs◦ valid solution – every point inside the convex hall◦ optimal solutions – vertexes or edges of the convex hall

• can always be mapped to 1 or 2 FSCs

Go to Motivations

Page 53: Constrained Power Management

Add-ons

CPM Overheads

• Worst-Case Analysis◦ synthetic drivers to configure the worst operating conditions◦ running on VirtualBox, host: Intel Core [email protected]◦ note: non-Cartesian logarithmic X axis

Hoverheads % wrt 60s timeframe

Go to Implementation Notes

Page 54: Constrained Power Management

Add-ons

Implementation Summary

$ git diff 4be3bd78.. --stat

Documentation/cpm/00-INDEX.txt | 61 +

Documentation/cpm/core.txt | 264 +++

Documentation/cpm/governors.txt | 146 ++

Documentation/cpm/overview.txt | 131 ++

Documentation/cpm/platform.txt | 123 ++

Documentation/cpm/policies.txt | 131 ++

Documentation/cpm/testing.txt | 67 +

Documentation/cpm/user-guide.txt | 139 ++

drivers/Kconfig | 2 +

drivers/Makefile | 1 +

drivers/cpm/Kconfig | 112 ++

drivers/cpm/Makefile | 10 +

drivers/cpm/cpm_core.c | 3402 +++++++++++++++++++++++++++++++++

drivers/cpm/cpm_governor_exhaustive.c | 420 ++++

drivers/cpm/cpm_policy_dummy.c | 122 ++

drivers/cpm/cpm_policy_performance.c | 199 ++

drivers/cpm/test/Kconfig | 38 +

drivers/cpm/test/Makefile | 7 +

drivers/cpm/test/cpm_test_bandwidth.c | 218 +++

drivers/cpm/test/cpm_test_dummy.c | 459 +++++

drivers/cpm/test/cpm_test_mp3gsm.c | 316 +++

include/linux/cpm.h | 491 +++++

22 files changed, 6859 insertions(+), 0 deletions(-)

Page 55: Constrained Power Management

Add-ons

Example - System-Wide Metrics Definitions

// SWM Identifiers definitions

#define SWM_AMBA_BANDWIDTH CPM_ASM_TOT+0

#define SWM_ADSP_CLK CPM_ASM_TOT+1

// Platform specific SWM (PSM) definition

struct cpm_swm cpm_platform_psm[] = {

CPM_PLATFORM_SWM("AMBA_BANDWIDTH", CPM_TYPE_GIB, CPM_USER_RW,

CPM_COMPOSITION_ADDITIVE, 0, 8000),

CPM_PLATFORM_SWM("ADSP_CLK", CPM_TYPE_GIB, CPM_USER_RO,

CPM_COMPOSITION_ADDITIVE, 0, 266),

};

// PSM Registration

struct cpm_platform_data cpm_platform_data = {

.swms = cpm_platform_psm,

.count = ARRAY_SIZE(cpm_platform_psm),

};

cpm_register_platform_psms(&cpm_platform_data);

Go to Definition

Page 56: Constrained Power Management

Add-ons

Example - Device Working Region

struct cpm_swm_range vdsp_dwr0_ranges[] = { /* V-DSP MPEG4 decoding mode */

DEV_DWR_ASM(CPM_VCODEC, 1, 1, CPM_ASM_TYPE_RANGE),

DEV_DWR_ASM(CPM_DSP_CLK, 40, 132, CPM_ASM_TYPE_RANGE),

};

struct cpm_swm_range vdsp_dwr1_ranges[] = { /* V-DSP OFF mode */

DEV_DWR_ASM(CPM_VCODEC, 0, 0, CPM_ASM_TYPE_RANGE),

DEV_DWR_ASM(CPM_DSP_CLK, 0, 132, CPM_ASM_TYPE_RANGE),

};

struct cpm_dev_dwr vdsp_dwrs_list[] = { /* V-DSP working mode */

DEV_DWR("Mpeg4", vdsp_dwr0_ranges, ARRAY_SIZE(vdsp_dwr0_ranges)),

DEV_DWR("OFF", vdsp_dwr1_ranges, ARRAY_SIZE(vdsp_dwr1_ranges)),

};

static struct cpm_dev_data vdsp_data = { /* V-DSP DWR’s registration */

.notifier_callback = vdsp_cpm_callback,

.dwrs = vdsp_dwrs_list,

.dwrs_count = ARRAY_SIZE(vdsp_dwrs_list),

};

ret = cpm_register_device(&vdsp.dev, &vdsp_data);

Go to Definition

Page 57: Constrained Power Management

Add-ons

Example - Real Use-Case

• Youtube and Torrent◦ 3 ASM:

• acodec, vcodec,bandwidth

◦ 2 PSM:

• cpu freq,cpu dsp platform

◦ devices(dwr):

• modem(5), vcodec(4),acodec(4), cpu(7),platform(7)

◦ Identified FSC: 415

• 10% out of 3920 ofworst case analysis