Download presentation
Presentation is loading. Please wait.
Published byRudolph Alexander Modified over 9 years ago
1
Atom-Aid: Detecting and Surviving Atomicity Violations Brandon Lucia, Joseph Devietti, Karin Strauss and Luis Ceze LBA Reading Group 7/3/08 Slides by Michelle Goodstein
2
Motivation Parallel programs are hard to write Non-deterministic bugs emerge Data races Deadlocks Atomicity Violations Non-deterministically affect program performance Large portion of non-deadlock concurrency bugs
3
Motivation Observe that BulkSC, ASO, Implicit Transactions provide implicit atomicity Implicit Atomicity: Two accesses in the same “chunk” appear atomic Leverage implicit atomicity to avoid atomicity violations
4
Outline Motivation Implicit Atomicity Atom-Aid Design Experimental Setup & Results Conclusions
5
Implicit Atomicity Property of systems that: Group instructions into larger chunks Support consistency at coarser granularity Coarse grain consistency Reduces space of possible interleavings Software remains oblivious Atom-Aid Works if system provides implicit atomicity Built on BulkSC
6
Atomicity Violation
7
Space of Interleavings
8
Serializability Serializable iff order assumed by the programmer produces same final state as actual interleaving
9
Serializability
10
Implicit Atomicity and Atomicity Violations Atomicity-lacking section Portion of code from one memory access to another which should be atomic but is not Intuitively: If all code for an atomicity violation lies within same “chunk”, violation will never occur Natural hiding
11
Implicit Atomicity and Atomicity Violations Formally c is the default chunk size d is the size of an atomicity-lacking section If c < d |Atomicity-lacking section| > |default chunk| Pr(hiding violation) = 0 If c ≥ d Pr(hiding violation) = (c-d+1)/c
12
Hiding an Atomicity Violation d atomicity lacking section Chunk bdry (c-d)th instr c 1 st memory operation from atomicity lacking section here, entire section atomic
13
Implications of natural hiding
14
Atomicity Violation Statistics Typical atomicity violation: 500-750 instr If chunk size ~ 2,000 instrs Pr(hiding violation) around 63-75% “Naturally hiding” violations Goal: Raise Pr(hiding violation) ~ 100%
15
Atom-Aid Design Smart chunking Place chunk boundaries deliberately instead of arbitrarily Try to increase number of hidden atomicity violations Intuition Observe accesses to some location a Notice unserializable sequence of accesses to a Next time access a, (potentially) “do something” “Do something” : Add a chunk boundary
16
Atom-Aid Design Details Track: Type and address of memory op Read/Write Sets R C, W C : current chunk R P, W P : previous chunk R RC, W RC : remote ops while current chunk executing R RP, W RP : remote ops while prior chunk executing ChunkBreakSet Addresses with past unserializable accesses
17
Atom-Aid Design Details
18
Address A is Added to ChunkBreakSet Another access to A: Atom-Aid is alerted Decides whether to break a chunk prematurely Always breaking a chunk doesn’t help Maintain two conditions Never break a chunk twice If add address to ChunkBreakSet during a chunk, cannot break that chunk
19
Chunk Breaking Flowchart
20
Atom-Aid Implementation Built on BulkSC Three sets of signatures added R C, W C : part of BulkSC R P, W P : copy from R C, W C after commit R RC, W RC : remote downgrades, copy from other processors sigs R RP, W RP : copy from R CP,W CP after commit ChunkBreakSet: Signature, or cache augmentation
21
Experimental Setup Model BulkSC like system using PIN Results average over several runs 95% confidence intervals added around average Explicitly annotate code Begin/end of atomicity-lacking section Dynamically check if markers within same chunk Yes: atomicity violation hidden
22
Observations None of the “natural” violations exceeded 1000 instructions BankAccount2, CircularList2, LogProc&Sweep2 modified to evaluate larger sizes
23
Workloads
24
Natural Hiding (no Atom-Aid)
25
Atom-Aid: Bug Kernels
26
Atom-Aid: Applications
27
Atom-Aid: Signature vs Exact
28
Atom-Aid as a debugger Record the PC when Atom-Aid inserts a chunk boundary Group PCs into line of code, function where it appears Examine functions in order of highest lowest frequency to look for bugs
29
Time to find bugs
30
Conclusions Implicit atomicity can help programmers by preventing bugs from becoming visible Atom-Aid leverages implicit atomicity via smart chunk boundaries Atom-Aid can hide almost 100% of atomicity violations
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.