Software Transactional Memory Should Not be Obstruction-Free

Slides:



Advertisements
Similar presentations
CS 603 Process Synchronization: The Colored Ticket Algorithm February 13, 2002.
Advertisements

Optimistic Methods for Concurrency Control By : H.T. Kung & John T. Robinson Presenters: Munawer Saeed.
1 Concurrency Control Chapter Conflict Serializable Schedules  Two actions are in conflict if  they operate on the same DB item,  they belong.
Concurrency: Deadlock and Starvation Chapter 6. Deadlock Permanent blocking of a set of processes that either compete for system resources or communicate.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 Concurrency Control Chapter 17 Sections
CS6223: Distributed Systems
Lock-Based Concurrency Control
Software Transactional Memory Should Not Be Obstruction Free Robert Ennals Intel Research Cambridge 15 JJ Thomson Avenue, Cambridge, CB3 0FD, UK
Parallel Processing (CS526) Spring 2012(Week 6).  A parallel algorithm is a group of partitioned tasks that work with each other to solve a large problem.
COS 461 Fall 1997 Transaction Processing u normal systems lose their state when they crash u many applications need better behavior u today’s topic: how.
Database Systems, 8 th Edition Concurrency Control with Time Stamping Methods Assigns global unique time stamp to each transaction Produces explicit.
Transactional Memory (TM) Evan Jolley EE 6633 December 7, 2012.
PARALLEL PROGRAMMING with TRANSACTIONAL MEMORY Pratibha Kona.
TOWARDS A SOFTWARE TRANSACTIONAL MEMORY FOR GRAPHICS PROCESSORS Daniel Cederman, Philippas Tsigas and Muhammad Tayyab Chaudhry.
Synchronization. Physical Clocks Solar Physical Clocks Cesium Clocks International Atomic Time Universal Coordinate Time (UTC) Clock Synchronization Algorithms.
OS Spring 2004 Concurrency: Principles of Deadlock Operating Systems Spring 2004.
CS510 Concurrent Systems Class 2 A Lock-Free Multiprocessor OS Kernel.
Transaction Management
OS Fall’02 Concurrency: Principles of Deadlock Operating Systems Fall 2002.
CS510 Concurrent Systems Class 13 Software Transactional Memory Should Not be Obstruction-Free.
TxLinux: Using and Managing Hardware Transactional Memory in an Operating System Christopher J. Rossbach, Owen S. Hofmann, Donald E. Porter, Hany E. Ramadan,
Language Support for Lightweight transactions Tim Harris & Keir Fraser Presented by Narayanan Sundaram 04/28/2008.
Christopher J. Rossbach, Owen S. Hofmann, Donald E. Porter, Hany E. Ramadan, Aditya Bhandari, and Emmett Witchel - Presentation By Sathish P.
G Robert Grimm New York University Scheduler Activations.
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.
Why The Grass May Not Be Greener On The Other Side: A Comparison of Locking vs. Transactional Memory Written by: Paul E. McKenney Jonathan Walpole Maged.
Transactions and Reliability. File system components Disk management Naming Reliability  What are the reliability issues in file systems? Security.
Software Transactional Memory for Dynamic-Sized Data Structures Maurice Herlihy, Victor Luchangco, Mark Moir, William Scherer Presented by: Gokul Soundararajan.
CS510 Concurrent Systems Jonathan Walpole. A Lock-Free Multiprocessor OS Kernel.
Cosc 4740 Chapter 6, Part 3 Process Synchronization.
Operating Systems Distributed Coordination. Topics –Event Ordering –Mutual Exclusion –Atomicity –Concurrency Control Topics –Event Ordering –Mutual Exclusion.
Optimistic Design 1. Guarded Methods Do something based on the fact that one or more objects have particular states  Make a set of purchases assuming.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Mutual Exclusion.
CS510 Concurrent Systems Why the Grass May Not Be Greener on the Other Side: A Comparison of Locking and Transactional Memory.
Chapter 15: Transactions Loc Hoang CS 157B. Definition n A transaction is a discrete unit of work that must be completely processed or not processed at.
7c.1 Silberschatz, Galvin and Gagne ©2003 Operating System Concepts with Java Module 7c: Atomicity Atomic Transactions Log-based Recovery Checkpoints Concurrent.
CS510 Concurrent Systems Jonathan Walpole. A Methodology for Implementing Highly Concurrent Data Objects.
Software Transactional Memory Should Not Be Obstruction-Free Robert Ennals Presented by Abdulai Sei.
CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office hours: M-Wd 11: :30 AM.
CS333 Intro to Operating Systems Jonathan Walpole.
MULTIVIE W Slide 1 (of 21) Software Transactional Memory Should Not Be Obstruction Free Paper: Robert Ennals Presenter: Emerson Murphy-Hill.
Optimistic Design CDP 1. Guarded Methods Do something based on the fact that one or more objects have particular states Make a set of purchases assuming.
CSCI1600: Embedded and Real Time Software Lecture 17: Concurrent Programming Steven Reiss, Fall 2015.
Recovery Control (Chapter 17)
Transactions and Reliability
Transaction Management
Concurrency: Deadlock and Starvation
Background on the need for Synchronization
Part 2: Software-Based Approaches
Multiple Writers and Races
Database Systems (資料庫系統)
Concurrency Control.
Advanced Operating Systems - Fall 2009 Lecture 8 – Wednesday February 4, 2009 Dan C. Marinescu Office: HEC 439 B. Office hours: M,
Introduction to Operating Systems
A Qualitative Survey of Modern Software Transactional Memory Systems
Designing Parallel Algorithms (Synchronization)
Concurrency Control via Timestamps
Outline Announcements Fault Tolerance.
Chapter 10 Transaction Management and Concurrency Control
Christopher J. Rossbach, Owen S. Hofmann, Donald E. Porter, Hany E
CS162 Operating Systems and Systems Programming Review (II)
Basic Two Phase Locking Protocol
Chapter 15 : Concurrency Control
Lecture 2 Part 2 Process Synchronization
Hybrid Transactional Memory
Concurrency: Mutual Exclusion and Process Synchronization
Locking Protocols & Software Transactional Memory
CONCURRENCY Concurrency is the tendency for different tasks to happen at the same time in a system ( mostly interacting with each other ) .   Parallel.
CSE 542: Operating Systems
CSE 542: Operating Systems
Presentation transcript:

