Drinking from Both PowerPoint Presentation, PPT - DocSlides

Drinking from Both PowerPoint Presentation, PPT - DocSlides

2017-05-28 24K 24 0 0

Description

Glasses:. Combining . Pessimistic and. Optimistic Tracking of Cross-Thread Dependences. Man Cao. Minjia. Zhang. Aritra. . Sengupta. Michael D. Bond. 1. PPoPP. 2016. Dynamic Analyses for Parallel Programs. ID: 553496

Embed code:

Download this presentation



DownloadNote - The PPT/PDF document "Drinking from Both" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.

Presentations text content in Drinking from Both

Slide1

Drinking from Both Glasses:Combining Pessimistic andOptimistic Tracking of Cross-Thread Dependences

Man CaoMinjia ZhangAritra SenguptaMichael D. Bond

1

PPoPP

2016

Slide2

Dynamic Analyses for Parallel Programs

Error detectionData Race DetectorAtomicity Violation DetectorProgramming modelTransactional MemoryEnforcement of Strong Memory ModelDebuggingRecord & ReplayDeterministic Execution

2

Slide3

Dynamic Analyses for Parallel Programs

Error detectionData Race DetectorAtomicity Violation DetectorProgramming modelTransactional MemoryEnforcement of Strong Memory ModelDebuggingRecord & ReplayDeterministic Execution

3

Bad performance!

Slide4

Dynamic Analyses for Parallel Programs

Error detectionData Race DetectorAtomicity Violation DetectorProgramming modelTransactional MemoryEnforcement of Strong Memory ModelDebuggingRecord & ReplayDeterministic Execution

4

Bad performance!

Difficulties?

Slide5

Cross-thread dependences

5

o.f

= …

… = o.f

T1

T2

Slide6

Cross-thread dependences

Tracking cross-thread dependences

6

o.f

= …

… = o.f

T1

T2

Slide7

Cross-thread dependences

Tracking cross-thread dependencesDetectingControlling

7

o.f

= …

… = o.f

T1

T2

Slide8

Outline

Dynamic Analyses and Cross-thread DependencesPessimistic TrackingOptimistic TrackingOur approachHybrid TrackingEvaluation

8

Slide9

Pessimistic Tracking

9

Per-object metadata:

o.state

last writer/reader

thread

Slide10

Pessimistic Tracking

10

rd/wr o.f

Per-object metadata:

o.state

last writer/reader

thread

At each object access:

Slide11

Pessimistic Tracking

11

Check o.state

rd/wr o.f

Analysis-specific work

Update

o.state

Per-object metadata:

o.state

last writer/reader

thread

At each object access:

Slide12

Pessimistic Tracking

12

Check o.state

rd/wr o.f

Analysis-specific work

Update

o.state

Atomic

Per-object metadata:

o.state

last writer/reader

thread

At each object access:

Slide13

Pessimistic Tracking

13

Check o.state

rd/wr o.f

Analysis-specific work

Update

o.state

Lock o.state

Unlock o.state

Per-object metadata:

o.state

last writer/reader

thread

At each object access:

Slide14

Pessimistic Tracking

14

Check o.state

rd/wr o.f

Analysis-specific work

Update

o.state

Lock o.state

Unlock o.state

NOT program locks

Per-object metadata:

o.state

last writer/reader

thread

At each object access:

Slide15

Pessimistic Tracking

15

Lock o.state

wr o.f

Unlock o.state

Lock

o.state

rd o.f

Unlock o.state

Slide16

Pessimistic Tracking

16

Lock o.state

wr o.f

Unlock o.state

Lock

o.state

rd o.f

Unlock o.state

Synchronization and write metadata

Slide17

Performance of Pessimistic Tracking Alone

17

340%

Slide18

Outline

Dynamic Analyses and Cross-thread DependencesPessimistic TrackingOptimistic TrackingOur approachHybrid TrackingEvaluation

18

Slide19

Optimistic Tracking

19

Biased reader-writer lock for o.state

Slide20

Optimistic Tracking

20

Biased reader-writer lock for o.stateAvoid synchronization for non-conflicting accesses

Slide21

Optimistic Tracking

21

Biased reader-writer lock for o.stateAvoid synchronization for non-conflicting accessesHeavyweight coordination for conflicting accesses

Slide22

Optimistic Tracking

22

T1

T2

wr o.f

write check

o.state

: WrExT1

Slide23

Optimistic Tracking

23

T1

T2

wr o.f

write check

o.state

: WrExT1

o.state

: WrExT1

read check

Slide24

Optimistic Tracking

24

T1

T2

read check

Analysis-specific work

wr

o.f

write check

o.state

: WrExT1

o.state: WrExT1

Request

Slide25

Optimistic Tracking

25

T1

T2

safe point

read check

