“Scheduling with Dynamic Voltage/Speed Adjustment Using Slack Reclamation In Multi-processor...

26
1 heduling with Dynamic Voltage/Speed Adjustme Using Slack Reclamation In Multi-processor Real-Time Systems” Dakai Zhu, Rami Melhem, and Bruce Childers Computer Science Department University of Pittsburgh Presented by Jin W. Lee October, 2001

description

“Scheduling with Dynamic Voltage/Speed Adjustment Using Slack Reclamation In Multi-processor Real-Time Systems” Dakai Zhu, Rami Melhem, and Bruce Childers Computer Science Department University of Pittsburgh Presented by Jin W. Lee October, 2001. Outline. - PowerPoint PPT Presentation

Transcript of “Scheduling with Dynamic Voltage/Speed Adjustment Using Slack Reclamation In Multi-processor...

Page 1: “Scheduling with Dynamic Voltage/Speed Adjustment  Using Slack Reclamation  In Multi-processor Real-Time Systems” Dakai Zhu, Rami Melhem, and Bruce Childers

1

“Scheduling with Dynamic Voltage/Speed Adjustment Using Slack Reclamation

In Multi-processor Real-Time Systems”

Dakai Zhu, Rami Melhem, and Bruce ChildersComputer Science Department

University of Pittsburgh

Presented by Jin W. LeeOctober, 2001

Page 2: “Scheduling with Dynamic Voltage/Speed Adjustment  Using Slack Reclamation  In Multi-processor Real-Time Systems” Dakai Zhu, Rami Melhem, and Bruce Childers

2

Outline

1. Task Model and Problem Description2. Energy Model and Power Management3. Power aware scheduling for independent tasks4. Power aware scheduling for dependent tasks5. Conclusion

Page 3: “Scheduling with Dynamic Voltage/Speed Adjustment  Using Slack Reclamation  In Multi-processor Real-Time Systems” Dakai Zhu, Rami Melhem, and Bruce Childers

3

Task Model and Problem Description

- Ti = (ci, ai) ci is the task’s worst case execution time (WCET) based on full CPU speed ai is actual case execution time (ACET)

- Problem: Scheduling Scheme for Multi-Processor Systems that Minimizes energy consumption for CPU while still meet Deadline

Page 4: “Scheduling with Dynamic Voltage/Speed Adjustment  Using Slack Reclamation  In Multi-processor Real-Time Systems” Dakai Zhu, Rami Melhem, and Bruce Childers

4

Processor Power DissipationPd= Cef*Vdd

2* f - Cef is the switch capacitance - f is processor frequency

-Vdd is processor supply voltage

Processor Speed f = k (Vdd –Vt )2/ Vdd

- k is a constant - Vt is the threshold voltage

Energy per TaskE/task = Pd * t = Cef* Vdd

2

- t is the time to execute the task

Energy Model and Power Management

Page 5: “Scheduling with Dynamic Voltage/Speed Adjustment  Using Slack Reclamation  In Multi-processor Real-Time Systems” Dakai Zhu, Rami Melhem, and Bruce Childers

5

Basic Idea

Deadline D

Cpu time units for task= X

Smax

Cpu time units for task= X

t

Page 6: “Scheduling with Dynamic Voltage/Speed Adjustment  Using Slack Reclamation  In Multi-processor Real-Time Systems” Dakai Zhu, Rami Melhem, and Bruce Childers

6

Slack Reclamation Schemes

– Task’s Dynamic Behavior Actual Execution Time: 40% [9] – Slack Unused time considered as slack and can be reused by the following tasks at run-time – Reclaim Slack Greedy Scheme Shared Scheme

Page 7: “Scheduling with Dynamic Voltage/Speed Adjustment  Using Slack Reclamation  In Multi-processor Real-Time Systems” Dakai Zhu, Rami Melhem, and Bruce Childers

7

P1

P2

T1=(10, 7), T2=(8,4), T3=(6,6), T4=(6,6), T5=(6,6)

Ready Queue

T3

T4

T5

0 20 Time

P1

P2

T1 T2

T3 T4 T5

0 20 Time

T1

T2

T1 T2 T3 T4 T5

LTF priority assignment Optimal priority assignment

P1

P2

T1

T2 T3

T4

T5

0 20 Time

Actual execution with max cpu speed

Basic Scheduling Schemes

Page 8: “Scheduling with Dynamic Voltage/Speed Adjustment  Using Slack Reclamation  In Multi-processor Real-Time Systems” Dakai Zhu, Rami Melhem, and Bruce Childers

