关于tlb表和data cache的关系
在阅读modern operating system中。关于tlb表的部分涉及到了一个FastMATH的实例。博主当时有一个疑惑。既然TLB表是一种cache。那么为什么还需要一个data cache呢?在google了之后得到了答案。
tlb是一种关于page table的cache。是一种virtual address to physical address lookup。data cache是一种关于main memory的cache。
Therefore, the data cache acts as a dedicated cache for memory reads. The data cache has some cache entries, where each cache entry contains a physical address and the value of memory at that address.
这就是为什么在fastmath中tlb表作为cache已经存在了,但是还是需要一个data cache。
这两个cache的工作机理如下:
They are both caches, but they serve a different purpose. The processor uses both for each memory operation: it first uses the TLB to convert from virtual address to physical address, then it checks the data cache to speed up the process of reading the value stored in memory at that address.
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步