Sound and Complete Race Detection in Software and Hardwaredevietti/slides/radish-isca2012.pdf ·...
Transcript of Sound and Complete Race Detection in Software and Hardwaredevietti/slides/radish-isca2012.pdf ·...
![Page 1: Sound and Complete Race Detection in Software and Hardwaredevietti/slides/radish-isca2012.pdf · software hardware complementary strengths Flanagan and Freund, PLDI 2009 Min and Choi,](https://reader034.fdocuments.net/reader034/viewer/2022052102/603c475bb09cd8467768a7fa/html5/thumbnails/1.jpg)
RADISH:Sound and Complete Race
Detection inSoftware and Hardware
Joseph Devietti*
Benjamin P. Wood*
Karin Strauss*^
Luis Ceze*
Dan Grossman*
Shaz Qadeer^
*University of Washington^Microsoft Research
image from pachd.com
![Page 2: Sound and Complete Race Detection in Software and Hardwaredevietti/slides/radish-isca2012.pdf · software hardware complementary strengths Flanagan and Freund, PLDI 2009 Min and Choi,](https://reader034.fdocuments.net/reader034/viewer/2022052102/603c475bb09cd8467768a7fa/html5/thumbnails/2.jpg)
Uses of Race Detection
multithreaded record+replay
simplifying consistency
models
atomicity checking
atomicity enforcement
determinism checking
determinism enforcement
concurrency bug detection
2
testing & verification
many uses requiresound+complete detection
![Page 3: Sound and Complete Race Detection in Software and Hardwaredevietti/slides/radish-isca2012.pdf · software hardware complementary strengths Flanagan and Freund, PLDI 2009 Min and Choi,](https://reader034.fdocuments.net/reader034/viewer/2022052102/603c475bb09cd8467768a7fa/html5/thumbnails/3.jpg)
3
slowpolling-based
sound+completestatic analysis
$ coherenceevent-based
unsound/incomplete$ evictions
descheduled threads$-line granularity
software hardware
complementary strengths
$ coherenceevent-based
sound+completestatic analysis
Flanagan and Freund, PLDI 2009 Min and Choi, ASPLOS 1991Muzahid et al., ISCA 2009
Prvulovic, HPCA 2006
![Page 4: Sound and Complete Race Detection in Software and Hardwaredevietti/slides/radish-isca2012.pdf · software hardware complementary strengths Flanagan and Freund, PLDI 2009 Min and Choi,](https://reader034.fdocuments.net/reader034/viewer/2022052102/603c475bb09cd8467768a7fa/html5/thumbnails/4.jpg)
RADISH overview
4
sound+complete race detection in sw+hw
byte-granularity tracking
unsound/incomplete$ evictions
descheduled threads$-line granularity
use sw to virtualize hw resources via “revision control”
hw mechanisms to reduce expensive
broadcasts, sw lookups
![Page 5: Sound and Complete Race Detection in Software and Hardwaredevietti/slides/radish-isca2012.pdf · software hardware complementary strengths Flanagan and Freund, PLDI 2009 Min and Choi,](https://reader034.fdocuments.net/reader034/viewer/2022052102/603c475bb09cd8467768a7fa/html5/thumbnails/5.jpg)
outlineimage from pachd.com
5
happens-beforedata race detection
in-$ RADISHfull RADISH
results
conclusions
![Page 6: Sound and Complete Race Detection in Software and Hardwaredevietti/slides/radish-isca2012.pdf · software hardware complementary strengths Flanagan and Freund, PLDI 2009 Min and Choi,](https://reader034.fdocuments.net/reader034/viewer/2022052102/603c475bb09cd8467768a7fa/html5/thumbnails/6.jpg)
data races
2 concurrent accesses to the same memory location,≥1 of which is a write
unordered wrt the happens-before relation
transitive closure ofprogram order + synchronization order
6
Lamport, CACM 1978
![Page 7: Sound and Complete Race Detection in Software and Hardwaredevietti/slides/radish-isca2012.pdf · software hardware complementary strengths Flanagan and Freund, PLDI 2009 Min and Choi,](https://reader034.fdocuments.net/reader034/viewer/2022052102/603c475bb09cd8467768a7fa/html5/thumbnails/7.jpg)
data races
t0 t1
read X
read X
release L
acquire L
write X
write X
synchronization
program order
data race
po + sync
7
Lamport, CACM 1978
![Page 8: Sound and Complete Race Detection in Software and Hardwaredevietti/slides/radish-isca2012.pdf · software hardware complementary strengths Flanagan and Freund, PLDI 2009 Min and Choi,](https://reader034.fdocuments.net/reader034/viewer/2022052102/603c475bb09cd8467768a7fa/html5/thumbnails/8.jpg)
happens-before race detection
locationlast
writelast
reads
X t2@Tt0@U, t1@-, t2@W
per-thread metadata
per-location metadata
thread last synchronized with
t0 t1@T, t2@U
8
canonical sound+complete approach
write ordered with last write and all last reads
read ordered with last write
Fidge, Computer 1991 Mattern, IWPDA 1989
![Page 9: Sound and Complete Race Detection in Software and Hardwaredevietti/slides/radish-isca2012.pdf · software hardware complementary strengths Flanagan and Freund, PLDI 2009 Min and Choi,](https://reader034.fdocuments.net/reader034/viewer/2022052102/603c475bb09cd8467768a7fa/html5/thumbnails/9.jpg)
locationlast
writelast
reads
X t2@Tt0@U, t1@–, t2@W
thread last synchronized with
t0 t1@T, t2@U
mapping to hardware
p0 p1 p2
unbounded # threads
unbounded # locations9
![Page 10: Sound and Complete Race Detection in Software and Hardwaredevietti/slides/radish-isca2012.pdf · software hardware complementary strengths Flanagan and Freund, PLDI 2009 Min and Choi,](https://reader034.fdocuments.net/reader034/viewer/2022052102/603c475bb09cd8467768a7fa/html5/thumbnails/10.jpg)
outlineimage from pachd.com
10
happens-beforedata race detection
in-$ RADISHfull RADISH
results
conclusions
![Page 11: Sound and Complete Race Detection in Software and Hardwaredevietti/slides/radish-isca2012.pdf · software hardware complementary strengths Flanagan and Freund, PLDI 2009 Min and Choi,](https://reader034.fdocuments.net/reader034/viewer/2022052102/603c475bb09cd8467768a7fa/html5/thumbnails/11.jpg)
strawmanall metadata is in hw,
so broadcast on every access?
11
local permissions cache what can be done without communication
p0
write X
write X
p0 p1 p2
![Page 12: Sound and Complete Race Detection in Software and Hardwaredevietti/slides/radish-isca2012.pdf · software hardware complementary strengths Flanagan and Freund, PLDI 2009 Min and Choi,](https://reader034.fdocuments.net/reader034/viewer/2022052102/603c475bb09cd8467768a7fa/html5/thumbnails/12.jpg)
local permissions
READ, WRITE or NONE permissions to each byte in a $ line
updated only on permissions violations and coherence events
12
p0
write X
write X
p0 p1 p2
w
![Page 13: Sound and Complete Race Detection in Software and Hardwaredevietti/slides/radish-isca2012.pdf · software hardware complementary strengths Flanagan and Freund, PLDI 2009 Min and Choi,](https://reader034.fdocuments.net/reader034/viewer/2022052102/603c475bb09cd8467768a7fa/html5/thumbnails/13.jpg)
outlineimage from pachd.com
13
happens-beforedata race detection
in-$ RADISHfull RADISH
results
conclusions
![Page 14: Sound and Complete Race Detection in Software and Hardwaredevietti/slides/radish-isca2012.pdf · software hardware complementary strengths Flanagan and Freund, PLDI 2009 Min and Choi,](https://reader034.fdocuments.net/reader034/viewer/2022052102/603c475bb09cd8467768a7fa/html5/thumbnails/14.jpg)
strawmanmetadata can be in hw or sw, so check sw on every access?
14
in-hardware status summarizes what metadata resides in hw
p0 p1 p2sw p0 p1 p2
R R W
![Page 15: Sound and Complete Race Detection in Software and Hardwaredevietti/slides/radish-isca2012.pdf · software hardware complementary strengths Flanagan and Freund, PLDI 2009 Min and Choi,](https://reader034.fdocuments.net/reader034/viewer/2022052102/603c475bb09cd8467768a7fa/html5/thumbnails/15.jpg)
in-hardware status
“checkout”
“checkin”
set IHS on checkout, degrade on $ evictions
Everything
Last Write
All LastReads
In Software
evict read
evict write
evict write
evict read
evict read
what can we figure out without going to sw?
15
![Page 16: Sound and Complete Race Detection in Software and Hardwaredevietti/slides/radish-isca2012.pdf · software hardware complementary strengths Flanagan and Freund, PLDI 2009 Min and Choi,](https://reader034.fdocuments.net/reader034/viewer/2022052102/603c475bb09cd8467768a7fa/html5/thumbnails/16.jpg)
also in the paper
16
leveraging type-safe languages to reduce metadata space overheads
asynchronous software lookups to reduce overheads
![Page 17: Sound and Complete Race Detection in Software and Hardwaredevietti/slides/radish-isca2012.pdf · software hardware complementary strengths Flanagan and Freund, PLDI 2009 Min and Choi,](https://reader034.fdocuments.net/reader034/viewer/2022052102/603c475bb09cd8467768a7fa/html5/thumbnails/17.jpg)
outlineimage from pachd.com
17
happens-beforedata race detection
in-$ RADISHfull RADISH
results
conclusions
![Page 18: Sound and Complete Race Detection in Software and Hardwaredevietti/slides/radish-isca2012.pdf · software hardware complementary strengths Flanagan and Freund, PLDI 2009 Min and Choi,](https://reader034.fdocuments.net/reader034/viewer/2022052102/603c475bb09cd8467768a7fa/html5/thumbnails/18.jpg)
simulation methodology
• Pin-based simulator
• 8 cores, MESI coherence
• 8-way 64KB L1, 8-way 256KB private L2, 16-way 16MB L3
• PARSEC 2.1
• compare with FastTrack [Flanagan and Freund, PLDI 2009]
18
![Page 19: Sound and Complete Race Detection in Software and Hardwaredevietti/slides/radish-isca2012.pdf · software hardware complementary strengths Flanagan and Freund, PLDI 2009 Min and Choi,](https://reader034.fdocuments.net/reader034/viewer/2022052102/603c475bb09cd8467768a7fa/html5/thumbnails/19.jpg)
runtime compared to native
1
2
3
4
5
6
blacksch fluid streamcl swaptions vips x264
runt
ime
wrt
nat
ive
FastTrack RADISH
19
![Page 20: Sound and Complete Race Detection in Software and Hardwaredevietti/slides/radish-isca2012.pdf · software hardware complementary strengths Flanagan and Freund, PLDI 2009 Min and Choi,](https://reader034.fdocuments.net/reader034/viewer/2022052102/603c475bb09cd8467768a7fa/html5/thumbnails/20.jpg)
runtime compared to FastTrack
0
0.2
0.4
0.6
0.8
1.0
blacksch fluid streamcl swaptions vips x264
runt
ime
wrt
Fas
tTra
ck
FastTrack RADISH
20
![Page 21: Sound and Complete Race Detection in Software and Hardwaredevietti/slides/radish-isca2012.pdf · software hardware complementary strengths Flanagan and Freund, PLDI 2009 Min and Choi,](https://reader034.fdocuments.net/reader034/viewer/2022052102/603c475bb09cd8467768a7fa/html5/thumbnails/21.jpg)
conclusions
sound+complete race detection in hw+sw
much faster than software-only race detection
unmodified cache design
21
![Page 22: Sound and Complete Race Detection in Software and Hardwaredevietti/slides/radish-isca2012.pdf · software hardware complementary strengths Flanagan and Freund, PLDI 2009 Min and Choi,](https://reader034.fdocuments.net/reader034/viewer/2022052102/603c475bb09cd8467768a7fa/html5/thumbnails/22.jpg)
thanks!
image from pachd.com
22