Professional Documents
Culture Documents
Response Time = 9
3 4
1
11/5/2019
7 8
11 12
2
11/5/2019
4 8
2
C2 = 3
2 0 2 6 12
ape
0 2 6 12
ape PS 0 2 4 6 8 10 12
Cs = 1
0 2 4 6 8 10 12
Ts = 4
0 4 8 12
Response Time = 9
Response Time = 7
13 14
n 1
Cn
Tn–1 C n Ts Cs C k n 1
n k 1 U ub U s R i
2Ts
n
0 Ts Tn = 2Ts – Tn i 1 Tn
15 16
2 1 2 U ub K
2Ts 2Ts T1 1 0 for Ri K 1/ n
hence: K Ri Ri P
Tn T1 Tn U s 1 P U s 1
Hence:
RM PS
Kn 1
U lub U s n K 1/ n 1
U ub U s Ri n
i 1 P
17 18
3
11/5/2019
PS properties RM + PS schedulability
In the worst-case, the PS behaves as a periodic RM PS 2
task with utilization Us = Cs/Ts U lub (n ) U s ln
U s 1
1
Aperiodic tasks execute at the highest priority if
Ts = min(T1, … , Tn).
ln2
Liu & Layland analysis gives that: RM PS
U lub (n) U s n ( K 1 / n 1)
2 1/ n
K
2
RM PS
U lub (n) U s n 1 Us 1
U s 1 Us
0 1
19 20
2
U smax 1 Ra a Ca Fa (Ts C s )
P
21 22
4
11/5/2019
ape 0 4 8
0 2 4 6 8 10 12 ape
DS 0 2 4 6 8 10 12
Cs = 1 deadline
Ts = 4 2 miss
0 4 8 0 5 10
25 26
Analysis of RM + DS RM + DS schedulability
RM DS
Cs Cs Cs
2Cs = T1 – Ts
U lub (n )
DS
1
C1 Ts +Cs C 2Ts+Cs
1 C1 = T2 – T1
1
PS
C2 T1 C2 ln2
2 C2 = T3 – T2
DS
T2
RM PS
U lub (n) U s n ( K 1/ n 1)
U 2 1n 2 Us 2
U RM DS
(n) U s n s 1 K PS K DS
2U s 1
Us 1 2U s 1
lub
Us
0 1
27 28
2P
U smax Ra a FaTs a
2P 1
29 30
5
11/5/2019
Ra a FaTs a
31 32
35 36
6
11/5/2019
6 12 18 24 6 12 18 24
10 20 10 20
4 4
37 38
39
R1 = 1 R2 = 4 Ravg = 2.5 R1 = 2 R2 =2 Ravg = 2 40
42
7
11/5/2019
8
11/5/2019
C1 = 1 C1 = 1
1 1
C2 = 3 4 8 C2 = 3 4 8
2 2
0 6 12 0 6 12
2 2
ape ape
0 2 4 6 8 10 12 0 2 4 6 8 10 12
r1 d1 r1 d1
49 50
C1 = 1 C1 = 1
1 1
C2 = 3 4 8 C2 = 3 4 8
2 2
0 6 12 0 6 12
2 2
ape ape
0 2 4 6 8 10 12 0 2 4 6 8 10 12
r1 d1 r1 d1
51 52
ape ape
s s s s
rk fk dk rk fk dk
53 54
9
11/5/2019
2
ei(t) ci(t)
1 0
2
6 12 18
0 4 8 12 16 20
ape
2 3 dk
ei(t) = time executed by i before t
0
2
6 12 18
I a (t , d )
s
k c (t ) i [C i ei (t )]
ci(t) = remaining WCET of i at time t
ape i active i active
d i d ks d i d ks
nexti(t) = next release time of i after t
3 dk
n
d ks next i ( t ) Actually this is wrong for
I p (t , d ks ) I a (t , d ks ) I f (t , d ks ) I f ( t , d ks ) i 1 Ti
Ci integer ratios
55 56
2
ei(t) ci(t)
f ks rk Ck I p ( rk , d ks )
0 6 12 18
2 shorten the deadline
ape d ks 1 f ks
3 dk
I a (t , d ks ) [C ei (t )] t s = s+1 d ks 1 d ks EXIT
active
i
nexti (t ) 1 Ti NO YES
Ti
i
d i d ks
Ck
n
d ks nexti (t ) ape
I f (t , d )
s
k
1 Ci s s
i 1 Ti fk dk
57 Ip 58
s=N EXIT
YES N=0
NO
f ks rk Ck I p (rk , d ks ) TBS
O(n) O(Nn)
d ks 1 f ks
polynomial
s = s+1 d ks 1 d ks overhead
NO YES
EXIT
59 60
10
11/5/2019
63 64
65 66
11
11/5/2019
When the budget is exhausted it is immediately if ( pending ape. requests) then <enqueue Jk>
replenished, but the deadline is postponed to keep the
demand constant. else if (qs > (ds – rk)Us) then qs = Qs
CBS parameters
t ds = rk + Ts
Maximum budget: Qs
assigned
Server period: Ts Budget exhausted postpone ds
by the user
Server bandwidth: Us = Qs/Ts
q s = Qs
Current budget: qs (initialized to 0) maintained
by the server
ds = ds + Ts
Server deadline: ds (initialized to 0)
67 68
3 2 5
0 5 12 0 3 6 12
cs cs
6 3
Qs = 6 3 Qs = 3
1
Ts = 12 1 Ts = 6
0 5 12 0 3 12
69 70
1 performance
optimal server (TBS*)
0 6 12 18 24 TBS(N)
2
Slack Stealer
0 9 18 27
TBS CBS
d0 d1 d2 d3 d4
3 3 1
ape DS SS
r1 8 r2 14 18 r3 24 27 PS
qs
Background
overhead
0 2 4 6 8 10 12 14 16 18 20 22 24 26
The best choice depends on the price (overhead)
CBS: Qs = 2, Ts = 6
we can pay to reduce task response times.
71 72
12