Analysis-specific work

change state

wr o.f

write check

rd

o.f

o.state

: WrExT1

o.state ← RdExT2

o.state: WrExT1

Request

Response

Slide26

Performance of Optimistic Tracking Alone

26

Slide27

Performance of Optimistic Tracking Alone

27

Slide28

Cost of Different Tracking

PessimisticOptimisticSame stateCoordination150479200

28

In CPU cycles

Averaged across all programs

Slide29

29

Optimistic

tracking

performs best if there are

few conflicting

accesses.

Slide30

30

Pessimistic

tracking

is

cheaper

for

conflicting

accesses.

Slide31

Drink from both glasses?

GoalOptimistic tracking for most non-conflicting accessesPessimistic tracking for most conflicting accesses

31

Slide32

Outline

Dynamic Analyses and Cross-thread DependencesPessimistic TrackingOptimistic TrackingOur approachHybrid TrackingEvaluation

32

Slide33

Outline

Dynamic Analyses and Cross-thread DependencesPessimistic TrackingOptimistic TrackingOur approachHybrid TrackingEvaluation

33

Hybrid State Model

Adaptive Policy

Slide34

Outline

Dynamic Analyses and Cross-thread DependencesPessimistic TrackingOptimistic TrackingOur approachHybrid TrackingEvaluation

34

Hybrid State Model

Adaptive Policy

Challenging!

Slide35

Outline

Dynamic Analyses and Cross-thread DependencesPessimistic TrackingOptimistic TrackingOur approachHybrid TrackingEvaluation

35

Hybrid State Model

Deferred Unlocking

Adaptive Policy

Slide36

Pessimistic-Optimistic Mismatch

36

safe point

read check

change state

wr

o.f

write check

rd o.f

Pessimistic Tracking

Optimistic Tracking

Lock

o.state

rd

/wr o.f

Unlock o.state

Slide37

