40
Whose Cache Line Is It Anyway? Mihir Nanavati, Mark Spear, Nathan Taylor, Shriram Rajagopalan, Dutch T. Meyer, William Aiello, and Andrew Warfield University of British Columbia Operating System Support for Live Detection and Repair of False Sharing

Whose Cache Line Is It Anyway?

  • Upload
    silas

  • View
    30

  • Download
    2

Embed Size (px)

DESCRIPTION

Whose Cache Line Is It Anyway?. Operating System Support for Live Detection and Repair of False Sharing. Mihir Nanavati , Mark Spear, Nathan Taylor, Shriram Rajagopalan , Dutch T. Meyer, William Aiello, and Andrew Warfield University of British Columbia. - PowerPoint PPT Presentation

Citation preview

Page 1: Whose Cache Line  Is It Anyway?

Whose Cache Line Is It Anyway?

Mihir Nanavati, Mark Spear, Nathan Taylor, Shriram Rajagopalan, Dutch T. Meyer, William Aiello, and Andrew

WarfieldUniversity of British Columbia

Operating System Support for LiveDetection and Repair of False Sharing

Page 2: Whose Cache Line  Is It Anyway?

2

Page 3: Whose Cache Line  Is It Anyway?

3

Page 4: Whose Cache Line  Is It Anyway?

4Mondriaan Memory Protection [ASPLOS ’02,

SOSP ’05]

Page 5: Whose Cache Line  Is It Anyway?

5

Byte-granularity,

software-only remapping

Page 6: Whose Cache Line  Is It Anyway?

6

False Sharing

Page 7: Whose Cache Line  Is It Anyway?

7

Page 8: Whose Cache Line  Is It Anyway?

8

Target System

Xen

Control VM

(Dom0)+

HardwareMemory

Page 9: Whose Cache Line  Is It Anyway?

9

Dynamic Detection

and

Mitigationof False

Sharing

Page 10: Whose Cache Line  Is It Anyway?

10

Page 11: Whose Cache Line  Is It Anyway?

11

T1 T2

Cache

Main Memory

0x300

Read 0x300

0x340

Write 0x300 Write 0x308

Page 12: Whose Cache Line  Is It Anyway?

12

Cache LineC Structure

With Padding

With AllocatorMetadata

Page 13: Whose Cache Line  Is It Anyway?

13

1 2 3 4 5 6 7 805

10152025303540

Serial ParallelRegular (FS) Source Fixed

No. of Cores

Tim

e (s

)

Page 14: Whose Cache Line  Is It Anyway?

14

1 2 3 4 5 6 7 805

10152025303540

Serial ParallelRegular (FS) Source Fixed

No. of Cores

Tim

e (s

)

Page 15: Whose Cache Line  Is It Anyway?

15

1 2 3 4 5 6 7 805

10152025303540

Serial ParallelRegular (FS) Source Fixed

No. of Cores

Tim

e (s

)

Page 16: Whose Cache Line  Is It Anyway?

16

1 2 3 4 5 6 7 805

10152025303540

Serial ParallelRegular (FS) Source Fixed

No. of Cores

Tim

e (s

)

Page 17: Whose Cache Line  Is It Anyway?

17

1 2 3 4 5 6 7 805

10152025303540

Serial ParallelRegular (FS) Source Fixed

No. of Cores

Tim

e (s

)

7.5x

Linux Kernel [OSDI ’10], JVM [Dice, 2012],Software Transactional Memory [HPCA ’06]

Page 18: Whose Cache Line  Is It Anyway?

18

Dynamic Detection

and

Mitigationof False

Sharing

Page 19: Whose Cache Line  Is It Anyway?

19

Modify access locations

Modify access frequencySheriff [OOPSLA ’11]

Page 20: Whose Cache Line  Is It Anyway?

20

Page 21: Whose Cache Line  Is It Anyway?

21

Isolated Page

Underlay Page

T1 T2

Page 22: Whose Cache Line  Is It Anyway?

22

Dynamic Detection

and

Mitigationof False

Sharing

Page 23: Whose Cache Line  Is It Anyway?

23

Persistent, high-frequency

false sharing

Page 24: Whose Cache Line  Is It Anyway?

24

Very Fast and Imprecise

Fast and Somewhat

Precise

Slow and Precise

Page 25: Whose Cache Line  Is It Anyway?

25

Does this signifyfalse sharing?

Performance Counters

Log Page Reads

Instruction Emulation

Log-Analysis

Does contention exist?What pages are involvedin the contention?

What are the byte rangesbeing accessed?

Rules for remapper

Page 26: Whose Cache Line  Is It Anyway?

26

Dynamic Detection

and

Mitigationof False

Sharing

Page 27: Whose Cache Line  Is It Anyway?

27

Isolated Page

Underlay Page

T1 T2

Page 28: Whose Cache Line  Is It Anyway?

28

Don’t be EvilHarmful

Page 29: Whose Cache Line  Is It Anyway?

29

Fault Driven Redirection

Page 30: Whose Cache Line  Is It Anyway?

30

Original Code Code Cache

?!It’s a Fault?!

Page 31: Whose Cache Line  Is It Anyway?

31

Original Code Code Cache

Page 32: Whose Cache Line  Is It Anyway?

32

Avoid code trampolines

Catch all accesses via data path

Amortize page fault cost

Page 33: Whose Cache Line  Is It Anyway?

33

“Know When You are Beaten”

Page 34: Whose Cache Line  Is It Anyway?

34

Isolated Page

Underlay Page

T1 T2

Page 35: Whose Cache Line  Is It Anyway?

35

Evaluation

Page 36: Whose Cache Line  Is It Anyway?

36

0 1000 2000 3000 4000 5000 60000

100

200

300

400

500

600

Time (ms)

Prog

ress

(milli

on re

cord

s)

Remappings Established

Version with false sharing under Plastic

Coherence Invalidations

Source-fixed Version

110 M/sec160 M/sec

Page 37: Whose Cache Line  Is It Anyway?

37

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1 Regular w/PlasticCCBenc

hPhoenix Parsec

1.4x

3.6x5.4x

Norm

alize

d Pe

rform

ance

Page 38: Whose Cache Line  Is It Anyway?

38

Low overhead runtime detection

Byte-granularity remapping

Speedup of up to 5.4x

Page 39: Whose Cache Line  Is It Anyway?

39

Performance Optimizations

Security Enhancements

Page 40: Whose Cache Line  Is It Anyway?

40