State Teleportation How Hardware Transactional Memory can Improve Legacy Data Structures Maurice Herlihy and Eli Wald Brown University.

Slides:



Advertisements
Similar presentations
Maurice Herlihy (DEC), J. Eliot & B. Moss (UMass)
Advertisements

Wait-Free Reference Counting and Memory Management Håkan Sundell, Ph.D.
Virendra J. Marathe, William N. Scherer III, and Michael L. Scott Department of Computer Science University of Rochester Presented by: Armand R. Burks.
McRT-Malloc: A Scalable Non-Blocking Transaction Aware Memory Allocator Ali Adl-Tabatabai Ben Hertzberg Rick Hudson Bratin Saha.
Linked Lists: Lazy and Non-Blocking Synchronization Based on the companion slides for The Art of Multiprocessor Programming (Maurice Herlihy & Nir Shavit)
Pessimistic Software Lock-Elision Nir Shavit (Joint work with Yehuda Afek Alexander Matveev)
Locality-Conscious Lock-Free Linked Lists Anastasia Braginsky & Erez Petrank 1.
Ali Saoud Object Based Transactional Memory. Introduction Resent trends go towards object based SMT because it’s dynamic Word-based STM systems are more.
Transactional Memory Overview Olatunji Ruwase Fall 2007 Oct
Concurrent Data Structures in Architectures with Limited Shared Memory Support Ivan Walulya Yiannis Nikolakopoulos Marina Papatriantafilou Philippas Tsigas.
It Ain’t the Meat, it’s the Notion Why Theory is Essential to Teaching Concurrent Programming Maurice Herlihy Brown University.
Lock-free Cuckoo Hashing Nhan Nguyen & Philippas Tsigas ICDCS 2014 Distributed Computing and Systems Chalmers University of Technology Gothenburg, Sweden.
Transactional Memory Yujia Jin. Lock and Problems Lock is commonly used with shared data Priority Inversion –Lower priority process hold a lock needed.
1 Johannes Schneider Transactional Memory: How to Perform Load Adaption in a Simple And Distributed Manner Johannes Schneider David Hasenfratz Roger Wattenhofer.
1 MetaTM/TxLinux: Transactional Memory For An Operating System Hany E. Ramadan, Christopher J. Rossbach, Donald E. Porter and Owen S. Hofmann Presenter:
[ 1 ] Agenda Overview of transactional memory (now) Two talks on challenges of transactional memory Rebuttals/panel discussion.
Lock vs. Lock-Free memory Fahad Alduraibi, Aws Ahmad, and Eman Elrifaei.
Computer Laboratory Practical non-blocking data structures Tim Harris Computer Laboratory.
CS510 Concurrent Systems Class 2 A Lock-Free Multiprocessor OS Kernel.
CS510 Concurrent Systems Class 13 Software Transactional Memory Should Not be Obstruction-Free.
Linked Lists: Locking, Lock- Free, and Beyond … Companion slides for The Art of Multiprocessor Programming by Maurice Herlihy & Nir Shavit.
CS533 - Concepts of Operating Systems 1 Class Discussion.
Companion slides for The Art of Multiprocessor Programming by Maurice Herlihy & Nir Shavit Concurrent Skip Lists.
A Transaction-Friendly Dynamic Memory Manager for Embedded Multicore Systems Maurice Herlihy Joint with Thomas Carle, Dimitra Papagiannopoulou Iris Bahar,
Copyright © 2010, Oracle and/or its affiliates. All rights reserved. Who’s Afraid of a Big Bad Lock Nir Shavit Sun Labs at Oracle Joint work with Danny.
An Introduction to Software Transactional Memory
1 Lock-Free Linked Lists Using Compare-and-Swap by John Valois Speaker’s Name: Talk Title: Larry Bush.
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.
A Qualitative Survey of Modern Software Transactional Memory Systems Virendra J. Marathe Michael L. Scott.
CS5204 – Operating Systems Transactional Memory Part 2: Software-Based Approaches.
Linked Lists: Locking, Lock- Free, and Beyond … Companion slides for The Art of Multiprocessor Programming by Maurice Herlihy & Nir Shavit.
Lowering the Overhead of Software Transactional Memory Virendra J. Marathe, Michael F. Spear, Christopher Heriot, Athul Acharya, David Eisenstat, William.
JVSTM and its applications João Software Engineering Group.
On the Performance of Window-Based Contention Managers for Transactional Memory Gokarna Sharma and Costas Busch Louisiana State University.
Linked Lists: Locking, Lock- Free, and Beyond … Companion slides for The Art of Multiprocessor Programming by Maurice Herlihy & Nir Shavit Modified by.
Concurrent Linked Lists and Linearizability Proofs Companion slides for The Art of Multiprocessor Programming by Maurice Herlihy & Nir Shavit Modified.
A Methodology for Creating Fast Wait-Free Data Structures Alex Koganand Erez Petrank Computer Science Technion, Israel.
Wait-Free Multi-Word Compare- And-Swap using Greedy Helping and Grabbing Håkan Sundell PDPTA 2009.
Advanced Locking Techniques
Darko Makreshanski Department of Computer Science ETH Zurich
A Simple Optimistic skip-list Algorithm Maurice Herlihy Brown University & Sun Microsystems Laboratories Yossi Lev Brown University & Sun Microsystems.
Range Queries in Non-blocking k-ary Search Trees Trevor Brown Hillel Avni.
Hazard Pointers: Safe Memory Reclamation for Lock-Free Objects Maged M. Michael Presented by Abdulai Sei.
Software Transactional Memory Should Not Be Obstruction-Free Robert Ennals Presented by Abdulai Sei.
© 2008 Multifacet ProjectUniversity of Wisconsin-Madison Pathological Interaction of Locks with Transactional Memory Haris Volos, Neelam Goyal, Michael.
Companion slides for The Art of Multiprocessor Programming by Maurice Herlihy & Nir Shavit Concurrent Skip Lists.
Linked Lists: Locking, Lock-Free, and Beyond … Companion slides for The Art of Multiprocessor Programming by Maurice Herlihy & Nir Shavit.
SkipLists and Balanced Search The Art Of MultiProcessor Programming Maurice Herlihy & Nir Shavit Chapter 14 Avi Kozokin.
An algorithm of Lock-free extensible hash table Yi Feng.
Hazard Pointers: Safe Memory Reclamation for Lock-Free Objects MAGED M. MICHAEL PRESENTED BY NURIT MOSCOVICI ADVANCED TOPICS IN CONCURRENT PROGRAMMING,
Linked Lists: Locking, Lock- Free, and Beyond … Companion slides for The Art of Multiprocessor Programming by Maurice Herlihy & Nir Shavit.
Linked Lists: Locking, Lock- Free, and Beyond … Companion slides for The Art of Multiprocessor Programming by Maurice Herlihy & Nir Shavit.
4 November 2005 CS 838 Presentation 1 Nested Transactional Memory: Model and Preliminary Sketches J. Eliot B. Moss and Antony L. Hosking Presented by:
MIT Lincoln Laboratory XYZ 3/11/2005 Introduction to a Wait-Free Hash Table Hash Table Key-Value pair stores and retrieves data Three Core Functions:
ECE 1747: Parallel Programming Short Introduction to Transactions and Transactional Memory (a.k.a. Speculative Synchronization)
Companion slides for The Art of Multiprocessor Programming by Maurice Herlihy & Nir Shavit Concurrent Skip Lists.
Scalable Computing model : Lock free protocol By Peeyush Agrawal 2010MCS3469 Guided By Dr. Kolin Paul.
Lecture 9 : Concurrent Data Structures Companion slides for The Art of Multiprocessor Programming by Maurice Herlihy & Nir Shavit.
6.852 Lecture 21 ● Techniques for highly concurrent objects – coarse-grained mutual exclusion – read/write locking – fine-grained locking (mutex and read/write)
Maurice Herlihy and J. Eliot B. Moss,  ISCA '93
Irina Calciu Justin Gottschlich Tatiana Shpeisman Gilles Pokam
Minh, Trautmann, Chung, McDonald, Bronson, Casper, Kozyrakis, Olukotun
Alex Kogan, Yossi Lev and Victor Luchangco
Faster Data Structures in Transactional Memory using Three Paths
CS510 Concurrent Systems Jonathan Walpole.
CS510 Concurrent Systems Jonathan Walpole.
Introduction of Week 13 Return assignment 11-1 and 3-1-5
CS510 Advanced Topics in Concurrency
CS510 Concurrent Systems Jonathan Walpole.
Presentation transcript:

