Tracking and Reducing Uncertainty in Dataflow Analysis-Based Dynamic Parallel Monitoring
Michelle Goodstein*
Phillip Gibbons*
Michael Kozuch‡
Todd Mowry*
*Carnegie Mellon University ‡Intel Labs
A Challenge of Parallel Programming
It is easy to accidentally introduce bugs when creating parallel software.
Idea: Adapt techniques to detect bugs in sequential applications
Tracking and Reducing Uncertainty in DADPM
2
Michelle Goodstein
Techniques to Detect Bugs in Sequential Applications
Tracking and Reducing Uncertainty in DADPM
3
Michelle Goodstein
Static Analysis
x=y+7;
x*=4;
Source Code
Dynamic Analysis
P
mov (%ecx), %eax
add $0x7, %eax
shl $0x2, %eax
Running App
Dynamic Program Monitoring
Tracking and Reducing Uncertainty in DADPM
4
Michelle Goodstein
Update p2’s metadata
.
.
taint p2
.
.
*p2
.
.
Lifeguard
Update
metadata
Application
p1 | 0 |
p2 | |
p3 | . |
p4 | . |
Metadata:
Tainted?
Commit Order
0
1
Dynamic Program Monitoring
Tracking and Reducing Uncertainty in DADPM
5
Michelle Goodstein
Is *p2 safe ?
ERROR: metadata for
p2 tainted
.
.
taint p2
.
.
*p2
.
.
Lifeguard
Check
metadata
Application
p1 | 0 |
p2 | 1 |
p3 | . |
p4 | . |
Metadata:
Tainted?
Commit Order
Dynamic Analysis: Challenges in Monitoring Parallel Programs
Tracking and Reducing Uncertainty in DADPM
6
Michelle Goodstein
.
.
.
.
.
C: taint p
P
Taint Tracking
.
.
A: untaint p
.
.
B: *p=…
P
Thread 0
Thread 1
Program Order
Dynamic Analysis: Challenges in Monitoring Parallel Programs
Tracking and Reducing Uncertainty in DADPM
7
Michelle Goodstein
.
.
A: untaint p
.
.
B: *p=…
P
.
.
.
.
.
C: taint p
P
Thread 0
Thread 1
Program Order
Lifeguard Thread 0
Three Possible Orderings
A
B
C
p is tainted
*p unsafe
A
B
C
p is untainted *p safe
A
B
C
Lifeguard must behave conservatively
Dataflow-Analysis Based Dynamic Parallel Monitoring (DADPM)
+ Parallel analysis proceeds without capturing inter-thread data dependences
+ Supports relaxed memory consistency models
Tracking and Reducing Uncertainty in DADPM
8
Michelle Goodstein
.
.
.
untaint p
*p
.
.
Thread 1
.
.
.
.
taint p
.
.
.
Thread 2
Lifeguard 2
Lifeguard 1
.
.
.
.
.
.
.
.
Thread 0
Lifeguard 0
Commit Order
Dataflow-Analysis Based Dynamic Parallel Monitoring (DADPM)
+ Parallel analysis proceeds without capturing inter-thread data dependences
+ Supports relaxed memory consistency models
+ Generalization of Butterfly Analysis to include sync arcs
+ Improved precision (compared to Butterfly Analysis)
Tracking and Reducing Uncertainty in DADPM
9
Michelle Goodstein
.
untaint p
*p
unlock L
.
.
.
.
Thread 1
.
.
.
.
.
lock L
taint p
.
Thread 2
Lifeguard 2
Lifeguard 1
.
.
.
.
.
.
.
.
Thread 0
Lifeguard 0
Commit Order
Prior DADPM Cannot Distinguish True Errors From False Positives
Tracking and Reducing Uncertainty in DADPM
10
Michelle Goodstein
.
.
A: untaint p
.
.
B: *p=…
P
.
.
.
.
.
C: taint p
P
Thread 0
Thread 1
Program Order
Lifeguard Thread 0
Three Possible Orderings
A
B
C
p is tainted
*p unsafe
A
B
C
p is untainted *p safe
A
B
C
This Work: Tracking and Reducing Uncertainty in DADPM
Tracking and Reducing Uncertainty in DADPM
11
Michelle Goodstein
.
A: untaint p
.
B: *p=…
P
..
.
.
C: taint p
P
Thread 0
Thread 1
Prgram Order
Lifeguard Thread 0
Three Possible Orderings
A
B
C
A
B
C
p is uncertain
*p potentially unsafe
A
B
C
Idea: What if we could “zoom in” and resolve uncertainty?
Contribution: Reducing Uncertainty in DADPM
Tracking and Reducing Uncertainty in DADPM
12
Michelle Goodstein
P
P
Lifeguard Thread 0
Thread 0
A: untaint p
B: *p=…
Thread 1
C: taint p
Three Possible Orderings
A
B
C
p is tainted
*p unsafe
A
B
C
p is untainted *p safe
A
B
C
Contribution: Reducing Uncertainty in DADPM
Tracking and Reducing Uncertainty in DADPM
13
Michelle Goodstein
P
P
Lifeguard Thread 0
“Zoom in”: One Order
A
B
C
p is tainted
*p unsafe
Thread 0
A: untaint p
B: *p=…
Thread 1
C: taint p
Related Work: Uncertainty In Static Analysis
Static analysis: run-time data values and control flow are unknown
Tracking and Reducing Uncertainty in DADPM
14
Michelle Goodstein
Roadmap to Remainder of Talk
Tracking and Reducing Uncertainty in DADPM
15
Michelle Goodstein
Butterfly Analysis: Fundamentals
Tracking and Reducing Uncertainty in DADPM
16
Michelle Goodstein
.
.
.
.
.
.
.
.
.
.
.
.
untaint p
*p
.
.
.
.
.
.
.
taint p
.
Concurrent
region
Occurs strictly
before *p
.
Occurs strictly
before *p
Commit Order
Concurrent
region
Window
Butterfly Analysis: A Brief Review
Consider an online execution trace
Tracking and Reducing Uncertainty in DADPM
17
Michelle Goodstein
.
.
.
.
.
.
.
untaint p
*p
.
.
.
.
.
.
.
.
.
.
.
.
taint p
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Commit Order
Butterfly Analysis Review: Epochs Partition Thread Execution
Tracking and Reducing Uncertainty in DADPM
18
Michelle Goodstein
taint p
untaint p
*p
Epoch 1
Epoch 0
Epoch 2
Epoch 3
Epoch 4
Execution divided into epochs separated by at least W events/thread
Commit Order
W
Butterfly Analysis Review: Reasoning About Concurrency
Tracking and Reducing Uncertainty in DADPM
19
Michelle Goodstein
taint p
untaint p
*p
Sliding window
limited to 3 epochs
W
Relative To Center Epoch
W
untaint p
*p
Commit Order
Butterfly Analysis Review: Concurrency Within Three Epoch Window
Tracking and Reducing Uncertainty in DADPM
20
Michelle Goodstein
Tail
Body
Head
Epochs
l
l-1
l+1
Thread t
Wings
Wings
Commit Order
Butterfly Analysis Review: Side-In and Side-Out
Tracking and Reducing Uncertainty in DADPM
21
Michelle Goodstein
Head
Tail
Body
Epochs
l
l-1
l+1
Thread t
Wings
Wings
Commit Order
Butterfly Analysis: Parallel Dataflow Analysis (DADPM)
Tracking and Reducing Uncertainty in DADPM
22
Michelle Goodstein
Head
Tail
Body
Epochs
l
l-1
l+1
Thread t
Wings
Wings
Commit Order
Butterfly Analysis: Parallel Dataflow Analysis (DADPM)
Tracking and Reducing Uncertainty in DADPM
23
Michelle Goodstein
Head
Tail
Body
Epochs
l
l-1
l+1
Thread t
Wings
Wings
Commit Order
Tracking and Reducing Uncertainty in DADPM
24
Michelle Goodstein
Butterfly Analysis: Reasoning About Concurrent Regions
24
.
.
.
A: untaint p
B: *p
.
.
Thread 1
Thread 2
.
.
.
.
C: taint p
.
.
.
.
Commit Order
.
.
.
.
.
.
.
.
Thread 0
Lifeguard 1
Concurrent Region of Execution Traces
Lifeguard must behave conservatively
Three Possible Orderings
A
B
C
p tainted
*p unsafe
A
B
C
p untainted
*p safe
A
B
C
Tracking and Reducing Uncertainty in DADPM
25
Michelle Goodstein
This Work: Butterfly Analysis With Uncertainty Extensions
25
.
.
.
A: untaint p
B: *p
.
.
Thread 1
Thread 2
.
.
.
.
C: taint p
.
.
.
.
Commit Order
.
.
.
.
.
.
.
.
Thread 0
Lifeguard 1
Concurrent Region of Execution Traces
Three Possible Orderings
A
B
C
A
B
C
A
B
C
p uncertain
*p potentially unsafe
Isolate all false positives
Challenge: Two Precise States with Non-Binary Metadata
Side-In/Side-Out
Tracking and Reducing Uncertainty in DADPM
26
Michelle Goodstein
.
.
.
GSO
GSI
Butterfly Analysis
.
.
.
GSO
GSI
Butterfly Analysis with New Uncertainty Ext.
MSO
KSO
MSI
KSI
Thread 0
Thread 0
Example: Conflicting taint, untaint in the wings
Dataflow Analysis-Based Dynamic Parallel Monitoring
27
Michelle Goodstein
untaint p
taint p
Epochs
l
l-1
l+1
Thread t
Wings
Wings
*p
Commit Order
Butterfly Analysis: Had Only Single Side-Out
Dataflow Analysis-Based Dynamic Parallel Monitoring
28
Michelle Goodstein
taint p
Epochs
l
l-1
l+1
Thread t
Wings
Wings
*p
Commit Order
untaint p
p
Taint-Side-Out
New Uncertainty Extensions: Additional Side-Outs Add Complexity
Dataflow Analysis-Based Dynamic Parallel Monitoring
29
Michelle Goodstein
taint p
Epochs
l
l-1
l+1
Thread t
Wings
*p
Commit Order
Wings
.
.
.
.
.
.
.
.
.
p
untaint p
p
Taint-Side-Out
Uncertain-Side-Out
Untaint-Side-Out
Butterfly Analysis Had Only Single Side-In
Dataflow Analysis-Based Dynamic Parallel Monitoring
30
Michelle Goodstein
taint p
Epochs
l
l-1
l+1
Thread t
Wings
Wings
*p
Commit Order
untaint p
p
Taint Side-In: p
New Uncertainty Extensions: Multiple Side-Ins Add Complexity
Dataflow Analysis-Based Dynamic Parallel Monitoring
31
Michelle Goodstein
taint p
Epochs
l
l-1
l+1
Thread t
Wings
*p
Commit Order
Wings
.
.
.
.
.
.
.
.
.
p
untaint p
p
Taint
Side-In
Uncertain Side-In: p
Untaint
Side-In
Challenge: Two Precise States with Non-Binary Metadata
Global (SOS) and Local (LSOS) State
Tracking and Reducing Uncertainty in DADPM
32
Michelle Goodstein
.
.
.
Butterfly Analysis
.
.
.
Butterfly Analysis with New Uncertainty Ext.
Thread 0
Thread 0
LSOS
SOS
LSOSG
LSOSM
LSOSK
SOSG
SOSM
SOSK
Incorporating Uncertainty: Theoretical Contributions
Can now segregate true errors from potential errors
Tracking and Reducing Uncertainty in DADPM
33
Michelle Goodstein
Opportunity: Dynamically Resize Epochs
Tracking and Reducing Uncertainty in DADPM
34
Michelle Goodstein
.
A: untaint p
.
.
.
.
.
.
.
..
B: *p=…
.
.
Thread 0
Thread 1
.
.
.
.
.
.
C: taint p
.
.
.
.
Program Order
Concurrent Region of Execution Traces
p uncertain
*p potentially unsafe
Three Possible Orderings
A
B
C
A
B
C
A
B
C
Epoch 5
Dynamically Resizing Epochs in Response to Uncertainty
Tracking and Reducing Uncertainty in DADPM
35
Michelle Goodstein
Thread 0
Thread 1
Program Order
Concurrent Region of Execution Traces
One Possible Ordering
A
B
C
p tainted
*p unsafe
A: untaint p
B: *p=…
C: taint p
5.1
5.2
5.3
5.4
5.4
Epoch
Comparison: Butterfly Analysis vs. Butterfly + Uncertainty Ext.
Butterfly Analysis
Cannot distinguish true errors from false positives
Butterfly Analysis + Uncertainty Ext.
Isolates true errors from potential errors
Tracking and Reducing Uncertainty in DADPM
36
Michelle Goodstein
Epochs
l
l-1
l+1
Thread t
Wings
Wings
Epochs
l
l-1
l+1
Thread t
Wings
Wings
?
Research Challenges
Dynamic Epoch Resizing Methodology
Tracking and Reducing Uncertainty in DADPM
37
Michelle Goodstein
Thread 1
Thread 0
Thread 2
Epochs
l
l-1
l+1
Thread 1
Thread 0
Thread 2
Dynamic Epoch Resizing Methodology
Tracking and Reducing Uncertainty in DADPM
38
Michelle Goodstein
Epochs
l
l-1
l+1
Thread 1
Thread 0
Thread 2
?
Dynamic Epoch Resizing Methodology
Dynamic[l-1,l+1]
Equivalently, Dynamic3
Tracking and Reducing Uncertainty in DADPM
39
Michelle Goodstein
Epochs
l
l-1
l+1
Thread 1
?
Thread 0
Thread 2
2 epoch rollback
Dynamic Epoch Resizing Methodology
Dynamic[l,l+1]
Equivalently, Dynamic2
Tracking and Reducing Uncertainty in DADPM
40
Michelle Goodstein
Epochs
l
l-1
l+1
Thread 1
?
Thread 0
Thread 2
1 epoch rollback
Dynamic Epoch Resizing Methodology
Dynamicl
Equivalently, Dynamic1
Tracking and Reducing Uncertainty in DADPM
41
Michelle Goodstein
Epochs
l
l-1
l+1
Thread 1
Thread 0
?
Thread 2
1 epoch rollback
Experimental Methodology
Tracking and Reducing Uncertainty in DADPM
42
Michelle Goodstein
Experimental Methodology
Tracking and Reducing Uncertainty in DADPM
43
Michelle Goodstein
Precision: Failed Checks Across 5 Configurations
Tracking and Reducing Uncertainty in DADPM
44
Michelle Goodstein
66
Lower is better
Precision: Failed Checks Across 5 Configurations
Tracking and Reducing Uncertainty in DADPM
45
Michelle Goodstein
66
Zero Failed Taint: All potential false positives isolated to uncertain
Precision: Failed Checks Across 5 Configurations
Tracking and Reducing Uncertainty in DADPM
46
Michelle Goodstein
66
Precision of dynamic runs similar or matches small config (smaller is better)
Precision: Failed Checks Across 5 Configurations
Tracking and Reducing Uncertainty in DADPM
47
Michelle Goodstein
66
Precision of dynamic runs similar or matches small config (smaller is better)
Performance Results: Average Parallel Execution Time
Tracking and Reducing Uncertainty in DADPM
48
Michelle Goodstein
Results shown: averaged over 10 runs, with 95% confidence intervals
Zoomed in
Performance Results: Average Parallel Execution Time
Tracking and Reducing Uncertainty in DADPM
49
Michelle Goodstein
Dynamic configs: performance on par/outperforming large, faster than small
Performance Results: Average Parallel Execution Time
Tracking and Reducing Uncertainty in DADPM
50
Michelle Goodstein
No single dynamic config is best —dynamic1/dynamic2 good enough
Parallel Execution Time, Breakdown Into Phases
Tracking and Reducing Uncertainty in DADPM
51
Michelle Goodstein
Large/dynamic configs have 29-54% reduction in boundary time vs small configs
Contributions: Uncertainty with Dynamic Epoch Resizing
+ Can segregate known errors from potential errors
+ Dynamic epoch resizing : performance of large epochs with precision of small epoch
Tracking and Reducing Uncertainty in DADPM
52
Michelle Goodstein
Epochs
l
l-1
l+1
Thread t
Wings
Wings
Epochs
l
l-1
l+1
Thread t
Wings
Wings
?
Tracking and Reducing Uncertainty in Dataflow Analysis-Based Dynamic Parallel Monitoring
Michelle Goodstein
Phillip Gibbons
Michael Kozuch
Todd Mowry
Carnegie Mellon University and Intel Labs
Contributions: Uncertainty with Dynamic Epoch Resizing
+ Can segregate known errors from potential errors
+ Dynamic epoch resizing : performance of large epochs with precision of small epoch
Tracking and Reducing Uncertainty in DADPM
54
Michelle Goodstein
Epochs
l
l-1
l+1
Thread t
Wings
Wings
?
Epochs
l
l-1
l+1
Thread t
Wings
Wings
?