Complexity Implications of Memory Models. Out-of-Order Execution Avoid with fences (and atomic operations) Shared memory processes reordering buffer Hagit.

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

Symmetric Multiprocessors: Synchronization and Sequential Consistency.
1 Episode III in our multiprocessing miniseries. Relaxed memory models. What I really wanted here was an elephant with sunglasses relaxing On a beach,
Inherent limitations facilitate design and verification of concurrent programs Hagit Attiya Technion.
IBM T. J. Watson Research Center Conditions for Strong Synchronization Maged Michael IBM T J Watson Research Center Joint work with: Martin Vechev, Hagit.
1 Lecture 20: Synchronization & Consistency Topics: synchronization, consistency models (Sections )
Operating Systems Part III: Process Management (Process Synchronization)
Synchronization. How to synchronize processes? – Need to protect access to shared data to avoid problems like race conditions – Typical example: Updating.
Memory Consistency Models Kevin Boos. Two Papers Shared Memory Consistency Models: A Tutorial – Sarita V. Adve & Kourosh Gharachorloo – September 1995.
CS 162 Memory Consistency Models. Memory operations are reordered to improve performance Hardware (e.g., store buffer, reorder buffer) Compiler (e.g.,
“FENDER” AUTOMATIC MEMORY FENCE INFERENCE Presented by Michael Kuperstein, Technion Joint work with Martin Vechev and Eran Yahav, IBM Research 1.
D u k e S y s t e m s Time, clocks, and consistency and the JMM Jeff Chase Duke University.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 5: Process Synchronization.
Multiprocessor Synchronization Algorithms ( ) Lecturer: Danny Hendler The Mutual Exclusion problem.
CH7 discussion-review Mahmoud Alhabbash. Q1 What is a Race Condition? How could we prevent that? – Race condition is the situation where several processes.
Local-spin, Abortable Mutual Exclusion Joe Rideout.
CS492B Analysis of Concurrent Programs Consistency Jaehyuk Huh Computer Science, KAIST Part of slides are based on CS:App from CMU.
PARTIAL-COHERENCE ABSTRACTIONS FOR RELAXED MEMORY MODELS Presented by Michael Kuperstein, Technion Joint work with Martin Vechev, IBM Research and Eran.
Inherent limitations facilitate design & verification of concurrent programs Hagit Attiya Technion.
Martin Vechev IBM Research Michael Kuperstein Technion Eran Yahav Technion (FMCAD’10, PLDI’11) 1.
Martin Vechev IBM Research Michael Kuperstein Technion Eran Yahav Technion (FMCAD’10, PLDI’11) 1.
Lock-free Cache-friendly Software Queue for Decoupled Software Pipelining Student: Chen Wen-Ren Advisor: Wuu Yang 學生 : 陳韋任 指導教授 : 楊武 Abstract Multicore.
Formalisms and Verification for Transactional Memories Vasu Singh EPFL Switzerland.
1 Martin Vechev IBM T.J. Watson Research Center Joint work with: Hagit Attiya, Rachid Guerraoui, Danny Hendler, Petr Kuznetsov, Maged Michael.
Lecture 13: Consistency Models
1 Adaptive and Efficient Mutual Exclusion Presented by: By Hagit Attya and Vita Bortnikov Mian Huang.
Computer Architecture II 1 Computer architecture II Lecture 9.
1 Lecture 15: Consistency Models Topics: sequential consistency, requirements to implement sequential consistency, relaxed consistency models.
Memory Consistency Models Some material borrowed from Sarita Adve’s (UIUC) tutorial on memory consistency models.
Parallel Programming Philippas Tsigas Chalmers University of Technology Computer Science and Engineering Department © Philippas Tsigas.
Shared Memory Consistency Models: A Tutorial Sarita V. Adve Kouroush Ghrachorloo Western Research Laboratory September 1995.
The Performance of Spin Lock Alternatives for Shared-Memory Multiprocessors THOMAS E. ANDERSON Presented by Daesung Park.
A Consistency Framework for Iteration Operations in Concurrent Data Structures Yiannis Nikolakopoulos A. Gidenstam M. Papatriantafilou P. Tsigas Distributed.
L AWS OF ORDER : EXPENSIVE SYNCHRONIZATION IN CONCURRENT ALGORITHMS CANNOT BE ELIMINATED POPL '11 Hagit Attiya, Rachid Guerraoui, Danny Hendler, Petr Kuznetsov,
Shared Memory Consistency Models. SMP systems support shared memory abstraction: all processors see the whole memory and can perform memory operations.
Mutual Exclusion Using Atomic Registers Lecturer: Netanel Dahan Instructor: Prof. Yehuda Afek B.Sc. Seminar on Distributed Computation Tel-Aviv University.
Anshul Kumar, CSE IITD CSL718 : Multiprocessors Synchronization, Memory Consistency 17th April, 2006.
Anshul Kumar, CSE IITD ECE729 : Advance Computer Architecture Lecture 26: Synchronization, Memory Consistency 25 th March, 2010.
Fence Scoping Changhui Lin †, Vijay Nagarajan*, Rajiv Gupta † † University of California, Riverside * University of Edinburgh.
Memory Consistency Models. Outline Review of multi-threaded program execution on uniprocessor Need for memory consistency models Sequential consistency.
Fence Complexity in Concurrent Algorithms Petr Kuznetsov TU Berlin/DT-Labs.
O(log n / log log n) RMRs Randomized Mutual Exclusion Danny Hendler Philipp Woelfel PODC 2009 Ben-Gurion University University of Calgary.
ICFEM 2002, Shanghai Reasoning about Hardware and Software Memory Models Abhik Roychoudhury School of Computing National University of Singapore.
CS533 Concepts of Operating Systems Jonathan Walpole.
Local-Spin Mutual Exclusion Multiprocessor synchronization algorithms ( ) Lecturer: Danny Hendler This presentation is based on the book “Synchronization.
CISC 879 : Advanced Parallel Programming Rahul Deore Dept. of Computer & Information Sciences University of Delaware Exploring Memory Consistency for Massively-Threaded.
740: Computer Architecture Memory Consistency Prof. Onur Mutlu Carnegie Mellon University.
OS Winter’03 Concurrency. OS Winter’03 Bakery algorithm of Lamport  Critical section algorithm for any n>1  Each time a process is requesting an entry.
Symmetric Multiprocessors: Synchronization and Sequential Consistency
O(log n / log log n) RMRs Randomized Mutual Exclusion
Håkan Sundell Philippas Tsigas
Memory Consistency Models
Memory Consistency Models
O(log n / log log n) RMRs Randomized Mutual Exclusion
Challenges in Concurrent Computing
Symmetric Multiprocessors: Synchronization and Sequential Consistency
Kernel Synchronization II
Symmetric Multiprocessors: Synchronization and Sequential Consistency
(Slides were added to Keren’s original presentation. DH.)
Lecture 2 Part 2 Process Synchronization
Sitting on a Fence: Complexity Implications of Memory Reordering
Lecture 10: Consistency Models
Multiprocessor Synchronization Algorithms ( )
Memory Consistency Models
CSE 153 Design of Operating Systems Winter 19
Chapter 6: Synchronization Tools
Relaxed Consistency Finale
(Slides were added to Keren’s original presentation. DH.)
Lecture 11: Consistency Models
Presentation transcript:

Complexity Implications of Memory Models

Out-of-Order Execution Avoid with fences (and atomic operations) Shared memory processes reordering buffer Hagit AttiyaDagstuhl // January 20152

Memory Models Abstract conditions on the way the reordering buffer is managed E.g., TSO does not allow reordering of stores PSO does not allow reordering of stores to the same location Dagstuhl // January 2015Hagit Attiya3 sequential consistency total store ordering (TSO) partial store ordering (PSO) relaxed memory ordering (RMO)

One fence is necessary Holds for concurrent data types with non- commutative operations (queues, counters…) Attiya, Guerraoui, Hendler, Kuznetsov, Michael, Vechev: Laws of order: expensive synchronization in concurrent algorithms cannot be eliminated. POPL 2011 A mutex algorithm must have a fence (unless it has an atomic operation) Hagit AttiyaDagstuhl // January 20154

Bakery algorithm needs O(1) fences But O(n) reads, and they are remote – Accesses served from cache: “free” – Remote Memory References (RMRs): “expensive” Not All Memory Accesses are Equal Shared memory processes operation buffer cache interconnect Hagit AttiyaDagstuhl // January 20155

Tournament-tree: entry section store Hagit AttiyaDagstuhl // January 20156

Tournament-tree: entry section store Hagit AttiyaDagstuhl // January 20157

Tournament-tree: entry section Hagit AttiyaDagstuhl // January 20158

Can We Optimize Fences and RMRs? E.g., with PSO, O(1) fences implies O(n) RMRs fencesRMRs Θ(log n) Tournament [Yang, Anderson] O(1)Θ(n)Bakery [Lamport] Without store reordering Θ(log n) O(1) With store reordering NO NO Hagit AttiyaDagstuhl // January Attiya, Hendler, Levy: An O(1)-barriers optimal RMRs mutual exclusion algorithm. PODC 2013

Write Fewer Fences? Make the tree more shallow by increasing the branching factor Hagit AttiyaDagstuhl // January

How Shallow? Hagit AttiyaDagstuhl // January Make the tree more shallow by increasing the branching factor

Tradeoff, for every f = 1, …, log n Make the tree more shallow by increasing the fanout… Hagit AttiyaDagstuhl // January This is optimal

Lower Bound on the Tradeoff with Store Reordering Hagit AttiyaDagstuhl // January

Wrap-Up Separation below TSO More accurate models for shared-memory multiprocessors – E.g., # fences Relate to semantic properties of implemented objects & operations Dagstuhl // January 2015Hagit Attiya14 sequential consistency total store ordering (TSO) partial store ordering (PSO) relaxed memory ordering (RMO)

Hagit AttiyaDagstuhl // January

Outline of the Tradeoff LB Proof Backup Slides Dagstuhl // January 2015Hagit Attiya16

Proof Strategy I RADICONJuly

Proof Strategy II RADICONJuly

Proof Strategy III RADICONJuly

The Encoding: Main Idea For each fence, handle writes with O(1) commands: – Wait for earlier processes to cover my writes – Wait for earlier processes to finish before my writes – Proceed Easy with a list of processes to wait for – But too lengthy  Write their number, and figure out their id’s when decoding July 2014RADICON20