Cache Related Preemption Delay for Set-Associative Caches - - PowerPoint PPT Presentation

cache related preemption delay for set associative caches
SMART_READER_LITE
LIVE PREVIEW

Cache Related Preemption Delay for Set-Associative Caches - - PowerPoint PPT Presentation

Cache Related Preemption Delay for Set-Associative Caches Resilience Analysis Sebastian Altmeyer, Claire Burgui` ere, Jan Reineke Predator Meeting, Pisa 2010 saarland university computer science saarland Context university computer


slide-1
SLIDE 1

Cache Related Preemption Delay for Set-Associative Caches

Resilience Analysis Sebastian Altmeyer, Claire Burgui` ere, Jan Reineke Predator Meeting, Pisa 2010

computer science

saarland

university

slide-2
SLIDE 2

computer science

saarland

university

Context

Preemptive scheduling Cache related preemption delay (CRPD):

◮ Impact of preemption on the cache content ◮ Overall cost of additional reloads due to preemption

T1 T2

= CRPD = Task Activation

Altmeyer, Burgui` ere, Reineke CRPD for set-associative caches Predator, Pisa 2010 2 / 16

slide-3
SLIDE 3

computer science

saarland

university

CRPD for set-associative caches - LRU

CRPD computation:

◮ preempted task: Useful Cache Blocks (UCB) ◮ preempting task: Evicting Cache Blocks (ECB)

CRPD from UCB and ECB:

◮ Previous combination overestimates

⇒ Some UCBs remain useful under preemption

Altmeyer, Burgui` ere, Reineke CRPD for set-associative caches Predator, Pisa 2010 3 / 16

slide-4
SLIDE 4

computer science

saarland

university

Useful Cache Block - [Lee et al., 1996]

Definition (Useful Cache Block)

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.

P

Cache Content: [A, B, C, D] A B D C B A C

= hit = miss

CRPDUCB =

c

  • s=1

CRPDs

UCB

CRPDs

UCB

= BRT × min(|UCB(s)|, n)

n = associativity BRT = Block Reload Time

Altmeyer, Burgui` ere, Reineke CRPD for set-associative caches Predator, Pisa 2010 4 / 16

slide-5
SLIDE 5

computer science

saarland

university

Useful Cache Block - [Lee et al., 1996]

Definition (Useful Cache Block)

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.

P

Cache Content: [A, B, C, D] A B D C B A C

= hit = miss

CRPDUCB =

c

  • s=1

CRPDs

UCB

CRPDs

UCB

= BRT × min(|UCB(s)|, n)

n = associativity BRT = Block Reload Time

Altmeyer, Burgui` ere, Reineke CRPD for set-associative caches Predator, Pisa 2010 4 / 16

slide-6
SLIDE 6

computer science

saarland

university

Evicting Cache Blocks [Tomiyama & Dutt, 2000]

Definition (Evicting Cache Blocks (ECB))

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.

A B C B A C Cache Content: [A, B, C, D] Cache Content: [X, Y, Z, D] X Y Z

= additional miss due to preemption (CRPD)

CRPDs

ECB =

if ECB(s) = ∅ BRT × n

  • therwise

Altmeyer, Burgui` ere, Reineke CRPD for set-associative caches Predator, Pisa 2010 5 / 16

slide-7
SLIDE 7

computer science

saarland

university

Impact of the preempting task

  • n the preempted task

CRPD (using UCB and ECB)

CRPDUCB&ECB =

c

  • s=1

min(CRPDs

UCB, CRPDs ECB) Altmeyer, Burgui` ere, Reineke CRPD for set-associative caches Predator, Pisa 2010 6 / 16

slide-8
SLIDE 8

computer science

saarland

university

Impact of the preempting task

  • n the preempted task (example)

0x0a 0x0b 0x0c

[c, b, a, x] a [a, c, b, x] b [b, a, c, x] c [c, b, a, x] no miss [e, c, b, a] a [a, e, c, b] b [b, a, e, c] c [c, b, a, e] no miss ECBs = {e}

CRPDUCB ⇒ |UCB| = 3 CRPDECB ⇒ n = 4 CRPDUCB&ECB = min(CRPDUCB, CRPDECB) ⇒ 3

