atom-aid: detecting and surviving atomicity violations brandon lucia, joseph devietti, karin strauss...
DESCRIPTION
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 violationsTRANSCRIPT
Atom-Aid: Detecting and Surviving Atomicity Violations
Brandon Lucia, Joseph Devietti, Karin Strauss and Luis Ceze
LBA Reading Group 7/3/08Slides by Michelle Goodstein
Motivation
Parallel programs are hard to writeNon-deterministic bugs emerge
Data racesDeadlocksAtomicity Violations
Non-deterministically affect program performanceLarge portion of non-deadlock concurrency bugs
Motivation
Observe that BulkSC, ASO, Implicit Transactions provide implicit atomicityImplicit Atomicity: Two accesses in the same
“chunk” appear atomicLeverage implicit atomicity to avoid
atomicity violations
Outline
MotivationImplicit AtomicityAtom-Aid DesignExperimental Setup & ResultsConclusions
Implicit Atomicity
Property of systems that:Group instructions into larger chunks Support consistency at coarser granularity
Coarse grain consistencyReduces space of possible interleavingsSoftware remains oblivious
Atom-AidWorks if system provides implicit atomicityBuilt on BulkSC
Atomicity Violation
Space of Interleavings
Serializability
Serializable iff order assumed by the programmer produces same final state as actual interleaving
Serializability
Implicit Atomicity and Atomicity Violations
Atomicity-lacking sectionPortion of code from one memory access to
another which should be atomic but is notIntuitively: If all code for an atomicity
violation lies within same “chunk”, violation will never occurNatural hiding
Implicit Atomicity and Atomicity Violations
Formallyc is the default chunk sized is the size of an atomicity-lacking section
If c < d|Atomicity-lacking section| > |default chunk|Pr(hiding violation) = 0
If c ≥ dPr(hiding violation) = (c-d+1)/c
Hiding an Atomicity Violation
d
atomicitylackingsection
Chunk
bdry
Chunk bdry
(c-d)th instr
c
1st memory operation from atomicity lacking section here, entire section atomic
Implications of natural hiding
Atomicity Violation Statistics
Typical atomicity violation: 500-750 instrIf chunk size ~ 2,000 instrs
Pr(hiding violation) around 63-75%“Naturally hiding” violations
Goal: Raise Pr(hiding violation) ~ 100%
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
Atom-Aid Design Details
Track:Type and address of memory op Read/Write Sets
RC, WC : current chunk
RP, WP : previous chunkRRC, WRC : remote ops while current chunk executingRRP, WRP : remote ops while prior chunk executing
ChunkBreakSetAddresses with past unserializable accesses
Atom-Aid Design Details
Atom-Aid Design Details
Address A is Added to ChunkBreakSetAnother access to A:
Atom-Aid is alerted Decides whether to break a chunk prematurely
Always breaking a chunk doesn’t help
Maintain two conditionsNever break a chunk twiceIf add address to ChunkBreakSet during a
chunk, cannot break that chunk
Chunk Breaking Flowchart
Atom-Aid Implementation
Built on BulkSCThree sets of signatures added
RC, WC : part of BulkSC RP, WP : copy from RC, WC after commitRRC,WRC : remote downgrades, copy from other
processors sigsRRP,WRP : copy from RCP,WCP after commit
ChunkBreakSet: Signature, or cache augmentation
Experimental Setup
Model BulkSC like system using PINResults 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 chunkYes: atomicity violation hidden
Observations
None of the “natural” violations exceeded 1000 instructions
BankAccount2, CircularList2, LogProc&Sweep2 modified to evaluate larger sizes
Workloads
Natural Hiding (no Atom-Aid)
Atom-Aid: Bug Kernels
Atom-Aid: Applications
Atom-Aid: Signature vs Exact
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 highestlowest frequency to look for bugs
Time to find bugs
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