energy efficient real-time scheduling - mit - massachusetts

19
Energy Efficient Real-Time Scheduling Amit Sinha and Anantha Chandrakasan Massachusetts Institute of Technology

Upload: others

Post on 03-Feb-2022

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Energy Efficient Real-Time Scheduling - MIT - Massachusetts

Energy Efficient Real-Time Scheduling

Amit Sinha and Anantha Chandrakasan

Massachusetts Institute of Technology

Page 2: Energy Efficient Real-Time Scheduling - MIT - Massachusetts

2

Outline

! Dynamic voltage and frequency scaling! Overview! Energy workload model

! Real-time algorithms! Performance metrics! Earliest Deadline First (EDF) algorithm

! Slacked Earliest Deadline First (SEDF) algorithm! Bounds on energy savings! Rate Monotonic extensions

Page 3: Energy Efficient Real-Time Scheduling - MIT - Massachusetts

3

Motivation for Energy Efficiency

! Electricity cost of servers, desktops and network equipment! Currently accounts for about 100

TWHr/year in the US

0

10

20

30

40

50

60

70

80

Proc

esso

r Pow

er (W

)

Inte

l386

Pow

erPC

Inte

l486

Pent

ium

Cyr

ix 1

25M

HzPo

wer

PCPe

ntiu

mPr

o Alph

aPo

wer

PC 2

66M

Hz

Pent

ium

233

MH

zPe

ntiu

m II

233

MH

zPe

ntiu

m II

300

MH

zU

ltraS

PAR

CPe

ntiu

m 4

, 1.7

GH

zAl

pha

2126

4AM

DAt

hlon

1.33

GH

z

1994

1995

1996

1997

1998

2001

! Proliferation of portable devices! Battery technology lags behind! 50X µP power vs. 4X in battery

Page 4: Energy Efficient Real-Time Scheduling - MIT - Massachusetts

4

Dynamic Voltage Scaling

ACTIVE IDLE

EFIXED = ½ C VDD2

Fixed Power Supply

ACTIVE

EVARIABLE = ½ C (VDD/2)2 = EFIXED / 4

Variable Power Supply

0.2 0.4 0.8 1.0

0.2

0.4

0.6

0.8

1.0

Normalized Workload

Nor

mal

ized

Ene

rgy

Fixed Supply

VariableSupply

00 0.6

! Variable frequency processors ! Transmeta�s Crusoe

! LongRun Technology

! AMD K6-2+! PowerNOW!

! Mobile Pentium III! SpeedStep

! StrongARM SA-1100! 59 MHz � 206 MHz

Page 5: Energy Efficient Real-Time Scheduling - MIT - Massachusetts

5

Energy Workload Model

( )2

2

00

20 22

+++= r

VVrr

VVrfTCVrE tt

refs

[Gutnik97]

( )

+++=

2

00

0

22r

VVrr

VV

VVrIrI tt

refref

0 0.2 0.4 0.6 0.8 10

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Workload (r)

Nor

mal

ized

Ene

rgy

No Voltage Scaling

Ideal

E(r) = r3

E(r) = r2

Energy vs Workload

! Quadratic model fairly accurate! E-r graph convex

( ) 2rrE ≈

( ) 21 rrEsave −≈

Page 6: Energy Efficient Real-Time Scheduling - MIT - Massachusetts

6

Real-Time DVS Scheduling

! At time ti scheduler decides! Next task that will run on the processor, τi

! Optimum operating voltage and frequency

! Maximize energy savings and real-time efficiency metric

Variable VoltageProcessor

DC

/DC

C

onve

rter

Wor

kloa

dM

onit

or

Vfixed

V(r) w f(r)

r

λ1

λ2

λn

Task Queue

λ

Pro

cess

or U

tiliz

atio

n (

%)

Time (s)

Dialup Server

WorkstationFileserver

Page 7: Energy Efficient Real-Time Scheduling - MIT - Massachusetts

7

Real-Time Metrics

Maximum lateness

Weighted completion time

Number of late tasks

Total completion time

Average response time

Cost FunctionMetric

( )∑=

−=N

iiir af

Nt

1

1

( ) ( )iic aft minmax −=

∑=

=N

iiiw fwt

1

( ) ( ) ≤

== ∑= other

dffmissfmissN iii

N

iilate 1

0

1

( )ii dfL −= maxmax

! Lmax appropriate metric for hard real-time algorithms

Page 8: Energy Efficient Real-Time Scheduling - MIT - Massachusetts

8

Earliest Deadline First

! EDF optimal in minimizing Lmax amongst all possible dynamic priority algorithms [Dertouzos]

c2

c1

a2 d2

