计算机的哪一部分管理缓存替换? [英] Which part of the computer manages cache replacement?

查看:68
本文介绍了计算机的哪一部分管理缓存替换?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我还没有找到一个明确的答案:控制单元本身是否会获取预定义的指令以执行高速缓存驱逐,还是操作系统进行了干预?如果可以,怎么办?

I haven't found a clear answer: does the control unit itself fetch pre-defined instructions to execute a cache eviction, or does the operating system intervene? If so, how?

推荐答案

计算机的哪一部分管理缓存替换?

Which part of the computer manages cache replacement?

通常;缓存本身管理缓存替换(它不是由单独的部分完成).

Typically; a cache manages cache replacement itself (its not done by a separate part).

有许多类型的缓存,其中一些是通过软件实现的(DNS缓存,网页缓存,文件数据缓存),而某些是通过硬件实现的(指令缓存,数据缓存,转换后备缓存).

There are many types of caches where some are implemented by software (DNS cache, web page cache, file data cache) and some are implemented in hardware (instruction caches, data caches, translation look-aside buffers).

对于所有情况;每当需要将新数据插入到缓存中并且没有足够的空间时,都需要快速逐出其他数据以为新数据腾出空间.理想地,极有可能很快需要".应该逐出数据,但是这很难确定,因此大多数高速缓存都做出可能最近不使用"的假设(可能不正确).是极有可能很快需要"的良好预测指标.

For all cases; whenever new data needs to be inserted into the cache and there isn't enough space, other data needs to be evicted quickly to make space for the new data. Ideally, "least likely to be needed soon" data should be evicted, but that's too hard determine so most caches make the (potentially incorrect) assumption that "least recently used" is a good predictor of "least likely to be needed soon".

通常,这意味着存储某种上次使用时间".以及数据(对于缓存中的每个项目);这意味着(出于性能考虑)通常最近最少使用".(和逐出本身)直接内置到缓存的设计中(例如,上次使用的时间"信息与其他元数据一起存储在缓存标签"中).

Typically this means storing some kind of "time when last used" along with the data (for each item in the cache); which means (for performance) typically "least recently used" (and eviction itself) is built directly into the design of the cache (e.g. the "time when last used" information is stored in a "cache tag" along with other meta-data).

这篇关于计算机的哪一部分管理缓存替换?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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