Elimina'ng Read Barriers through Procras'na'on and - - PowerPoint PPT Presentation

elimina ng read barriers through procras na on and
SMART_READER_LITE
LIVE PREVIEW

Elimina'ng Read Barriers through Procras'na'on and - - PowerPoint PPT Presentation

Elimina'ng Read Barriers through Procras'na'on and Cleanliness KC Sivaramakrishnan Lukasz Ziarek Suresh Jagannathan Big Picture Lightweight user-level threads


slide-1
SLIDE 1

Elimina'ng ¡Read ¡Barriers ¡through ¡ Procras'na'on ¡and ¡Cleanliness ¡

KC ¡Sivaramakrishnan ¡ Lukasz ¡Ziarek ¡ Suresh ¡Jagannathan ¡

slide-2
SLIDE 2

Big ¡Picture ¡

2 ¡ Lightweight ¡user-­‑level ¡threads ¡

Scheduler ¡1 ¡ t1 ¡ t2 ¡ tn ¡ Lots ¡of ¡ concurrency! ¡

Core ¡1 ¡ Core ¡n ¡ Core ¡2 ¡ Heap ¡

slide-3
SLIDE 3

Big ¡Picture ¡

3 ¡

Expendable ¡ resource? ¡

Big ¡Picture ¡

3 ¡

Scheduler ¡1 ¡ t1 ¡ t2 ¡ tn ¡ Lots ¡of ¡ concurrency! ¡

Heap ¡

slide-4
SLIDE 4

Big ¡Picture ¡

4 ¡

Expendable ¡ resource? ¡

Big ¡Picture ¡

4 ¡

Scheduler ¡1 ¡ t1 ¡ t2 ¡ tn ¡ Lots ¡of ¡ concurrency! ¡

Heap ¡

Exploit ¡program ¡concurrency ¡ ¡ to ¡ ¡ eliminate ¡read ¡barriers ¡from ¡thread-­‑local ¡collectors ¡

GC ¡OperaDon ¡

Alleviate ¡MM ¡ cost? ¡

slide-5
SLIDE 5

MulDMLton ¡

  • Goals ¡

– Safety, ¡Scalability, ¡ready ¡for ¡future ¡manycore ¡processors ¡

  • Parallel ¡extension ¡of ¡MLton ¡– ¡a ¡whole-­‑program, ¡
  • pDmizing ¡SML ¡compiler ¡
  • Parallel ¡extension ¡of ¡Concurrent ¡ML ¡

– Lots ¡of ¡Concurrency! ¡ – Interact ¡by ¡sending ¡messages ¡over ¡first-­‑class ¡channels ¡

5 ¡ C ¡ send ¡(c, ¡v) ¡ v ¡ß ¡recv ¡(c) ¡

slide-6
SLIDE 6

MulDMLton ¡GC: ¡ConsideraDons ¡

  • Standard ¡ML ¡– ¡funcDonal ¡PL ¡with ¡side-­‑effects ¡

– Most ¡objects ¡are ¡small ¡and ¡ephemeral ¡

  • Independent ¡generaDonal ¡GC ¡

– # ¡MutaDons ¡<< ¡# ¡Reads ¡

  • Keep ¡cost ¡of ¡reads ¡to ¡be ¡low ¡
  • Minimize ¡NUMA ¡effects ¡
  • Run ¡on ¡non-­‑cache ¡coherent ¡HW ¡

¡

6 ¡

slide-7
SLIDE 7

MulDMLton ¡GC: ¡Design ¡

7 ¡ Core ¡ Local ¡Heap ¡ Core ¡ Local ¡Heap ¡ Core ¡ Local ¡Heap ¡ Core ¡ Local ¡Heap ¡ Shared ¡Heap ¡ Thread-­‑local ¡GC ¡

  • NUMA ¡Awareness ¡
  • Circumvent ¡cache-­‑coherence ¡issues ¡
slide-8
SLIDE 8

Invariant ¡PreservaDon ¡

  • Read ¡and ¡write ¡barriers ¡for ¡preserving ¡

invariants ¡

8 ¡ Shared ¡Heap ¡ r ¡ Local ¡Heap ¡ x ¡ Target ¡ Source ¡ ExporDng ¡ writes ¡

r ¡:= ¡x ¡

Shared ¡Heap ¡ r ¡ Local ¡Heap ¡ x ¡ FWD ¡ TransiDve ¡ closure ¡of ¡x ¡ Mutator ¡ needs ¡read ¡ barriers! ¡