Software Transactional Memory Should Not be Obstruction-Free CS510 Concurrent Systems Software Transactional Memory Should Not be Obstruction-Free

What is Obstruction Freedom? Weakest of the series of properties wait-free – every process must complete an operation after a finite number of steps (i.e. no starvation) lock-free – some process must complete an operation after a finite number of steps (i.e. no system-wide blocking) obstruction-free - a process is guaranteed to make progress when all other processes are stopped (i.e. no blocking by inactive processes) CS510 - Concurrent Systems

Why is Obstruction Freedom Useful? Distributed systems have independent failure domains obstruction freedom stops failed CPUs from preventing progress on healthy CPUs But is it useful in shared memory multi-core systems with a single failure domain? existing multi-core applications do not have this property do they need it? is STM interesting because of its obstruction freedom property, or for some other reason? CS510 - Concurrent Systems

CS510 - Concurrent Systems Causes of Obstruction? Threads become inactive for long periods due to: Failures Scheduling policies Blocking operations Priority inversions How are each of these situations handled in non-STM systems? CS510 - Concurrent Systems

Why is Obstruction Freedom Expensive? Because it precludes accessing object data in-place! Requires extra memory accesses for a level of indirection must go via an object descriptor to get to the object data Results in poor use of cache and TLB What if one process wants to access an object owned (being written to) by a swapped-out process? Wait? but that’s not obstruction-free! Go ahead? but that’s not safe Abort the blocked process and wait for acknowledgement? but that’s not obstruction-free either (may live-lock) CS510 - Concurrent Systems

Indirection in Obstruction-Free STM CS510 - Concurrent Systems

Why is Obstruction Freedom Expensive? Because it results in an excessive number of active transactions this increases memory contention If there are N transactions on N processors, what happens if we want to start another transaction Obstruction-free implementations can’t wait for other transactions to complete, so memory contention must increase CS510 - Concurrent Systems

Converting Existing Code to STM Threading for convenience convert lock-protected critical sections to transactions Threading for performance match number of active threads to number of CPUs poor mapping of threads to CPUs not solved by STM! CS510 - Concurrent Systems

STM Without Obstruction Freedom Revocable Two Phase Locking for Writes A transaction locks all objects it intends to write Locks are released when transaction completes On deadlock, one transaction aborts and rolls back it’s writes Optimistic Concurrency Control for Reads Objects log the version number they read Version numbers must match end-of-transaction version numbers on commit if no match, retry like sequence locks in Linux CS510 - Concurrent Systems

CS510 - Concurrent Systems Memory Layout CS510 - Concurrent Systems

CS510 - Concurrent Systems Writing If the object’s handle is a version number CAS handle to point to new write descriptor object is now locked Make private working copy of data why? Aborts, concurrent reads, … If the object’s handle is a write descriptor, wait Until it is a version number (ie until its unlocked) Or a timeout has been reached, then request other process to abort (if its lower priority than you) On deadlock, system aborts one transaction CS510 - Concurrent Systems

CS510 - Concurrent Systems Reading To read from an object Wait for handle to become a version wait until its unlocked once it is, proceed optimistically (i.e. without read locking it!) Log the version number so you can tell if you need to retry CS510 - Concurrent Systems

CS510 - Concurrent Systems Committing Make sure all read objects still have same version (check) Write working copy to original object (update) Set object’s descriptor to a new version (unlock) CS510 - Concurrent Systems

CS510 - Concurrent Systems Performance (1) CS510 - Concurrent Systems

CS510 - Concurrent Systems Performance (2) CS510 - Concurrent Systems

CS510 - Concurrent Systems Performance (3) CS510 - Concurrent Systems

Why the Poor Performance? Obstruction-Freedom effect on cache and TLB inability to co-locate data and meta-data in memory such that they map to the same cache line impacts performance in the uncontended case Helping occurs in the contended case contending transactions help others to finish transactions slow each other down more and more as the number of transactions involved in helping increases CS510 - Concurrent Systems

CS510 - Concurrent Systems Conclusion Obstruction freedom is not important to software transactional memory systems Obstruction freedom makes implementations: Inefficient Complicated Remove it from the requirements list! CS510 - Concurrent Systems