30
Understanding Shared Memory Bank Access Interference in Mul:-Core Avionics Andreas Löfwenmark , Simin Nadjm-Tehrani Linköping University, Sweden 2016-07-05

Understanding Shared Memory Bank Access Interference in Mul: …wcet2016.compute.dtu.dk/slides/lofwenmark.pdf · 2016-07-21 · Understanding Shared Memory Bank Access Interference

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Understanding Shared Memory Bank Access Interference in Mul: …wcet2016.compute.dtu.dk/slides/lofwenmark.pdf · 2016-07-21 · Understanding Shared Memory Bank Access Interference

UnderstandingSharedMemoryBankAccessInterferenceinMul:-CoreAvionicsAndreasLöfwenmark,SiminNadjm-TehraniLinköpingUniversity,Sweden2016-07-05

Page 2: Understanding Shared Memory Bank Access Interference in Mul: …wcet2016.compute.dtu.dk/slides/lofwenmark.pdf · 2016-07-21 · Understanding Shared Memory Bank Access Interference

Mo:va:on•  Future safety-critical avionic systems will use multi-

core –  More complex systems => more computational

capacity –  Availability of single-core processors

•  Demonstrating predictability not yet accomplished

2

Page 3: Understanding Shared Memory Bank Access Interference in Mul: …wcet2016.compute.dtu.dk/slides/lofwenmark.pdf · 2016-07-21 · Understanding Shared Memory Bank Access Interference

Mul:-CoreChallenges•  Achieving Temporal Partitioning –  Multiple cores can access a shared resource

simultaneously

•  Worst-Case Execution Time (WCET) and Worst-Case Response Time (WCRT) analysis –  Pessimism could negate the added processing

capacity

3

Page 4: Understanding Shared Memory Bank Access Interference in Mul: …wcet2016.compute.dtu.dk/slides/lofwenmark.pdf · 2016-07-21 · Understanding Shared Memory Bank Access Interference

SharedResources

4

C1

C2

C4

C3

C5

C6

C8

C7

C9

C10

C12

C11

L2Cache L2Cache L2Cache

Interconnect

DRAMCtrlDRAMCtrlDRAMCtrl

DRAMDRAMDRAM

Page 5: Understanding Shared Memory Bank Access Interference in Mul: …wcet2016.compute.dtu.dk/slides/lofwenmark.pdf · 2016-07-21 · Understanding Shared Memory Bank Access Interference

SharedResources

5

C1

C2

C4

C3

C5

C6

C8

C7

C9

C10

C12

C11

L2Cache L2Cache L2Cache

Interconnect

DRAMCtrlDRAMCtrlDRAMCtrl

DRAMDRAMDRAM

Page 6: Understanding Shared Memory Bank Access Interference in Mul: …wcet2016.compute.dtu.dk/slides/lofwenmark.pdf · 2016-07-21 · Understanding Shared Memory Bank Access Interference

SharedResources

6

C1

C2

C4

C3

C5

C6

C8

C7

C9

C10

C12

C11

L2Cache L2Cache L2Cache

Interconnect

DRAMCtrlDRAMCtrlDRAMCtrl

DRAMDRAMDRAM

Page 7: Understanding Shared Memory Bank Access Interference in Mul: …wcet2016.compute.dtu.dk/slides/lofwenmark.pdf · 2016-07-21 · Understanding Shared Memory Bank Access Interference

DRAM

7

MemoryModule

Chip1

Chip2

Chip3

Chip4

Chip5

Chip6

Chip7

Chip8

Command Address

Data

Page 8: Understanding Shared Memory Bank Access Interference in Mul: …wcet2016.compute.dtu.dk/slides/lofwenmark.pdf · 2016-07-21 · Understanding Shared Memory Bank Access Interference

DRAM

8

DRAMChipBank…

Bank0

RowBuffer

ColDecoder

RowDecod

er

CommandDe

code

r

Command

Data

Address

Page 9: Understanding Shared Memory Bank Access Interference in Mul: …wcet2016.compute.dtu.dk/slides/lofwenmark.pdf · 2016-07-21 · Understanding Shared Memory Bank Access Interference

DRAM

9

DRAMChipBank…

Bank0

RowBuffer

ColDecoder

RowDecod

er

CommandDe

code

r

Command

Data

Address

Page 10: Understanding Shared Memory Bank Access Interference in Mul: …wcet2016.compute.dtu.dk/slides/lofwenmark.pdf · 2016-07-21 · Understanding Shared Memory Bank Access Interference

DRAM•  Activate (ACT)

10

DRAMChipBank…

Bank0

RowBuffer

ColDecoder

RowDecod

er

CommandDe

code

r

Command

Data

Address

Page 11: Understanding Shared Memory Bank Access Interference in Mul: …wcet2016.compute.dtu.dk/slides/lofwenmark.pdf · 2016-07-21 · Understanding Shared Memory Bank Access Interference

DRAM•  Activate (ACT)

•  Read/Write (RD/WR)

11

DRAMChipBank…

Bank0

RowBuffer

ColDecoder

RowDecod

er

