MESI protocol. Write with cache miss. Why needs main memory value fetch?

不问归期 提交于 2021-02-05 08:06:32

问题


I'm wondering about MESI protocol implementation of writing with the allocation on write miss policy. Let's say that we have write request and got cache miss with no other copies of cache line. This diagram says that the next step is to fetch value from main memory (or L2 cache), store it and mark cache line as M (modified). I suppose then the new value is stored in cache block. The question is: Why we need the step of fetching data from main memory? Why we can't simply write the new value in to the first found cache line in I (invalid) state/replace the eldest cache line and mark it as M (modified)?

Thank you for your help!


回答1:


Assume you have 64-byte cache lines, and you write one byte. You can't put "1/64ths of a cache line" into the cache, so where do the remaining 63 bytes come from? They have to come from main memory (or the next level cache).



来源:https://stackoverflow.com/questions/39180919/mesi-protocol-write-with-cache-miss-why-needs-main-memory-value-fetch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!