State Teleportation How Hardware Transactional Memory can Improve Legacy Data Structures Maurice Herlihy and Eli Wald Brown University

Transactional Memory

Concurrent Data Structure = State Machine atomic step memory barrier

Concurrent Data Structure = State Machine atomic step memory barrier critical section, CAS, load/store

“as if” sequence of transitions State Teleportation atomic step atomic step atomic step memory barrier memory barrier memory barrier Hardware Transaction “as if” sequence of transitions

Three Concurrent Lists lazy wait-free traversal + locks lock-free lock-free everything locking hand-over-hand locking

Hand-Over-Hand Locking b c d remove(b)

Hand-Over-Hand Locking b c d remove(b)

Hand-Over-Hand Locking b c d remove(b) Found it!

Hand-Over-Hand Locking b c d remove(b)

Lazy List a b c remove(b)

Lazy List a b c remove(b)

Lazy List a b c remove(b)

Lazy List a b c remove(b)

Lazy List a b c validate … remove(b)

Lazy List a b c Logical delete remove(b)

Lazy List a b c Physical delete

Lock-Free List CAS a b c d remove(c)

seconds to finish 100,000 operations 80% writes, 20% modifications Benchmarks median of 6 runs higher = worse seconds to finish 100,000 operations 80% writes, 20% modifications

