cache-coherence MOESI protocol
processor A owns a cache line which is shared with processor B.
what happens when B tries to write to that line? also, if it was 'invalid' inste开发者_如何学Pythonad of 'shared' would it make any difference? thank you.I found this:
"If a processor wishes to write to an Owned cache line, it must notify the other processors that are sharing that cache line. Depending on the implementation it may simply tell them to invalidate their copies (moving its own copy to the Modified state), or it may tell them to update their copies with the new contents (leaving its own copy in the Owned state)."
I assume you are saying: - Processor A has the cache line in 'O' state - Processor B has the cache line in 'S' state
If processor B intends to modify the line, processor A downgrades the line from 'O' to 'I', and processor B upgrades the line from 'S' to 'M'. The details on how these two operations happen depend on how the cache coherence protocol is implemented.. snooping or directory.
Note that in the above case there's no data transfer from Processor A/memory to Processor B, because Processor B already has the data (and should be the latest).
Now coming to the case, where processor B has the line in 'I' state instead of 'S'. Processor B may only be modifying part of a cache line. For a, write allocate, write back cache, the cache line should be transferred from Processor A to Processor B, before processor B writes the cache line.
Simple answer to your question is: "Data transfer is involved when in 'I' state vs no data transfer when in 's" state"
精彩评论