HOME

TheInfoList



OR:

In
cache coherency In computer architecture, cache coherence is the uniformity of shared resource data that ends up stored in multiple local caches. When clients in a system maintain caches of a common memory resource, problems may arise with incoherent data, whi ...
protocol literature, Write-Once was the first
MESI protocol The MESI protocol is an Invalidate-based cache coherence protocol, and is one of the most common protocols that support write-back caches. It is also known as the Illinois protocol (due to its development at the University of Illinois at Urbana-Ch ...
defined. It has the optimization of executing write-through on the first write and a write-back on all subsequent writes, reducing the overall
bus A bus (contracted from omnibus, with variants multibus, motorbus, autobus, etc.) is a road vehicle that carries significantly more passengers than an average car or van. It is most commonly used in public transport, but is also in use for cha ...
traffic in consecutive writes to the
computer memory In computing, memory is a device or system that is used to store information for immediate use in a computer or related computer hardware and digital electronic devices. The term ''memory'' is often synonymous with the term ''primary storage ...
. It was first described by James R. Goodman in (1983). Cache coherence protocols are an important issue in
Symmetric multiprocessing Symmetric multiprocessing or shared-memory multiprocessing (SMP) involves a multiprocessor computer hardware and software architecture where two or more identical processors are connected to a single, shared main memory, have full access to all ...
systems, where each CPU maintains a
cache Cache, caching, or caché may refer to: Places United States * Cache, Idaho, an unincorporated community * Cache, Illinois, an unincorporated community * Cache, Oklahoma, a city in Comanche County * Cache, Utah, Cache County, Utah * Cache County ...
of the memory.


States

In this protocol, each block in the local cache is in one of these four states: * Invalid: This block has an incoherent copy of the memory. * Valid: This block has a coherent copy of the memory. The data may be possibly shared, but its content is not modified. * Reserved: The block is the only copy of the memory, but it is still coherent. No write-back is needed if the block is replaced. * Dirty: The block is the only copy of the memory and it is incoherent. This copy was written one or more times. This is the only state that generates a write-back when the block is replaced in the cache. These states have exactly the same meanings as the four states of the
MESI protocol The MESI protocol is an Invalidate-based cache coherence protocol, and is one of the most common protocols that support write-back caches. It is also known as the Illinois protocol (due to its development at the University of Illinois at Urbana-Ch ...
(they are simply listed in reverse order), but this is a simplified form of it that avoids the Read for Ownership operation. Instead, all invalidation is done by writes to main memory. For any given pair of caches, the permitted states of a given cache line are as follows (abbreviated in the order above):


Transitions

The protocol follows some transition rules for each event: * Read hit: The information is supplied by the current cache. No state change. * Read miss: The data is read from main memory. The read is snooped by other caches; if any of them have the line in the ''Dirty'' state, the read is interrupted long enough to write the data back to memory before it is allowed to continue. Any copies in the ''Dirty'' or ''Reserved'' states are set to the ''Valid'' state. * Write hit: If the information in the cache is in ''Dirty'' or ''Reserved'' state, the cache line is updated in place and its state is set to ''Dirty'' without updating memory. If the information is in ''Valid'' state, a write-through operation is executed updating the block and the memory and the block state is changed to ''Reserved''. Other caches snoop the write and set their copies to ''Invalid''. * Write miss: A partial cache line write is handled as a read miss (if necessary to fetch the unwritten portion of the cache line) followed by a write hit. This leaves all other caches in the ''Invalid'' state, and the current cache in the ''Reserved'' state. This is a variant of the MESI protocol, but there is no explicit read-for-ownership or broadcast invalidate operation to bring a line into cache in the ''Exclusive'' state without performing a main memory write. Instead, the first write to a ''Valid'' (a.k.a. ''Shared'') cache line performs a write through to memory, which implicitly invalidates other caches. After that, the line is in the ''Reserved'' (''Exclusive'') state, and further writes can be done without reference to main memory, leaving the cache line in the ''Dirty'' (''Modified'') state.


References

* * {{Cite conference , last1 = Goodman , first1 = J. R., title = Using cache memory to reduce processor-memory traffic, doi = 10.1145/800046.801647, book-title = Proceedings of the 10th annual international symposium on Computer architecture - ISCA '83, conference = International Symposium on Computer Architecture: Stockholm, Sweden, June 13–17, 1983, pages = 124–131, year = 1983, isbn = 0-89791-101-6 Cache coherency