Memory Access Control in Multiprocessor with memory throttling

27
Memory Access Control in Multiprocessor for Real-time Systems with Mixed Criticality Heechul Yun + , Gang Yao + , Rodolfo Pellizzoni * , Marco Caccamo + , Lui Sha + University of Illinois at Urbana and Champaign + Univerity of Waterloo *

Transcript of Memory Access Control in Multiprocessor with memory throttling

Page 1: Memory Access Control in Multiprocessor with memory throttling

Memory Access Control in Multiprocessor for Real-time Systems

with Mixed Criticality

Heechul Yun+, Gang Yao+, Rodolfo Pellizzoni*, Marco Caccamo+, Lui Sha+

University of Illinois at Urbana and Champaign+

Univerity of Waterloo*

Page 2: Memory Access Control in Multiprocessor with memory throttling

Multi-core Systems

• Mainstream in smartphone

– Dual/quad-core smartphones

– More performance with less power

• Traditional embedded/real-time domains

– Avionics companies are investigating [Nowotsch12]

• 8 core P4080 processor from Freescale

Tegra 3 (4 cores)

[Nowotsch12] “Leveraging Multi-Core Computing Architectures in Avionics”, EDCC, 2012 2

Page 3: Memory Access Control in Multiprocessor with memory throttling

Challenge

• Timing isolation is hard to achieve

Core1 Core2

System bus

Core3 Core4

DRAM

3

Page 4: Memory Access Control in Multiprocessor with memory throttling

Challenge

• Cores compete for shared HW resources

– System bus, DRAM controller, shared cache, …

Core1 Core2

System bus

Core3 Core4

DRAM

Appl1 App2 App 3 App 4

4

Page 5: Memory Access Control in Multiprocessor with memory throttling

Effect of Memory Contention

• Run-time increase due to contention – Five SPEC2006 benchmarks

– Compared to solo execution

Shared system bus

Core

Memory

Core

App App. membomb

0%

10%

20%

30%

40%

50%

60%

70%

429.mcf 471.omnetpp 473.astar 433.milc 470.lbm

Run-time increase (%)

60% WCET increase is unacceptable

5

Page 6: Memory Access Control in Multiprocessor with memory throttling

Goal

• Mechanism to control memory contention

– Software based controller for COTS multi-core processors

• Response time analysis accounting memory contention effect

– Based on proposed software based controller

6

Page 7: Memory Access Control in Multiprocessor with memory throttling

Outline

• Motivation

• Memory Access Control System

• Response Time Analysis

• Evaluation

• Conclusion

7

Page 8: Memory Access Control in Multiprocessor with memory throttling

System Architecture

• Assign memory bandwidth to each core using per-core memory bandwidth controller

Memory bandwidth controllers (Part of OS)

30%

Core1 Core2

System bus

Core3 Core4

10% 40%

DRAM

20%

8

Page 9: Memory Access Control in Multiprocessor with memory throttling

Memory Bandwidth Controller

• Periodic server for memory resource

• Periodically monitor memory accesses of the core and control user specified bandwidth using OS scheduler

– Monitoring can be efficiently done by using per-core hardware performance counter

– Bandwidth = # memory accesses X avg. access time

9

Page 10: Memory Access Control in Multiprocessor with memory throttling

Memory Bandwidth Controller

10

• Period: 10 time unit, Budget: 2 memory accesses

– memory access takes 1 time unit

10 20 0

Dequeue tasks

Enqueue tasks

Dequeue tasks

computation

memory fetch

Budget

Task

2 1

Page 11: Memory Access Control in Multiprocessor with memory throttling

Outline

• Motivation

• Memory Bandwidth Control System

• Response Time Analysis

• Evaluation

• Conclusion

11

Page 12: Memory Access Control in Multiprocessor with memory throttling

System Model

• Cores are partitioned based on criticality

• Critical core runs periodic real-time tasks with fixed priority scheduling algorithm

• Interfering cores run non-critical workload and regulated with proposed memory access controller

Memory bandwidth controller

Core1 Core2

System bus

Core3 Core4

DRAM

Critical core Interfering cores

12

Page 13: Memory Access Control in Multiprocessor with memory throttling

Assumptions

• Private or partitioned last level cache (LLC)

• Round-robin bus arbitration policy

• Memory access latency is constant

• 1 LLC miss = 1 DRAM access

Memory bandwidth controller

Core1 Core2

System bus

Core3 Core4

DRAM

Critical core Interfering cores

13

Page 14: Memory Access Control in Multiprocessor with memory throttling

Simple Case: One Interfering Core

• Critical core - core under analysis • Interfering core – generating memory interference

Memory bandwidth controller

