multiprocessor scheduling real-time systems · eda222/dit161 – real-time systems, chalmers/gu,...
Post on 03-Jan-2020
5 Views
Preview:
TRANSCRIPT
EDA222/DIT161 – Real-Time Systems, Chalmers/GU, 2010/2011 Lecture #15 Updated February 27, 2011
1
Implementation
Specification
• Dynamic scheduling -- Earliest-deadline-first scheduling • Processor-demand analysis
Task Ci Di Ti
1 1 1
1 2 3
2 4 8
Simulate an execution of the tasks:
The tasks are not schedulable even though
U =
12
+14
+18
=78
= 0.875 < 1
misses its deadline!
t 0 6 8 4 2
EDA222/DIT161 – Real-Time Systems, Chalmers/GU, 2010/2011 Lecture #15 Updated February 27, 2011
2
• Let represent the number of instances of that must complete execution before .
• The total processor demand up to is
CP (0, L) = Ni
LCii=1
n
∑
0, L − Di⎡⎣ ⎤⎦
• We can ignore instances of the task that arrived during the interval since for these instances. Di > L
L − Di , L⎡⎣ ⎤⎦
t 0 L
Instance with Di > L
• The total processor demand is thus
Ni
L =L − Di
Ti
⎢⎣⎢
⎥⎦⎥
+ 1
CP (0, L) =
L − Di
Ti
⎢⎣⎢
⎥⎦⎥
+ 1⎛⎝⎜
⎞⎠⎟
Cii=1
n
∑
Di ≤ Ti
∀L : CP (0, L) ≤ L
CP (0, L)
EDA222/DIT161 – Real-Time Systems, Chalmers/GU, 2010/2011 Lecture #15 Updated February 27, 2011
3
∀L ∈K : CP (0, L) ≤ L
K = Dik | Di
k = kTi + Di , Dik ≤ LCM T1,…,Tn{ }, 1 ≤ i ≤ n, k ≥ 0{ }
Task Ci Di Ti
2 2 3
3 7 12
4 8 16
t1
H blocked
t2 t
t H
t M
normal execution
critical region
L
H and L share resource R
H misses its deadline
EDA222/DIT161 – Real-Time Systems, Chalmers/GU, 2010/2011 Lecture #15 Updated February 27, 2011
4
The tasks are assigned preemption levels, the properties of which are: – The preemption level of task is denoted – Task is not allowed to preempt another task unless – If has higher priority than and arrives later, then must
have a higher preemption level than .
τ i π i
τ i τ j π i > π jτ i τ j τ iτ j
π i > π j ⇔ Di < Dj
system-wide ceiling is set to R’s resource ceiling (= H’s preemption level)
system-wide ceiling is restored H blocked
H
M
normal execution
critical region
preemption level (H) > preemption level (M) > preemption level (L)
L
H and L share resource R
t
t
t
Again: note the similarity to the behavior of ICPP CP
i =L − Dk
Tk
⎢⎣⎢
⎥⎦⎥
+ 1⎛⎝⎜
⎞⎠⎟
Ckk =1
i
∑ +L − Di
Ti
⎢⎣⎢
⎥⎦⎥
+ 1⎛⎝⎜
⎞⎠⎟
Bi
π i > π j ⇔ i < j
∀L ∈K ,∀i ∈ 1,n[ ] : CPi (0, L) ≤ L
EDA222/DIT161 – Real-Time Systems, Chalmers/GU, 2010/2011 Lecture #15 Updated February 27, 2011
5
τ i
1. Determine the worst-case resource ceiling for each critical region, that is, assume the run-time situation where the corresponding resource is unavailable.
2. Identify the tasks that have a preemption level lower than and that calls critical regions with a worst-case resource ceiling equal to or higher than the preemption level of . τ i
τ i
3. Consider the times that these tasks lock the actual critical regions. The longest of those times constitutes the blocking factor .
R1 R2
Task Ci Di Ti
6 10
50 7 17 50 10 25
50 HR1 HR2
- 2 3 2
1 2
HR3
2 2 2
- 1 1 3
2 1 1
3 1
μR1 μR2 μR3 Task Ci Di Ti
R3
τ 2
τ 2
Examine the schedulability of the tasks when the SRP (Stack Resource Policy) protocol is used.
a) Derive the ceilings (dynamic and worst-case) of the resources. b) Derive the blocking factors for the tasks. c) Show whether the tasks are schedulable or not.
U ≤ n(21/ n − 1)
U ≤ 1
∀i : Ri = Ci +
Ri
Tj
⎡
⎢⎢
⎤
⎥⎥ C j ≤ Di
∀j∈hp( i)∑
∀L :
L − Di
Ti
⎢⎣⎢
⎥⎦⎥
+ 1⎛⎝⎜
⎞⎠⎟i=1
n
∑ Ci ≤ L
Di = Ti Di ≤ Ti
top related