CS 258 Parallel Computer Architecture Lecture 13 Shared Memory Multiprocessors March 10, 2008 Prof John D. Kubiatowicz

Slides:



Advertisements
Similar presentations
Chapter 5 Part I: Shared Memory Multiprocessors
Advertisements

Cache Coherence. Memory Consistency in SMPs Suppose CPU-1 updates A to 200. write-back: memory and cache-2 have stale values write-through: cache-2 has.
L.N. Bhuyan Adapted from Patterson’s slides
Lecture 7. Multiprocessor and Memory Coherence
SE-292 High Performance Computing
Multi-core systems System Architecture COMP25212 Daniel Goodman Advanced Processor Technologies Group.
Cache Optimization Summary
CSE 490/590, Spring 2011 CSE 490/590 Computer Architecture Snoopy Caches II Steve Ko Computer Sciences and Engineering University at Buffalo.
CS252 Graduate Computer Architecture Lecture 25 Memory Consistency Models and Snoopy Bus Protocols Prof John D. Kubiatowicz
Computer Architecture II 1 Computer architecture II Lecture 8.
CIS629 Coherence 1 Cache Coherence: Snooping Protocol, Directory Protocol Some of these slides courtesty of David Patterson and David Culler.
1 Multiprocessors. 2 Idea: create powerful computers by connecting many smaller ones good news: works for timesharing (better than supercomputer) bad.
EECC756 - Shaaban #1 lec # 11 Spring Shared Memory Multiprocessors Symmetric Multiprocessors (SMPs): –Symmetric access to all of main memory.
CS252/Patterson Lec /23/01 CS213 Parallel Processing Architecture Lecture 7: Multiprocessor Cache Coherency Problem.
Computer architecture II
ECE669 L13: Shared Memory Multiprocessors March 11, 2004 ECE 669 Parallel Computer Architecture Lecture 13 Shared Memory Multiprocessors.
Computer Architecture II 1 Computer architecture II Lecture 9.
Shared Memory Multiprocessors CS 258, Spring 99 David E. Culler Computer Science Division U.C. Berkeley.
CPE 731 Advanced Computer Architecture Snooping Cache Multiprocessors Dr. Gheith Abandah Adapted from the slides of Prof. David Patterson, University of.
CS252/Patterson Lec /28/01 CS 213 Lecture 10: Multiprocessor 3: Directory Organization.
CS 258 Parallel Computer Architecture Lecture 12 Shared Memory Multiprocessors II March 1, 2002 Prof John D. Kubiatowicz
Snooping Cache and Shared-Memory Multiprocessors
1 Shared-memory Architectures Adapted from a lecture by Ian Watson, University of Machester.
Multiprocessor Cache Coherency
Memory Consistency Models Some material borrowed from Sarita Adve’s (UIUC) tutorial on memory consistency models.
Graduate Computer Architecture I Lecture 10: Shared Memory Multiprocessors Young Cho.
©RG:E0243:L2- Parallel Architecture 1 E0-243: Computer Architecture L2 – Parallel Architecture.
Shared Address Space Computing: Hardware Issues Alistair Rendell See Chapter 2 of Lin and Synder, Chapter 2 of Grama, Gupta, Karypis and Kumar, and also.
Presented By:- Prerna Puri M.Tech(C.S.E.) Cache Coherence Protocols MSI & MESI.
Spring EE 437 Lillevik 437s06-l21 University of Portland School of Engineering Advanced Computer Architecture Lecture 21 MSP shared cached MSI protocol.
EECS 252 Graduate Computer Architecture Lec 13 – Snooping Cache and Directory Based Multiprocessors David Patterson Electrical Engineering and Computer.
Lecture 13: Multiprocessors Kai Bu
Ch4. Multiprocessors & Thread-Level Parallelism 2. SMP (Symmetric shared-memory Multiprocessors) ECE468/562 Advanced Computer Architecture Prof. Honggang.
Caltech CS184 Spring DeHon 1 CS184b: Computer Architecture (Abstractions and Optimizations) Day 12: May 3, 2003 Shared Memory.
Cache Coherence CSE 661 – Parallel and Vector Architectures
Shared Memory Consistency Models. SMP systems support shared memory abstraction: all processors see the whole memory and can perform memory operations.
CS252 Graduate Computer Architecture Lecture 18 April 4 th, 2011 Memory Consistency Models and Snoopy Bus Protocols Prof John D. Kubiatowicz
Cache Coherence Protocols A. Jantsch / Z. Lu / I. Sander.
1 Memory and Cache Coherence. 2 Shared Memory Multiprocessors Symmetric Multiprocessors (SMPs) Symmetric access to all of main memory from any processor.
1 Lecture 3: Coherence Protocols Topics: consistency models, coherence protocol examples.
3/12/2013Computer Engg, IIT(BHU)1 PARALLEL COMPUTERS- 2.
Cache Coherence CS433 Spring 2001 Laxmikant Kale.
CS267 Lecture 61 Shared Memory Hardware and Memory Consistency Modified from J. Demmel and K. Yelick
CMSC 611: Advanced Computer Architecture Shared Memory Most slides adapted from David Patterson. Some from Mohomed Younis.
Multi Processing prepared and instructed by Shmuel Wimer Eng. Faculty, Bar-Ilan University June 2016Multi Processing1.
CSC/ECE 506: Architecture of Parallel Computers Bus-Based Coherent Multiprocessors 1 Lecture 12 (Chapter 8) Lecture 12 (Chapter 8)
Lecture 13: Multiprocessors Kai Bu
COSC6385 Advanced Computer Architecture
Cache Coherence in Shared Memory Multiprocessors
Shared Memory Multiprocessors
CS 704 Advanced Computer Architecture
Cache Coherence for Shared Memory Multiprocessors
Multiprocessor Cache Coherency
CPSC 614 Computer Architecture Lec 9 – Multiprocessor
CMSC 611: Advanced Computer Architecture
Example Cache Coherence Problem
Flynn’s Taxonomy Flynn classified by data and control streams in 1966
Prof John D. Kubiatowicz
The University of Adelaide, School of Computer Science
Protocol Design Space of Snooping Cache Coherent Multiprocessors
Lecture 2: Snooping-Based Coherence
Multiprocessors CS258 S99.
Bus-Based Coherent Multiprocessors
Chapter 5 Exploiting Memory Hierarchy : Cache Memory in CMP
Shared Memory Multiprocessors
Lecture 24: Multiprocessors
Lecture 8 Outline Memory consistency
CS 258 Parallel Computer Architecture Lecture 16 Snoopy Protocols I
Prof John D. Kubiatowicz
Prof John D. Kubiatowicz
Presentation transcript:

