Feedback EDF Scheduling Exploiting Dynamic Voltage Scaling

Download Report

Transcript Feedback EDF Scheduling Exploiting Dynamic Voltage Scaling

Feedback EDF Scheduling Exploiting
Dynamic Voltage Scaling
Yifan Zhu and Frank Mueller
Department of Computer Science
Center for Embedded Systems Research
North Carolina State University
Overview






Motivation
Background
Feedback-DVS
Example
Experiments
Summary
Motivation



Embedded systems w/ limited power supply
DVS for real-time system
 trade-off: energy saving vs. timing requirements
 lower CPU voltage/frequency  deadline may miss
Task workloads change dynamically
 WCET overestimates actual execution time
 wide variation of execution times
• Longest vs. shortest times
Motivation

Real-world examples:
 graphics: 78% of WCET [Wegener,Mueller];
 defense: 87%; automotive: 74%;
 benchmarks: 30-89%; image recognition: 85% [Wolf]
1.2
Prior DVS algorithms:
lack adaptability to
dynamic workloads.
c==50%WCET
1
Energy (normalized)

c in [20%WCET, 80%WCET]
0.8
0.6
0.4
0.2
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
WCET Utilization
Look-ahead DVS [Pillai/ Shin]
Background



DVS:
 E ~ f  V²
Hard real-time systems
 periodic, preemptive, independent tasks [Liu, Layland]
 jobs: periodically released instances of a task
 WCET: measured at full freq., w/o DVS
 most practical system: U << 1
Earliest-deadline-first (EDF) scheduling

Ci
i P  1
i

fk
Ci
  ,  = f max (0<  1)  scaled by frequency

i 1 Pi
n
, Ci=WCET, Pi=period
Feedback-DVS Framework


V/F selector:
error  c – Ca
Ca = func(error)
Fig. Feedback-DVS Framework

Maximum EDF schedule
 determine slack in EDF schedule
 assumes: c = WCET
Voltage-Frequency Selector
C
C
1
k
i
 
1
 : 
Pk i{1,...,n}\{ k } Pi



Greedy scheme:
 assign all idle time/slack to running task
Assuming all other tasks at the maximal freq. (speed)
Capitalize on early completion of current task
 early completion  more slack for other tasks
 repeat scaling on next task
Task Splitting


T  Ta + Tb
 Ta at freq.  ( 0   100%); Tb at freq. 100%
 More aggressive:
•  < uniform frequency w/o splitting
 Objective:
• T should finish before Tb
lower energy consumption 100% f
Solve for 

Tb
 Ck = Ca+Cb (w/o slack)
Ta
 Ck+slack = Ca/ +Cb
Ca/  Cb
 = Ca/(Ca+slack)
t
Slack Collection


Static and dynamic slack
 U<100%  static slack
 Idle task: fills gap between actual U and 100% U
 Early completion  dynamic slack
 Slack passing
Preemption handling
 Reserve future execution time for preempted task
 Avoid over-utilizing slack by high priority tasks
 Backward sweep reservation
Example (w/o Feedback)
T1={C=3,P=8,c=2}
T3={C=1,P=14,c=1}
f
100%
75%
50%
25%
I
T1
0
T2={C=3,P=10,c=2}
IdleT={C=1,P=4,c=0}
I
T2
I T3
T1
I
Ca=50%WCET
T2
5
10
15
Maximal Schedule (EDF with idle task)
t
f
100%
75%
50%
25%
2
0.5+2
We can do better!
1+2
t
0
5
10
Actual Schedule (w/o Feedback)
15
Feedback Control





Scaling factor: =Ca/(Ca+slack)
Feedback control: to adjust Ca
 0<Ca<=WCET
Objective:
 Ca  actual exec. time (c)
But actual exec. time changes dynamically
 high processing demands up to some point
 receding processing demands afterwards
PID Feedback control
 to improve adaptability to exec. time fluctuations
PID Feedback





c
Controlled variable: Ca
Set point: c
Ca +  PID
System error:  = c – Ca
When Ca  c:
 T = Ta, no Tb, entire task at low freq./speed
PID: Proportional + Integral + Derivative
 Proportional control: K   ij


Integral control:
1 IW
   ij
I
j 1
Derivative control:
D
 ij   i , j  DW
DW
Ca
Feedback Example
T1={C=3,P=8,c=2}
T3={C=1,P=14,c=1}
f
100%
75%
50%
25%
100%
75%
50%
25%
I
T1
I
T2
I T3
T1
I
T2
0
5
10
15
Maximal Schedule (EDF + idle task)
0
3
f
f
100%
75%
50%
25%
T2={C=3,P=10,c=2}
IdleT={C=1,P=4,c=0}
Ca=2,s=2
5 6.5
10
15
Actual Schedule without feedback
Ca=2,s=2
t
t
Ca=1,s=2
480
485
490
495
Actual Schedule with feedback (from the 1st hyperperiod)
t
Algorithm Complexity



