Deterministic transactional execution
Tiago Vale1 João Silva1 Ricardo Dias12 João Lourenço1
1NOVA LINCS / UNL 2SUSE Linux GmbH
Slide 2
Slide 2 text
No content
Slide 3
Slide 3 text
read/write read/write
Slide 4
Slide 4 text
Coordinate operations that
access shared state
using TM
transaction {
read this
do something
write that
}
Only specify what
should be atomic,
system ensures it!
Slide 5
Slide 5 text
Coordinate operations that
access shared state
using TM
transaction {
read this
do something
write that
}
Slide 6
Slide 6 text
Transactions appear to
execute one at a time
Slide 7
Slide 7 text
Transactions appear to
execute one at a time
in any order
= A = B = C
Slide 8
Slide 8 text
“Heisenbugs”
Slide 9
Slide 9 text
“Heisenbugs”
~70% of concurrency bugs!*
*Learning from mistakes: a comprehensive study on real world concurrency bug characteristics, ASPLOS 2008
Slide 10
Slide 10 text
Fault tolerance
= B
Replica 1 Replica 2
A ≠ B
= A
Slide 11
Slide 11 text
Deterministic
transaction order
helps building reliable
concurrent software
Software transactional memory (see paper for + detail)
• Slowdown of deterministic execution?
• Is the fast execution mode faster?
• Do transactions wait less?
Hardware transactional memory (see paper)
Evaluation
See for
+details
Slide 60
Slide 60 text
Normalized execution time
0
1
2
3
4
5
Number of threads
2 4 8 16
Deterministic execution (STAMP trend)
Slide 61
Slide 61 text
Normalized execution time
0
1
2
3
4
5
Number of threads
2 4 8 16
Nondeterministic
Deterministic execution (STAMP trend)
Slide 62
Slide 62 text
Normalized execution time
0
1
2
3
4
5
Number of threads
2 4 8 16
Nondeterministic
This work
Deterministic execution (STAMP trend)
Slide 63
Slide 63 text
Normalized execution time
0
1
2
3
4
5
Number of threads
2 4 8 16
Comparable to nondeterministic!
Nondeterministic
This work
Deterministic execution (STAMP trend)
Slide 64
Slide 64 text
Normalized execution time
0
1
2
3
4
5
Number of threads
2 4 8 16
< 2× slower than nondeterministic
Nondeterministic
This work
Deterministic execution (STAMP trend)
Slide 65
Slide 65 text
Normalized execution time
0
1
2
3
4
5
Number of threads
2 4 8 16
Nondeterministic
This work
State of the art (DeSTM)
Deterministic execution (STAMP trend)
Slide 66
Slide 66 text
Normalized execution time
0
1
2
3
4
5
Number of threads
2 4 8 16
Nondeterministic
This work
State of the art (DeSTM)
~3× better than state of the art!
Deterministic execution (STAMP trend)
Slide 67
Slide 67 text
Evaluation
Software transactional memory (see paper for + detail)
• Slowdown of deterministic execution?
• Is the fast execution mode faster?
• Do transactions wait less?
Hardware transactional memory (see paper)
See for
+details
Slide 68
Slide 68 text
Fast mode speedup
× faster than standard execution
0
1
2
3
4
5
6
Number of accesses
0 1 2 4 8 16 32 64
Slide 69
Slide 69 text
× faster than standard execution
0
1
2
3
4
5
6
Number of accesses
0 1 2 4 8 16 32 64
50% reads, 50% writes
Fast mode speedup
Slide 70
Slide 70 text
× faster than standard execution
0
1
2
3
4
5
6
Number of accesses
0 1 2 4 8 16 32 64
Pays off after 2 accesses
50% reads, 50% writes
Fast mode speedup
Slide 71
Slide 71 text
Evaluation
Software transactional memory (see paper for + detail)
• Slowdown of deterministic execution?
• Is the fast execution mode faster?
• Do transactions wait less?
Hardware transactional memory (see paper)
See for
+details
Slide 72
Slide 72 text
Waiting overhead (STAMP trend)
Normalized time transactions
waste waiting
0
1
2
3
4
Number of threads
2 4 8 16
Slide 73
Slide 73 text
This work
Normalized time transactions
waste waiting
0
1
2
3
4
Number of threads
2 4 8 16
Waiting overhead (STAMP trend)
Slide 74
Slide 74 text
Normalized time transactions
waste waiting
0
1
2
3
4
Number of threads
2 4 8 16
This work
State of the art (DeSTM)
Waiting overhead (STAMP trend)
Slide 75
Slide 75 text
Determinism helps building reliable concurrent
software
Methodology applicable to both STM and HTM
Fast mode: take advantage of deterministic order to
minimise overheads
<2× slower than nondeterministic
~3× better than state of the art
Conclusion
Slide 76
Slide 76 text
Determinism helps building reliable concurrent
software
Methodology applicable to both STM and HTM
Fast mode: take advantage of deterministic order to
minimise overheads
<2× slower than nondeterministic
~3× better than state of the art
Thank you for your attention!
Conclusion
Slide 77
Slide 77 text
Tiago Vale1 João Silva1 Ricardo Dias12 João Lourenço1
1NOVA LINCS / UNL 2SUSE Linux GmbH
Deterministic transactional execution