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

Slides:



Advertisements
Similar presentations
You have been given a mission and a code. Use the code to complete the mission and you will save the world from obliteration…
Advertisements

Advanced Piloting Cruise Plot.
Chapter 1 The Study of Body Function Image PowerPoint
Bounded Model Checking of Concurrent Data Types on Relaxed Memory Models: A Case Study Sebastian Burckhardt Rajeev Alur Milo M. K. Martin Department of.
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 3 CPUs.
1 Copyright © 2010, Elsevier Inc. All rights Reserved Fig 2.1 Chapter 2.
By D. Fisher Geometric Transformations. Reflection, Rotation, or Translation 1.
Business Transaction Management Software for Application Coordination 1 Business Processes and Coordination.
Symmetric Multiprocessors: Synchronization and Sequential Consistency.
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Title Subtitle.
My Alphabet Book abcdefghijklm nopqrstuvwxyz.
0 - 0.
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
Addition Facts
Year 6 mental test 5 second questions
Data recovery 1. 2 Recovery - introduction recovery restoring a system, after an error or failure, to a state that was previously known as correct have.
1 Interprocess Communication 1. Ways of passing information 2. Guarded critical activities (e.g. updating shared data) 3. Proper sequencing in case of.
ZMQS ZMQS
ABC Technology Project
1 Lecture 20: Synchronization & Consistency Topics: synchronization, consistency models (Sections )
VOORBLAD.
1 Breadth First Search s s Undiscovered Discovered Finished Queue: s Top of queue 2 1 Shortest path from s.
Squares and Square Root WALK. Solve each problem REVIEW:
© 2012 National Heart Foundation of Australia. Slide 2.
Chapter 5 Test Review Sections 5-1 through 5-4.
GG Consulting, LLC I-SUITE. Source: TEA SHARS Frequently asked questions 2.
Addition 1’s to 20.
25 seconds left…...
Håkan Sundell, Chalmers University of Technology 1 Evaluating the performance of wait-free snapshots in real-time systems Björn Allvin.
Week 1.
We will resume in: 25 Minutes.
PSSA Preparation.
Memory Consistency Models Sarita Adve Department of Computer Science University of Illinois at Urbana-Champaign Ack: Previous tutorials.
The University of Adelaide, School of Computer Science
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.,
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.
CSE 490/590, Spring 2011 CSE 490/590 Computer Architecture Synchronization and Consistency II Steve Ko Computer Sciences and Engineering University at.
1 Lecture 7: Consistency Models Topics: sequential consistency, requirements to implement sequential consistency, relaxed consistency models.
Lecture 13: Consistency Models
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.
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 )
Memory Consistency Models Some material borrowed from Sarita Adve’s (UIUC) tutorial on memory consistency models.
Shared Memory Consistency Models: A Tutorial Sarita V. Adve Kouroush Ghrachorloo Western Research Laboratory September 1995.
Shared Memory Consistency Models. Quiz (1)  Let’s define shared memory.
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.
Memory Consistency Models. Outline Review of multi-threaded program execution on uniprocessor Need for memory consistency models Sequential consistency.
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.
Symmetric Multiprocessors: Synchronization and Sequential Consistency
Memory Consistency Models
Lecture 11: Consistency Models
Memory Consistency Models
Symmetric Multiprocessors: Synchronization and Sequential Consistency
Shared Memory Consistency Models: A Tutorial
Symmetric Multiprocessors: Synchronization and Sequential Consistency
Background for Debate on Memory Consistency Models
Lecture 10: Consistency Models
Memory Consistency Models
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:

1 Episode III in our multiprocessing miniseries. Relaxed memory models. What I really wanted here was an elephant with sunglasses relaxing On a beach, but I couldnt find one. Relaxed Memory Models Page 1

2 PPPPPP m Sequential Consistency = arbitrary order-preserving interleaving of memory references of sequential programs SC is easy to understand but architects and compiler writers want to violate it for performance Mark Hill written a paper which essentially says why break your back for 20%. Actually people are out there breaking their backs for 1% in architecture these days. Sequential Consistency: A Memory Model Page 2

3 m Architectural optimizations that are correct for uniprocessors often result in a new memory model for multiprocessors Optimizations & Memory Models Memory Processor- Memory Interface Load queue Pushout buffers Data Cache CPU load/store buffers This means that we are relaxing the ordering or relaxing atomicity. Page 3

4 Relaxed Models What orderings among reads and writes performed by a single processor are preserved by the model? – R R, R W, W W, W R dependence if they are to the same address If there is a dependence, then program semantics demand that operations be ordered If there is no dependence, the memory consistency model determines what orders must be preserved – Relaxed model may allow an operation executed later to complete first Page 4

5 Page 5 Memory Fences & Weak Memory Models Processors with relaxed or weak memory models need memory fence instructions to force serialization of memory accesses – In SC there is an implicit fence at each memory operation Processors with relaxed memory models: Sparc V8 (TSO, PSO): Membar PowerPC (WO): Sy nc, EIEIO Memory fences are expensive operations, however, one pays for serialization only when it is required

6 Ensures that tail pointer is not updated before X has been stored. Ensures that R is not loaded before x has been stored. Page 6

7 Page 7 Data-Race Free Programs (a.k.a. Properly Synchronized Programs) Process 1... Acquire(mutex); Release(mutex); Process 2... Acquire(mutex); Release(mutex); Synchronization variables (e.g., mutex) are separate from data variables Accesses to writable shared data variables are protected in critical regions no data races except for locks (Formal definition is elusive) In general, it cannot be proven if a program is data- race free. Nondeterminator.

8 Page 8 Processor should not speculate or prefetch across fences.

9 Page 9 Total Store Order (TSO) IBM370, DECVAX Eliminates the order W(a) R(b) Advantage? a b Allows the buffering of writes with bypassing by reads, which occurs whenever the processor allows a read to proceed before it guarantees that an earlier write by the processor has been seen by all the other processors.

10 Page 10 TSO vs. SC Initially x = old, y = old Processor P 1 Processor P 2 x = new; y = new; y_copy = y; x_copy = x; Under SC what values can x_copy and y_copy get ? Under TSO what values can x_copy and y_copy get ? TSO both can get old values. SC at least one has to get the value of new.

11 Allows pipelining or overlapping of write operations, rather than Forcing one operation to complete before another. Page 11

12 Non-blocking reads, doesnt help too much. Page 12

13 Page 13 Release Consistency Alpha, MIPS Read/write that precedes acquire need not complete before acquire, and read/write that follows a release need not wait for the release Weakest of the memory models used these days.

14 Page 14 Release Consistency Example Initially data = old Processor P 1 Processor P 2 data = new; while(flag != SET) { } flag = SET; data_copy = data; How do we ensure that data_copy is always set to new ? Membar Store StoreMembar Load Load

15 Page 15

16 Page 16

17 Page 17

18 Page 18

19 Page 19

20 Page 20

21 Page 21 CRF: Fences Instructions can be reordered except for Data dependence StoreL(a,v); Commit(a); Reconcile(a); LoadL(a); Reconcile(a 1 ); LoadL(a 1 ); Fence rr (a 1, a 2 ) Reconcile(a 2 ); LoadL(a 2 ); Fence wr ;Fence rw ;Fence ww ;

22 Page 22

23 Page 23

24 Page 24 Translating SC into CRF

25 Page 25

26 Page 26