◮ Overestimation: number of additional misses= 0 < 3

Why?

◮ |ECB| to evict a UCB = 2 ◮ but, |ECB| = 1 ◮ One single ECB is not sufficient to evict a UCB Altmeyer, Burgui` ere, Reineke CRPD for set-associative caches Predator, Pisa 2010 7 / 16

slide-9
SLIDE 9

computer science

saarland

university

Refinement

Determining max|ECB| s.t. no additional cache miss occur m ∈ UCB m is 4-resilient (res(m) = 4) m a1 a2 a3 m [m, , , , , , , ] [a3, a2, a1, m, , , , ] [m, a3, a2, a1, , , , ]

Altmeyer, Burgui` ere, Reineke CRPD for set-associative caches Predator, Pisa 2010 8 / 16

slide-10
SLIDE 10

computer science

saarland

university

Resilience analysis

Definition (Resilience)

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 ∈ UCB res(m) = 4 m a1 a2 a3 m [m, , , , , , , ] [a3, e4, e3, e2, e1, a2, a1, m] [m, a3, e4, e3, e2, e1, a2, a1] preempting task ECB = {e1, e2, e3, e4}

if |ECB| ≤ l then the UCB is not evicted

Altmeyer, Burgui` ere, Reineke CRPD for set-associative caches Predator, Pisa 2010 9 / 16

slide-11
SLIDE 11

computer science

saarland

university

CRPD using resilience

CRPD (combining UCB and ECB by using resilience)

CRPD ≤ BRT × |

blocks contributing to CRPD

  • UCB

useful

\ {m | res(m) = |ECB|}

  • remain useful

|

Altmeyer, Burgui` ere, Reineke CRPD for set-associative caches Predator, Pisa 2010 10 / 16

slide-12
SLIDE 12

computer science

saarland

university

CRPD using resilience - example

0x0a 0x0b 0x0c

[c, b, a, x] a [a, c, b, x] b [b, a, c, x] c [c, b, a, x] no miss [e, c, b, a] a [a, e, c, b] b [b, a, e, c] c [c, b, a, e] no miss ECBs = {e}

◮ |ECB| = 1 ◮ res(a) = res(b) = res(c) = 1 ◮ CRPDres UCB&ECB = BRT × |UCB \ {m | res(m) = |ECB| }| = 0

Instead of: CRPDUCB&ECB = min(CRPDUCB, CRPDECB) = 3 × BRT

Altmeyer, Burgui` ere, Reineke CRPD for set-associative caches Predator, Pisa 2010 11 / 16

slide-13
SLIDE 13

computer science

saarland

university

Evaluation Setting

Cachesize 8KB 8 ways 32 sets linesize 32 bytes LRU caches Testcases: M¨ alardalen benchmark suite:

Altmeyer, Burgui` ere, Reineke CRPD for set-associative caches Predator, Pisa 2010 12 / 16

slide-14
SLIDE 14

computer science

saarland

university

Evaluation Benchmarks

Task Code Size Cache Util. |UCB| minmax 608B 7.4% 4 insertsort 384B 4.7% 5 fibcall 256B 3.1% 5 fac 256B 3.1% 6 bs 320B 3.9% 8 bsort100 544B 6.6% 10 ns 576B 7% 11 matmult 864B 10.5% 12 fir 928B 11.3% 22 crc 1216B 14.8% 35 select 1280B 15.6% 37 qsort-exam 1440B 17.6% 42 sqrt 3680B 44.9% 101 qurt 4160B 50.8% 118

Altmeyer, Burgui` ere, Reineke CRPD for set-associative caches Predator, Pisa 2010 13 / 16

slide-15
SLIDE 15

computer science

saarland

university

Evaluation

1 10 100 minmax insertsort fac bs bsort100 ns matmult fir crc select qsort-exam sqrt preempted by fibcall (#ECBs= 8) 1 10 100 minmax insertsort fac bs bsort100 ns matmult fir crc select qsort-exam sqrt preempted by qurt (#ECBs= 121) resilience tan UCB & ECB #UCBs Altmeyer, Burgui` ere, Reineke CRPD for set-associative caches Predator, Pisa 2010 14 / 16

