Escolar Documentos
Profissional Documentos
Cultura Documentos
Resilience Analysis
saarland
university
computer science
Context
saarland
university
computer science
T1 T2
= CRPD = Task Activation
2 / 16
saarland
university
computer science
CRPD computation:
preempted task: Useful Cache Blocks (UCB) preempting task: Evicting Cache Blocks (ECB)
3 / 16
saarland
university
computer science
A memory block m at program point P is called a useful cache block, if a) m may be cached at P b) m may be reused at program point P that may be reached from P with no eviction of m on this path.
= hit = miss
P
A B D C Cache Content: [A, B , C , D ] B A C
=
s =1
CRPDs UCB
n = associativity BRT = Block Reload Time
Predator, Pisa 2010 4 / 16
= BRT min(|UCB(s)|, n)
CRPD for set-associative caches
saarland
university
computer science
A memory block m at program point P is called a useful cache block, if a) m may be cached at P b) m may be reused at program point P that may be reached from P with no eviction of m on this path.
= hit = miss
P
A B D C Cache Content: [A, B , C , D ] B A C
=
s =1
CRPDs UCB
n = associativity BRT = Block Reload Time
Predator, Pisa 2010 4 / 16
= BRT min(|UCB(s)|, n)
CRPD for set-associative caches
saarland
university
computer science
A memory block of the preempting task is called an evicting cache block, if it may be accessed during the execution of the preempting task.
Cache Content: [A, B , C , D ] X Y Z Cache Content: [X , Y , Z , D ]
CRPDs ECB =
` Altmeyer, Burguiere, Reineke
saarland
university
computer science
CRPDUCB&ECB =
6 / 16
saarland
university
computer science
[a, c , b, x ]
[b , a , c , x ]
[c , b , a , x ]
no miss
[a , e , c , b ]
[b , a , e , c ]
[c , b, a, e]
no miss
Why?
|ECB| to evict a UCB = 2 but, |ECB| = 1 One single ECB is not sufcient to evict a UCB
` Altmeyer, Burguiere, Reineke CRPD for set-associative caches Predator, Pisa 2010 7 / 16
Renement
saarland
university
computer science
[m , , , , , , , ]
[a3 , a2 , a1 , m, , , , ] [m, a3 , a2 , a1 , , , , ]
8 / 16
Resilience analysis
Denition (Resilience)
saarland
university
computer science
The resilience resP (m) of memory block m at program point P is the greatest l, such that all possible next accesses to m, a) that would be hits without preemption, b) would still be hits in case of a preemption with l accesses at P.
preempted task m a1 a2 preempting task
[m , , , , , , , ] ECB = {e1 , e2 , e3 , e4 }
m UCB res(m) = 4
a3 [a3 , e4 , e3 , e2 , e1 , a2 , a1 , m] m [m, a3 , e4 , e3 , e2 , e1 , a2 , a1 ]
saarland
university
computer science
CRPD
BRT
10 / 16
saarland
university
computer science
[a, c , b, x ]
[b , a , c , x ]
[c , b , a , x ]
no miss
[a , e , c , b ]
[b , a , e , c ]
[c , b, a, e]
no miss
|ECB | = 1 res(a) = res(b) = res(c ) = 1 res CRPDUCB&ECB = BRT |UCB \ {m | res(m) = |ECB | }| = 0
11 / 16
Evaluation Setting
saarland
university
computer science
Cachesize 8KB 8 ways 32 sets linesize 32 bytes LRU caches Testcases: Malardalen benchmark suite:
12 / 16
Evaluation Benchmarks
Task minmax insertsort bcall fac bs bsort100 ns matmult r crc select qsort-exam sqrt qurt
` Altmeyer, Burguiere, Reineke
saarland
university
computer science
Code Size 608B 384B 256B 256B 320B 544B 576B 864B 928B 1216B 1280B 1440B 3680B 4160B
Cache Util. 7.4% 4.7% 3.1% 3.1% 3.9% 6.6% 7% 10.5% 11.3% 14.8% 15.6% 17.6% 44.9% 50.8%
Evaluation
preempted by fibcall (#ECBs= 8) 100
saarland
university
computer science
10
min
in f max sertso ac rt
bs
bso
n rt10 s 0
mat
f mult ir
crc
sele
ct
qso
rt-e
sqrt xam
10
min
in f max sertso ac rt
bs
bso
tan
n rt10 s 0
mat
f mult ir
crc
sele
ct
qso
rt-e
sqrt xam
resilience
#UCBs
14 / 16
Conclusions
saarland
university
computer science
Resilience analysis:
regain some precision reduce pessimism
Resilience analysis:
simple data-ow analyses similar to UCB analysis for LRU
15 / 16
Further reading
saarland
university
computer science
` Altmeyer, S. & Burguiere, C. (2009). In Proceedings of the 21st Euromicro Conference on Real-Time Systems (ECRTS 09) pp. 109118, IEEE Computer Society. Lee, C.-G., Hahn, J., Min, S. L., Ha, R., Hong, S., Park, C. Y., Lee, M. & Kim, C. S. (1996). In RTSS96 p. 264, IEEE Computer Society. Negi, H. S., Mitra, T. & Roychoudhury, A. (2003). In CODES+ISSS03 ACM. Reineke, J. (2008). Caches in WCET Analysis. des Saarlandes, Saarbrucken. PhD thesis, Universitat Staschulat, J. & Ernst, R. (2007). ACM Trans. on Embedded Computing Sys. 6, 25. Tan, Y. & Mooney, V. (2004). In SCOPES04 pp. 182199,. Tomiyama, H. & Dutt, N. D. (2000). In CODES00 ACM.
16 / 16
l -resilience analysis
0-resilient 0-resilient m is not useful 2-resilient
saarland
university
computer science
m 2-resilient
m 2-resilient
Predator, Pisa 2010
m m
m (b)
(a)
16 / 16
saarland
university
computer science
[8, b, a, 9]
[9, 8, b, a]
[a, 9, 8, b]
[b, a, 9, 8]
0 misses
[8, e, b, a]
[9, 8, e, b]
[a, 9, 8, e]
[b, a, 9, 8]
4 misses
16 / 16
saarland
computer science
using UCB [Lee et al., 1996]: CRPDUCB = BRT |{si | m UCB : m mod c = si }|
using ECB [Tomiyama & Dutt, 2000]: CRPDECB = BRT |{si | m ECB : m mod c = si }|
using UCB and ECB [Negi et al., 2003, Tan & Mooney, 2004]: CRPDUCB&ECB = BRT |{si | m UCB : m mod c = si m ECB : m mod c = si }|
16 / 16
saarland
university
computer science
ECBs = {x}
[b, a] [x, b]
a a
[b , a ] [a, x]
e e
[e , b ] [e, a]
b b
[e, b] [b, e]
c c
[c , e] [c , b ]
e e
[c , e ] [e , c ]
2 misses 5 misses
16 / 16
saarland
university
computer science
1 1 a ECBs = {x, y} 0 a y c b 1 0 x c 1 d
d 1 a d* 0 a y b
0 0 c 0 1 d x d
b 0 a b* 1 b y b
1 0 c 1 1 d x d
c 0 a c* 1 b y b
0 1 c 0 0 d c d
b 0 a b 1 b y b
1 1 c 1 0 d c d
a 1 a a* 1 b y b
1 1 c 0 1 a c d
d 1 a d* 0 b d b
0 0 c 1 1 a c 5 misses d 0 misses
16 / 16