8

P1

P2

T1=(5, 2), T2=(4,4), T3=(3,3), T4=(2,2), T5=(2,2), T6=(2,2)

Ready Queue

0 9 Time

P1

P2

0 9 Time

T1 T2 T3 T4 T5

Canonical Execution Actual Execution with NPM

T6

T1

T2 T3

T4 T5

T6 T2

T3

T4

T5T1

T6

Example for Global Scheduling with Slack Reclamationfor Independent Tasks

Page 9: “Scheduling with Dynamic Voltage/Speed Adjustment  Using Slack Reclamation  In Multi-processor Real-Time Systems” Dakai Zhu, Rami Melhem, and Bruce Childers

9

P1

P2

0 9 Time

Global Scheduling with Greedy Slack Reclamation

T1

T2

P1

P2

0 9 Time

T1

T2

T3 T6

T4 T5

P1

P2

0 9 Time

T1

T2

T3

T1 T3

We know c1 for T1 and c3 for T3c1+c3 is the time T3 must be finishedIf T3 can start time 2, we can expend execution timefor T3 to time 7 like below graph.

T1 T3

Miss Deadline !!

2 3 3

T1=(5, 2), T2=(4,4), T3=(3,3), T4=(2,2), T5=(2,2), T6=(2,2)

Page 10: “Scheduling with Dynamic Voltage/Speed Adjustment  Using Slack Reclamation  In Multi-processor Real-Time Systems” Dakai Zhu, Rami Melhem, and Bruce Childers

10

P1

P2

0 9 Time

Global Scheduling with Shared Slack Reclamation

T1

T2

P1

P2

0 9 Time

T1

T2

P1

P2

0 9 Time

T2

T3 T5

T6

T1

T4

Meet Deadline !!

2

T1=(5, 2), T2=(4,4), T3=(3,3), T4=(2,2), T5=(2,2), T6=(2,2)

4 5 4 5

Page 11: “Scheduling with Dynamic Voltage/Speed Adjustment  Using Slack Reclamation  In Multi-processor Real-Time Systems” Dakai Zhu, Rami Melhem, and Bruce Childers

11

1 While (Ready-Q is not Empty) 2 {3 Tk = Dequeue (Ready-Q);4 If ( STNTid > STNT~id )5 STNTid STNT~id ; 6 EETk = STNTid + ck ; 7 STNTid = EETk;8 Sid = Smax * ck / ( EETk - t );9 Execute(Tk, Sid);10 }

Global Scheduling with Shared Slack ReclamationAlgorithm Implementation

Page 12: “Scheduling with Dynamic Voltage/Speed Adjustment  Using Slack Reclamation  In Multi-processor Real-Time Systems” Dakai Zhu, Rami Melhem, and Bruce Childers

12

T1=(5, 2), T2=(4,4), T3=(3,3), T4=(2,2), T5=(2,2), T6=(2,2)

Ready Queue T1 T2 T3 T4 T5 T6

Time 0 Task 1(c1=5) dequeue id = 1 STNT1 = 0, STNT2 = 0 EET1 = 0 + 5 STNT1 = 5 Cpu Speed 5/(5-0) 100 % Task 2(c2=4) dequeue id = 2 STNT1 = 5, STNT2 = 0 EET2 = 0 + 4 STNT2 = 4 Cpu Speed 4/(4-0) 100 %

P1

P2

0 9

T1

T2

Algorithm : Example Step 1

Page 13: “Scheduling with Dynamic Voltage/Speed Adjustment  Using Slack Reclamation  In Multi-processor Real-Time Systems” Dakai Zhu, Rami Melhem, and Bruce Childers

13

Time 2 Task 3(c1=3) dequeue id = 1 STNT1 = 5, STNT2 = 4 Switch STNT for sharing Slack !! STNT1 = 4, STNT2 = 5 EET3 = 4 + 3 STNT1 = 7 Cpu Speed 3/(7-2) 60 %

T1=(5, 2), T2=(4,4), T3=(3,3), T4=(2,2), T5=(2,2), T6=(2,2)

Ready Queue T4 T5 T6

T1P1

P2

0 9 Time

T2

Algorithm : Example Step 2

T1P1

P2

0 9 Time

T2

T3

4 5

Page 14: “Scheduling with Dynamic Voltage/Speed Adjustment  Using Slack Reclamation  In Multi-processor Real-Time Systems” Dakai Zhu, Rami Melhem, and Bruce Childers

14

