Software Transactional Memory Should Not Be Obstruction-Free Robert Ennals Presented by Abdulai Sei.

Slides:



Advertisements
Similar presentations
Remus: High Availability via Asynchronous Virtual Machine Replication
Advertisements

Interactive lesson about operating system
Optimistic Methods for Concurrency Control By : H.T. Kung & John T. Robinson Presenters: Munawer Saeed.
1 Lecture 18: Transactional Memories II Papers: LogTM: Log-Based Transactional Memory, HPCA’06, Wisconsin LogTM-SE: Decoupling Hardware Transactional Memory.
Mutual Exclusion.
Software Transactional Memory Should Not Be Obstruction Free Robert Ennals Intel Research Cambridge 15 JJ Thomson Avenue, Cambridge, CB3 0FD, UK
Hybrid Transactional Memory Nir Shavit MIT and Tel-Aviv University Joint work with Alex Matveev (and describing the work of many in this summer school)
Thread-Level Transactional Memory Decoupling Interface and Implementation UW Computer Architecture Affiliates Conference Kevin Moore October 21, 2004.
Data and Database Administration Chapter 12. Outline What is Concurrency Control? Background Serializability  Locking mechanisms.
Transactional Memory (TM) Evan Jolley EE 6633 December 7, 2012.
Progress Guarantee for Parallel Programs via Bounded Lock-Freedom Erez Petrank – Technion Madanlal Musuvathi- Microsoft Bjarne Steensgaard - Microsoft.
PARALLEL PROGRAMMING with TRANSACTIONAL MEMORY Pratibha Kona.
TOWARDS A SOFTWARE TRANSACTIONAL MEMORY FOR GRAPHICS PROCESSORS Daniel Cederman, Philippas Tsigas and Muhammad Tayyab Chaudhry.
Transactional Memory Yujia Jin. Lock and Problems Lock is commonly used with shared data Priority Inversion –Lower priority process hold a lock needed.
1 Lecture 21: Transactional Memory Topics: consistency model recap, introduction to transactional memory.
1 Lecture 23: Transactional Memory Topics: consistency model recap, introduction to transactional memory.
Transaction Management and Concurrency Control
Transaction Management and Concurrency Control
CS510 Advanced OS Seminar Class 10 A Methodology for Implementing Highly Concurrent Data Objects by Maurice Herlihy.
OS Spring 2004 Concurrency: Principles of Deadlock Operating Systems Spring 2004.
CS510 Concurrent Systems Class 2 A Lock-Free Multiprocessor OS Kernel.
OS Fall’02 Concurrency: Principles of Deadlock Operating Systems Fall 2002.
CS510 Concurrent Systems Class 13 Software Transactional Memory Should Not be Obstruction-Free.
Language Support for Lightweight transactions Tim Harris & Keir Fraser Presented by Narayanan Sundaram 04/28/2008.
1 Last Class: Introduction Operating system = interface between user & architecture Importance of OS OS history: Change is only constant User-level Applications.
G Robert Grimm New York University Scheduler Activations.
1 OS & Computer Architecture Modern OS Functionality (brief review) Architecture Basics Hardware Support for OS Features.
I/O Systems ◦ Operating Systems ◦ CS550. Note:  Based on Operating Systems Concepts by Silberschatz, Galvin, and Gagne  Strongly recommended to read.
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.
Development of a Resource Locking Algorithm for a Kernel Debugging User-space API Library TJHSST Computer Systems Lab Timothy Wismer.
111 © 2002, Cisco Systems, Inc. All rights reserved.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
CS5204 – Operating Systems Transactional Memory Part 2: Software-Based Approaches.
I/O management is a major component of operating system design and operation Important aspect of computer operation I/O devices vary greatly Various methods.
ECE200 – Computer Organization Chapter 9 – Multiprocessors.
Games Development 2 Concurrent Programming CO3301 Week 9.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
State Teleportation How Hardware Transactional Memory can Improve Legacy Data Structures Maurice Herlihy and Eli Wald Brown University.
On the Performance of Window-Based Contention Managers for Transactional Memory Gokarna Sharma and Costas Busch Louisiana State University.
Chapter 7 -1 CHAPTER 7 PROCESS SYNCHRONIZATION CGS Operating System Concepts UCF, Spring 2004.
Non-Blocking Concurrent Data Objects With Abstract Concurrency By Jack Pribble Based on, “A Methodology for Implementing Highly Concurrent Data Objects,”
Java Thread and Memory Model
Wait-Free Multi-Word Compare- And-Swap using Greedy Helping and Grabbing Håkan Sundell PDPTA 2009.
Hazard Pointers: Safe Memory Reclamation for Lock-Free Objects Maged M. Michael Presented by Abdulai Sei.
CS510 Concurrent Systems Jonathan Walpole. A Methodology for Implementing Highly Concurrent Data Objects.
IM NTU Distributed Information Systems 2004 Distributed Transactions -- 1 Distributed Transactions Yih-Kuen Tsay Dept. of Information Management National.
CS510 Concurrent Systems Jonathan Walpole. RCU Usage in Linux.
CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office hours: M-Wd 11: :30 AM.
MULTIVIE W Slide 1 (of 21) Software Transactional Memory Should Not Be Obstruction Free Paper: Robert Ennals Presenter: Emerson Murphy-Hill.
©Bob Godfrey, 2002, 2005 Lecture 17: Transaction Integrity and Concurrency BSA206 Database Management Systems.
Operating System Concepts
Mutual Exclusion -- Addendum. Mutual Exclusion in Critical Sections.
Chapter 13 Managing Transactions and Concurrency Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
Lecture 20: Consistency Models, TM
Maurice Herlihy and J. Eliot B. Moss,  ISCA '93
Minh, Trautmann, Chung, McDonald, Bronson, Casper, Kozyrakis, Olukotun
Part 2: Software-Based Approaches
Faster Data Structures in Transactional Memory using Three Paths
Chapter 10 Transaction Management and Concurrency Control
Lecture 22: Consistency Models, TM
Threads Chapter 4.
Hybrid Transactional Memory
Introduction of Week 13 Return assignment 11-1 and 3-1-5
Concurrency: Mutual Exclusion and Process Synchronization
Software Transactional Memory Should Not be Obstruction-Free
CS510 Operating System Foundations
Foundations and Definitions
Programming with Shared Memory Specifying parallelism
Chapter 13: I/O Systems.
Presentation transcript:

