CS 295 – Memory Models Harry Xu Oct 1, 2013. Multi-core Architecture Core-local L1 cache L2 cache shared by cores in a processor All processors share.

Slides:



Advertisements
Similar presentations
1 Episode III in our multiprocessing miniseries. Relaxed memory models. What I really wanted here was an elephant with sunglasses relaxing On a beach,
Advertisements

1 Lecture 20: Synchronization & Consistency Topics: synchronization, consistency models (Sections )
Memory Consistency Models Kevin Boos. Two Papers Shared Memory Consistency Models: A Tutorial – Sarita V. Adve & Kourosh Gharachorloo – September 1995.
SE-292 High Performance Computing
CSE 490/590, Spring 2011 CSE 490/590 Computer Architecture Snoopy Caches I Steve Ko Computer Sciences and Engineering University at Buffalo.
CS 162 Memory Consistency Models. Memory operations are reordered to improve performance Hardware (e.g., store buffer, reorder buffer) Compiler (e.g.,
© Krste Asanovic, 2014CS252, Spring 2014, Lecture 12 CS252 Graduate Computer Architecture Spring 2014 Lecture 12: Synchronization and Memory Models Krste.
D u k e S y s t e m s Time, clocks, and consistency and the JMM Jeff Chase Duke University.
1 Lecture 20: Speculation Papers: Is SC+ILP=RC?, Purdue, ISCA’99 Coherence Decoupling: Making Use of Incoherence, Wisconsin, ASPLOS’04 Selective, Accurate,
Is SC + ILP = RC? Presented by Vamshi Kadaru Chris Gniady, Babak Falsafi, and T. N. VijayKumar - Purdue University Spring 2005: CS 7968 Parallel Computer.
CS492B Analysis of Concurrent Programs Consistency Jaehyuk Huh Computer Science, KAIST Part of slides are based on CS:App from CMU.
By Sarita Adve & Kourosh Gharachorloo Review by Jim Larson Shared Memory Consistency Models: A Tutorial.
Computer Architecture 2011 – coherency & consistency (lec 7) 1 Computer Architecture Memory Coherency & Consistency By Dan Tsafrir, 11/4/2011 Presentation.
1 Lecture 7: Consistency Models Topics: sequential consistency, requirements to implement sequential consistency, relaxed consistency models.
Chapter Hardwired vs Microprogrammed Control Multithreading
Lecture 13: Consistency Models
Computer Architecture II 1 Computer architecture II Lecture 9.
Chapter 2: Impact of Machine Architectures What is the Relationship Between Programs, Programming Languages, and Computers.
1 Lecture 15: Consistency Models Topics: sequential consistency, requirements to implement sequential consistency, relaxed consistency models.
1 Lecture 12: Relaxed Consistency Models Topics: sequential consistency recap, relaxing various SC constraints, performance comparison.
Shared Memory – Consistency of Shared Variables The ideal picture of shared memory: CPU0CPU1CPU2CPU3 Shared Memory Read/ Write The actual architecture.
Shared Memory Consistency Models: A Tutorial By Sarita V Adve and Kourosh Gharachorloo Presenter: Meenaktchi Venkatachalam.
1 Lecture 22: Synchronization & Consistency Topics: synchronization, consistency models (Sections )
Shared Memory Consistency Models: A Tutorial By Sarita V Adve and Kourosh Gharachorloo Presenter: Sunita Marathe.
Memory Consistency Models Some material borrowed from Sarita Adve’s (UIUC) tutorial on memory consistency models.
15-740/ Oct. 17, 2012 Stefan Muller.  Problem: Software is buggy!  More specific problem: Want to make sure software doesn’t have bad property.
Multi-core systems System Architecture COMP25212 Daniel Goodman Advanced Processor Technologies Group.
Memory Consistency Models Alistair Rendell See “Shared Memory Consistency Models: A Tutorial”, S.V. Adve and K. Gharachorloo Chapter 8 pp of Wilkinson.
Shared Memory Consistency Models. SMP systems support shared memory abstraction: all processors see the whole memory and can perform memory operations.
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.
Memory Consistency Models. Outline Review of multi-threaded program execution on uniprocessor Need for memory consistency models Sequential consistency.
Multiprocessor Cache Consistency (or, what does volatile mean?) Andrew Whitaker CSE451.
December 1, 2006©2006 Craig Zilles1 Threads and Cache Coherence in Hardware  Previously, we introduced multi-cores. —Today we’ll look at issues related.
Memory Consistency Zhonghai Lu Outline Introduction What is a memory consistency model? Who should care? Memory consistency models Strict.
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.
1 Lecture 3: Coherence Protocols Topics: consistency models, coherence protocol examples.
CISC 879 : Advanced Parallel Programming Rahul Deore Dept. of Computer & Information Sciences University of Delaware Exploring Memory Consistency for Massively-Threaded.
1 Lecture 20: Speculation Papers: Is SC+ILP=RC?, Purdue, ISCA’99 Coherence Decoupling: Making Use of Incoherence, Wisconsin, ASPLOS’04.
Fundamentals of Memory Consistency Smruti R. Sarangi Prereq: Slides for Chapter 11 (Multiprocessor Systems), Computer Organisation and Architecture, Smruti.
740: Computer Architecture Memory Consistency Prof. Onur Mutlu Carnegie Mellon University.
Lecture 20: Consistency Models, TM
COSC6385 Advanced Computer Architecture
CS5102 High Performance Computer Systems Memory Consistency
Memory Consistency Models
Lecture 11: Consistency Models
The University of Adelaide, School of Computer Science
Memory Consistency Models
The University of Adelaide, School of Computer Science
Threads and Memory Models Hal Perkins Autumn 2011
Symmetric Multiprocessors: Synchronization and Sequential Consistency
Shared Memory Consistency Models: A Tutorial
Lecture 12: TM, Consistency Models
Symmetric Multiprocessors: Synchronization and Sequential Consistency
Threads and Memory Models Hal Perkins Autumn 2009
Lecture 22: Consistency Models, TM
Background for Debate on Memory Consistency Models
Shared Memory Consistency Models: A Tutorial
Lecture 10: Consistency Models
EE 4xx: Computer Architecture and Performance Programming
Store Atomicity What does atomicity really require?
Memory Consistency Models
Relaxed Consistency Part 2
Why we have Counterintuitive Memory Models
Lecture 21: Synchronization & Consistency
Lecture: Consistency Models, TM
Lecture 11: Relaxed Consistency Models
CS 152 Computer Architecture and Engineering CS252 Graduate Computer Architecture Lecture 19 Memory Consistency Models Krste Asanovic Electrical Engineering.
Lecture 11: Consistency Models
Presentation transcript:

CS 295 – Memory Models Harry Xu Oct 1, 2013

Multi-core Architecture Core-local L1 cache L2 cache shared by cores in a processor All processors share system memory

Programming with Shared Memory Single copy of shared data in memory Threads communicate by reading/writing to a shared location Shared memory correctness are intuitive at a hand- wave level Subtle issues may arise in the presence of shared memory accesses – What does it mean for a compiler optimization to be correct – What does it mean for a hardware implementation to be correct – What program behavior should a developer expect

Memory Correctness Memory consistency models – Rules about loads and stores – How they act upon memory Cache coherence – A value written by a processor is eventually visible to reads by other processors – two writes to the same location by two processors are seen in the same order by all processors – Invisible to software

A Motivating Example

Memory Correctness Intuitively, a read should return the value of the “last” write to the same memory location – Enforced by program order in a single threaded program – What does it mean for a write to be the last write if the read and the write are executed in different threads? A classroom change example

Sequential Consistency Making multiple threads run as if they were time-multiplexed on a single-core processor – An interleaving of the sequential executions of each thread Two constraints – Maintain program order within each thread – Maintain a single sequential order among operations from all processors

Relaxed Memory Models Most memory orderings in strong models are unnecessary Relaxed memory models seek to capture increased ordering flexibility to get higher performance or simpler implementation For example, use of a FENCE instruction

Why Are Memory Models Important Impact on hardware design – Out-of-order processor cores – Write buffers – Prefetching – Multiple cache banks Impact on compiler design – What kind of optimizations can be allowed Impact on high-level development – What program behavior should developers expect

This Class Sequential consistency (SC) --- Khanh TSO in x86 and SPARC --- Jianfei Relaxed/weak memory models -- David The Java memory model ---Peizhao C++ memory model --- Kai Adversarial memory --- Bharathram DRFx --- Byron SC-preserving compiler --- Lu End-to-end sequential consistency --- Yutao