Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
MOESI protocol
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Cache coherence protocol}} '''Modified Owned Exclusive Shared Invalid''' ('''MOESI''') is a full [[List of cache coherency protocols|cache coherency protocol]] that encompasses all of the possible states commonly used in other protocols. In addition to the four common [[MESI protocol]] states, there is a fifth "Owned" state representing data that is both modified and shared. This avoids the need to write modified data back to main memory before sharing it. While the data must still be written back eventually, the write-back may be deferred . In order for this to be possible, direct cache-to-cache transfers of data must be possible, so a cache with the data in the modified state can supply that data to another reader without transferring it to memory. As discussed in [[AMD64]] Architecture Programmer's Manual Vol. 2 {{`}}''System Programming''{{'}},<ref>{{Cite web |url=http://developer.amd.com/wordpress/media/2012/10/24593_APM_v21.pdf#page=217 |title=AMD64 Architecture Programmer's Manual Vol 2 'System Programming' |access-date=August 28, 2015 |pages=169–172 |archive-url=https://web.archive.org/web/20170619232736/http://developer.amd.com/wordpress/media/2012/10/24593_APM_v21.pdf#page=217 |archive-date=June 19, 2017 |url-status=dead }}</ref> each [[cache line]] is in one of five states: ;Modified: This cache has the only valid copy of the cache line, and has made changes to that copy. The cached copy may be further modified freely. ;Owned: This line is one of several copies in the system. This cache does not have permission to modify the copy ''but'' the line is modified (dirty) relative to main memory, and this cache has the exclusive responsibility for ensuring main memory is eventually updated. The cache line may be changed to the Modified state after invalidating all shared copies, or changed to the Shared state by [[Write-back#WRITE-BACK|writing the modifications back]] to main memory. Owned cache lines ''must'' respond to a [[Snoopy cache|snoop]] request with data, to ensure the stale copy in main memory is not used. ;Exclusive: This cache has the only copy of the line, but the line is clean (unmodified). It may be written to, changing to the Modified state. ;Shared: This line is one of several copies in the system. This cache does not have permission to modify the copy. Unlike the MESI protocol, a shared cache line ''may'' be dirty with respect to memory; if it is, one cache has a copy in the Owned state, and that cache is responsible for eventually updating main memory. If no cache holds the line in the Owned state, the memory copy is up to date. The cache line may not be written, but must be changed to the Exclusive or Modified state first, by invalidating all other cached copies. (If the cache line was Owned before, the invalidate response will indicate this, and the state will become Modified, so the obligation to eventually write the data back to memory is not forgotten.) It may also be discarded (changed to the Invalid state) at any time. ;Invalid: This block is not valid; it must be fetched to satisfy any attempted access. For any given pair of caches, the permitted states of a given cache line are as follows: {|class=wikitable style=text-align:center ! !! M !! O !! E !! S !! I |- ! M | {{N}} || {{N}} || {{N}} || {{N}} || {{Y}} |- ! O | {{N}} || {{N}} || {{N}} || {{Y}} || {{Y}} |- ! E | {{N}} || {{N}} || {{N}} || {{N}} || {{Y}} |- ! S | {{N}} || {{Y}} || {{N}} || {{Y}} || {{Y}} |- ! I | {{Y}} || {{Y}} || {{Y}} || {{Y}} || {{Y}} |} (The order in which the states are normally listed serves only to make the acronym "MOESI" pronounceable.) This protocol, a more elaborate version of the simpler [[MESI protocol]], avoids the need to write a dirty cache line back to [[main memory]] when another processor tries to read it. Instead, the Owned state allows a processor to supply the modified data directly to the other processor. This is beneficial when the communication between two CPUs is significantly better than to main memory. An example would be multi-core CPUs with per-core L2 caches. While MOESI can quickly share dirty cache lines from cache, it may struggle to quickly share clean lines from cache. If a cache line is clean with respect to memory and in the shared state, then there is no obvious single candidate cache to respond to a read request, so it is normal to let the read request be filled from memory. (This is solved by the [[MESIF protocol]], which may be combined with MOESI to make MOESIF.) If a processor wishes to write to an Owned cache line, it must notify the other processors which are sharing that cache line. The standard implementation simply tells them to invalidate their copies, moving its own copy to the Modified state when this is complete, but alternatively it may use a [[Cache (computing)#Writing policies|write-through policy]], telling them to update their copies with the new contents. This is a partial write-through which does not go as far as main memory; the processor's own copy remains in the Owned state. The latter reduces cache traffic ''if'' there are multiple active readers of e.g. a heavily [[Resource contention|contended]] lock; one broadcast write is less communication than separate replies to a [[Thundering herd problem|thundering herd]] of read requests. Because these two variants are fully compatible, they may both be used in the same system based on [[heuristic]]s like the cache's estimate of the number of active readers of this cache line. ==See also== * [[Cache coherency]] * [[MSI protocol]] * [[MESI protocol]] * [[MOSI protocol]] * [[MESIF protocol]] == References == {{reflist}} {{DEFAULTSORT:Moesi Protocol}} [[Category:Cache coherency]] [[Category:Cache (computing)]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:'
(
edit
)
Template:Cite web
(
edit
)
Template:N
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Y
(
edit
)
Template:`
(
edit
)