Core

System bus

Core

DRAM

Critical Interfering

14

Page 15: Memory Access Control in Multiprocessor with memory throttling

Problem Formulation

• For a given periodic real-time task set 𝑇 = {𝜏1, 𝜏1,…, 𝜏𝑛} on a critical core

• Problem:

– Determine 𝑇 is schedulable on the critical core given memory access control budget Q and period P on the interfering core

15

Page 16: Memory Access Control in Multiprocessor with memory throttling

Task Model

– C : WCET of a task on isolated core (no interference)

– CM: number of last level cache misses (DRAM accesses)

– L: stall time of single cache miss

computation

memory fetch (cache stall)

time C

CM

16

Page 17: Memory Access Control in Multiprocessor with memory throttling

Memory Interference Model

– P : memory access controller period

– Q: memory access time budget

– αu(t): Linearized interfering memory traffic upper-bound

17

Page 18: Memory Access Control in Multiprocessor with memory throttling

Background [Pellizzoni07]

• Accounting Memory Interference

– Cache bound: maximum interference time <= maximum number cache-accesses (CM) * L of the task under analysis

– Traffic bound: maximum interference time <= maximum bus time requested by the interfering core

Cache-bound Traffic bound

𝐶 : WCET account memory stall delay L: stall time of single cache miss

18 [Pellizzoni07] “Toward the predictable integration of real-time cots based systems,” RTSS, 2007

Page 19: Memory Access Control in Multiprocessor with memory throttling

Classic Response Time Analysis

– Tasks are sorted in priority order • low index = high priority task

– 𝐶𝑖 : WCET of task i (in isolation w/o memory interference)

– 𝑅𝑖 : Response time of task i

– 𝑇𝑗 : Period of task I

𝑅𝑖𝑘+1 = 𝐶𝑖 +

𝑅𝑖𝑘

𝑇𝑗∗ 𝐶𝑗

𝑗<𝑖

19

Page 20: Memory Access Control in Multiprocessor with memory throttling

Extended Response Time Analysis

– 𝑁 𝑡 : aggregated cache misses over time t

– 𝛼𝑢(𝑡): interfering memory traffic over time t

– P: memory access control period

– Q: memory access time budget

• Proposed method achieves tighter response time than using 𝐶

𝑅𝑖𝑘+1 = 𝐶𝑖 +

𝑅𝑖𝑘

𝑇𝑗∗ 𝐶𝑗

𝑗<𝑖

+ min 𝑁 𝑅𝑘 ∗ 𝐿, 𝛼𝑢 𝑅𝑘

where 𝑁 𝑡 = 𝑡

𝑇𝑗∗ 𝐶𝑀𝑗𝑗≤𝑖

𝛼𝑢 𝑡 = 𝑡𝑄

𝑃+ 2

𝑄(𝑃 − 𝑄)

𝑃

20

Page 21: Memory Access Control in Multiprocessor with memory throttling

Outline

• Motivation

• Memory Bandwidth Control System

• Response Time Analysis

• Evaluation

• Conclusion

21

Page 22: Memory Access Control in Multiprocessor with memory throttling

Linux Kernel Implementation

• Extending CPU bandwidth reservation feature of group scheduler

– Specify core and bandwidth (memory budget, period) • mkdir /sys/fs/cgroup/core3; cd /sys/fs/cgroup/core3

• echo 3 > cpuset.cpus core 3

• echo 10000 > cpu.cfs_period_us period

• echo 500000 > cpu.cfs_quota_event cache-misses budget

– Added feature

– Monitor memory usage at every scheduler tick and context switch

22

Page 24: Memory Access Control in Multiprocessor with memory throttling

Synthetic Task

• Core under analysis runs a synthetic task with 50% memory bandwidth • Vary throttling budget of the interfering core from 0 to 100% • Two findings: (1) we can control interference, (2) analysis provide an upper

bound (albeit still pessimistic)

Shared system bus

Core1

Memory

Core3

App App. membomb

24

Page 25: Memory Access Control in Multiprocessor with memory throttling

H.264 Movie Playback

• Cache-miss counts sampled over every 100ms

• Some inaccuracy in regulation due to implementation limitation – Current version is improved accurate by using hardware overflow interrupt

25

Page 26: Memory Access Control in Multiprocessor with memory throttling

Conclusion

• Shared hardware resources in multi-core systems are big challenges for designing real-time systems

• We proposed and implemented a mechanism to

provide memory bandwidth reservation capability on COTS multi-core processors

• We developed a response time analysis method using the proposed memory access control mechanism

26

Page 27: Memory Access Control in Multiprocessor with memory throttling

Thank you.

27