Benchmarks every thread has a core 1-4

Benchmarks every thread has a hyperthread 5-8

Benchmarks 9-up

No Memory Management lazy lock-free locking

Memory Management? Locking: Lazy: Lock-Free: immediate re-use hazard pointers

Hazard Pointers Node* hazardRead(Node** object) { while (true) { Node* read = *object; hazard[myIndex] = read; membar(); Node* reread = *object; if (read == reread) return read; }

Hazard Pointers read pointer to object Node* hazardRead(Node** object) { while (true) { Node* read = *object; hazard[myIndex] = read; membar(); Node* reread = *object; if (read == reread) return read; } read pointer to object

Hazard Pointers announce hazard Node* hazardRead(Node** object) { while (true) { Node* read = *object; hazard[myIndex] = read; membar(); Node* reread = *object; if (read == reread) return read; } announce hazard

Hazard Pointers make announcement visible (expensive) Node* hazardRead(Node** object) { while (true) { Node* read = *object; hazard[myIndex] = read; membar(); Node* reread = *object; if (read == reread) return read; } make announcement visible (expensive)

Hazard Pointers reread and validate Node* hazardRead(Node** object) { while (true) { Node* read = *object; hazard[myIndex] = read; membar(); Node* reread = *object; if (read == reread) return read; } reread and validate

Without Memory Management lazy lock-free locking

With Memory Management lazy lock-free locking

Lock Teleportation a b c d

Lock Teleportation read transaction a b c d

Lock Teleportation read transaction a b c d

Lock Teleportation no locks acquired a b c d

Hazard PointerTeleportation read transaction a b c d

Hazard PointerTeleportation b c d

Hazard Pointer Teleportation read transaction a b c d

Hazard Pointer Teleportation no memory barriers a b c d

Without Teleportation lazy lock-free locking

With Teleportation lazy lock-free locking

Speedup lazy lock-free locking

Adaptive Jumps If transaction commits … Add 1 to next distance If transaction aborts… Cut next distance in half

Average Teleport Distance lazy lock-free locking

Average Commit Rate lazy lock-free locking

Abort Reasons 4 threads 8 threads capacity explicit conflict unknown

Conclusions True cost of concurrent data structures should include memory management Cost of hazard pointers can equalize lock-based and lock-free structures Adaptive Teleportation can substantially improve memory management costs for both lock-based and lock-free structures