Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Engineering 2nd Semester

Similar presentations


Presentation on theme: "Computer Engineering 2nd Semester"— Presentation transcript:

1 Computer Engineering 2nd Semester
Rabie A. Ramadan

2 Shared Memory Architecture

3 Shared Memory Architecture
Shared Memory System performance degradation due to contention, and coherence problems. Coherence Problem Multiple Copies

4 CLASSIFICATION OF SHARED MEMORY SYSTEMS
Simplest model One memory storage Accessed by two processors Using two ports

5 Uniform Memory Access All processors have the same opportunity
Sun Starfire servers, HP V series, and Compaq AlphaServer GS. Single Address Space

6 Non Uniform Memory Access (NUMA)
The access to the memory module depends on its distance from the memory.

7 Cache-Only Memory Architecture (COMA)
The shared memory consists of cache memory. D is the remote directory to help in remote cache access

8 BUS-BASED SYMMETRIC MULTIPROCESSORS
One bus to connect the memories and the processors. Bus contention problem Try to minimize accessing the memory Use the cache Processors usually execute less than an instruction per cycle Superscalar processors executes many instructions per cycle

9 Performance measure The effective bandwidth = B*I fetches per second
Miss rate = V(1-h) For N processors, the miss rate = V(1-h)N Bus saturation case when

10 Performance measure The maximum number of processors with cache memories that the bus can support is given by the relation:

11 Group Activity Suppose a shared memory system is constructed from processors that can execute V = 107 instructions/s and the processor duty cycle I = 1. The caches are designed to support a hit rate of 97%, and the bus supports a peak bandwidth of B =106 cycles/s. How many number of processors that can be supported by such organization? What hit rate is needed to support a 30-processor system.

12 Answer

13 Basic Cache Coherence Problem
Multiple copies of data, spread throughout the caches, The copies in the caches are coherent if they all equal the same value Problems: Cache–Memory Coherence Cache–Cache Coherence

14 Cache–Memory Coherence
The copy of the cache is not coherent with the copy in the memory Solutions: Write through the memory is updated every time the cache is updated, Write update the memory is updated only when the block in the cache is being replaced.

15 Example

16 Cache–Cache Coherence
Two or more processors read the same data from the memory. Example: P reads X to its cache Q reads X to its cache What happens if P wants to write a new value over the old value of X?

17 Cache–Cache Coherence
Write-invalidate Maintains consistency by reading from local caches until a write occurs. When any processor updates the value of X through a write, posting a dirty bit for X invalidates all other copies. Write-update Maintains consistency by immediately updating all copies in all caches.

18 Example

19 SNOOPING PROTOCOLS Snooping protocols are based on watching bus activities and carry out the appropriate coherency commands when necessary. Global memory is moved in blocks Each block has a state associated with it.

20 Write-Invalidate and Write-Through Protocol
Multiple processors can read block copies from main memory safely until one processor updates its copy. All cache copies are invalidated and the memory is updated to remain consistent.

21 Write-Invalidate and Write-Through Protocol

22 Group Activity Consider a bus-based shared memory with two processors P and Q as shown in Figure Let us see how the cache coherence is maintained using Write-Invalidate Write-Through protocol. Assume that that X in memory was originally set to 5 and the following operations were performed in the order given: (1) P reads X; (2) Q reads X; (3) Q updates X; (4) Q reads X; (5) Q updates X; (6) P updates X; (7) Q reads X.

23 Answer

24 Write-Invalidate and Write-Back (Ownership Protocol)
a valid block can be owned by memory and shared in multiple caches that can contain only the shared copies of the block. Multiple processors can safely read these blocks from their caches until one processor updates its copy. At this time, the writer becomes the only owner of the valid block and all other copies are invalidated.

25

26 Group Activity Consider the shared memory system of Figure and the following operations: (1) P reads X; (2) Q reads X; (3) Q updates X; (4) Q reads X; (5) Q updates X; (6) P updates X; (7) Q reads X.

27 Answer

28 Write-Once uses a combination of write-through and write-back.
Write-through is used the very first time a block is written. Subsequent writes are performed using write-back.

29

30 Group Activity Consider the shared memory system of Figure and the following operations: (1) P reads X; (2) Q reads X; (3) Q updates X; (4) Q reads X; (5) Q updates X; (6) P updates X; (7) Q reads X.

31 Answer

32 Write-Update and Partial Write-Through
An update to one cache is written to memory at the same time it is broadcast to other caches sharing the updated block.

33

34 Group Activity Consider the shared memory system of Figure and the following operations: (1) P reads X; (2) P updates X; (3) Q reads X; (4) Q updates X; (5) Q reads X; (6) Block X is replaced in P’s cache; (7) Q updates X; (8) P updates X.

35

36 Write-Update and Write-Back
This protocol is similar to the previous one except that instead of writing through to the memory whenever a shared block is updated, memory updates are done only when the block is being replaced.

37

38 Group Activity Consider the shared memory system of Figure and the following operations: (1) P reads X; (2) P updates X; (3) Q reads X; (4) Q updates X; (5) Q reads X; (6) Block X is replaced in Q’s cache; (7) P updates X; (8) Q updates X.

39

40 Group Activity Consider the shared memory system of Figure and the following operations: (1) P reads X; (2) Q reads X; (3) Q updates X; (4) Q updates X; (5) P reads X; (6) Block X is replaced in Q’s cache; (7) P updates X; (8) Q updates X. Use the following protocols: Write-Invalidate and Write-Through Protocol Write-Invalidate and Write-Back (Ownership Protocol) Write-Once Write-Update and Partial Write-Through Write-Update and Write-Back


Download ppt "Computer Engineering 2nd Semester"

Similar presentations


Ads by Google