CommandDe

code

r

Command

Data

Address

Page 12: Understanding Shared Memory Bank Access Interference in Mul: …wcet2016.compute.dtu.dk/slides/lofwenmark.pdf · 2016-07-21 · Understanding Shared Memory Bank Access Interference

DRAM•  Activate (ACT)

•  Read/Write (RD/WR)

•  Precharge (PRE)

12

DRAMChipBank…

Bank0

RowBuffer

ColDecoder

RowDecod

er

CommandDe

code

r

Command

Data

Address

Page 13: Understanding Shared Memory Bank Access Interference in Mul: …wcet2016.compute.dtu.dk/slides/lofwenmark.pdf · 2016-07-21 · Understanding Shared Memory Bank Access Interference

Contribu:ons•  Single Core Equivalence (SCE) based WCRT

estimation (Mancuso et al., 2015) combined with shared bank interference delay (Kim et al., 2014)

•  Validation of WCRT estimates –  Understanding (shared) bank interference –  Comparison of estimates with measurements

•  Adaptation of avionics RTOS

13

Page 14: Understanding Shared Memory Bank Access Interference in Mul: …wcet2016.compute.dtu.dk/slides/lofwenmark.pdf · 2016-07-21 · Understanding Shared Memory Bank Access Interference

SCE(Mancusoetal.,ECRTS2015)•  Colored Lockdown –  Colors memory pages and locks them in cache

•  MemGuard –  Limits the number of memory accesses per core

•  PALLOC –  Allocates memory in specified DRAM banks for

each core

14

Page 15: Understanding Shared Memory Bank Access Interference in Mul: …wcet2016.compute.dtu.dk/slides/lofwenmark.pdf · 2016-07-21 · Understanding Shared Memory Bank Access Interference

Adap:ngWCRTAnalysis•  Why? –  Private banks not always feasible –  Not viable on our RTOS

•  Change estimation equations to allow shared banks

15

Page 16: Understanding Shared Memory Bank Access Interference in Mul: …wcet2016.compute.dtu.dk/slides/lofwenmark.pdf · 2016-07-21 · Understanding Shared Memory Bank Access Interference

WCRTEs:ma:on(Kimetal.,RTAS2014)•  Classical response time test is extended

16

Rik+1 =Ci +

Rik

Tj

⎢⎢

⎥⎥⋅Cj +Hi ⋅RDp +

Rik

Tj

⎢⎢

⎥⎥

τ j∈hp(τ i )∑ ⋅H j ⋅RDp

τ j∈hp(τ i )∑

Hi :Number of memory requests for task iRDp : Interference delay per request from core p

Page 17: Understanding Shared Memory Bank Access Interference in Mul: …wcet2016.compute.dtu.dk/slides/lofwenmark.pdf · 2016-07-21 · Understanding Shared Memory Bank Access Interference

WCRTEs:ma:on(Kimetal.,RTAS2014)•  Classical response time test is extended

17

Rik+1 =Ci +

Rik

Tj

⎢⎢

⎥⎥⋅Cj +Hi ⋅RDp +

Rik

Tj

⎢⎢

⎥⎥

τ j∈hp(τ i )∑ ⋅H j ⋅RDp

τ j∈hp(τ i )∑

Hi :Number of memory requests for task iRDp : Interference delay per request from core p

Page 18: Understanding Shared Memory Bank Access Interference in Mul: …wcet2016.compute.dtu.dk/slides/lofwenmark.pdf · 2016-07-21 · Understanding Shared Memory Bank Access Interference

WCRTEs:ma:on(Kimetal.,RTAS2014)•  Classical response time test is extended

18

Rik+1 =Ci +

Rik

Tj

⎢⎢

⎥⎥⋅Cj +Hi ⋅RDp +

Rik

Tj

⎢⎢

⎥⎥

τ j∈hp(τ i )∑ ⋅H j ⋅RDp

τ j∈hp(τ i )∑

Hi :Number of memory requests for task iRDp : Interference delay per request from core p

Page 19: Understanding Shared Memory Bank Access Interference in Mul: …wcet2016.compute.dtu.dk/slides/lofwenmark.pdf · 2016-07-21 · Understanding Shared Memory Bank Access Interference

Contribu:ons•  Single Core Equivalence (SCE) based WCRT

estimation (Mancuso et al., 2015) combined with shared bank interference delay (Kim et al., 2014)

•  Validation of WCRT estimates –  Understanding (shared) bank interference –  Comparison of estimates with measurements

•  Adaptation of avionics RTOS

19

Page 20: Understanding Shared Memory Bank Access Interference in Mul: …wcet2016.compute.dtu.dk/slides/lofwenmark.pdf · 2016-07-21 · Understanding Shared Memory Bank Access Interference

DRAM

InterferenceDelay

20

RDp = RDpinter + RDp

intra C1(p)

C2(q1)

C4(q3)

C3(q2)

B1

B2

B4

B3

Page 21: Understanding Shared Memory Bank Access Interference in Mul: …wcet2016.compute.dtu.dk/slides/lofwenmark.pdf · 2016-07-21 · Understanding Shared Memory Bank Access Interference

