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.

Slides:



Advertisements
Similar presentations
Bounded Model Checking of Concurrent Data Types on Relaxed Memory Models: A Case Study Sebastian Burckhardt Rajeev Alur Milo M. K. Martin Department of.
Advertisements

1 COMP 206: Computer Architecture and Implementation Montek Singh Mon, Oct 3, 2005 Topic: Instruction-Level Parallelism (Dynamic Scheduling: Introduction)
1 CS216 Advanced Database Systems Shivnath Babu Notes 11: Concurrency Control.
Memory Consistency Arbob Ahmad, Henry DeYoung, Rakesh Iyer /18-740: Recent Research in Architecture October 14, 2009.
Hastings Purify: Fast Detection of Memory Leaks and Access Errors.
Race Conditions. Isolated & Non-Isolated Processes Isolated: Do not share state with other processes –The output of process is unaffected by run of other.
ADVERSARIAL MEMORY FOR DETECTING DESTRUCTIVE RACES Cormac Flanagan & Stephen Freund UC Santa Cruz Williams College PLDI 2010 Slides by Michelle Goodstein.
PARALLEL PROGRAMMING with TRANSACTIONAL MEMORY Pratibha Kona.
Continuously Recording Program Execution for Deterministic Replay Debugging.
1 Lecture 21: Transactional Memory Topics: consistency model recap, introduction to transactional memory.
Transaction Processing Lecture ACID 2 phase commit.
Concurrency Control and Recovery In real life: users access the database concurrently, and systems crash. Concurrent access to the database also improves.
1 MetaTM/TxLinux: Transactional Memory For An Operating System Hany E. Ramadan, Christopher J. Rossbach, Donald E. Porter and Owen S. Hofmann Presenter:
1 Lecture 23: Transactional Memory Topics: consistency model recap, introduction to transactional memory.
Transaction Management and Concurrency Control
Transaction Management and Concurrency Control
Transaction Processing: Concurrency and Serializability 10/4/05.
Tuple Spaces and JavaSpaces CS 614 Bill McCloskey.
Computer Architecture II 1 Computer architecture II Lecture 9.
Multiscalar processors
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 8-1 COS 346 Day 18.
PathExpander: Architectural Support for Increasing the Path Coverage of Dynamic Bug Detection S. Lu, P. Zhou, W. Liu, Y. Zhou, J. Torrellas University.
1 Lecture 15: Consistency Models Topics: sequential consistency, requirements to implement sequential consistency, relaxed consistency models.
Consistency. Consistency model: –A constraint on the system state observable by applications Examples: –Local/disk memory : –Database: What is consistency?
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
Shared Memory Consistency Models: A Tutorial By Sarita V Adve and Kourosh Gharachorloo Presenter: Meenaktchi Venkatachalam.
Shared Memory Consistency Models: A Tutorial By Sarita V Adve and Kourosh Gharachorloo Presenter: Sunita Marathe.
Transaction. A transaction is an event which occurs on the database. Generally a transaction reads a value from the database or writes a value to the.
Learning From Mistakes—A Comprehensive Study on Real World Concurrency Bug Characteristics Shan Lu, Soyeon Park, Eunsoo Seo and Yuanyuan Zhou Appeared.
KAUSHIK LAKSHMINARAYANAN MICHAEL ROZYCZKO VIVEK SESHADRI Transactional Memory: Hybrid Hardware/Software Approaches.
INTRODUCTION TO TRANSACTION PROCESSING CHAPTER 21 (6/E) CHAPTER 17 (5/E)
1 IT420: Database Management and Organization Transactions 31 March 2006 Adina Crăiniceanu
15-740/ Oct. 17, 2012 Stefan Muller.  Problem: Software is buggy!  More specific problem: Want to make sure software doesn’t have bad property.
Reliable Communication in the Presence of Failures Based on the paper by: Kenneth Birman and Thomas A. Joseph Cesar Talledo COEN 317 Fall 05.
Evaluating FERMI features for Data Mining Applications Masters Thesis Presentation Sinduja Muralidharan Advised by: Dr. Gagan Agrawal.
1 IT420: Database Management and Organization Session Control Managing Multi-user Databases 24 March 2006 Adina Crăiniceanu
Colorama: Architectural Support for Data-Centric Synchronization Luis Ceze, Pablo Montesinos, Christoph von Praun, and Josep Torrellas, HPCA 2007 Shimin.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Mutual Exclusion.
Shared Memory Consistency Models. SMP systems support shared memory abstraction: all processors see the whole memory and can perform memory operations.
The Relational Model1 Transaction Processing Units of Work.
Transactional Coherence and Consistency Presenters: Muhammad Mohsin Butt. (g ) Coe-502 paper presentation 2.
Design - programming Cmpe 450 Fall Dynamic Analysis Software quality Design carefully from the start Simple and clean Fewer errors Finding errors.
Software Transactional Memory Should Not Be Obstruction-Free Robert Ennals Presented by Abdulai Sei.
Thread basics. A computer process Every time a program is executed a process is created It is managed via a data structure that keeps all things memory.
Transaction Management Transparencies. ©Pearson Education 2009 Chapter 14 - Objectives Function and importance of transactions. Properties of transactions.
Detecting Atomicity Violations via Access Interleaving Invariants
9 1 Chapter 9_B Concurrency Control Database Systems: Design, Implementation, and Management, Rob and Coronel.
Soyeon Park, Shan Lu, Yuanyuan Zhou UIUC Reading Group by Theo.
Transactional Memory Coherence and Consistency Lance Hammond, Vicky Wong, Mike Chen, Brian D. Carlstrom, John D. Davis, Ben Hertzberg, Manohar K. Prabhu,
Agenda  Quick Review  Finish Introduction  Java Threads.
CSCE 240 – Intro to Software Engineering Lecture 3.
PRES: Probabilistic Replay with Execution Sketching on Multiprocessors Soyeon Park and Yuanyuan Zhou (UCSD) Weiwei Xiong, Zuoning Yin, Rini Kaushik, Kyu.
LECTURE 19 Subroutines and Parameter Passing. ABSTRACTION Recall: Abstraction is the process by which we can hide larger or more complex code fragments.
Chapter 13 Managing Transactions and Concurrency Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
Lecture 5 Page 1 CS 111 Summer 2013 Bounded Buffers A higher level abstraction than shared domains or simple messages But not quite as high level as RPC.
Explicitly Parallel Programming with Shared-Memory is Insane: At Least Make it Deterministic! Joe Devietti, Brandon Lucia, Luis Ceze and Mark Oskin University.
Lecture 20: Consistency Models, TM
YAHMD - Yet Another Heap Memory Debugger
Minh, Trautmann, Chung, McDonald, Bronson, Casper, Kozyrakis, Olukotun
Multi-User Databases Chapter 9.
Ch 21: Transaction Processing
Database Processing: David M. Kroenke’s Chapter Nine: Part One
Chapter 10 Transaction Management and Concurrency Control
Lecture 22: Consistency Models, TM
Hybrid Transactional Memory
Transactions and Concurrency
Lecture: Consistency Models, TM
Transactions-Concurrency Problems
Transaction Communication
Presentation transcript:

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

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

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

Outline Motivation Implicit Atomicity Atom-Aid Design Experimental Setup & Results Conclusions

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

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 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

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

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

Implications of natural hiding

Atomicity Violation Statistics Typical atomicity violation: instr If 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 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

Atom-Aid Design Details

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

Chunk Breaking Flowchart

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

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

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 highest  lowest 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