Task admission (offline):
 generate maximal schedule: O(N)
• N = # jobs in hyperperiod
Scheduling point (online):
 O(n), n = # tasks
Task splitting overhead:
 only paid when task does not complete within Ta
• hardly even happens
Experiements





Frequency/Voltage levels [Puwelse et al.]:
Parameters: 3 tasks, 10 tasks,
Freq.
Vary U: utilization=0.1~ 1.0
25%
50%
Feedback controller
75%
 DW=1, IW=10
100%
 Kp=0.9, I=0.08, D=0.1
Compare:
 Our feedback-DVS vs.
 Look-ahead DVS [Pillai/Shin]
Voltage
2V
3V
4V
5V
Result (1)
c
Task exec. time pattern 1:

event-triggered activities,
often observed in interruptdriven systems
job
1.2
Our Feedback-DVS
1
Energy (normalized)

Look-ahead RT-DVS
0.8
0.6
0.4
0.2
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
WCET Utilization
0.8
0.9
1
Result (2)
Task exec. time pattern 2:

simulating computational
demands with slowly
decaying 1.2
tendency
job
Our feedback-DVS
1
Energy (normalized)

c
Look-ahead RT-DVS
0.8
0.6
0.4
0.2
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
WCET Utilization
0.8
0.9
1
Result (3)
c
Task exec. time pattern 3:

periodic fluctuating activities
with peak computational
demands 1.2
job
Our Feedback-DVS
Look-ahead RT-DVS
1
Energy (normalized)

0.8
0.6
0.4
0.2
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
WCET Utilization
0.8
0.9
1
Varying Task Sets Property

Varying exec. time
(baseline: pattern 1)

10 tasks vs. 3 tasks
1.2
1.2
Ours,baseline=75%WCET
Ours, baseline=50%WCET
Ours, baseline=25%WCET
Look-ahead, baseline=75%WCET
0.8
10 tasks, ours
10 tasks, Look-ahead
1
Energy (normalized)
Energy (normalized)
1
3 tasks, ours
3 tasks, Look-ahead
0.8
Look-ahead, baseline=50%WCET
Look-ahead, baseline=25%WCET
0.6
0.6
0.4
0.4
0.2
0.2
0
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
WCET Utilization
0.8
0.9
1
0.1
0.2
0.3
0.4
0.5
0.6
WCET Utilization
0.7
0.8
0.9
1
Related Work






Feedback control real-time scheduling [C. Lu et. al.]
DVS with feedback for multimedia systems [Z. Lu et. al.]
Look-ahead DVS [Pillai/Shin]
Exploit early completion of tasks [Aydin et. al.]
Dual-frequency DVS, stochastic approach [Gruian]
Non-preempt. Blocking, dual-speed DVS [Zhang et. al.]
Conclusion
Feedback-DVS
 for hard real-time systems
 more aggressive by task splitting
 more adaptive with feedback control
 Not sensitive to particular workload characteristics
 O(n) online complexity
 Up to 29% more energy savings over prior work
Future Work
 Feedback analytical model
 Real-world architecture evaluation
 Systematic PID parameter tuning

Example (w/o Feedback)
T1={C=4,P=10,c=1}
T3={C=1,P=17,c=1}
f
100%
75%
50%
25%
I
T1
0
T2={C=4,P=14,c=1}
IdleT={C=1,P=4,c=0}
I T1 T2
I
T2 T3 I
Ca=50%WCET
T1
I
5
10
15
Maximal Schedule (EDF with idle task)
t
f
100%
75%
50%
25%
s=3
s=6s=6
it will be better with
feedback!
t
0
5
10
Actual Schedule (w/o Feedback)
15
Feedback Example
T1={C=4,P=10,c=1},
T3={C=1,P=17,c=1},
100%
75%
50%
25%
100%
75%
50%
25%
f
I
T1
I T1 T2
T2 T3 I
I
T1
I
t
0
f
5
Maximal Schedule
0
100%
75%
50%
25%
T2={C=4,P=14,c=1},
IdleT={C=1,P=4,c=0}
5
10
15
10
15
Actual Schedule without feedback
f
Ca=1,s=3
480
Ca=1,s=3
485
t
Ca=1,s=3
490
495
Actual Schedule with feedback (from the 1st hyperperiod)
t