slide-9
SLIDE 9

Challenge ¡

  • Object ¡reads ¡are ¡pervasive ¡

– RB ¡overhead ¡∝ ¡cost ¡(RB) ¡* ¡frequency ¡(RB) ¡

  • Read ¡barrier ¡opDmizaDon ¡

– Stacks ¡and ¡Registers ¡never ¡point ¡to ¡forwarded ¡objects ¡

9 ¡

  • 20.1 ¡% ¡

15.3 ¡% ¡ 21.3 ¡% ¡ Mean ¡Overhead ¡

  • ­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑ ¡

Read ¡barrier ¡overhead ¡(%) ¡

slide-10
SLIDE 10

Mutator ¡and ¡Forwarded ¡Objects ¡

10 ¡

# ¡RB ¡invocaDons ¡ # ¡Encountered ¡ forwarded ¡objects ¡ < ¡ 0.00001 ¡ Eliminate ¡read ¡barriers ¡altogether ¡

slide-11
SLIDE 11

RB ¡EliminaDon ¡

  • Visibility ¡Invariant ¡

– Mutator ¡does ¡not ¡encounter ¡forwarded ¡objects ¡

  • ObservaDon ¡

– No ¡forwarded ¡objects ¡created ¡⇒ ¡visibility ¡ invariant ¡⇒ ¡No ¡read ¡barriers ¡

  • Exploit ¡concurrency ¡à