Pessimistic-Optimistic Mismatch (#1)

37

safe point

read check

change state

wr

o.f

write check

rd o.f

Lock

o.state

rd/wr o.f

Unlock o.state

Pessimistic Tracking

Optimistic Tracking

No unlock!

Slide38

Pessimistic-Optimistic Mismatch (#1)

38

safe point

read check

change state

wr

o.f

write check

rd o.f

Lock

o.state

rd/wr o.f

Unlock o.state

Pessimistic Tracking

Optimistic Tracking

No unlock!

Conditional unlock?

Slide39

Pessimistic-Optimistic Mismatch (#2)

39

safe point

read check

change state

wr

o.f

write check

rd o.f

Pessimistic Tracking

Optimistic Tracking

Lock

o.state

rd

/

wr

o.f

Unlock o.state

Atomic

Atomic

Slide40

Pessimistic-Optimistic Mismatch (#2)

40

safe point

read check

change state

wr

o.f

write check

rd o.f

Pessimistic Tracking

Optimistic Tracking

Lock

o.state

rd

/

wr

o.f

Unlock o.state

Atomic

Atomic

Atomicity granularity may

affect specific analysis

Slide41

Pessimistic-Optimistic Mismatch (#2)

41

safe point

read check

change state

wr

o.f

write check

rd o.f

Pessimistic Tracking

Optimistic Tracking

Lock

o.state

rd

/

wr

o.f

Unlock o.state

Atomic

Atomic

Conditional unlock

Atomicity granularity may

affect specific analysis

Slide42

Key Insights

Coarsening atomicity granularity for pessimistic tracking

42

Slide43

Key Insights

Coarsening atomicity granularity for pessimistic trackingProgram synchronization may hint at cross-thread dependences

43

Slide44

Addressing Pessimistic-Optimistic Mismatch

Defer unlocking of pessimistic stateTill program synchronization release operation (PSRO)

44

Slide45

Addressing Pessimistic-Optimistic Mismatch

Defer unlocking of pessimistic stateTill program synchronization release operation (PSRO)Reader-writer locking

45

Slide46

Addressing Pessimistic-Optimistic Mismatch

Defer unlocking of pessimistic stateTill program synchronization release operation (PSRO)Reader-writer lockingFall back to coordination on contention when locking a state

46

Slide47

Deferred Unlocking Example 1

synchronized (m) { …}

47

Unlock all states

Lock

o.state

wr o.f

synchronized (m) { …

Lock

o.state

rd

o.f

Slide48

Deferred Unlocking Example 2

synchronized (m) { … …}

48

Unlock all states

Lock

o.state

wr o.f

Lock o.state

rd o.f

safe point

Slide49

Deferred Unlocking Example 2

synchronized (m) { …}

49

Unlock all states

Lock

o.state

wr o.f

Lock o.state

rd o.f

safe point

Contention => object-level data race

Slide50

Hybrid State Model

50

Slide51

Hybrid State Model

51

Slide52

Outline

Dynamic Analyses and Cross-thread DependencesPessimistic TrackingOptimistic TrackingOur approachHybrid TrackingEvaluation

52

Hybrid State Model

Deferred Unlocking

Adaptive Policy

Slide53

Adaptive Policy

Decide when to transition between pessimistic and optimistic states

53

Slide54

Adaptive Policy

Decide when to transition between pessimistic and optimistic statesCost—benefit model

54

Slide55

Adaptive Policy

Decide when to transition between pessimistic and optimistic statesCost—benefit modelBoil down to counting state transitions

55

Slide56

Adaptive Policy

Decide when to transition between pessimistic and optimistic statesCost—benefit modelBoil down to counting state transitionsOnline profilingPer-objectSimple yet effective

56

Slide57

Application of Hybrid Tracking

Two dynamic analysesHybrid dependence recorder and replayer (detect)Hybrid region serializability (RS) enforcer (control)

57

Slide58

Application of Hybrid Tracking

Two dynamic analysesHybrid dependence recorder and replayer (detect)Hybrid region serializability (RS) enforcer (control)Deferred unlocking helps overcome key challenges!

58

Slide59

Outline

Dynamic Analyses and Cross-thread DependencesPessimistic TrackingOptimistic TrackingOur approachHybrid TrackingEvaluation

59

Slide60

Implementation

Jikes RVM 3.1.3

60

Slide61

Implementation

Jikes RVM 3.1.3Pessimistic tracking, optimistic tracking[Octet, Bond et al. OOPSLA’13]Optimistic recorder and replayer[Replay, Bond et al. PPPJ’15]Optimistic RS enforcer[EnfoRSer, Sengupta et al, ASPLOS’15]

61

Slide62

Implementation

Jikes RVM 3.1.3Pessimistic tracking, optimistic tracking[Octet, Bond et al. OOPSLA’13]Optimistic recorder and replayer[Replay, Bond et al. PPPJ’15]Optimistic RS enforcer[EnfoRSer, Sengupta et al, ASPLOS’15]Hybrid tracking, hybrid recorder and replayer, hybrid RS enforcerpublicly available

62

Slide63

Performance of Tracking

63

22%

Slide64

Performance of Tracking

64

Slide65

Performance of Tracking

65

Most programs are low-conflict

22%

Slide66

Performance of

Recorders and RS enforcers

66

Recorders

RS enforcers

Slide67

Additional Materials

67

Slide68

Related work

Analyses that use pessimistic tracking[FastTrack, Flanagan & Freund, PLDI’09][Velodrome, Flanagan et al., PLDI’08][Chimera, Lee et al., PLDI’12][Lightweight Transactions, Harris & Fraser, OOPSLA’03][DMP, Devietti et al., ASPLOS’09]Analyses that use optimistic tracking[Shasta, Scales et al. ASPLOS’96][Object Race Detection, von Praun & Gross, OOPSLA’01][DoubleChecker, Biswas et al. PLDI’14][LarkTM, Zhang et al, PPoPP’15]Adaptive Mechanisms[Adaptive Locks, Usui et al. PACT’09][Strong Atomicity TM, Abadi et al. PPoPP’09][Adaptive Lock Elision, Dice et al, SPAA’14][Concurrency Control, Ziv et al, PLDI’15]

68

Slide69

Contributions

Hybrid tracking combines pessimistic tracking and optimistic tracking effectively and efficientlyHybrid tracking achieves better overall performanceNever significantly degrades performanceSometimes improves performance substantiallySuitable for workload of diverse communication patterns

69

Slide70

Differences From Locking in Programs

Locking in ProgramTracking DependencesVisible to program?YesNoScopeCode segmentAround each memory accessFrequencyRareCommon

70

Slide71

Adaptive Policy

Decide when to transition between pessimistic and optimistic statesCost—Benefit model

 

71

Slide72

Online Profiling

Counting conflicting/non-conflicting state transitions for each objectCoarse profiling for optimistic objectDetailed profiling for pessimistic objectPer-object vs aggregate profilingPer-object is effective for programs we evaluated

72

Slide73

Evaluation

Parallel programsDaCapo Benchmarks 2006 & 2009SPEC JBB 2000 & 2005Platform32 cores (Intel Xeon E5 4620)

73

Slide74

Performance of Recorders

74

Slide75

Performance of RS enforcers

75


About DocSlides
DocSlides allows users to easily upload and share presentations, PDF documents, and images.Share your documents with the world , watch,share and upload any time you want. How can you benefit from using DocSlides? DocSlides consists documents from individuals and organizations on topics ranging from technology and business to travel, health, and education. Find and search for what interests you, and learn from people and more. You can also download DocSlides to read or reference later.