MESI协议.写入高速缓存未命中.为什么需要获取主内存值? [英] MESI protocol. Write with cache miss. Why needs main memory value fetch?

查看:62
本文介绍了MESI协议.写入高速缓存未命中.为什么需要获取主内存值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道 MESI 协议的实现与写未命中策略的分配有关.假设我们有写入请求,并且没有其他缓存行副本,但是缓存未命中.此关系图表示,下一步是从中获取价值主存储器(或L2高速缓存),将其存储并将高速缓存行标记为M(已修改).我想然后将新值存储在缓存块中.问题是:为什么我们需要从主存储器中获取数据的步骤?为什么我们不能简单地将新值写入处于I(无效)状态的第一个找到的高速缓存行/替换最旧的高速缓存行并将其标记为M(已修改)?

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)?

谢谢您的帮助!

推荐答案

假定您有64字节的缓存行,并且您写入了一个字节.您不能将"1/64的缓存行"放入缓存中,那么剩下的63个字节从何而来?它们必须来自主内存(或下一级缓存).

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).

这篇关于MESI协议.写入高速缓存未命中.为什么需要获取主内存值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