real- time dynamic voltage scaling for low- power embedded operating systems written by p. pillai...

25
Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real Time Systems

Upload: alessandro-edenfield

Post on 14-Dec-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real

Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems

Written by P. Pillai and K.G. Shin

Presented by Gaurav Saxena

CSE 666 – Real Time Systems

Page 2: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real

Introduction

Energy consumption is an important issue in embedded systems Mobile and portable device

Laptops, PDA’s

Cellular phones, camcorders

Real Time Dynamic Voltage Scaling (RT-DVS) Reduces Energy consumption by lowering the supply voltage and operating

frequency.

Modify OS’s real-time scheduler and task management service to maintain real-time deadline

Page 3: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real

Facts

High performance is needed for a small fraction of time, while for the rest of time, a low performance, a low power processor would suffice

Low performance is achieved by lowering the operating frequency of the processor when full speed is not needed.

Processors are based on CMOS Logic - has voltage dependent maximum operating frequency– V α f ( so at lower frequency, the processor can operate at lower voltage)

Energy dissipated per cycle E α V2 (Higher the frequency level, higher the energy consumption)

Page 4: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real

RT-DVS Algorithms

Static Voltage Scaling EDF

Cycle conserving RT- DVS

Look Ahead RT - DVS

Page 5: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real

Static Voltage Scaling EDF: Motivation

wc1 wc2 wc3 wc4

Holes in the pre-run schedule imply:

EDF Test:

∑(wci/pi) < 1 at frequency = Fmax

In other words, whenever ∑(wci/pi) < 1 there are holes in the EDF schedule

Next arrival of T1

WCi = worst case computation time @ Fmax

Page 6: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real

Static Voltage Scaling EDF: exploiting holes

wc1 wc2 wc3 wc4

Next arrival of T1

Pre-run schedule with holes

WCi = worst case computation time @ Fmax

Processor typically idles during holes.

Instead, the holes can be exploited to slowdown the processor to save energy

Page 7: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real

Static Voltage Scaling EDF

wc1 wc2 wc3 wc4

K*wc1 K *wc2 K * wc3 K * wc4

EDF Test:

∑(wci/pi) < 1 at maximum frequency = Fmax

Static-VS EDF Test:

K* [∑(wci/pi)] = 1 at frequency = Fmax/K

Next arrival of T1

Page 8: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real

Static EDF: example

Available frequencies: 1.00, 0.75

DT1: 16DT2: 10DT3: 14

DT1: 24DT2: 20DT3: 28

DT1: 16DT2: 20DT3: 28

DT1: 16DT2: 20DT3: 14

3 7 8

4 8

Page 9: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real

What if (Ci < WCi )??

K*c1 K *c2 K * c3 K * c4

Next arrival of T1

More holes left unexploited

Actual computation time

Page 10: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real

What if (Ci < WCi )??

K*c1 K *wc2 K * wc3 K * wc4

Next arrival of T1

Actual computation time

Task T1 completes

Slow down all these tasks proportionally

Hole of size = (wc1 – c1)

Page 11: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real

What if (Ci < WCi )?? (contd..)

K*c1 K’ *wc2 K’ * wc3 K’ * wc4

Next arrival of T1

CPU Cycles are conserved by slowing down the remaining tasks

Page 12: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real

Cycle Conserving RT-DVS

When a task set completes its first release, compare real execution time with worst case specified initially.

Any idle time in that period can be used to conserve energy

Rescale frequency that avoid idle cycles, surplus time is used to run other remaining tasks at lower frequency

Page 13: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real

Cycle conserving EDF: Example

Task set @ (Fmax): T1 = (3,6) and T2 = (6,12)U = 3/6 + 6/12 = 1 @ (Fmax)

T1

0 1 3

Frequenc

y

Fm

Time

T2

10

New utilization = 1/6 + 6/12 = 0.67

Finding the right “k”(1*k)/6 + (6*k)/12 = 1

K = (1/0.67)New freq = (0.67) Fmax

Page 14: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real

DVS-RT Problem Definition

N Tasks each caracterized by: A fixed period Pi

A deadline Di

Worst-case Execution Time (WCET) Ci

Actual Execution Time ACi

Objective: Find the best task scheduling and clock

frequency in order to: Minimizing energy consumption. Meeting all the deadlines.

Page 15: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real

Task set:

TaskWorst case

computation time

Period/Deadli

ne

Invocation 1

(ac1)

Invocation 2

(ac2)

1 3ms 8ms 2ms 1ms

2 3ms 10ms 1ms 1ms

3 1ms 14ms 1ms 1ms

At freq. : fm

Page 16: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real

Look-Ahead EDF

Defer as much works as possible and set initially to the minimum possible frequency.

Hence at later stage if a task uses much less than it worst case, deferred work may never be needed.

It ensures that there are sufficient cycles available for each task to meet its deadline after reserving cycles for higher priority jobs.

Best saving of energy.

Page 17: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real

(a)Plan to defer T3’s execution time until after D1 but, by D3

Look-ahead EDF step 1 of 6

5 10 15ms

D1

0.5

0.75

1.0

freq.

T3

D2 D3

Reservation for T1

Reservation for T2

Page 18: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real

(b) Find u so as to finish T1 by D1 and T2 by D2

Look-ahead EDF step 2 of 6

5 10 15ms

T2

D1

0.5

0.75

1.0

freq.

T3

D2 D3

Reservation for T1

Reservation for T2T1

T2

Page 19: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real

(c) u = 0.75, T1 finishes earlier, find new u for T2 to finish by D2

Look-ahead EDF step 3 of 6

5 10 15ms

T2

D1

0.5

0.75

1.0

freq.

T3

D2 D3

Reservation for T1

Reservation for T2T1

T2

t = 2.67

Page 20: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real

Look-ahead EDF step 4 of 6

5 10 15ms

D1

0.5

0.75

1.0

freq.

T3

D2 D3

Reservation for T1

Reservation for T2T1

t = 4.67

T2

(d) α = 0.5, T2 finishes earlier, enough time until D1, but EDF is work conserving, launch T3 at u = 0.5

Page 21: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real

Look-ahead EDF step 5 of 6

5 10 15ms

0.5

0.75

1.0

freq.

D2 D3

T1

t = 8.00

Reservation for T2

T1T2 T3

(e) Guess for T1 again,

Page 22: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real

Look-ahead EDF step 6 of 6

5 10 15ms

0.5

0.75

1.0

freq.

D2 D3

T1

t = 8.00

T1T2 T3 T2 T3

(f) u= 0. 5, every task is dynamically scheduled successfully

Page 23: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real

Relative performance

schemes

Energy savings Look Ahead EDF

Cycle Conserving EDF

Static Voltage Scaling EDF

Page 24: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real

Implementation

Scheduler hooking in the kernel

Page 25: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real

References and Credits

Real time dynamic voltage scaling for low power embedded operating systems, P. Pillai and K.G. Shin, in ACM SOSP, pages 89-201, 2001.

Dynamic Voltage Scaling Algorithms for Hard Real Time Systems, Andrea Romei, Università di Pisa

RT- DVS Algorithms by Sungwuk Jung

Energy aware real time systems by G. Sudha Anil Kumar, Iowa State University