The Cost of Privatization Hagit Attiya Eshcar Hillel Technion & EPFLTechnion.

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

Transactional Memory Parag Dixit Bruno Vavala Computer Architecture Course, 2012.
Pay-to-use strong atomicity on conventional hardware Martín Abadi, Tim Harris, Mojtaba Mehrara Microsoft Research.
Privatization Techniques for Software Transactional Memory Michael F. Spear, Virendra J. Marathe, Luke Dalessandro, and Michael L. Scott University of.
Impossibilities for Disjoint-Access Parallel Transactional Memory : Alessia Milani [Guerraoui & Kapalka, SPAA 08] [Attiya, Hillel & Milani, SPAA 09]
Enabling Speculative Parallelization via Merge Semantics in STMs Kaushik Ravichandran Santosh Pande College.
Chapter 15: Transactions Transaction Concept Transaction Concept Concurrent Executions Concurrent Executions Serializability Serializability Testing for.
Principles of Transaction Management. Outline Transaction concepts & protocols Performance impact of concurrency control Performance tuning.
Architecture-aware Analysis of Concurrent Software Rajeev Alur University of Pennsylvania Amir Pnueli Memorial Symposium New York University, May 2010.
Presented by: Dmitri Perelman.  Intro  “Don’t touch my read-set” approach  “Precedence graphs” approach  On avoiding spare aborts  Your questions.
IDIT KEIDAR DMITRI PERELMAN RUI FAN EuroTM 2011 Maintaining Multiple Versions in Software Transactional Memory 1.
A Rely-Guarantee-Based Simulation for Verifying Concurrent Program Transformations Hongjin Liang, Xinyu Feng & Ming Fu Univ. of Science and Technology.
D u k e S y s t e m s Time, clocks, and consistency and the JMM Jeff Chase Duke University.
Virendra J. Marathe, William N. Scherer III, and Michael L. Scott Department of Computer Science University of Rochester Presented by: Armand R. Burks.
Highly-Concurrent Data Structures Hagit Attiya and Eshcar Hillel Computer Science Department Technion.
Safety Definitions and Inherent Bounds of Transactional Memory Eshcar Hillel.
Inherent limitations on DAP TMs 1 Inherent Limitations on Disjoint-Access Parallel Transactional Memory Hagit Attiya, Eshcar Hillel, Alessia Milani Technion.
Pessimistic Software Lock-Elision Nir Shavit (Joint work with Yehuda Afek Alexander Matveev)
The Complexity of Transactional Memory & What to Do About It Hagit Attiya Technion & EPFL.
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)
Consistency Conditions for STM Sandeep Hans. Agenda Database Consistency Conditions STM Consistency Conditions A different perspective Consistency with.
A Programming Language View of Transactional Memory Hagit Attiya, Technion Joint work with Sandeep Hans, Alexey Gotsman and Noam Rinetzky Published in.
Ali Saoud Object Based Transactional Memory. Introduction Resent trends go towards object based SMT because it’s dynamic Word-based STM systems are more.
Exploring the relations between STM and DB consistency conditions Sandeep Hans Technion Joint work with Hagit Attiya.
Transactional Memory (TM) Evan Jolley EE 6633 December 7, 2012.
Sequential reductions for verifying serializability Hagit Attiya Technion & EPFL G. RamalingamMSR India Noam Rinetzky University of London.
A Mile-High View of Concurrent Algorithms Hagit Attiya Technion.
DMITRI PERELMAN IDIT KEIDAR TRANSACT 2010 SMV: Selective Multi-Versioning STM 1.
1 Lecture 21: Transactional Memory Topics: consistency model recap, introduction to transactional memory.
Formalisms and Verification for Transactional Memories Vasu Singh EPFL Switzerland.
1 Lecture 7: Transactional Memory Intro Topics: introduction to transactional memory, “lazy” implementation.
Algorithmics for Software Transactional Memory Hagit Attiya Technion.
1 Lecture 23: Transactional Memory Topics: consistency model recap, introduction to transactional memory.
Locality in Concurrent Data Structures Hagit Attiya Technion.
Database Management Systems I Alex Coman, Winter 2006
KAUSHIK LAKSHMINARAYANAN MICHAEL ROZYCZKO VIVEK SESHADRI Transactional Memory: Hybrid Hardware/Software Approaches.
An Introduction to Software Transactional Memory
Software Transactional Memory for Dynamic-Sized Data Structures Maurice Herlihy, Victor Luchangco, Mark Moir, William Scherer Presented by: Gokul Soundararajan.
Reduced Hardware NOrec: A Safe and Scalable Hybrid Transactional Memory Alexander Matveev Nir Shavit MIT.
TRANSACTIONS. Objectives Transaction Concept Transaction State Concurrent Executions Serializability Recoverability Implementation of Isolation Transaction.
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.
WG5: Applications & Performance Evaluation Pascal Felber
Lowering the Overhead of Software Transactional Memory Virendra J. Marathe, Michael F. Spear, Christopher Heriot, Athul Acharya, David Eisenstat, William.
Low-Overhead Software Transactional Memory with Progress Guarantees and Strong Semantics Minjia Zhang, 1 Jipeng Huang, Man Cao, Michael D. Bond.
©Silberschatz, Korth and Sudarshan15.1Database System Concepts Chapter 15: Transactions Transaction Concept Transaction State Implementation of Atomicity.
Sekolah Tinggi Ilmu Statistik (STIS) 1 Dr. Said Mirza Pahlevi, M.Eng.
On the Performance of Window-Based Contention Managers for Transactional Memory Gokarna Sharma and Costas Busch Louisiana State University.
Technology from seed Exploiting Off-the-Shelf Virtual Memory Mechanisms to Boost Software Transactional Memory Amin Mohtasham, Paulo Ferreira and João.
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.
A Relativistic Enhancement to Software Transactional Memory Philip Howard, Jonathan Walpole.
Jinze Liu. ACID Atomicity: TX’s are either completely done or not done at all Consistency: TX’s should leave the database in a consistent state Isolation:
Reduction Theorems for Proving Serializability with Application to RCU-Based Synchronization Hagit Attiya Technion Work with Ramalingam and Rinetzky (POPL.
Lecture 20: Consistency Models, TM
Maurice Herlihy, Victor Luchangco, Mark Moir, William N. Scherer III
Minh, Trautmann, Chung, McDonald, Bronson, Casper, Kozyrakis, Olukotun
Part 2: Software-Based Approaches
Faster Data Structures in Transactional Memory using Three Paths
Database Management System
On disjoint access parallelism
Challenges in Concurrent Computing
A Lock-Free Algorithm for Concurrent Bags
Transactions.
Transactions Isolation Levels.
Lecture 22: Consistency Models, TM
Transactions Isolation Levels.
Transaction management
Lecture: Consistency Models, TM
Dynamic Performance Tuning of Word-Based Software Transactional Memory
Presentation transcript:

The Cost of Privatization Hagit Attiya Eshcar Hillel Technion & EPFLTechnion

The cost of privatization (June 2010) 2 A silver bullet for concurrent programming? A transaction is a sequence of operations, on a set of high level items –Appears to execute atomically –Ends by committing or by aborting Read() Write() Commit / Abort Transactional Memory STM

The cost of privatization (June 2010) 3 STM Software TM Implementation (STM) Translates high-level operations into primitives on base objects –e.g., read, write, CAS

The cost of privatization (June 2010) 4 STM Non-Transactional Accesses Direct operations on data items –Due to legacy code, irrevocable operations, or library functions May harm memory consistency & interfere with correct operation of the STM

The cost of privatization (June 2010) 5 STM Strong Atomicity Isolation and consistent ordering of transactions and non-transactional accesses E.g., a non-transactional read observes the value written by an earlier committed transaction

The cost of privatization (June 2010) 6 STM Obvious Solution Single-operation transaction –High overhead –Even with compiler optimizations Want uninstrumented access: single base object m for each item t Read t  read m Write t  write m

The cost of privatization (June 2010) 7 STM Privatization Cannot just assume a region is private [Guerraoui, Henzinger, Kapalka, Singh ’10] –Need a privatizing transaction: isolate a data region, and access it non-transactionally  Deferred updates: write / CAS applied to m (by another transaction) after t is privatized

The cost of privatization (June 2010) 8 Privatization-Safe STM A non-transactional read obtains values written by preceding committed transactions After privatization, a base object associated with a privatized item is not written by another thread

The cost of privatization (June 2010) 9 Linked-List Workload  A linked list & blue items are privatized  Other transactions write to blue items Cannot just write an item w/o checking first Transactions that write to data that might be private must have non-empty read sets

The cost of privatization (June 2010) 10 Single Global Lock  Efficient privatization –JudoSTM [Olszewski, Cutler, Steffan, ‘07] –NOrec [Dalessandro, Spear, Scott, ‘10]  Inherently sequential: only one transaction makes progress

The cost of privatization (June 2010) 11 Nonconflicting transactions must commit (even when running concurrently)  RingSTM : uses global ring, not progressive [Spear, Michael, von Praun, ‘08]  Private transactions: uses quiescing barrier, not progressive [Dice, Matveev, Shavit ‘10]  SkySTM : Traces W-R conflicts, progressive [Lev, Luchangco, Marathe, Moir, Nussbaum, ‘09] STM Properties: Progressiveness

The cost of privatization (June 2010) 12 No Early Updates Eager STM: Items in the write set are updated before the transaction is guaranteed to commit Lemma: Assuming progressiveness, eager STMs are not privatization-safe

The cost of privatization (June 2010) 13 STM Properties: Obliviousness No tracking of the data sets of non conflicting transactions (do not distinguish between them) Many STMs are oblivious  NOrec, RingSTM, private transactions  TLRW (slotted readers) [Dice, Shavit, ’10] –Exceptions are TLRW (unslotted readers), SkySTM 012

The cost of privatization (June 2010) 14 Cost of Privatization I: Invisible Reads Read operations do not write (also at commit-time) –Reduces contention on the memory –Look like empty read sets ― to the rest of the world! –JudoSTM, NOrec, RingSTM Theorem: In a progressive, oblivious STM, a transaction privatizing k items in the linked- list workload must have data set of size Ω(k)

The cost of privatization (June 2010) 15 Lower Bound with Invisible Reads: Proof p 1 executing T 1 ’ p 0 executing T 0 still commits invisibility p 0 executes T 0 privatizing the k blue items –Pick some item u that is not accessed by T 0 p 1 executes T 1 ’ writing to u –Nonempty read set u ready to commit but not eager

The cost of privatization (June 2010) 16 titi Lower Bound with Invisible Reads: Proof p 1 executing T 1 ’ p 0 executing T 0 If T 0 does not access item t i p 1 now executes T 1 writing t i –Nonempty read set, e.g., the linked list T 1 commits after T 0 commits u p 1 executing T 1 p 1 completes T 1 commits progressive oblivious invisible reads p 0 executing T 0

The cost of privatization (June 2010) 17 titi Lower Bound with Invisible Reads: Proof u p 1 executing T 1 p 1 completes T 1 p 0 executing T 0 not eager Base object m i is associated with t i p 1 must write to m i in the suffix of T 1  Contradicts privatization safety

The cost of privatization (June 2010) 18 Cost of Privatization II: Visible Reads Read operations write at some point, e.g. TLRW, SkySTM (read locks), private transactions –Semi-visible: the reader’s identity is unknown (oblivious) Theorem: In an ℓ-progressive, oblivious STM, a transaction privatizing k items in the linked-list workload must access min{ℓ,k} base objects  Tradeoff: memory accesses  parallelism TLRW, RingSTM realize extreme cases –Can be adapted to get intermediate tradeoffs many transactions make progress

The cost of privatization (June 2010) 19 T 1 … T k write to linked-list items without T 0 observing them (despite being visible) “Confusing” transactions T 1 ’ … T k ’ access a clone of the linked-list Lower Bound for Visible Reads: Hiding p 1 executing T 1 ’ p 0 executing T 0 p 2 executing T 2 ’

The cost of privatization (June 2010) 20 Inductively, swap a confusing transaction with an updating transaction –Incurs an access to an additional base object (to observe the updating transaction) –Be careful, not to lose previous accesses Lower Bound for Visible Reads: Proof p 1 executing T 1 ’ p 2 executing T 2 ’ p 0 executing T 0 p 1 executing T 1 ’ p 2 executing T 2 p 1 executing T 1

The cost of privatization (June 2010) 21 Summary Inherent cost for privatization, linear in the number of privatized items –Invisible reads: high-level accesses –Visible reads: low-level accesses  Efficient privatization requires tracking data sets of other transactions or limiting parallelism –Both have significant impact on performance Same results for disjoint-access parallel STM Same results for static & dynamic separation [Abadi, Birrell, Harris, Isard ’08] [Abadi, Birrell, Harris, Hsiesh ’09]

The cost of privatization (June 2010) 22 Alternative Costs SkySTM is progressive, and provides efficient privatization Not oblivious: Tracks data sets in detail –All transactions have cost proportional to the size of their data set  Is this inherent?

The cost of privatization (June 2010) 23 Thank you

The cost of privatization (June 2010) 24 Supporting Strong Atomicity STM using a global clock provides strong atomicity, w/o privatization [Guerraoui, Henzinger, Kapalka, Singh ’10] Theorem: progressive STMs cannot guarantee strong atomicity Static separation [Abadi, Birrell, Harris, Isard ’08] Dynamic separation [Abadi, Birrell, Harris, Hsiesh ’09] –Same lower bounds

The cost of privatization (June 2010) 25 Linked List Workload A privatizing transaction privatizes the list, for a thread that is going to work on the blue items Other transactions read the linked list nodes and write to a single blue item The privatizing transaction nullifies the head

The cost of privatization (June 2010) 26 STM Properties: Invisible Reads

The cost of privatization (June 2010) 27 Disjoint-Access Parallel STMs With invisible reads –Requires Ω(k) high-level accesses Allowing contention only due to nontrivial conflicts –Requires Ω(k) low-level accesses –Even with visible reads

The cost of privatization (June 2010) 28 Lower Bound with Invisible Reads: Proof p 0 executes T 0 privatizing k items –Some item u is not accessed by T 0 p 1 executes T 1 ’ writing to u –Arbitrary read set Cost of Privatization 28 p 1 executing T 1 ’ p 0 executing T 0 progressive

The cost of privatization (June 2010) 29 Lower Bound with Invisible Reads: Proof If T 0 does not access item t i Mofidy p 1 to execute T 1 writing to t i –Arbitrary read set T 1 commits after T 0 commits p 1 executing T 1 ’ p 1 executing T 1 p 1 completes T 1 p 0 executing T 0 progressiveoblivious invisible reads p 0 executing T 0

The cost of privatization (June 2010) 30 Lower Bound with Invisible Reads: Proof Base object m i is associated with t i p 1 must write to m i in the suffix of T 1  Contradicts privatization safety p 1 executing T 1 p 1 completes T 1 p 0 executing T 0 not eager

The cost of privatization (June 2010) 31 Open Question SkySTM is progressive, but not oblivious, with efficient privatization –Alternative cost: “writing” all the read locks (proportional to the size of the data set) –Intuitively, this is the cost of not being oblivious Can this be avoided?