Software Transactional Memory Should Not Be Obstruction-Free Robert Ennals Presented by Abdulai Sei

Obstruction-Free Concept seen in previous paper by Maurice Herlihy “A Methodology for Implementing Highly concurrent Data Objects” Weakest of the series of properties wait-free - each process must complete an operation after taking a finite number of steps lock-free - a thread cannot lock up and every step it takes brings progress to the system obstruction-free - a thread is guaranteed to make progress when all other threads are suspended Essential in distributed systems (which is the background of most Software Transactional Memory researches)

Software Transactional Memory (STM) and Obstruction-Freedom Obstruction-freedom is not a necessary property for STM in a non-distributed systems because use of STM is to improve performance of programs that would otherwise execute sequentially but with obstruction-freedom, this is a problem it is sometimes allowable for one transaction to block another transaction of the same or lower priority easy to adaptively vary the # of task to match available cores unlikely that a transaction will be blocked by a transaction that has been switched out

Threads and Tasks Thread and Tasks thread – a programmable level construct use to specify that several block of codes can be executed in parallel tasks (kernel thread)– OS level construct that runs on a core and execute code from threads Use of threads threading for convenience – can be ported to STM by converting all locks-protected blocks into transaction threading for performance – large program that previously uses small # of threads can now be broken down into small programs running on more threads

Application Parallelism critical to map application parallelism to underlining hardware parallelism and must be done carefully i.e. mapping kernel threads onto actual CPU building STM that tries to be immune to poor mapping does not solve the core problem

Motivation behind Obstruction-Freedom Prevent a long running transaction from blocking others transaction e.g – a transaction computes for a year then write to the same thread. Need to block other threads for this to happen obstruction-freedom guarantee progress if there are no other conflicting transactions lock-freedom only guarantee that the system as a whole make progress Prevent system locking occurs when a thread switch part-way through a transaction but guarantee the thread will be switch back – not a problem Prevent the system locking up if a thread fails

Why Obstruction-Freedom makes efficient implementation difficult Obstruction–Freedom makes efficient implementation difficult Cache-Locality Object metadata must be adjacent to object data for unlikely cache misses Excessive Active Transaction Active transaction should not exceed number of cores causing new transactions to wait for free core

Implementation Based on concept in previous slides Idea revocable two phase locking for writes transaction locks all objects that it writes until it terminates what about dead lock? optimistic concurrency control for reads logs versions that transaction reads from verifies that versions are the same as the ones read when it commits Memory layout public memory – can be accessed by any transaction private memory – accessed by only transaction owner

Memory Layout

Implementation – (o=object, t=transaction) Writing an objects t must obtain an exclusive lock on o If o’s handle is a v t uses atomic CAS to replace v with a pointer to a new write descriptor last-version field of write descriptor field set to v working copy initialized to the current version of o data If o’s handle is a pointer to a write descriptor w t waits until the owning transaction, s, sets the handle to be a version number – indication it is finished if t, timeout after some # of cycle, and s is of lower priority, t request s aborts itself t can find descriptor for s by zeroing the lower-order bits of w What if deadlock is detected?

Implementation- continue Reading an object to read, t waits for o handler to be a version then logs the version number in the read descriptor Committing an object transaction checks that it is valid when is a transaction considered valid? then makes it write visible to other transactions

Performance

Performance Evaluation

Reasons for poor performance Obstruction-Freedom effect on cache and TLB due to the inability to colocate data and meta-data in memory such that they map to the same cache line affect performance in the uncontended case Helping applies to the contended case contending transaction help others to finish each transaction slows each other down as the number of transaction involve in helping increases

Conclusion Obstruction-freedom is not an important property for STMs Non-obstruction-freedom can achieve significantly better performance than an obstruction-free one Future designs should not attempt to be obstruction-free