Time 4 Task 4(c1=2) dequeue id = 2 STNT1 = 7, STNT2 = 5 EET4 = 5 + 2 STNT2 = 7 Cpu Speed 2/(7-4) 67 %

T1=(5, 2), T2=(4,4), T3=(3,3), T4=(2,2), T5=(2,2), T6=(2,2)

Ready Queue T5 T6

T1P1

P2

0 9 Time

T2

T3

T4

Algorithm : Example Step 3

Page 15: “Scheduling with Dynamic Voltage/Speed Adjustment  Using Slack Reclamation  In Multi-processor Real-Time Systems” Dakai Zhu, Rami Melhem, and Bruce Childers

15

T1=(5, 2), T2=(4,4), T3=(3,3), T4=(2,2), T5=(2,2), T6=(2,2)

Ready Queue

Time 7 Task 5(c1=2) dequeue id = 1 STNT1 = 7, STNT2 = 7 EET5 = 2 + 7 STNT1 = 9 Cpu Speed 2/(9-7) 100 % Task 6(c2=2) dequeue id = 2 STNT1 = 9, STNT2 = 7 EET6 = 2 + 7 STNT2 = 9 Cpu Speed 2/(9-7) 100 %

T1P1

P2

0 9 Time

T2

T3 T5

T6T4

Meet Deadline !!

Algorithm : Example Step 4

Page 16: “Scheduling with Dynamic Voltage/Speed Adjustment  Using Slack Reclamation  In Multi-processor Real-Time Systems” Dakai Zhu, Rami Melhem, and Bruce Childers

16

Example for Global Scheduling with Slack Reclamationfor Dependent Tasks

T2

T1

T3

T4

T6

T5

(2,2)

(3,1)

(3,3)

(4,4)(6,6)

(6,6)

Precedence Graph

Page 17: “Scheduling with Dynamic Voltage/Speed Adjustment  Using Slack Reclamation  In Multi-processor Real-Time Systems” Dakai Zhu, Rami Melhem, and Bruce Childers

17

P1

P2

T1=(3,1), T2=(2,2), T3=(4,4), T4=(3,3), T5=(6,6), T6=(6,6)

Worst Case Ready Time

0 12 Time

P1

P2

0 12 Time

T1 T2 T3 T4

T5

Canonical Execution Actual Execution with NPM

T6

T1

T2 T3

T4

T5

T6

T1

T2

T5

T3 T4

T6

Actual Case Ready Time

T1 T2 T3 T4 T6T5

List Scheduling for Dependent Tasks

0 2 3 6 0 1 2 6

Miss Deadline !!

List scheduling is a standard algorithm used to schedule task sets with precedence constraints

Page 18: “Scheduling with Dynamic Voltage/Speed Adjustment  Using Slack Reclamation  In Multi-processor Real-Time Systems” Dakai Zhu, Rami Melhem, and Bruce Childers

18

P1

P2

0 12 TimeActual Execution with NPM

T1

T2

T5

T3 T4

T6

Ready Time

T1 T2 T3 T4 T6T5

0 1 2 6

Miss Deadline !!

T1=(3,1), T2=(2,2), T3=(4,4), T4=(3,3), T5=(6,6), T6=(6,6)

List Scheduling with Shared Slack Reclamationfor Dependent Tasks

Page 19: “Scheduling with Dynamic Voltage/Speed Adjustment  Using Slack Reclamation  In Multi-processor Real-Time Systems” Dakai Zhu, Rami Melhem, and Bruce Childers

19

Ready Time

T1 T2 T3 T4 T6T5

0 1 2 6

T1=(3,1), T2=(2,2), T3=(4,4), T4=(3,3), T5=(6,6), T6=(6,6)

Fixed-Order List Scheduling with Shared Slack Reclamation for Dependent Tasks

Global Queue

T1 T2 T3 T4 T6T5

0 2 1 6

Global Queue

Page 20: “Scheduling with Dynamic Voltage/Speed Adjustment  Using Slack Reclamation  In Multi-processor Real-Time Systems” Dakai Zhu, Rami Melhem, and Bruce Childers

20

1 If (Head(Global-Q) is ready) 2 {3 Tk = Dequeue (Global-Q);4 If ( STNTid > STNT~id )5 STNTid STNT~id ; 6 EETk = max{ RTc

k, STNTid, t } + ck ; 7 STNTid = EETk;8 Sid = Smax * ck / ( EETk - t );9 If((Head(Global-Q) is ready) AND (P~id is idle))10 Signal(P~id);11 Execute(Tk, Sid);12 } else wait();

List Scheduling with Shared Slack ReclamationAlgorithm Implementation