CS 258 Parallel Computer Architecture Lecture 13 Shared Memory Multiprocessors March 10, 2008 Prof John D. Kubiatowicz

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 P Uniprocessor View Performance depends heavily on memory hierarchy –Managed by hardware –Sizes varied to optimize speed/locality Time spent by a program –Timeprog(1) = Busy(1) + Data Access(1) –Divide by cycles to get CPI equation Data access time can be reduced by: – Optimizing machine »bigger caches, lower latency... – Optimizing program »temporal and spatial locality T i m e ( s ) Busy-useful Data-local

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Same Processor-Centric Perspective T i m e ( s ) (a) Sequentia l

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 A collection of communicating processors –Goals: balance load, reduce inherent communication and extra work A multi-cache, multi-memory system –Role of these components essential regardless of programming model –Prog. model and comm. abstr. affect specific performance tradeoffs What is a Multiprocessor? PPP... PPP

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Relationship between Perspectives Busy(1) + Data(1) Busy useful (p)+Data local (p)+Synch(p)+Data remote (p)+Busy overhead (p) Speedup <

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Artifactual Communication Accesses not satisfied in local portion of memory hierarchy cause “communication” –This can either be fundamental to computation or “overhead” Inherent Communication: Fundamental –Required part of computation –implicit or explicit »determined by program –Inherent communication is what occurs with unlimited capacity, small transfers, and perfect knowledge of what is needed. Artifactual communication –determined by program implementation and arch. interactions –poor allocation of data across distributed memories –unnecessary data in a transfer –unnecessary transfers due to system granularities –redundant communication of data –finite replication capacity (in cache or main memory)

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Back to Basics Parallel Architecture = Computer Architecture +Communication Architecture Small-scale shared memory –extend the memory system to support multiple processors –good for multiprogramming throughput and parallel computing –allows fine-grain sharing of resources Naming & Synchronization –communication is implicit in store/load of shared address –synchronization is performed by operations on shared addresses Latency & Bandwidth –utilize the normal migration within the storage to avoid long latency operations and to reduce bandwidth –economical medium with fundamental BW limit  focus on eliminating unnecessary traffic

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Natural Extensions of Memory System P 1 Switch Main memory P n (Interleaved) First-level $ P 1 $ Interconnection network $ P n Mem P 1 $ Interconnection network $ P n Mem Shared Cache Centralized Memory Dance Hall, UMA Distributed Memory (NUMA) Scale

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Bus-Based Symmetric Shared Memory Dominate the server market even now –Building blocks for larger systems; arriving to desktop Attractive as throughput servers and for parallel programs –Fine-grain resource sharing –Uniform access via loads/stores –Automatic data movement and coherent replication in caches –Cheap and powerful extension Normal uniprocessor mechanisms to access data –Key is extension of memory hierarchy to support multiple processors I/O devices Mem P 1 $ $ P n Bus

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Caches are Critical for Performance Reduce average latency –automatic replication closer to processor Reduce average bandwidth usage –Accesses satisfied by cache Much “simpler” to share data among processors –Just pass a pointer Data is logically transferred from producer to consumer through memory –store reg --> mem –load reg <-- mem Question: what actually happens when loads and stores executed on different processors? –Issues of Coherence and Consistency arise PPP

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Example Cache Coherence Problem Things to note: –Processors see different values for u after event 3 –With write back caches, value written back to memory depends on happenstance of which cache flushes or writes back value when »Processes accessing main memory may see very stale value –Unacceptable to programs, and frequent! I/O devices Memory P 1 $$ $ P 2 P 3 5 u = ? 4 u u :5 1 u 2 u 3 u = 7

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Caches and Cache Coherence Caches play key role in all cases –Reduce average data access time –Reduce bandwidth demands placed on shared interconnect private processor caches create a problem –Copies of a variable can be present in multiple caches –A write by one processor may not become visible to others »They’ll keep accessing stale value in their caches  Cache coherence problem What do we do about it? –Organize the mem hierarchy to make it go away –Detect and take actions to eliminate the problem

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Advantages Cache placement identical to single cache –only one copy of any cached block fine-grain sharing –communication latency determined level in the storage hierarchy where the access paths meet »2-10 cycles »Cray Xmp has shared registers! Potential for positive interference –one proc prefetches data for another Smaller total storage –only one copy of code/data used by both proc. Can share data within a line without “ping-pong” –long lines without false sharing

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Disadvantages Fundamental BW limitation Increases latency of all accesses –X-bar –Larger cache –L1 hit time determines proc. cycle time !!! Potential for negative interference –one proc flushes data needed by another Many L2 caches are shared today

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 P Disk Memory L2 L1 100:34 100:35 100:67 Intuitive Memory Model Reading an address should return the last value written to that address Easy in uniprocessors –except for I/O Cache coherence problem in MPs is more pervasive and more performance critical

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Snoopy Cache-Coherence Protocols Bus is a broadcast medium & Caches know what they have Cache Controller “snoops” all transactions on the shared bus –relevant transaction if for a block it contains –take action to ensure coherence »invalidate, update, or supply value –depends on state of the block and the protocol State Address Data

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Example: Write-thru Invalidate I/O devices Memory P 1 $$ $ P 2 P 3 5 u = ? 4 u u :5 1 u 2 u 3 u = 7

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Architectural Building Blocks Bus Transactions –fundamental system design abstraction –single set of wires connect several devices –bus protocol: arbitration, command/addr, data => Every device observes every transaction Cache block state transition diagram –FSM specifying how disposition of block changes »invalid, valid, dirty

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Design Choices Controller updates state of blocks in response to processor and snoop events and generates bus transactions Snoopy protocol –set of states –state-transition diagram –actions Basic Choices –Write-through vs Write-back –Invalidate vs. Update Snoop State Tag Data ° ° ° Cache Controller Processor Ld/St

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Write-through Invalidate Protocol Basic Bus-Based Protocol –Each processor has cache, state –All transactions over bus snooped Writes invalidate all other caches –can have multiple simultaneous readers of block,but write invalidates them Two states per block in each cache –as in uniprocessor –state of a block is a p-vector of states –Hardware state bits associated with blocks that are in the cache –other blocks can be seen as being in invalid (not-present) state in that cache I V BusWr / - PrRd/ -- PrWr / BusWr PrRd / BusRd State Tag Data I/O devices Mem P 1 $ $ P n Bus State Tag Data

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Write-through vs. Write-back Write-through protocol is simple –every write is observable Every write goes on the bus  Only one write can take place at a time in any processor Uses a lot of bandwidth! Example: 200 MHz dual issue, CPI = 1, 15% stores of 8 bytes  30 M stores per second per processor  240 MB/s per processor 1GB/s bus can support only about 4 processors without saturating State Tag Data I/O devices Mem P 1 $ $ P n Bus State Tag Data

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Invalidate vs. Update Basic question of program behavior: –Is a block written by one processor later read by others before it is overwritten? Invalidate. –yes: readers will take a miss –no: multiple writes without addition traffic »also clears out copies that will never be used again Update. –yes: avoids misses on later references –no: multiple useless updates »even to pack rats  Need to look at program reference patterns and hardware complexity  Can we tune this automatically???? but first - correctness

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 P Disk Memory L2 L1 100:34 100:35 100:67 Intuitive Memory Model??? Reading an address should return the last value written to that address What does that mean in a multiprocessor?

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Coherence? Caches are supposed to be transparent What would happen if there were no caches Every memory operation would go “to the memory location” –may have multiple memory banks –all operations on a particular location would be serialized »all would see THE order Interleaving among accesses from different processors –within individual processor => program order –across processors => only constrained by explicit synchronization Processor only observes state of memory system by issuing memory operations!

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Definitions Memory operation –load, store, read-modify-write Issues –leaves processor’s internal environment and is presented to the memory subsystem (caches, buffers, busses,dram, etc) Performed with respect to a processor –write: subsequent reads return the value –read: subsequent writes cannot affect the value Coherent Memory System –there exists a serial order of mem operations on each location s. t. »operations issued by a process appear in order issued »value returned by each read is that written by previous write in the serial order => write propagation + write serialization

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Is 2-state Protocol Coherent? Assume bus transactions and memory operations are atomic, one-level cache –all phases of one bus transaction complete before next one starts –processor waits for memory operation to complete before issuing next –with one-level cache, assume invalidations applied during bus xaction All writes go to bus + atomicity –Writes serialized by order in which they appear on bus (bus order)  invalidations applied to caches in bus order How to insert reads in this order? –Important since processors see writes through reads, so determines whether write serialization is satisfied –But read hits may happen independently and do not appear on bus or enter directly in bus order

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Ordering Reads Read misses –appear on bus, and will “see” last write in bus order Read hits: do not appear on bus –But value read was placed in cache by either »most recent write by this processor, or »most recent read miss by this processor –Both these transactions appeared on the bus –So reads hits also see values as produced bus order

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Determining Orders More Generally mem op M2 is subsequent to mem op M1 (M1  M2) if –the operations are issued by the same processor and –M2 follows M1 in program order. write W  read R if –read generates bus xaction that follows that for W. read or write M  write W if –M generates bus xaction and the xaction for W follows that for M. read R  write W if –read R does not generate a bus xaction and –is not already separated from write W by another bus xaction.

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Ordering Writes establish a partial order Doesn’t constrain ordering of reads, though bus will order read misses too – any order among reads between writes is fine, as long as in program order

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Write-Through vs Write-Back Write-thru requires high bandwidth Write-back caches absorb most writes as cache hits  Write hits don’t go on bus –But now how do we ensure write propagation and serialization? –Need more sophisticated protocols: large design space But first, let’s understand other ordering issues

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Setup for Mem. Consistency Coherence  Writes to a location become visible to all in the same order But when does a write become visible? How do we establish orders between a write and a read by different procs? – use event synchronization – typically use more than one location!

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Example Intuition not guaranteed by coherence expect memory to respect order between accesses to different locations issued by a given process –to preserve orders among accesses to same location by different processes Coherence is not enough! –pertains only to single location P 1 P 2 /*Assume initial value of A and ag is 0*/ A = 1;while (flag == 0); /*spin idly*/ flag = 1;print A; Mem P 1 P n Conceptual Picture

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Another Example of Ordering? What’s the intuition? –Whatever it is, we need an ordering model for clear semantics »across different locations as well »so programmers can reason about what results are possible – This is the memory consistency model P 1 P 2 /*Assume initial values of A and B are 0 */ (1a) A = 1;(2a) print B; (1b) B = 2;(2b) print A;

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Memory Consistency Model Specifies constraints on the order in which memory operations (from any process) can appear to execute with respect to one another –What orders are preserved? –Given a load, constrains the possible values returned by it Without it, can’t tell much about an SAS program’s execution Implications for both programmer and system designer –Programmer uses to reason about correctness and possible results –System designer can use to constrain how much accesses can be reordered by compiler or hardware Contract between programmer and system

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Sequential Consistency  Total order achieved by interleaving accesses from different processes –Maintains program order, and memory operations, from all processes, appear to [issue, execute, complete] atomically w.r.t. others –as if there were no caches, and a single memory “A multiprocessor is sequentially consistent if the result of any execution is the same as if the operations of all the processors were executed in some sequential order, and the operations of each individual processor appear in this sequence in the order specified by its program.” [Lamport, 1979]

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 What Really is Program Order? Intuitively, order in which operations appear in source code –Straightforward translation of source code to assembly –At most one memory operation per instruction But not the same as order presented to hardware by compiler So which is program order? –Depends on which layer, and who’s doing the reasoning –We assume order as seen by programmer

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 SC Example What matters is order in which operations appear to execute, not the chronological order of events Possible outcomes for (A,B): (0,0), (1,0), (1,2) What about (0,2) ? –program order  1a->1b and 2a->2b –A = 0 implies 2b->1a, which implies 2a->1b –B = 2 implies 1b->2a, which leads to a contradiction (cycle!) Since there is a cycle  no sequential order that is consistent! P 1 P 2 /*Assume initial values of A and B are 0*/ (1a) A = 1;(2a) print B; (1b) B = 2;(2b) print A; A=0 B=2

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Implementing SC Two kinds of requirements –Program order »memory operations issued by a process must appear to execute (become visible to others and itself) in program order –Atomicity »in the overall hypothetical total order, one memory operation should appear to complete with respect to all processes before the next one is issued »guarantees that total order is consistent across processes –tricky part is making writes atomic

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Sequential Consistency Memory operations from a proc become visible (to itself and others) in program order There exist a total order, consistent with this partial order - i.e., an interleaving –the position at which a write occurs in the hypothetical total order should be the same with respect to all processors How can compilers violate SC? –Architectural enhancements?

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Happens Before: arrows are time Tricky part is relationship between nodes with respect to single location – Program order adds relationship between locations Easy topological sort comes up with sequential ordering assuming: – All happens-before relationships are time – Then – can’t have time cycles (at least not inside classical machine in normal spacetime ). Unfortunately, writes are not instantaneous – What do we do?

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Ordering: Scheurich and Dubois Sufficient Conditions –every process issues mem operations in program order –after a write operation is issued, the issuing process waits for the write to complete before issuing next memory operation –after a read is issued, the issuing process waits for the read to complete and for the write whose value is being returned to complete (gloabaly) before issuing its next operation R W R RR RR RR R RR R R P 0 : P 1 : P 2 : “Instantaneous” Completion point Exclusion Zone

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Write-back Caches (Uniprocessor) 2 processor operations –PrRd, PrWr 3 states –invalid, valid (clean), modified (dirty) –ownership: who supplies block 2 bus transactions: –read (BusRd), write-back (BusWB) –only cache-block transfers  treat Valid as “shared” and Modified as “exclusive”  introduce one new bus transaction –read-exclusive: read for purpose of modifying (read-to-own) PrRd/— PrWr/BusRd BusRd/— PrWr/— V M I Replace/BusWB PrW PrRd/BusRd Replace/-

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 MSI Invalidate Protocol Three States: –“M”: “Modified” –“S”: “Shared” –“I”: “Invalid” Read obtains block in “shared” –even if only cache copy Obtain exclusive ownership before writing –BusRdx causes others to invalidate (demote) –If M in another cache, will flush –BusRdx even if hit in S »promote to M (upgrade) What about replacement? –S->I, M->I as before PrRd/— PrWr/BusRdX BusRd/— PrWr/— S M I BusRdX/Flush BusRdX/— BusRd/Flush PrWr/BusRdX PrRd/BusRd

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Example: Write-Back Protocol I/O devices Memory u :5 P0P0 P1P1 P4P4 PrRd U US5 BusRd U PrRd U BusRd U US5 PrWr U 7 UM7 BusRdx U PrRd U US7US7 7 BusRd Flush

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Correctness When is write miss performed? –How does writer “observe” write? –How is it “made visible” to others? –How do they “observe” the write? When is write hit made visible?

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Write Serialization for Coherence Writes that appear on the bus (BusRdX) are ordered by bus –performed in writer’s cache before other transactions, so ordered same w.r.t. all processors (incl. writer) –Read misses also ordered wrt these Write that don’t appear on the bus: –P issues BusRdX B. –further mem operations on B until next transaction are from P »read and write hits »these are in program order –for read or write from another processor »separated by intervening bus transaction Reads hits?

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Sequential Consistency Bus imposes total order on bus xactions for all locations Between xactions, procs perform reads/writes (locally) in program order So any execution defines a natural partial order –M j subsequent to M i if »(I) follows in program order on same processor, »(ii) M j generates bus xaction that follows the memory operation for M i In segment between two bus transactions, any interleaving of local program orders leads to consistent total order w/i segment writes observed by proc P serialized as: –Writes from other processors by the previous bus xaction P issued –Writes from P by program order

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Sufficient conditions Sufficient Conditions –issued in program order –after write issues, the issuing process waits for the write to complete before issuing next memory operation –after read is issues, the issuing process waits for the read to complete and for the write whose value is being returned to complete (globally) before issuing its next operation Write completion – can detect when write appears on bus Write atomicity: –if a read returns the value of a write, that write has already become visible to all others already

Lec /10/08Kubiatowicz CS258 ©UCB Spring 2008 Summary Shared-memory machine –All communication is implicit, through loads and stores –Parallelism introduces a bunch of overheads over uniprocessor Memory Coherence: –Writes to a given location eventually propagated –Writes to a given location seen in same order by everyone Memory Consistency: –Constraints on ordering between processors and locations Sequential Consistency: –For every parallel execution, there exists a serial interleaving