a1

г2

г1

EDF schedule

d1

d3a3

г3 c3

г1 г2 г3 г2 г1

Time

Task

s

Page 9: Energy Efficient Real-Time Scheduling - MIT - Massachusetts

9

DVS with Real-Time Deadlines

c2

c1

a2 d1,d2

a1

г2

г1

Earliest Deadline First

Greedy DVS

c2

c1/2

a2 d1,d2

a1

г2

г1r1=0.5

c1/2

! Need an intelligent scheduling algorithm

Page 10: Energy Efficient Real-Time Scheduling - MIT - Massachusetts

10

Proposed Optimal Scheduling

ti-1 ti ti+1 di∆t

τi scheduled

ci

di

i

ii d

cS =

! The Slacked Earliest Deadline First (SEDF) algorithm! Optimum processing rate is approximated by

( ) ( ) ≤<−+

=otherwise

SUSSUSr iiii

iii ,110,1

,

( ) ( ){ }rErP save⋅maxOptimum rate, r

Page 11: Energy Efficient Real-Time Scheduling - MIT - Massachusetts

11

SEDF Analysis

( ) ( ) kdi

ki

d

rck

i ii

i

UUkd

rP −

=

= ∑ 1

! Probability that task τi completes before its deadline for a given slack, r, and utilization Ui

! Expected energy savings

( ) ( )( )21 rrPr −=ξ

! Optimal slack, ropt

( ) ( )( )rPrP

rr

rr ′

=−

⇒=∂

∂21

20ξ

! Optimal slack well approximated by linear solution

Page 12: Energy Efficient Real-Time Scheduling - MIT - Massachusetts

12

Why SEDF is Optimal

! Maximizes expectedenergy savings

Si increasing

Page 13: Energy Efficient Real-Time Scheduling - MIT - Massachusetts

13

SEDF Scheduling Example

! SEDF is optimal in minimizing maximum lateness (Lmax) and processor energy

SEDF Schedule

Arrival time

Deadline

Computation

ProcessorUtilization, U

Page 14: Energy Efficient Real-Time Scheduling - MIT - Massachusetts

14

SEDF Results

0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

Processor Utilization

Ener

gy R

atio

! Energy savings of 60% with 10% Lmax degradation (averaged over 3x106 experiments)

! SEDF approaches EDF as utilization increases

Energy Ratio

Maximum Lateness Ratio

Page 15: Energy Efficient Real-Time Scheduling - MIT - Massachusetts

15

Bounds on Energy Savings

! Averaging is energy efficient because of convex E(r)

T 2T

Time

Wor

kloa

d

1.0

0.5

W1

W2

0.675

Ener

gy

1.0

0.5

W1 W2

0.5625

)()(22

221

22

21 rErErrrr ≥→

+≥+

! Best schedule tries to! Minimize workload variance! Maximize utilization! Use all possible slack

Page 16: Energy Efficient Real-Time Scheduling - MIT - Massachusetts

16

Bounds on Energy Savings [cont ..]

! Maximum energy savings

2

∑∑∑k

kk

kkk k

k crcrc

( ) ∑∑∑ ≥=k

kk

kkk

kk

k rcrcrErc

min

Time

Wor

kloa

d

1.0

0.5

ττττ2

ττττ1

( )k

kk

d

cr

maxmin

∑=

2minmax, 1 rEsave −=

Page 17: Energy Efficient Real-Time Scheduling - MIT - Massachusetts

17

Periodic Scheduling

! Rate Monotonic Analysis (RMA) [Liu73]

−≤∑ 12

1N

i i

i NTc Guaranteed schedulability criteria

Smaller period tasks have higher priority

83.012265.0 21

2

2

1

1 =

−≤=+

Tc

Tc

Example

г1

г2

c1 = 2 T1 = 5

c2 = 1 T2 = 4

RM Schedule

Page 18: Energy Efficient Real-Time Scheduling - MIT - Massachusetts

18

Slacked Rate Monotonic Analysis

! A set of periodic real-time tasks is guaranteed to be schedulable with maximum energy savings iffprocessing rate is set to rmin

=∑

121min

N

ii

i

N

Tc

rTi → PeriodN → Total TasksCi → Computation Time

! Slack processing rate, r, till utilization approaches RM bound

Page 19: Energy Efficient Real-Time Scheduling - MIT - Massachusetts

19

Conclusions

! Dynamic voltage and frequency scheduling can yield quadratic energy savings

! Slacked Earliest Deadline First (SEDF) algorithm is optimal in minimizing expected energy consumption under Lmax criteria

! Optimal slacking possible under Rate Monotonic scheduling for static periodic task sets