Page 21: “Scheduling with Dynamic Voltage/Speed Adjustment  Using Slack Reclamation  In Multi-processor Real-Time Systems” Dakai Zhu, Rami Melhem, and Bruce Childers

21

Global Queue

Time 0 Task 1(c1=3) dequeue id = 1 STNT1 = 0, STNT2 = 0 EET1 = max{0, 0, 0} + 3 STNT1 = 3 Cpu Speed 3/(3-0) 100 % Task 2(c2=2) dequeue id = 2 STNT1 = 3, STNT2 = 0 EET2 = max{0, 0, 0} + 2 STNT2 = 2 Cpu Speed 2/(2-0) 100 %

Algorithm : Example Step 1T1=(3,1), T2=(2,2), T3=(4,4), T4=(3,3), T5=(6,6), T6=(6,6)

Ready Time

T1 T2 T3 T4 T6T5

0 2 1 6

P1

P2

0 12 Time

T1

T2

2 3

Page 22: “Scheduling with Dynamic Voltage/Speed Adjustment  Using Slack Reclamation  In Multi-processor Real-Time Systems” Dakai Zhu, Rami Melhem, and Bruce Childers

22

Global Queue

Time 1 Head(Global-Q) is not ready so id = 1 is wait();

Algorithm : Example Step 2T1=(3,1), T2=(2,2), T3=(4,4), T4=(3,3), T5=(6,6), T6=(6,6)

Ready Time

T3 T4 T6T5

2 1 6

P1

P2

0 12 Time

T1

T2

6

Page 23: “Scheduling with Dynamic Voltage/Speed Adjustment  Using Slack Reclamation  In Multi-processor Real-Time Systems” Dakai Zhu, Rami Melhem, and Bruce Childers

23

Global Queue

Time 2 Head(Global-Q) is ready Task 3(c1=4) dequeue id = 1 STNT1 = 3, STNT2 = 2 Switch STNT for sharing Slack !! STNT1 = 2, STNT2 = 3 EET3 = max{2, 2, 2} + 4 STNT1 = 6 Cpu Speed 4/(6-2) 100 %

Algorithm : Example Step 2T1=(3,1), T2=(2,2), T3=(4,4), T4=(3,3), T5=(6,6), T6=(6,6)

Ready Time

T3 T4 T6T5

2 1 6

P1

P2

0 12 Time

T1

T2

T3

2 3 6

Page 24: “Scheduling with Dynamic Voltage/Speed Adjustment  Using Slack Reclamation  In Multi-processor Real-Time Systems” Dakai Zhu, Rami Melhem, and Bruce Childers

24

Global Queue

Time 2 Task 4(c1=3) dequeue id = 2 STNT1 = 6, STNT2 = 3 EET4 = max{2, 3, 2} + 3 STNT2 = 6 Cpu Speed 3/(6-2) 75 %

Algorithm : Example Step 3T1=(3,1), T2=(2,2), T3=(4,4), T4=(3,3), T5=(6,6), T6=(6,6)

Ready Time

T4 T6T5

1 6

P1

P2

0 12 Time

T1

T2 T4

2 3 6

T3

Page 25: “Scheduling with Dynamic Voltage/Speed Adjustment  Using Slack Reclamation  In Multi-processor Real-Time Systems” Dakai Zhu, Rami Melhem, and Bruce Childers

25

Global Queue

Time 6 Task 5(c1=6) dequeue id = 1 STNT1 = 6, STNT2 = 6 EET5 = max{1, 6, 6} + 6 STNT1 = 12 Cpu Speed 6/(12-6) 100 % Task 6(c1=6) dequeue id = 2 STNT1 = 12, STNT2 = 6 EET6 = max{6, 6, 6} + 6 STNT2 = 12 Cpu Speed 6/(12-6) 100 %

Algorithm : Example Step 4T1=(3,1), T2=(2,2), T3=(4,4), T4=(3,3), T5=(6,6), T6=(6,6)

Ready Time

T6T5

1 6

P1

P2

0 12 Time

T1

T2

T3

T4

T5

T6

Meet Deadline !!

Page 26: “Scheduling with Dynamic Voltage/Speed Adjustment  Using Slack Reclamation  In Multi-processor Real-Time Systems” Dakai Zhu, Rami Melhem, and Bruce Childers

26

Conclusion

- Good Performance Result. Up to 60% power saving in simulation.

- Problem for LSSR Need to reorder ready queue before start scheduling.

Enhanced List Scheduling with Shared Slack Reclamation This technique does not need reordering queue