本文为半翻译文(非直译,多数理解为主),主旨在于理解缓存预取机制,以便提高缓存效率
Even programs with good data locality will now and then have to access a cache line that is not in the cache, and will then stall until the data has been fetchedfrom main memory. It would of course be better if there was a way to load thedata into the cache before it is needed so the stall could be avoided. This iscalled prefetching and there are two ways to achieve it,software prefetching and hardware prefetching.
即使程序有好的数据局部性,也仍然在某一时刻需要访问不在Cache中的数据,此时CPU必须等待数据被加载到Cache后,计算才能继续进行,为此数据预取是一个很好的优化方法:数据预取分为软件预取和硬件预取。