Docsity

Snooping Cache-coherence Protocol 1 - Assignment 5 | CS 433, Assignments of Computer Architecture and Organization

Partial preview of the text

Download Snooping Cache-coherence Protocol 1 - Assignment 5 | CS 433 and more Assignments Computer Architecture and Organization in PDF only on Docsity!

CS433: Computer Systems Organization Fall 2008

Homework 5

Assigned: Nov/

Due in class Dec/

Total points: 32 for undergraduate students, 40 for graduate students.

Instructions:

Please write your name, NetID and an alias on your homework submissions for posting grades (If you don’t want your grades posted, then don’t write an alias). We will use this alias throughout the semester. Homeworks are due in class on the date posted.

  1. [8 points] Snooping Cache Coherence Protocols I We are adding a Owned state to the basic MSI snooping cache protocol (Figure 4.7). More specifically:
  • One node at most may have a block of data in the owned state; if another node has the data as well, it should be in the shared state.
  • When a read miss occurs and another processor has the data in the Owned or Modified, that processor provides the data and the block, in that processor, transitions to (or stays in) Owned.
  • When a write miss occurs and another processor has the data in the Owned or Modified state, that processor provides the data and the block, in that processor, transitions to Invalid.
  • Main memory is updated when a block in the modified/dirty state or owned state is replaced.
  • A processor write to Owned state will transition the state to Modified.

(a) [5 points] Draw the state transition diagram.

  1. [10 points] Snooping Cache Coherence Protocols II (a) [2 points] How does the Valid Exclusive state in the MESI (Illinois) Protocol improve performance over the basic MSI scheme?

(b) [2 points] In the MESI (Illinois) Protocol, why can’t a node transition from the shared state to the excusive state if all other nodes have had a particular block evicted from the cache, leaving that node with the only copy in memory?

(c) [6 points] Suppose we want to combine the protocol in question 1 with the MESI (Illinois) Protocol to improve efficiency even further. What modifications will be needed to incorporate the Owned state into the MESI Protocol. You don’t need to draw the state transition diagram, just describe what needs to be done.

  1. [8 points] More Multiprocessing (a) [1 points] What is the main difference between snooping protocols and directory protocols?

(b) [1 points] Why do directory protocols scale better than snooping protocols? Why are snooping protocols popular?

(c) [3 points] Implementations of directory protocol where the whole directory is centralized in one location have problems scaling to more than a couple hundred processors. What is the bottleneck in basic directory protocols and why does it occur? How might this bottleneck be removed?

(d) [3 points] In snooping protocols, what is the difference between invalidate schemes and update schemes? For each scheme, discuss a situation where the scheme performs poorly and explain why.

GRADUATE PROBLEM

Problem 5 [8 points]

Consider the following system S :

  • The system S contains a cache per processor that can contain shared read/write data. Cache coherence is maintained through an invalidation snooping protocol.
  • When a processor’s cache controller sees an invalidate on the bus for a line present in its cache, it buffers this invalidate in a local buffer. The bus is free for the next transaction as soon as such buffering is done. The cache controller will apply the invalidate to its cache line some time later (e.g., when the cache is not being used by the processor). It is also possible that the buffered invalidates are applied to a cache in an order different from the order in which they were received from the bus.
  • A processor is allowed to have multiple outstanding memory accesses and these accesses could occur out of program order.
  • An instruction called memory _ barrier , denoted by MB , is provided with the following specification.
  • An MB by processor P is not issued until the following is true of all operations op of processor P that are before MB by program order: o if op is a read, then it has returned its value, and o if op is a write, then the invalidate for that write has been applied to all the cache lines with an older value.
  • Further, processor P does not issue any memory operation until all preceding MB instructions (by program order) have been issued.
  • The memory consistency model of system S is not sequential consistency and does not impose any constraints on the ordering of loads and stores other than that due to the MB instruction.

Answer the following two parts for the above system.

Part A [4 points]

Consider the following program.

(Note: Operations in a vertical column are issued by the same processor, and appear in program

order.)

Initially X = Y = 0

P1 P2 P

X = 1 tmp1 = X tmp2 = Y

Y = 1 tmp3 = X

Suppose processor P2’s read of X and processor P3’s read of Y both return the value 1.

Then what values could processor P3’s read of X return on a sequentially consistent system?

What values could it return on system S.

Part B [4 points]

The designers of system S claim that S is simple to program because programmers who want

sequential consistency can simply put MB instructions before and after every memory operation