Asynchronous Assertions Eddie Aftandilian and Sam Guyer Tufts University Martin Vechev ETH Zurich and IBM Research Eran Yahav Technion.

Slides:



Advertisements
Similar presentations
Software Transactional Objects Guy Eddon Maurice Herlihy TRAMP 2007.
Advertisements

Copyright 2008 Sun Microsystems, Inc Better Expressiveness for HTM using Split Hardware Transactions Yossi Lev Brown University & Sun Microsystems Laboratories.
Time-based Transactional Memory with Scalable Time Bases Torvald Riegel, Christof Fetzer, Pascal Felber Presented By: Michael Gendelman.
Wait-Free Linked-Lists Shahar Timnat, Anastasia Braginsky, Alex Kogan, Erez Petrank Technion, Israel Presented by Shahar Timnat 469-+
Ditto: Speeding Up Runtime Data Structure Invariant Checks AJ Shankar and Ras Bodik UC Berkeley.
Optimistic Methods for Concurrency Control By : H.T. Kung & John T. Robinson Presenters: Munawer Saeed.
1 Write Barrier Elision for Concurrent Garbage Collectors Martin T. Vechev Cambridge University David F. Bacon IBM T.J.Watson Research Center.
A Program Transformation For Faster Goal-Directed Search Akash Lal, Shaz Qadeer Microsoft Research.
CS492B Analysis of Concurrent Programs Lock Basics Jaehyuk Huh Computer Science, KAIST.
1 © R. Guerraoui The Power of Registers Prof R. Guerraoui Distributed Programming Laboratory.
Runtime checking of expressive heap assertions Greta Yorsh, Martin Vechev, Eran Yahav, Bard Bloom.
A Randomized Dynamic Program Analysis for Detecting Real Deadlocks Koushik Sen CS 265.
OSDI ’10 Research Visions 3 October Epoch parallelism: One execution is not enough Jessica Ouyang, Kaushik Veeraraghavan, Dongyoon Lee, Peter Chen,
Concurrency The need for speed. Why concurrency? Moore’s law: 1. The number of components on a chip doubles about every 18 months 2. The speed of computation.
Virtual Memory Background Demand Paging Performance of Demand Paging
Virtual Memory Introduction to Operating Systems: Module 9.
A Pipeline for Lockless Processing of Sound Data David Thall Insomniac Games.
MC 2 : High Performance GC for Memory-Constrained Environments - Narendran Sachindran, J. Eliot B. Moss, Emery D. Berger Sowmiya Chocka Narayanan.
U NIVERSITY OF M ASSACHUSETTS, A MHERST – Department of Computer Science The Implementation of the Cilk-5 Multithreaded Language (Frigo, Leiserson, and.
An On-the-Fly Mark and Sweep Garbage Collector Based on Sliding Views Hezi Azatchi - IBM Yossi Levanoni - Microsoft Harel Paz – Technion Erez Petrank –
Parallel and Distributed Simulation Time Warp: Other Mechanisms.
1 Cheriton School of Computer Science 2 Department of Computer Science RemusDB: Transparent High Availability for Database Systems Umar Farooq Minhas 1,
Thread-Level Transactional Memory Decoupling Interface and Implementation UW Computer Architecture Affiliates Conference Kevin Moore October 21, 2004.
Transactional Memory (TM) Evan Jolley EE 6633 December 7, 2012.
1 The Compressor: Concurrent, Incremental and Parallel Compaction. Haim Kermany and Erez Petrank Technion – Israel Institute of Technology.
G Robert Grimm New York University Cool Pet Tricks with… …Virtual Memory.
G Robert Grimm New York University Recoverable Virtual Memory.
CS510 Advanced OS Seminar Class 10 A Methodology for Implementing Highly Concurrent Data Objects by Maurice Herlihy.
Correctness-Preserving Derivation of Concurrent Garbage Collection Algorithms Martin T. Vechev Eran Yahav David F. Bacon University of Cambridge IBM T.J.
Capriccio: Scalable Threads for Internet Services Rob von Behren, Jeremy Condit, Feng Zhou, Geroge Necula and Eric Brewer University of California at Berkeley.
G Robert Grimm New York University Recoverable Virtual Memory.
Backup and Recovery Part 1.
1 The Google File System Reporter: You-Wei Zhang.
An Adaptive, Region-based Allocator for Java Feng Qian, Laurie Hendren {fqian, Sable Research Group School of Computer Science McGill.
15-740/ Oct. 17, 2012 Stefan Muller.  Problem: Software is buggy!  More specific problem: Want to make sure software doesn’t have bad property.
Copyright 2007 Sun Microsystems, Inc SNZI: Scalable Non-Zero Indicator Yossi Lev (Brown University & Sun Microsystems Laboratories) Joint work with: Faith.
The HDF Group Multi-threading in HDF5: Paths Forward Current implementation - Future directions May 30-31, 2012HDF5 Workshop at PSI 1.
Integrating and Optimizing Transactional Memory in a Data Mining Middleware Vignesh Ravi and Gagan Agrawal Department of ComputerScience and Engg. The.
Dynamic Object Sampling for Pretenuring Maria Jump Department of Computer Sciences The University of Texas at Austin Stephen M. Blackburn.
Synchronization Transformations for Parallel Computing Pedro Diniz and Martin Rinard Department of Computer Science University of California, Santa Barbara.
COMP 111 Threads and concurrency Sept 28, Tufts University Computer Science2 Who is this guy? I am not Prof. Couch Obvious? Sam Guyer New assistant.
Computer Science Department Daniel Frampton, David F. Bacon, Perry Cheng, and David Grove Australian National University Canberra ACT, Australia
SPECULATIVE EXECUTION IN A DISTRIBUTED FILE SYSTEM E. B. Nightingale P. M. Chen J. Flint University of Michigan.
Low-Overhead Software Transactional Memory with Progress Guarantees and Strong Semantics Minjia Zhang, 1 Jipeng Huang, Man Cao, Michael D. Bond.
Practical Reduction for Store Buffers Ernie Cohen, Microsoft Norbert Schirmer, DFKI.
September 11, 2003 Beltway: Getting Around GC Gridlock Steve Blackburn, Kathryn McKinley Richard Jones, Eliot Moss Modified by: Weiming Zhao Oct
CS162 Week 5 Kyle Dewey. Overview Announcements Reactive Imperative Programming Parallelism Software transactional memory.
Speculative Execution in a Distributed File System Ed Nightingale Peter Chen Jason Flinn University of Michigan.
A Methodology for Creating Fast Wait-Free Data Structures Alex Koganand Erez Petrank Computer Science Technion, Israel.
Drinking from Both Glasses: Adaptively Combining Pessimistic and Optimistic Synchronization for Efficient Parallel Runtime Support Man Cao Minjia Zhang.
Detecting Atomicity Violations via Access Interleaving Invariants
SCALING AND PERFORMANCE CS 260 Database Systems. Overview  Increasing capacity  Database performance  Database indexes B+ Tree Index Bitmap Index 
® July 21, 2004GC Summer School1 Cycles to Recycle: Copy GC Without Stopping the World The Sapphire Collector Richard L. Hudson J. Eliot B. Moss Originally.
GC Assertions: Using the Garbage Collector To Check Heap Properties Samuel Z. Guyer Tufts University Edward Aftandilian Tufts University.
Does the Optimistic Concurrency resolve your blocking problems Margarita Naumova, SQL Master Academy.
Concurrent Revisions: A deterministic concurrency model. Daan Leijen & Sebastian Burckhardt Microsoft Research (OOPSLA 2010, ESOP 2011)
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.
FastTrack: Efficient and Precise Dynamic Race Detection [FlFr09] Cormac Flanagan and Stephen N. Freund GNU OS Lab. 23-Jun-16 Ok-kyoon Ha.
Free Transactions with Rio Vista Landon Cox April 15, 2016.
Free Transactions with Rio Vista
No Bit Left Behind: The Limits of Heap Data Compression
Lecture 25 More Synchronized Data and Producer/Consumer Relationship
Introduction to NewSQL
Ulterior Reference Counting Fast GC Without The Wait
Chapter 9: Virtual-Memory Management
Jipeng Huang, Michael D. Bond Ohio State University
Free Transactions with Rio Vista
No Bit Left Behind: The Limits of Heap Data Compression
Continuously and Compacting By Lyndon Meadow
CSE 542: Operating Systems
Presentation transcript:

Asynchronous Assertions Eddie Aftandilian and Sam Guyer Tufts University Martin Vechev ETH Zurich and IBM Research Eran Yahav Technion

OOPSLA, October 25-27, Assertions are great Assertions are not cheap Cost paid at runtime Limits kinds of assertions Our goal Support more costly assertions (e.g., invariants) Support more frequent assertions Do it efficiently Motivation

OOPSLA, October 25-27, Asynchronous assertions Evaluate assertions concurrently with program Lots of cores (more coming) Enable more expensive assertions Thank you. Questions? Idea Two problems What if program modifies data being checked? When do we find out about failed assertions?

OOPSLA, October 25-27, Run assertions on a snapshot of program state Guarantee Get the same result as synchronous evaluation No race conditions How can we do this efficiently? Solution

OOPSLA, October 25-27, Incremental construction of snapshots (copy-on-write) Integrated into the runtime system (Jikes RVM 3.1.1) Supports multiple in-flight assertions Our implementation

OOPSLA, October 25-27, Overview Program threadChecker thread a = assert(OK()); o.f = p; if (o.f == …); OK() { return res; } wait(); b = a.get();... if (b) {.....wait.. Needs to see old o.f

OOPSLA, October 25-27, Main threadChecker thread Key o.f = p; if (o.f == …) for each active assertion A if o not already in A’s snapshot o’ = copy o mapping(A, o) := o’ modify o.f if o in my snapshot o’ = mapping(me, o) return o’.f else return o.f Write BarrierRead Barrier

OOPSLA, October 25-27, How do we know when a copy is needed? Epoch counter E Ticked each time a new assertion starts On each object: copied-at timestamp Last epoch in which a copy was made Write barrier fast path: If o.copied-at < E then some assertion needs a copy How do we implement the mapping? Per-object forwarding array One slot for each active assertion Implementation

OOPSLA, October 25-27, Synchronization Potential race condition Checker looks in mapping, o not there Application writes o.f Checker reads o.f Lock on copied-at timestamp Cleanup Zero out slot in forwarding array of all copied objects We need to keep a list of them Copies themselves reclaimed during GC Tricky bits

OOPSLA, October 25-27, Snapshot sharing All assertions that need a copy can share it Reduces performance overhead by 25-30% Store copy in each empty slot in forwarding array (for active assertions) Avoid snapshotting new objects New objects are not in any snapshot Idea: initialize copied-at to E Fast path test fails until new assertion started Optimizations

OOPSLA, October 25-27, Waiting for assertion result Traditional assertion model Assertion triggers whenever check completes Futures model Wait for assertion result before proceeding Another option: “Unfire the missiles!” Roll back side-effecting computations after receiving assertion failure Interface

OOPSLA, October 25-27, Idea: We know this can catch bugs Goal: understand the performance space Two kinds of experiments Microbenchmarks Various data structures with invariants Pulled from runtime invariant checking literature pseudojbb Instrumented with a synthetic assertion check Performs a bounded DFS on database Systematically control frequency and size of checks Evaluation

OOPSLA, October 25-27, Performance When there’s enough work x speedup vs. synchronous evaluation With 10 checker threads Ex. 12x sync slowdown  1.65x async When there’s less work: 0-60% overhead Extra memory usage for snapshots MB for JBB (out of 210 MB allocated) In steady state, almost all mutated objects are copied Cost plateaus Key results

OOPSLA, October 25-27, Pseudojbb graph schema Assertion workload 1.0 Sync Async Application waiting Normalized runtime Snapshot overhead Overloaded OK

OOPSLA, October 25-27, Fixed frequency, increasing cost

OOPSLA, October 25-27, Fixed frequency, increasing cost, zoomed

OOPSLA, October 25-27, Fixed frequency, increasing cost

OOPSLA, October 25-27, Concurrent GC Futures Runtime invariant checking FAQ: why didn’t you use STM? Wrong model We don’t want to abort In STM, transaction sees new state, other threads see snapshot Weird for us: the entire main thread would be a transaction Related work

OOPSLA, October 25-27, Execute data structure checks in separate threads Checks are written in standard Java Handle all synchronization automatically Enables more expensive assertions than traditional synchronous evaluation Thank you! Conclusions

OOPSLA, October 25-27,

OOPSLA, October 25-27, Snapshot volume

OOPSLA, October 25-27, Sharing snapshots

OOPSLA, October 25-27, Snapshot overhead

OOPSLA, October 25-27, Fixed cost, increasing frequency

OOPSLA, October 25-27, Fixed cost, increasing frequency, zoomed

OOPSLA, October 25-27, Copy-on-write implementation a obj a b b c

OOPSLA, October 25-27, Safe Futures for Java [Welc 05] Future Contracts [Dimoulas 09] Ditto [Shankar 07] SuperPin [Wallace 07] Speculative execution [Nightingale 08, Kelsey 09, Susskraut 09] Concurrent GC Transactional memory Related work