Computing the Maximum Blocking Time for Scheduling with Deferred - - PowerPoint PPT Presentation
Computing the Maximum Blocking Time for Scheduling with Deferred - - PowerPoint PPT Presentation
Computing the Maximum Blocking Time for Scheduling with Deferred Preemption Sebastian Altmeyer, Claire Burgui` ere, Reinhard Wilhelm Saarland University STFSSD, Tokyo 2009 Motivation preemptive schedule non-preemptive schedule good
Motivation
preemptive schedule good performance/bad predictability non-preemptive schedule bad performance/good predictability tradeoff: deferred preemption
deferred preemption: preemption only at predefined, selected preemption points
Computing Maximum Blocking for Deferred Preemption Altmeyer, Burgui` ere, Wilhelm STFSSD, Tokyo 2009
Schedulability Analysis for Deferred Preemption
Schedulability needs:
- Periods
- Worst Case Execution Time
- Context Switch Costs
- Maximum Blocking Time
T1 T2
BT BT
∗ ∗ ∗ ∗ ∗
Context Switch Costs Task Activation
∗
Preemption Point
Computing Maximum Blocking for Deferred Preemption Altmeyer, Burgui` ere, Wilhelm STFSSD, Tokyo 2009
Overview
Maximum Blocking Time (MBT) = longest non-preemptive path
1 Basics
WCET Analysis Implicit Path Enumeration Technique Cache-Related Preemption Delay
2 Computing Maximum Blocking Time 3 Conclusion
Computing Maximum Blocking for Deferred Preemption Altmeyer, Burgui` ere, Wilhelm STFSSD, Tokyo 2009
WCET Analysis
CFG Value Analysis Loop Analysis Low-Level Analysis Path Analysis WCET
Value Analysis determines values for registers and memory cells Loop Analysis determines loop-bounds Low-Level Analysis determines WCET for basic blocks Path Analysis determines longest path trough the program
Computing Maximum Blocking for Deferred Preemption Altmeyer, Burgui` ere, Wilhelm STFSSD, Tokyo 2009
Implicit Path Enumeration Technique
1 2 y1 3 y2 4 y3 y4 5 y5 y6 1 = x1 x1 = y1 + y2; y1 + y4 = x2 x2 = y3 + y5; y2 = x3 x3 = y6; y3 = x4 x4 = y4; y5 + y6 = x5 x5 = 1; y3 ≤ bl · y1; max
i xici
- node counter xi, edge counter yi
- first node x1 entered once, last node x5 left once.
- nodes executed as often as entered/left
- loop l executed bl times as often as entered
- WCET given by max. sum of xi times ci ( = WCET of node i)
- set of constraints solved using ILP
Computing Maximum Blocking for Deferred Preemption Altmeyer, Burgui` ere, Wilhelm STFSSD, Tokyo 2009
Cache-Related Preemption Delay (CRPD)
a
1
b
2
c
3
d
4
a
5
At basic block (2):
- a may be cached,
may be reused at (5)
- d may be cached,
may be reused at (4) Preemption at (2) ⇒ 2 additional misses may occur
Computing Maximum Blocking for Deferred Preemption Altmeyer, Burgui` ere, Wilhelm STFSSD, Tokyo 2009
Useful Cache Blocks
A memory block is a useful cache block (UCB) at program point P, if it
- may be cached at P, and
- may be reused at program point P′ reached from P.
CRPD at basic block i: CRPDi ≤ costreload × |UCBi|
Computing Maximum Blocking for Deferred Preemption Altmeyer, Burgui` ere, Wilhelm STFSSD, Tokyo 2009
Maximum Blocking Time
Maximum Blocking Time (MBT) = Longest Path from preemption point or program start to preemption point or program end longest path given by: WCET of the basic blocks + CRPD for the sake of simplicity: preemption points only at the beginning or end of a basic block
Computing Maximum Blocking for Deferred Preemption Altmeyer, Burgui` ere, Wilhelm STFSSD, Tokyo 2009
Maximum Blocking Time
- 1. partition preemption points into two sets:
Up = {i| preemption point at beginning of Bi} Lo = {i| preemption point at end of Bi}
- 2. introduce artificial nodes:
1 2 3 4 5 1 2
3u
3 4
4l
5
Up = {3} Lo = {4}
Computing Maximum Blocking for Deferred Preemption Altmeyer, Burgui` ere, Wilhelm STFSSD, Tokyo 2009
1 2 y1
3u
3 y2 4 y3
4l
y4 5 y5 y6
- theoretical start node S, connected to beginnings of all paths
- theoretical end node E, connected to ends of all paths
- structural constraints as before (but with additional nodes)
- MBT given by max. xici + possible CRPD Ci
Computing Maximum Blocking for Deferred Preemption Altmeyer, Burgui` ere, Wilhelm STFSSD, Tokyo 2009
1 2 y1
3u
3 y2 4 y3
4l
y4 5 y5 y6 S x1 + x3 + xl
4 = 1;
- theoretical start node S, connected to beginnings of all paths
- theoretical end node E, connected to ends of all paths
- structural constraints as before (but with additional nodes)
- MBT given by max. xici + possible CRPD Ci
Computing Maximum Blocking for Deferred Preemption Altmeyer, Burgui` ere, Wilhelm STFSSD, Tokyo 2009
1 2 y1
3u
3 y2 4 y3
4l
y4 5 y5 y6 E x1 + x3 + xl
4 = 1;
1 = x4 + x5 + xu
3 ;
- theoretical start node S, connected to beginnings of all paths
- theoretical end node E, connected to ends of all paths
- structural constraints as before (but with additional nodes)
- MBT given by max. xici + possible CRPD Ci
Computing Maximum Blocking for Deferred Preemption Altmeyer, Burgui` ere, Wilhelm STFSSD, Tokyo 2009
1 2 y1
3u
3 y2 4 y3
4l
y4 5 y5 y6 x1 + x3 + xl
4 = 1;
1 = x4 + x5 + xu
3 ;
x1 = y1 + y2; y1 + y4 = x2 x2 = y3 + y5; y2 = xu
3 ;
x3 = y6; y3 = x4; xl
4 = y4;
y5 + y6 = x5; y3 ≤ by1;
- theoretical start node S, connected to beginnings of all paths
- theoretical end node E, connected to ends of all paths
- structural constraints as before (but with additional nodes)
- MBT given by max. xici + possible CRPD Ci
Computing Maximum Blocking for Deferred Preemption Altmeyer, Burgui` ere, Wilhelm STFSSD, Tokyo 2009
1 2 y1
3u
3 y2 4 y3
4l
y4 5 y5 y6 x1 + x3 + xl
4 = 1;
1 = x4 + x5 + xu
3 ;
x1 = y1 + y2; y1 + y4 = x2 x2 = y3 + y5; y2 = xu
3 ;
x3 = y6; y3 = x4; xl
4 = y4;
y5 + y6 = x5; y3 ≤ by1; max
i xici + xl 4C l 4 + x3C u 3
- theoretical start node S, connected to beginnings of all paths
- theoretical end node E, connected to ends of all paths
- structural constraints as before (but with additional nodes)
- MBT given by max. xici + possible CRPD Ci
Computing Maximum Blocking for Deferred Preemption Altmeyer, Burgui` ere, Wilhelm STFSSD, Tokyo 2009
Conclusion
- Essential ingredient for the analysis of deferred preemption
- Only minor extensions to IPET:
- one new variable per preemption point
- no additional constraints
- All data available from WCET / UCB analysis
& Future Work
- implementation and evaluation
- automatic derivation of good preemption points
Computing Maximum Blocking for Deferred Preemption Altmeyer, Burgui` ere, Wilhelm STFSSD, Tokyo 2009
Implicit Path Enumeration - Equations
max
- i
xici (1) xi = 1, where Bi = s (2) xj = 1, where Bj = e (3)
- j∈S
yj = xk, where S = {j|Ej = ( , Bk)} (4) xk =
- j∈S
yj, where S = {j|Ej = (Bk, )} (5) yl ≤ bl(
- j∈S
yj) where S = {j|Ej loop entry edge} (6)
Computing Maximum Blocking for Deferred Preemption Altmeyer, Burgui` ere, Wilhelm STFSSD, Tokyo 2009
Maximum Blocking Time - Equations 1
max
n
- i=1
(xici) +
- Bi∈Lo
xl
i C l i +
- Bi∈Up
xiC u
i
(7) xs +
- Bi∈Lo
xl
i +
- Bi∈Up
xi = 1 (8) xe +
- Bi∈Up
xu
i +
- Bi∈Lo
xi = 1 (9)
Computing Maximum Blocking for Deferred Preemption Altmeyer, Burgui` ere, Wilhelm STFSSD, Tokyo 2009
Maximum Blocking Time - Equations 2
- j∈S
yj = xu
k
if Bk ∈ Up xk
- therwise
(10) where S = {j|Ej = ( , Bk)}
- j∈S
yj = xl
k
if Bk ∈ Lo xk
- therwise
(11) where S = {j|Ej = (Bk, )} yl ≤ bl
j∈S
yj (12) where S = {j|Ej loop entry edge}
Computing Maximum Blocking for Deferred Preemption Altmeyer, Burgui` ere, Wilhelm STFSSD, Tokyo 2009