ECRTS 2013
A Coordinated Approach for Practical OS-Level Cache Management in Multi-Core Real-Time Systems
Hyoseung Kim Arvind Kandhalu
- Prof. Raj Rajkumar
A Coordinated Approach for Practical OS-Level Cache Management in - - PowerPoint PPT Presentation
ECRTS 2013 A Coordinated Approach for Practical OS-Level Cache Management in Multi-Core Real-Time Systems Hyoseung Kim Arvind Kandhalu Prof. Raj Rajkumar Electrical and Computer Engineering Carnegie Mellon University ECRTS 2013 Why
ECRTS 2013
ECRTS 2013
Motivation → Coordinated Cache Mgmt → Evaluation → Conclusion
2/24
ECRTS 2013
Motivation → Coordinated Cache Mgmt → Evaluation → Conclusion
3/24
ECRTS 2013
C1 C2 C3
L1 L2 L1 L2 L1 L2 L3
C4
L1 L2
Cores Private Caches Shared Cache
C1 C2 C3
L1 L2 L1 L2 L1 L2 L3
C4
L1 L2
Cores Private Caches Shared Cache
Tasks Tasks
* PARSEC Benchmark on Intel i7
Motivation → Coordinated Cache Mgmt → Evaluation → Conclusion
4/24
ECRTS 2013
Physical page #
Virtual page # Page offset Page offset Line offset Set index
l bits (cache-line: 2l ) s bits (# of sets: 2s) (s+ l – g) bits Color Index
Motivation → Coordinated Cache Mgmt → Evaluation → Conclusion
5/24
ECRTS 2013
Color Index 0 Color Index 1
……
Color Index 29 Color Index 30 Color Index 31
Cache partitions
1 2
i i+1
Task τ1 Physical pages (Memory partitions) Virtual Address Space
1 2
i i+1
Task τ2 ……
Motivation → Coordinated Cache Mgmt → Evaluation → Conclusion
6/24
ECRTS 2013
Color Index 0 Color Index 1
……
Color Index 29 Color Index 30 Color Index 31
Task τ1 Task τ2 Task τ32
Task τ30 Task τ31
Motivation → Coordinated Cache Mgmt → Evaluation → Conclusion
7/24
ECRTS 2013
Motivation → Coordinated Cache Mgmt → Evaluation → Conclusion
8/24
ECRTS 2013
9/24
ECRTS 2013
𝑞, 𝑈𝑗, 𝐸𝑗, 𝑁𝑗
𝑞: Worst-case execution time (WCET) of task 𝜐𝑗,
𝑗: Period of task 𝜐𝑗
# of cache partitions
WCET
1 2 3 4 5 6
𝑞 is non-increasing with 𝑞 Motivation → Coordinated Cache Mgmt → Evaluation → Conclusion
10/24
ECRTS 2013
Tasks
Bounded Penalties Memory partitions Cache partitions
1 2 3 NP -1 NP
Reservation
Cache Sharing
Task Allocation Task Parameters
p, Ti, Di, Mi )
Core 1 Core 2 Core NC
Partitioned Fixed-priority Scheduling
Page Coloring (Cache Partitioning)
Motivation → Coordinated Cache Mgmt → Evaluation → Conclusion
11/24
ECRTS 2013
t+1 t+2 t+3 t+4 t+5 t+6 t+7 t+8 t+9 t+10 t (High) (Low) Time Tasks
Preemption Resumption 𝜐2 arrival
𝐷1=3 𝐷2=3
𝜐1 arrival
Cache warm-up delay Cache-related preemption delay
Motivation → Coordinated Cache Mgmt → Evaluation → Conclusion
12/24
ECRTS 2013
Color Index 0 Color Index 1
…… Cache partitions Task τ1 Memory partitions Virtual Address Space
1 2
Motivation → Coordinated Cache Mgmt → Evaluation → Conclusion
13/24
ECRTS 2013
Tasks
Bounded Penalties Memory partitions Cache partitions
1 2 3 NP -1 NP
Reservation
Cache Sharing
Task Allocation
Core 1 Core 2 Core NC
Partitioned Fixed-priority Task Scheduling
Page Coloring (Cache Partitioning) Task Parameters
p, Ti, Di, Mi ) Cache-Aware Task Allocation
Motivation → Coordinated Cache Mgmt → Evaluation → Conclusion
14/24
ECRTS 2013
Motivation → Coordinated Cache Mgmt → Evaluation → Conclusion
15/24
ECRTS 2013
𝜐1 0.7
Core 1 Core 2 Core 3 Core 4
𝜐2 0.4
𝜐1 0.5
Assigned cache partitions
Remaining space: 0.3
Remaining space: 0.5 (Harmonic)
Motivation → Coordinated Cache Mgmt → Evaluation → Conclusion
16/24
ECRTS 2013
17/24
ECRTS 2013
Motivation → Coordinated Cache Mgmt → Evaluation → Conclusion
Mem-partition header Pages in Mem-partition Cache color index: 1 Cache color index: NP
Cache color index: 2 Task i : Parameters
RT Taskset
Task i : CPU/Mem reserve with cache partitions
i i i p i i
M D T C , , , :
18/24
ECRTS 2013
𝑞 and 𝑁𝑗 for tasks are estimated ahead of time
Motivation → Coordinated Cache Mgmt → Evaluation → Conclusion
19/24
ECRTS 2013
Motivation → Coordinated Cache Mgmt → Evaluation → Conclusion
20/24
ECRTS 2013
N/A
20 40 60 80 100 8 tasks 12 tasks 16 tasks 8 tasks 12 tasks 16 tasks Cache Usage (%) Mtotal = 1 GB Mtotal = 2 GB BFD WFD CATA * Smaller is better
Motivation → Coordinated Cache Mgmt → Evaluation → Conclusion
21/24
ECRTS 2013
N/A 100 200 300 400 8 tasks 12 tasks 16 tasks 8 tasks 12 tasks 16 tasks Total CPU Util. (%) BFD WFD CATA * Smaller is better Mtotal = 1 GB Mtotal = 2 GB
Motivation → Coordinated Cache Mgmt → Evaluation → Conclusion
22/24
ECRTS 2013
Motivation → Coordinated Cache Mgmt → Evaluation → Conclusion
23/24
ECRTS 2013
Motivation → Coordinated Cache Mgmt → Evaluation → Conclusion
24/24