slide-16
SLIDE 16

computer science

saarland

university

Conclusions

UCB and ECB analyses:

◮ pessimistic overapproximation of the CRPD

Resilience analysis:

◮ regain some precision ◮ reduce pessimism

Resilience analysis:

◮ simple data-flow analyses ◮ similar to UCB analysis for LRU Altmeyer, Burgui` ere, Reineke CRPD for set-associative caches Predator, Pisa 2010 15 / 16

slide-17
SLIDE 17

computer science

saarland

university

Further reading

Altmeyer, S. & Burgui` ere, C. (2009). In Proceedings of the 21st Euromicro Conference on Real-Time Systems (ECRTS ’09) pp. 109–118, 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 RTSS’96 p. 264, IEEE Computer Society. Negi, H. S., Mitra, T. & Roychoudhury, A. (2003). In CODES+ISSS’03 ACM. Reineke, J. (2008). Caches in WCET Analysis. PhD thesis, Universit¨ at des Saarlandes, Saarbr¨ ucken. Staschulat, J. & Ernst, R. (2007). ACM Trans. on Embedded Computing Sys. 6, 25. Tan, Y. & Mooney, V. (2004). In SCOPES’04 pp. 182–199,. Tomiyama, H. & Dutt, N. D. (2000). In CODES’00 ACM.

Altmeyer, Burgui` ere, Reineke CRPD for set-associative caches Predator, Pisa 2010 16 / 16

slide-18
SLIDE 18

computer science

saarland

university

l-resilience analysis

(a) 0-resilient 0-resilient 2-resilient m m m (b) 2-resilient m is not useful 2-resilient m m m

Altmeyer, Burgui` ere, Reineke CRPD for set-associative caches Predator, Pisa 2010 16 / 16

slide-19
SLIDE 19

computer science

saarland

university

CPRD using ECB: Pitfall

0x08 0x09 0x0a 0x0b

[b, a, 9, 8] 8 [8, b, a, 9] 9 [9, 8, b, a] a [a, 9, 8, b] b [b, a, 9, 8] 0 misses [e, b, a, 9] 8∗ [8, e, b, a] 9∗ [9, 8, e, b] a∗ [a, 9, 8, e] b∗ [b, a, 9, 8] 4 misses ECBs = {e}

|UCB(s)| = 4 |ECB(s)| = 1 n = 4 number of additional misses= 4

Altmeyer, Burgui` ere, Reineke CRPD for set-associative caches Predator, Pisa 2010 16 / 16

slide-20
SLIDE 20

computer science

saarland

university

Upper-bound on the CRPD - direct-mapped caches

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}|

Altmeyer, Burgui` ere, Reineke CRPD for set-associative caches Predator, Pisa 2010 16 / 16

slide-21
SLIDE 21

computer science

saarland

university

CRPD for FIFO: Pitfalls

[b, a] a [b, a] e∗ [e, b] b [e, b] c∗ [c, e] e [c, e] 2 misses [x, b] a∗ [a, x] e∗ [e, a] b∗ [b, e] c∗ [c, b] e∗ [e, c] 5 misses ECBs = {x}

|UCB(s)| = 2 |ECB(s)| = 1 n = 2 But: number of additional misses= 3

Altmeyer, Burgui` ere, Reineke CRPD for set-associative caches Predator, Pisa 2010 16 / 16

slide-22
SLIDE 22

computer science

saarland

university

CRPD for PLRU: Pitfalls

1 1 1 a b c d d 1 a b c d b 1 a b c d c 1 a b c d b 1 1 a b c d a 1 1 1 a b c d d 1 a b c d 0 misses 1 a y c x d* 1 a y d x b* 1 1 1 b y d x c* 1 b y d c b 1 1 b y d c a* 1 1 b y a c d* 1 1 b d a c 5 misses ECBs = {x, y}

|UCB(s)| = 4 |ECB(s)| = 2 n = 4 But: number of additional misses= 5

Altmeyer, Burgui` ere, Reineke CRPD for set-associative caches Predator, Pisa 2010 16 / 16