à ¡Procras(na(on! ¡ ¡

11 ¡

slide-12
SLIDE 12

ProcrasDnaDon ¡

Shared ¡Heap ¡ r1 ¡ Local ¡Heap ¡ x1 ¡ T1 ¡ T2 ¡ r2 ¡ x2 ¡

à ¡r1 ¡:= ¡x1 ¡ ¡ ¡ ¡ ¡ ¡ ¡r2 ¡:= ¡x2 ¡

T ¡ à ¡T ¡is ¡running ¡ T ¡ à ¡T ¡is ¡suspended ¡ T ¡ à ¡T ¡is ¡blocked ¡ 12 ¡

slide-13
SLIDE 13

ProcrasDnaDon ¡

Shared ¡Heap ¡ r1 ¡ Local ¡Heap ¡ x1 ¡

r1 ¡:= ¡x1 ¡

T1 ¡ T2 ¡

¡à ¡r2 ¡:= ¡x2 ¡

r2 ¡ x2 ¡

Delayed ¡write ¡list ¡à ¡

Control ¡ switches ¡ to ¡T2 ¡ T ¡ à ¡T ¡is ¡running ¡ T ¡ à ¡T ¡is ¡suspended ¡ T ¡ à ¡T ¡is ¡blocked ¡ 13 ¡

slide-14
SLIDE 14

ProcrasDnaDon ¡

Shared ¡Heap ¡ r1 ¡ Local ¡Heap ¡ x1 ¡ T1 ¡ T2 ¡ r2 ¡ x2 ¡

Delayed ¡write ¡list ¡à ¡

r1 ¡:= ¡x1 ¡ ¡ ¡ ¡ ¡ ¡ ¡r2 ¡:= ¡x2 ¡

T ¡ à ¡T ¡is ¡running ¡ T ¡ à ¡T ¡is ¡suspended ¡ T ¡ à ¡T ¡is ¡blocked ¡ 14 ¡

slide-15
SLIDE 15

ProcrasDnaDon ¡

Shared ¡Heap ¡ r1 ¡ Local ¡Heap ¡ T1 ¡ T2 ¡ r2 ¡ x2 ¡

Delayed ¡write ¡list ¡à ¡

r1 ¡:= ¡x1 ¡ ¡ ¡ ¡ ¡ ¡ ¡r2 ¡:= ¡x2 ¡

x1 ¡ T ¡ à ¡T ¡is ¡running ¡ T ¡ à ¡T ¡is ¡suspended ¡ T ¡ à ¡T ¡is ¡blocked ¡ FWD ¡ 15 ¡ FWD ¡

slide-16
SLIDE 16

ProcrasDnaDon ¡

Shared ¡Heap ¡ r1 ¡ Local ¡Heap ¡ T1 ¡ T2 ¡ r2 ¡ x2 ¡

Delayed ¡write ¡list ¡à ¡

x1 ¡ Force ¡local ¡ GC ¡ T ¡ à ¡T ¡is ¡running ¡ T ¡ à ¡T ¡is ¡suspended ¡ T ¡ à ¡T ¡is ¡blocked ¡ 16 ¡

à ¡r1 ¡:= ¡x1 ¡ ¡ ¡ ¡ ¡ ¡ ¡r2 ¡:= ¡x2 ¡

slide-17
SLIDE 17

Correctness ¡

  • Does ¡ProcrasDnaDon ¡introduce ¡deadlocks? ¡

– Threads ¡can ¡be ¡procrasDnated ¡while ¡holding ¡a ¡lock! ¡

¡

17 ¡ T1 ¡ T2 ¡ T2 ¡ T ¡ à ¡T ¡is ¡running ¡ T ¡ à ¡T ¡is ¡suspended ¡ T ¡ à ¡T ¡is ¡blocked ¡

slide-18
SLIDE 18

Correctness ¡

18 ¡ T1 ¡

  • Is ¡ProcrasDnaDon ¡safe? ¡

– Yes. ¡Forcing ¡a ¡local ¡GC ¡unblocks ¡the ¡threads. ¡ – No ¡deadlocks ¡or ¡livelocks! ¡

T2 ¡ T ¡ à ¡T ¡is ¡running ¡ T ¡ à ¡T ¡is ¡suspended ¡ T ¡ à ¡T ¡is ¡blocked ¡

  • Does ¡ProcrasDnaDon ¡introduce ¡deadlocks? ¡

– Threads ¡can ¡be ¡procrasDnated ¡while ¡holding ¡a ¡lock! ¡

¡

slide-19
SLIDE 19

Correctness ¡

19 ¡ T1 ¡ T2 ¡

  • Does ¡ProcrasDnaDon ¡introduce ¡deadlocks? ¡

– Threads ¡can ¡be ¡procrasDnated ¡while ¡holding ¡a ¡lock! ¡

¡

T ¡ à ¡T ¡is ¡running ¡ T ¡ à ¡T ¡is ¡suspended ¡ T ¡ à ¡T ¡is ¡blocked ¡

  • Is ¡ProcrasDnaDon ¡safe? ¡

– Yes. ¡Forcing ¡a ¡local ¡GC ¡unblocks ¡the ¡threads. ¡ – No ¡deadlocks ¡or ¡livelocks! ¡

slide-20
SLIDE 20
  • Efficacy ¡(ProcrasDnaDon) ¡∝ ¡# ¡Available ¡runnable ¡

threads ¡ ¡

Is ¡ProcrasDnaDon ¡alone ¡enough? ¡

20 ¡ M ¡ W1 ¡ W1 ¡ W1 ¡ F ¡ J ¡ Serial ¡(low ¡thread ¡availability) ¡ Concurrent ¡(high ¡thread ¡availability) ¡

  • With ¡ProcrasDnaDon, ¡half ¡of ¡local ¡major ¡GCs ¡were ¡

forced ¡ Eager ¡exporDng ¡writes ¡while ¡preserving ¡ visibility ¡invariant ¡

slide-21
SLIDE 21

Cleanliness ¡

  • A ¡clean ¡object ¡closure ¡can ¡be ¡liped ¡to ¡the ¡

shared ¡heap ¡without ¡breaking ¡the ¡visibility ¡ invariant ¡

21 ¡

r ¡:= ¡x ¡

inSharedHeap ¡(r) ¡ inLocalHeap ¡(x) ¡ && ¡ isClean ¡(x) ¡

Eager ¡write ¡(no ¡ProcrasDnaDon) ¡

slide-22
SLIDE 22

Cleanliness: ¡IntuiDon ¡

22 ¡ Shared ¡Heap ¡ Local ¡Heap ¡ x ¡

lip ¡(x) ¡to ¡shared ¡ ¡ heap ¡

slide-23
SLIDE 23

Shared ¡Heap ¡ Local ¡Heap ¡

Cleanliness: ¡IntuiDon ¡

23 ¡ x ¡ FWD ¡

find ¡all ¡references ¡ ¡ to ¡FWD ¡

slide-24
SLIDE 24

Shared ¡Heap ¡ Local ¡Heap ¡

Cleanliness: ¡IntuiDon ¡

24 ¡ x ¡

Need ¡to ¡scan ¡the ¡ ¡ enDre ¡local ¡heap ¡

slide-25
SLIDE 25

Local ¡Heap ¡ h ¡ Shared ¡Heap ¡

Cleanliness: ¡Simpler ¡quesDon ¡

25 ¡ x ¡ FWD ¡

Do ¡all ¡references ¡ ¡

  • riginate ¡from ¡ ¡

heap ¡region ¡h? ¡ sizeof ¡(h) ¡<< ¡sizeof ¡(local ¡heap) ¡

slide-26
SLIDE 26

Local ¡Heap ¡ h ¡ Shared ¡Heap ¡

Cleanliness: ¡Simpler ¡quesDon ¡

26 ¡ x ¡

Only ¡scan ¡the ¡ heap ¡region ¡h. ¡

Heap ¡ session! ¡

sizeof ¡(h) ¡<< ¡sizeof ¡(local ¡heap) ¡

slide-27
SLIDE 27
  • Current ¡session ¡closed ¡& ¡new ¡session ¡opened ¡

– Aper ¡an ¡exporDng ¡write, ¡a ¡user-­‑level ¡context ¡switch, ¡a ¡ local ¡GC ¡

Heap ¡Sessions ¡

  • Source ¡of ¡an ¡exporDng ¡write ¡is ¡open ¡

– Young ¡ – rarely ¡referenced ¡from ¡outside ¡the ¡closure ¡

27 ¡ Previous ¡Session ¡

Current ¡ Session ¡

Free ¡

Local ¡Heap ¡ SessionStart ¡ FronDer ¡ Young ¡ Objects ¡ Old ¡ ¡ Objects ¡ Start ¡

slide-28
SLIDE 28
  • Current ¡session ¡closed ¡& ¡new ¡session ¡opened ¡

– Aper ¡an ¡exporDng ¡write, ¡a ¡user-­‑level ¡context ¡switch, ¡a ¡ local ¡GC ¡ – SessionStart ¡is ¡moved ¡to ¡FronDer ¡

Heap ¡Sessions ¡

  • Source ¡of ¡an ¡exporDng ¡write ¡is ¡open ¡

– Young ¡ – rarely ¡referenced ¡from ¡outside ¡the ¡closure ¡

28 ¡

  • Average ¡current ¡session ¡size ¡< ¡4KB ¡

Previous ¡Session ¡ Free ¡

Local ¡Heap ¡ FronDer ¡& ¡SessionStart ¡ Start ¡

slide-29
SLIDE 29

Cleanliness: ¡Eager ¡exporDng ¡writes ¡

29 ¡

  • A ¡clean ¡object ¡closure ¡

– is ¡fully ¡contained ¡within ¡the ¡current ¡session ¡ – has ¡no ¡references ¡from ¡previous ¡session ¡

Previous ¡Session ¡

Current ¡ Session ¡

Free ¡

Local ¡Heap ¡

X Y Z

r ¡:= ¡x ¡

r ¡

Shared ¡Heap ¡

slide-30
SLIDE 30

Cleanliness: ¡Eager ¡exporDng ¡writes ¡

30 ¡

  • A ¡clean ¡object ¡closure ¡

– is ¡fully ¡contained ¡within ¡the ¡current ¡session ¡ – has ¡no ¡references ¡from ¡previous ¡session ¡

Previous ¡Session ¡

Current ¡ Session ¡

Free ¡

Local ¡Heap ¡

X Y Z

r ¡:= ¡x ¡

r ¡

Shared ¡Heap ¡

Walk ¡ and ¡fix ¡

FWD ¡

slide-31
SLIDE 31

Avoid ¡tracing ¡current ¡session? ¡

  • Many ¡SML ¡objects ¡are ¡tree-­‑structured ¡(List, ¡Tree, ¡etc,.) ¡

– Specialize ¡for ¡no ¡pointers ¡from ¡outside ¡the ¡object ¡closure ¡

  • ∀x’ ¡∊ ¡transiDve ¡object ¡closure ¡(x), ¡ ¡

¡ ¡ ¡ref_count ¡(x) ¡= ¡0 ¡&& ¡ref_count ¡(x’) ¡= ¡1 ¡

31 ¡

Local ¡Heap ¡

x(0) ¡ y(1) ¡ z(1) ¡

  • Eager ¡exporDng ¡write ¡

– No ¡current ¡session ¡tracing ¡needed! ¡

¡

No ¡refs ¡ from ¡

  • utside ¡

– ref_count ¡does ¡not ¡consider ¡pointers ¡from ¡stack ¡or ¡registers ¡

slide-32
SLIDE 32

Reference ¡Count ¡

32 ¡

Current ¡Session ¡ X(0) ¡ Current ¡Session ¡ X(1) ¡ Current ¡Session ¡ X(LM) ¡ Current ¡Session ¡ X(G) ¡

Prev Sess ¡ Zero ¡ One ¡ LocalMany ¡ Global ¡

  • Purpose ¡

– Track ¡pointers ¡from ¡previous ¡session ¡to ¡current ¡session ¡ – IdenDfy ¡tree-­‑structured ¡object ¡

  • Does ¡not ¡track ¡pointers ¡from ¡stack ¡and ¡registers ¡

– Reference ¡count ¡only ¡triggered ¡during ¡object ¡iniDalizaDon ¡ and ¡mutaDon ¡

slide-33
SLIDE 33

Bringing ¡it ¡all ¡together ¡

  • ∀x’ ¡∊ ¡transiDve ¡object ¡closure ¡(x), ¡ ¡

¡ ¡ ¡if ¡max ¡(ref_count ¡(x’)) ¡

– One ¡& ¡ref_count ¡(x) ¡= ¡0 ¡⇒ ¡tree-­‑structured ¡(Clean) ¡ ⇒ ¡Session ¡tracing ¡not ¡needed ¡ – LocalMany ¡⇒ ¡Clean ¡⇒ ¡Trace ¡current ¡session ¡ – Global ¡⇒ ¡1+ ¡pointer ¡from ¡previous ¡session ¡⇒ ¡ ProcrasGnate ¡

33 ¡

slide-34
SLIDE 34

Example ¡1: ¡Tree-­‑structured ¡Object ¡

34 ¡ Previous ¡ Session ¡

Current ¡Session ¡

x(0) ¡ y(1) ¡ z(1) ¡ T1 ¡

Local ¡Heap ¡ Shared ¡heap ¡

r ¡:= ¡x ¡

r ¡ current ¡ ¡ stack ¡

slide-35
SLIDE 35

Shared ¡heap ¡

Example ¡1: ¡Tree-­‑structured ¡Object ¡

35 ¡ Previous ¡ Session ¡

Current ¡Session ¡

x ¡ y ¡ z ¡ T1 ¡ current ¡ ¡ stack ¡

Local ¡Heap ¡

r ¡:= ¡x ¡

FWD ¡

r ¡ Walk ¡ current ¡ stack ¡

slide-36
SLIDE 36

Shared ¡heap ¡

Example ¡1: ¡Tree-­‑structured ¡Object ¡

36 ¡ Previous ¡ Session ¡

Current ¡Session ¡

x ¡ y ¡ z ¡ T1 ¡ current ¡ ¡ stack ¡

Local ¡Heap ¡

r ¡:= ¡x ¡

r ¡ No ¡need ¡to ¡ walk ¡current ¡ session! ¡

slide-37
SLIDE 37

Shared ¡heap ¡

Example ¡1: ¡Tree-­‑structured ¡Object ¡

37 ¡ Previous ¡ Session ¡

Current ¡Session ¡

x ¡ y ¡ z ¡ T1 ¡

Local ¡Heap ¡

r ¡:= ¡x ¡

r ¡ T2 ¡ Next ¡ stack ¡

FWD ¡

current ¡ ¡ stack ¡

slide-38
SLIDE 38

Shared ¡heap ¡

Example ¡1: ¡Tree-­‑structured ¡Object ¡

38 ¡ Previous ¡ Session ¡

Current ¡Session ¡

x ¡ y ¡ z ¡ T1 ¡ previous ¡ stack ¡

Local ¡Heap ¡

r ¡:= ¡x ¡

r ¡ T2 ¡ current ¡ stack ¡

Context ¡Switch ¡

Walk ¡ target ¡ stack ¡

slide-39
SLIDE 39

Example ¡2: ¡Object ¡Graph ¡

39 ¡ Previous ¡ Session ¡

Current ¡Session ¡

x(0) ¡ y

(LM) ¡

z(1) ¡ current ¡ ¡ stack ¡

Local ¡Heap ¡ Shared ¡heap ¡

r ¡:= ¡x ¡

r ¡ a ¡

slide-40
SLIDE 40

Shared ¡heap ¡

Example ¡2: ¡Object ¡Graph ¡

40 ¡ Previous ¡ Session ¡

Current ¡Session ¡

x ¡ y ¡ z ¡ current ¡ ¡ stack ¡

Local ¡Heap ¡

r ¡:= ¡x ¡

r ¡ a ¡

FWD ¡ FWD ¡

Walk ¡ current ¡ stack ¡ Walk ¡ current ¡ session ¡

slide-41
SLIDE 41

Shared ¡heap ¡

Example ¡2: ¡Object ¡Graph ¡

41 ¡ Previous ¡ Session ¡

Current ¡Session ¡

x ¡ y ¡ z ¡ current ¡ ¡ stack ¡

Local ¡Heap ¡

r ¡:= ¡x ¡

r ¡ a ¡ Walk ¡ current ¡ stack ¡ Walk ¡ current ¡ session ¡ ¡

slide-42
SLIDE 42

Example ¡3: ¡Global ¡Reference ¡

42 ¡ Previous ¡ Session ¡

Current ¡Session ¡

x(0) ¡ y(1) ¡ z(G) ¡ T1 ¡ current ¡ ¡ stack ¡

Local ¡Heap ¡ Shared ¡heap ¡

r ¡:= ¡x ¡

r ¡ a ¡

slide-43
SLIDE 43

Example ¡3: ¡Global ¡Reference ¡

43 ¡ Previous ¡ Session ¡

Current ¡Session ¡

x(0) ¡ y(1) ¡ z(G) ¡ T1 ¡ current ¡ ¡ stack ¡

Local ¡Heap ¡ Shared ¡heap ¡

r ¡:= ¡x ¡

r ¡ a ¡ ProcrasDnate ¡

slide-44
SLIDE 44

Immutable ¡Objects ¡

  • Specialize ¡exporDng ¡writes ¡
  • If ¡immutable ¡object ¡in ¡previous ¡session ¡

– Copy ¡to ¡shared ¡heap ¡

  • Immutable ¡objects ¡in ¡SML ¡do ¡not ¡have ¡idenGty ¡

– Original ¡object ¡unmodified ¡

  • Avoid ¡space ¡leaks ¡

– Treat ¡large ¡immutable ¡objects ¡as ¡mutable ¡

44 ¡

slide-45
SLIDE 45

Cleanliness: ¡Summary ¡

  • Cleanliness ¡allows ¡eager ¡exporDng ¡writes ¡

while ¡preserving ¡visibility ¡invariant ¡

  • With ¡ProcrasDnaDon ¡+ ¡Cleanliness, ¡<1% ¡of ¡

local ¡GCs ¡were ¡forced ¡

45 ¡

slide-46
SLIDE 46

EvaluaDon ¡

46 ¡

  • Variants ¡

– RB-­‑ ¡: ¡TLC ¡with ¡ProcrasDnaDon ¡and ¡Cleanliness ¡ ¡ – RB+ ¡: ¡TLC ¡with ¡read ¡barriers ¡

  • Sansom’s ¡dual-­‑mode ¡GC ¡

– Cheney’s ¡2-­‑space ¡copying ¡collecDon ¡ßà ¡Jonker’s ¡sliding ¡ mark-­‑compacDng ¡ – GeneraDonal, ¡2 ¡generaDons, ¡No ¡aging ¡

  • Target ¡Architectures: ¡ ¡

– 16-­‑core ¡AMD ¡Opteron ¡server ¡(NUMA) ¡ – 48-­‑core ¡Intel ¡SCC ¡(non-­‑cache ¡coherent) ¡ – 864-­‑core ¡Azul ¡Vega3 ¡

slide-47
SLIDE 47

Results ¡

  • Speedup: ¡At ¡3X ¡min ¡heap ¡size, ¡RB-­‑ ¡faster ¡than ¡

RB+ ¡

– AMD ¡(16-­‑cores) ¡32% ¡(2X ¡faster ¡than ¡STW ¡ collector) ¡ – SCC ¡(48-­‑cores) ¡20% ¡ – AZUL ¡(864-­‑cores) ¡30% ¡

  • Concurrency ¡

– During ¡exporDng ¡write, ¡8 ¡runnable ¡user-­‑level ¡ threads/core! ¡

47 ¡

slide-48
SLIDE 48

Cleanliness ¡Impact ¡

  • RB-­‑ ¡MU-­‑ ¡: ¡RB-­‑ ¡GC ¡ignoring ¡mutability ¡for ¡Cleanliness ¡
  • RB-­‑ ¡CL-­‑ ¡: ¡RB-­‑ ¡GC ¡ignoring ¡Cleanliness ¡(Only ¡ProcrasGnaGon) ¡

48 ¡

  • Avg. ¡slowdown ¡
  • ­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑ ¡

11.4% ¡ 28.2% ¡ 31.7% ¡

slide-49
SLIDE 49

Conclusion ¡

  • Eliminate ¡the ¡need ¡for ¡read ¡barriers ¡by ¡

preserving ¡the ¡visibility ¡invariant ¡

– Procras'na'on: ¡Exploit ¡concurrency ¡for ¡delaying ¡ exporDng ¡writes ¡ – Cleanliness: ¡Exploit ¡generaDonal ¡property ¡for ¡ eagerly ¡perform ¡exporDng ¡writes ¡

  • AddiDonal ¡niceDes ¡

– Completely ¡dynamic ¡à ¡Portable ¡ – Does ¡not ¡impose ¡any ¡restricDon ¡on ¡the ¡GC ¡ strategy ¡

49 ¡

slide-50
SLIDE 50

QuesDons? ¡

hxp://mulDmlton.cs.purdue.edu ¡

50 ¡

slide-51
SLIDE 51

Results ¡

  • On ¡AMD, ¡16 ¡Cores, ¡3X ¡minimum ¡heap ¡size ¡
  • Mutator ¡'me: ¡ ¡

– STW ¡GC ¡spends ¡the ¡least ¡amount ¡of ¡Dme ¡in ¡the ¡ mutator ¡

  • No ¡read/write ¡barriers ¡

– Compared ¡to ¡STW ¡GC, ¡the ¡mutator ¡Dme ¡of ¡

  • RB-­‑ ¡18% ¡more, ¡RB+ ¡39% ¡more ¡
  • GC ¡'me: ¡ ¡

– RB-­‑ ¡spends ¡the ¡least ¡amount ¡Dme ¡doing ¡GC ¡ – RB-­‑ ¡within ¡5% ¡of ¡RB+ ¡

51 ¡

slide-52
SLIDE 52

Performance ¡on ¡AMD ¡(16-­‑cores) ¡

  • (a) Total time
  • At ¡3X ¡min ¡

heap ¡size: ¡

  • ­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑ ¡

RB+ ¡ ¡32% ¡ ¡ STW ¡106% ¡ BDW ¡584% ¡

52 ¡

  • (c) GC time
  • (b) Mutator time
slide-53
SLIDE 53

MulDMLton ¡-­‑ ¡SCC ¡implementaDon ¡

  • Shared off-die DRAM

CPU0 L1$ L2$

Private DRAM

CPU47 L1$ L2$

Private DRAM

Message Passing Buffer (8KB/core)

Non-­‑Cached ¡-­‑-­‑ ¡ Shared ¡heap ¡ Cached ¡-­‑-­‑ ¡ Local ¡heap ¡

53 ¡

slide-54
SLIDE 54

Total ¡Dme: ¡SCC ¡and ¡AZUL ¡

54 ¡

  • SCC ¡(48-­‑cores) ¡

AZUL ¡(864-­‑Cores) ¡

20% ¡ 30% ¡ Non-­‑cache ¡coherent ¡ Scalable, ¡cache-­‑coherent ¡

slide-55
SLIDE 55

Cleanliness ¡Impact ¡(1) ¡

!"#$%&'() !""#$%&' ($&)*'+,- ./,)-0&$12' 0$3*456%5* 78",'-*&%)9 :$);*"<&/- =,8"*%8 >$?-&$8* *!+ @AB@ CDEBF @EC BADF@ FEA@F @BF @ED BEFB *!+,-.+ @AB@ CGHFB@F @HF IBEECB EGBFB FGH CBBGHF BICB *!+,/0+ @FCFBF DI@EDAF@ EG@IA EADICFB FIGFBH@@ FECH@ H@FBCH D@@HA

Figure 14: Number of preemptions on write barrier.

!"#$%&'() !""#$%&' ($&)*'+,- ./,)-0&$12' 0$3*456%5* 78",'-*&%)9 :$);*"<&/- =,8"*%8 >$?-&$8* *!+ @A@B @ACD @ EAFG @ CAGE @ CADH *!+,-.+ @A@B CIAH @A@E IAGD @A@H HABJ IAED CADH *!+,/0+ EBAFF C@@ @ACB IIADF HCAJG BJAHH CIAE HGABJ

Figure 15: Forced GCs as a percentage of the total number of major GCs.

  • 55 ¡

Number ¡of ¡PreempDons ¡on ¡exporDng ¡writes ¡ Forced ¡GCs ¡as ¡a ¡% ¡of ¡total ¡number ¡of ¡local ¡major ¡GCs ¡ ¡

slide-56
SLIDE 56

Benchmark ¡CharacterisDcs ¡

56 ¡

!"# $%% !&'( !"# $%% !&'( )*$+ !"# $%% !&'( '(()*+,- ./% 01 /020 /# /# 0! // "0# 0/" 1"%#. 3*,45-678 %%" %2 /1." "2 "2 .%# " 0/" /2"! 1"%#. 9:748;,*<6- "0&! /!! !!%0 "! "! //%# / /". "0# /#1.! =*>5?@A+@5 "!!0 /"% !"## "/ "/ &01 /1 "0# /2"! ./&" BC(7-85,+4; 1#!1 /2. .&"% 1" 1" /"#0 1 "0# /2"! ./&" D*4E5(F,:8 1!& !1 ##& " " 1" . /". 0/" ./&" G7C(5+C /!12 .% !%#/ /1 /! #2& / #! 1.! /#1.! H*I8,*C5 .2& 0! "/11 // /" ##1 ! /". "0# "2!. !,,-./01-2*3/04* 5"6789 642.+:/;< =*>+;4/?8 6@048*!,,-./04?*5A69

slide-57
SLIDE 57

Session ¡Impact ¡

  • !"#$%&'()

!6678(9& :89*'&;<= >)<*=#98?;& @8A'BCD(C' EF6<&='9(*# G8*H'6I9)= J<F6'(F K8L=98F' *+,-+$."'# 1$2 02$4 /$3 ,2$, 05$3 4$1 02$2 /$, /012+3"3345#+ 346"+789:"3; ,-./ 01/. 230, 0244 ,20/ /5,2 0,34 00,2

Figure 17: Impact of heap session: % LM clean represents the fraction of instances when a clean object closure has at least one

  • bject with LOCAL MANY references.

57 ¡

slide-58
SLIDE 58

Read ¡Barrier ¡

CondiDonal ¡(Baker ¡Style) ¡ UncondiDonal ¡(Brooks ¡style) ¡

From ¡ From ¡ To ¡ To ¡ 58 ¡

slide-59
SLIDE 59

Read ¡Barrier ¡

CondiDonal ¡(Baker ¡Style) ¡ UncondiDonal ¡(Brooks ¡style) ¡

F ¡

pointer readBarrier (pointer *p) { if (*(Header*)(p – HD_OFF) == F) return *(pointer*)p; return p; } pointer readBarrier (pointer *p) { return *(pointer*)(p – IND_OFF); }

F ¡ Has ¡CondiDonal ¡Check ¡ Needs ¡extra ¡header ¡word ¡

From ¡ From ¡ To ¡ To ¡ 59 ¡

slide-60
SLIDE 60

Read ¡Barrier ¡OpDmizaDons ¡

  • Stacks ¡and ¡registers ¡never ¡point ¡to ¡forwarding ¡

pointers ¡

  • “Eager” ¡read ¡barriers ¡(D.Bacon ¡et ¡al. ¡POPL’93) ¡
  • Scan ¡stack ¡aper ¡exporDng ¡write ¡
  • ExporDng ¡write ¡is ¡a ¡GC ¡safe-­‑point ¡
  • Reduces ¡RB ¡overhead ¡by ¡~5% ¡

60 ¡

slide-61
SLIDE 61

Performance ¡on ¡AZUL ¡

  • (a) Total time
  • (b) Mutator time
  • (c) Garbage collection time
  • (d) Garbage collection overhead
  • At ¡3X ¡min ¡

heap ¡size: ¡

  • ­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑ ¡

RB+ ¡30% ¡

61 ¡

slide-62
SLIDE 62

Performance ¡on ¡SCC ¡

  • (a) Total time
  • (b) Mutator time
  • (c) Garbage collection time
  • (d) Garbage collection overhead

At ¡3X ¡min ¡ heap ¡size: ¡

  • ­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑-­‑ ¡

RB+ ¡20% ¡

62 ¡

slide-63
SLIDE 63

Under ¡the ¡hood ¡

63 ¡ C ¡ send ¡(c, ¡v) ¡ v ¡ß ¡recv ¡(c) ¡ Abstract ¡Shared ¡Heap ¡ T1 ¡ T2 ¡ C ¡ T1’s ¡local ¡heap ¡ T2’s ¡local ¡heap ¡ v ¡ Before ¡CommunicaDon ¡

slide-64
SLIDE 64

Under ¡the ¡hood ¡

64 ¡ C ¡ send ¡(c, ¡v) ¡ v ¡ß ¡recv ¡(c) ¡ Abstract ¡Shared ¡Heap ¡ T1 ¡ T2 ¡ C ¡ T1’s ¡local ¡heap ¡ T2’s ¡local ¡heap ¡ v ¡ Aper ¡CommunicaDon ¡