DRAM

InterferenceDelay

21

RDpinter = (LPRE + LACT + LRW )

q≠pshares no

bank with p

RDp = RDpinter + RDp

intra C1(p)

C2(q1)

C4(q3)

C3(q2)

B1

B2

B4

B3

Page 22: Understanding Shared Memory Bank Access Interference in Mul: …wcet2016.compute.dtu.dk/slides/lofwenmark.pdf · 2016-07-21 · Understanding Shared Memory Bank Access Interference

DRAM

InterferenceDelay

22

RDpinter = (LPRE + LACT + LRW )

q≠pshares no

bank with p

RDpintra = reorder(p)+ (Lconf + RDq

inter )q≠p

shares bank with p

RDp = RDpinter + RDp

intra C1(p)

C2(q1)

C4(q3)

C3(q2)

B1

B2

B4

B3

Page 23: Understanding Shared Memory Bank Access Interference in Mul: …wcet2016.compute.dtu.dk/slides/lofwenmark.pdf · 2016-07-21 · Understanding Shared Memory Bank Access Interference

InterferenceDelay

23

0 1 2 3Number of cores sharing bank with core under analysis

0

50

100

150

200

250

Max

imum

del

ay ti

me

per r

eque

st (n

s)

Combined (RDp)Inter-bankIntra-bank

DRAM

C1(p)

C2(q1)

C4(q3)

C3(q2)

B1

B2

B4

B3

DRAM

C1(p)

C2(q1)

C4(q3)

C3(q2)

B1

B2

B4

B3

Page 24: Understanding Shared Memory Bank Access Interference in Mul: …wcet2016.compute.dtu.dk/slides/lofwenmark.pdf · 2016-07-21 · Understanding Shared Memory Bank Access Interference

Contribu:ons•  Single Core Equivalence (SCE) based WCRT

estimation (Mancuso et al., 2015) combined with shared bank interference delay (Kim et al., 2014)

•  Validation of WCRT estimates –  Understanding (shared) bank interference –  Comparison of estimates with measurements

•  Adaptation of avionics RTOS

24

Page 25: Understanding Shared Memory Bank Access Interference in Mul: …wcet2016.compute.dtu.dk/slides/lofwenmark.pdf · 2016-07-21 · Understanding Shared Memory Bank Access Interference

Valida:onoftheAdaptedModel•  Calculate WCRT –  Estimate single-core WCET in isolation (C)

•  Measurement based –  Estimate number of memory requests (H)

•  Perform multi-core experiments to measure WCRT

25

Page 26: Understanding Shared Memory Bank Access Interference in Mul: …wcet2016.compute.dtu.dk/slides/lofwenmark.pdf · 2016-07-21 · Understanding Shared Memory Bank Access Interference

Es:ma:onsonSingle-Core•  Estimate single-core WCET in isolation (C) •  Count number of memory requests (H)

26

Par$$on WCET(C)(us) MemoryRequests(H)(Par$$on)(RTOS)

Nav 14 93 54

Mult 16615 21740 160

Cubic 9345 45 38

Image 4391 560 40

Page 27: Understanding Shared Memory Bank Access Interference in Mul: …wcet2016.compute.dtu.dk/slides/lofwenmark.pdf · 2016-07-21 · Understanding Shared Memory Bank Access Interference

ComparisonofCalculatedandMeasured•  Calculate WCRT •  Measure WCRT

27

Par$$on Core Period(us) ResponseTime(R)(us)Es$matedMeasured

Nav 0 16667 45 14

Mult 1 16667 21192 16620

Cubic 2 16667 9362 9345

Image 3 16667 4516 4391

Page 28: Understanding Shared Memory Bank Access Interference in Mul: …wcet2016.compute.dtu.dk/slides/lofwenmark.pdf · 2016-07-21 · Understanding Shared Memory Bank Access Interference

Focusingonprocesseswith:ghtmargins•  Methodology –  Measure WCRT with a memory intensive

synthetic application on core 1 – 3 –  With and without memory regulation

–  “Right” memory access restriction here can also be used as bound when run with other applications!

28

Par$$on Core Period(us) ResponseTime(R)(us)Noregula$onRegula$on

Mult 0 16667 17075 16654

Page 29: Understanding Shared Memory Bank Access Interference in Mul: …wcet2016.compute.dtu.dk/slides/lofwenmark.pdf · 2016-07-21 · Understanding Shared Memory Bank Access Interference

Conclusions•  Adaptation of SCE framework and avionics RTOS

indeed support running critical avionic applications on multi-core

•  Bound on interference delay with shared DRAM banks is a pessimistic upper bound – as expected

•  Insight: Worst-case interference need not arise in a scenario with maximum number of cores

29

Page 30: Understanding Shared Memory Bank Access Interference in Mul: …wcet2016.compute.dtu.dk/slides/lofwenmark.pdf · 2016-07-21 · Understanding Shared Memory Bank Access Interference

www.liu.se

AndreasLöfwenmark,SiminNadjm-TehraniLinköpingUniversity,Sweden