Tracking Conflicting Accesses Efficiently for Software Record & Replay
-
Upload
hayfa-phelps -
Category
Documents
-
view
46 -
download
1
description
Transcript of Tracking Conflicting Accesses Efficiently for Software Record & Replay
![Page 1: Tracking Conflicting Accesses Efficiently for Software Record & Replay](https://reader036.fdocuments.in/reader036/viewer/2022062720/56813492550346895d9b7b40/html5/thumbnails/1.jpg)
Tracking Conflicting Accesses Efficiently for Software Record & ReplayMichael Bond (Ohio State)Milind Kulkarni (Purdue)
![Page 2: Tracking Conflicting Accesses Efficiently for Software Record & Replay](https://reader036.fdocuments.in/reader036/viewer/2022062720/56813492550346895d9b7b40/html5/thumbnails/2.jpg)
Concurrent software is nondeterministic
Record & replay: more important & harder
![Page 3: Tracking Conflicting Accesses Efficiently for Software Record & Replay](https://reader036.fdocuments.in/reader036/viewer/2022062720/56813492550346895d9b7b40/html5/thumbnails/3.jpg)
Record & Replay
Offline replayReproduce production bugs
Online replay• Replication-based fault tolerance• Offloading of security events
![Page 4: Tracking Conflicting Accesses Efficiently for Software Record & Replay](https://reader036.fdocuments.in/reader036/viewer/2022062720/56813492550346895d9b7b40/html5/thumbnails/4.jpg)
Why is record & replay hard?
Nondeterministic thread interleavings:
• Synchronization• Data races
![Page 5: Tracking Conflicting Accesses Efficiently for Software Record & Replay](https://reader036.fdocuments.in/reader036/viewer/2022062720/56813492550346895d9b7b40/html5/thumbnails/5.jpg)
Prior Work
Detects races high overhead[LeBlanc & Mellor-Crummey ’87]
Custom hardware support[FDR] [Rerun] [Strata] [DeLorean] [MRR]
Doesn’t support offline or online replay[Respec] [ODR] [PRES] [Weeratunge et al. ’10]
DoublePlay: extra cores; doesn’t scale well
![Page 6: Tracking Conflicting Accesses Efficiently for Software Record & Replay](https://reader036.fdocuments.in/reader036/viewer/2022062720/56813492550346895d9b7b40/html5/thumbnails/6.jpg)
Prior Work
Detects races high overhead[LeBlanc & Mellor-Crummey ’87]
Custom hardware support[FDR] [Rerun] [Strata] [DeLorean] [MRR]
Doesn’t support offline or online replay[Respec] [ODR] [PRES] [Weeratunge et al. ’10]
DoublePlay: extra cores; doesn’t scale well
![Page 7: Tracking Conflicting Accesses Efficiently for Software Record & Replay](https://reader036.fdocuments.in/reader036/viewer/2022062720/56813492550346895d9b7b40/html5/thumbnails/7.jpg)
Prior Work
Detects races high overhead[LeBlanc & Mellor-Crummey ’87]
Custom hardware support[FDR] [Rerun] [Strata] [DeLorean] [MRR]
Doesn’t support offline or online replay[Respec] [ODR] [PRES] [Weeratunge et al. ’10]
DoublePlay: extra cores; doesn’t scale well
Don’t track conflicting dependences
![Page 8: Tracking Conflicting Accesses Efficiently for Software Record & Replay](https://reader036.fdocuments.in/reader036/viewer/2022062720/56813492550346895d9b7b40/html5/thumbnails/8.jpg)
Tracking Conflicting Dependences
Every access might conflict
Synchronization conflicting access
T1if o.lastAccess != T1 …write o.f
T2if o.lastWrite != T2 …read o.f
![Page 9: Tracking Conflicting Accesses Efficiently for Software Record & Replay](https://reader036.fdocuments.in/reader036/viewer/2022062720/56813492550346895d9b7b40/html5/thumbnails/9.jpg)
Tracking Conflicting Dependences
Every access might conflict:Need instrumentation at every accessSynchronization conflicting accessT1if o.lastAccess != T1 … o.lastAccess = T1write o.f
T2if o.lastAccess != T2 … o.lastAccess = T2read o.f
![Page 10: Tracking Conflicting Accesses Efficiently for Software Record & Replay](https://reader036.fdocuments.in/reader036/viewer/2022062720/56813492550346895d9b7b40/html5/thumbnails/10.jpg)
Tracking Conflicting Dependences
Every access might conflict:Need synchronization at every accessSynchronization conflicting accessT1if o.lastAccess != T1 … o.lastAccess = T1write o.f
T2if o.lastAccess != T2 … o.lastAccess = T2read o.f
![Page 11: Tracking Conflicting Accesses Efficiently for Software Record & Replay](https://reader036.fdocuments.in/reader036/viewer/2022062720/56813492550346895d9b7b40/html5/thumbnails/11.jpg)
Tracking Conflicting Dependences
Every access might conflict:Need synchronization at every access
at conflicting accesses onlyT1if o.lastAccess != T1 … o.lastAccess = T1write o.f
T2if o.lastAccess != T2 … o.lastAccess = T2read o.f
![Page 12: Tracking Conflicting Accesses Efficiently for Software Record & Replay](https://reader036.fdocuments.in/reader036/viewer/2022062720/56813492550346895d9b7b40/html5/thumbnails/12.jpg)
Tracking Conflicting Dependences
Every access might conflict:Need synchronization at every access
at conflicting accesses onlyT2if o.lastAccess != T2 … … o.lastAccess = T2read o.f
![Page 13: Tracking Conflicting Accesses Efficiently for Software Record & Replay](https://reader036.fdocuments.in/reader036/viewer/2022062720/56813492550346895d9b7b40/html5/thumbnails/13.jpg)
Tracking Conflicting Dependences
Every access might conflict:Need synchronization at every access
at conflicting accesses only
T1……safe point:…
T2if o.lastAccess != T2 … … o.lastAccess = T2read o.f
![Page 14: Tracking Conflicting Accesses Efficiently for Software Record & Replay](https://reader036.fdocuments.in/reader036/viewer/2022062720/56813492550346895d9b7b40/html5/thumbnails/14.jpg)
Tracking Conflicting Dependences
Every access might conflict:Need synchronization at every access
at conflicting accesses only
T1if o.state != WrExT1
…write o.f
T2if o.state in { WrExT2 , RdEx T2 , RdSh } …read o.f
![Page 15: Tracking Conflicting Accesses Efficiently for Software Record & Replay](https://reader036.fdocuments.in/reader036/viewer/2022062720/56813492550346895d9b7b40/html5/thumbnails/15.jpg)
Tracking Conflicting Dependences
Every access might conflict:Need synchronization at every access
at conflicting accesses only
Related to locality & ownership tracking[Shasta] [Biased locking] [von Praun &
Gross ’01][CoreDet?] [IBM’s STM?]
![Page 16: Tracking Conflicting Accesses Efficiently for Software Record & Replay](https://reader036.fdocuments.in/reader036/viewer/2022062720/56813492550346895d9b7b40/html5/thumbnails/16.jpg)
Recording Happens-Before
…safe point
if o.state = … …read o.f
Record dynamic program location
Happens-before
![Page 17: Tracking Conflicting Accesses Efficiently for Software Record & Replay](https://reader036.fdocuments.in/reader036/viewer/2022062720/56813492550346895d9b7b40/html5/thumbnails/17.jpg)
Replaying Happens-Before
Increment counter Wait for counter
…safe point
if o.state = … …read o.f
Happens-before
![Page 18: Tracking Conflicting Accesses Efficiently for Software Record & Replay](https://reader036.fdocuments.in/reader036/viewer/2022062720/56813492550346895d9b7b40/html5/thumbnails/18.jpg)
Replaying Happens-Before
sync (o) { write o.f}
sync (o) { read o.f}
Happens-before
![Page 19: Tracking Conflicting Accesses Efficiently for Software Record & Replay](https://reader036.fdocuments.in/reader036/viewer/2022062720/56813492550346895d9b7b40/html5/thumbnails/19.jpg)
Replaying Happens-Before
sync (o) { write o.f}
sync (o) { read o.f}
Happens-before
![Page 20: Tracking Conflicting Accesses Efficiently for Software Record & Replay](https://reader036.fdocuments.in/reader036/viewer/2022062720/56813492550346895d9b7b40/html5/thumbnails/20.jpg)
Performance
eclip
se
hsql
db
xala
n
SPEC
jbb2
000
geom
ean
-10%
0%
10%
20%
30%
40%
50%
60%
70%
Track conf depsFast path
Ru
nti
me o
verh
ead
![Page 21: Tracking Conflicting Accesses Efficiently for Software Record & Replay](https://reader036.fdocuments.in/reader036/viewer/2022062720/56813492550346895d9b7b40/html5/thumbnails/21.jpg)
Performance
eclip
se
hsql
db
xala
n
SPEC
jbb2
000
geom
ean
-10%
0%
10%
20%
30%
40%
50%
60%
70%
Record & replayTrack conf depsFast path
Ru
nti
me o
verh
ead
![Page 22: Tracking Conflicting Accesses Efficiently for Software Record & Replay](https://reader036.fdocuments.in/reader036/viewer/2022062720/56813492550346895d9b7b40/html5/thumbnails/22.jpg)
Challenge: Performance
Non-conflicting accesses very fast• Static analysis
Conflicting accesses not too slow• Pessimistic concurrency?
![Page 23: Tracking Conflicting Accesses Efficiently for Software Record & Replay](https://reader036.fdocuments.in/reader036/viewer/2022062720/56813492550346895d9b7b40/html5/thumbnails/23.jpg)
Challenge: Replayability
Controlling other sources of nondeterminism:• I/O• Low-level VM concurrency• Timer-based sampling• Record vs. replay
![Page 24: Tracking Conflicting Accesses Efficiently for Software Record & Replay](https://reader036.fdocuments.in/reader036/viewer/2022062720/56813492550346895d9b7b40/html5/thumbnails/24.jpg)
Challenge: Replayability
Controlling other sources of nondeterminism:• I/O• Low-level VM concurrency• Timer-based sampling• Record vs. replay
Different heap layouts different hash codes
![Page 25: Tracking Conflicting Accesses Efficiently for Software Record & Replay](https://reader036.fdocuments.in/reader036/viewer/2022062720/56813492550346895d9b7b40/html5/thumbnails/25.jpg)
Challenge: Replayability
Controlling other sources of nondeterminism:• I/O• Low-level VM concurrency• Timer-based sampling• Record vs. replay
Different heap layouts different hash codes
Deterministic hash codes?
![Page 26: Tracking Conflicting Accesses Efficiently for Software Record & Replay](https://reader036.fdocuments.in/reader036/viewer/2022062720/56813492550346895d9b7b40/html5/thumbnails/26.jpg)
Summary
Software record & replay bytracking conflicting dependences• Optimistic concurrency control• Performance & replayability challenges
Apply concurrency control mechanismto other problems?