什么是cache
什么是cache
To minimize the quantity of control information stored, the spatial locality property is used to group several locations together under the same tag. This logical block is commonly known as a cache line.
When data is loaded into a cache, access times for subsequent loads and stores are reduced, resulting in overall performance benefits. An access to information already in a cache is known as a cache hit, and other accesses are called cache misses.
在S32K1xx的RM中可以看到。
This device includes one 4 KB code cache to minimize the performance impact of memory access latencies. The code cache exists on the I/D bus, and there is no cache on the system bus.
Cache的主要作用是降低访问主存(一般size都比较大)时的延迟。尤其是我们访问硬盘时,如果速度过慢,特别影响性能。当然,硬盘不是主存,这是另外一个话题。
Cache的存在对于用户是不可见的,只有的极少量的场合软件才需要去控制它。
对于一些嵌入式系统,我们似乎对这种性能的优化要小心。但是这种性能的优化导致的时间的不确定性能够以其他方式去解决。
WT = Write through, no write allocate.
WBWA = Write back, write allocate.
Write-allocate (WA)
In a write-allocate cache, a cache miss on storing data causes a cache line to be allocated into the cache.
在这种类型的cache(物理实体)中,发生了一个cache miss的事件,会导致 一块 logical block(也就是cache line)被分配。
Write-back (WB)
In a write-back cache, data is only written to main memory when it is forced out of the cache on line replacement following a cache miss. Otherwise, writes by the processor only update the cache. This is also known as copyback.
英语阅读理解:line replacement following a cache miss, 意思是cache miss发生之后会 line replacement。
cache miss followed by line replacement.
Write-through (WT) In a write-through cache, data is written to main memory at the same time as the cache is updated.
写的时候同步写入到主存。
Wikipedia中的词条中指出,TLB也是一种cache。
Other types of caches exist (that are not counted towards the "cache size" of the most important caches mentioned above), such as the translation lookaside buffer (TLB) which is part of the memory management unit (MMU) which most CPUs have.
所以,很多概念容易混淆。
参考资料:
https://en.wikipedia.org/wiki/CPU_cache
《Cortex-M0 Devices Generic User Guide》2009 ARM Limited.
什么是cache的更多相关文章
- ASP.NET Core 折腾笔记二:自己写个完整的Cache缓存类来支持.NET Core
背景: 1:.NET Core 已经没System.Web,也木有了HttpRuntime.Cache,因此,该空间下Cache也木有了. 2:.NET Core 有新的Memory Cache提供, ...
- [Java 缓存] Java Cache之 DCache的简单应用.
前言 上次总结了下本地缓存Guava Cache的简单应用, 这次来继续说下项目中使用的DCache的简单使用. 这里分为几部分进行总结, 1)DCache介绍; 2)DCache配置及使用; 3)使 ...
- Spring cache简单使用guava cache
Spring cache简单使用 前言 spring有一套和各种缓存的集成方式.类似于sl4j,你可以选择log框架实现,也一样可以实现缓存实现,比如ehcache,guava cache. [TOC ...
- 笔记:Memory Notification: Library Cache Object loaded into SGA
笔记:Memory Notification: Library Cache Object loaded into SGA在警告日志中发现一些这样的警告信息:Mon Nov 21 14:24:22 20 ...
- ABP源码分析十三:缓存Cache实现
ABP中有两种cache的实现方式:MemroyCache 和 RedisCache. 如下图,两者都继承至ICache接口(准确说是CacheBase抽象类).ABP核心模块封装了MemroyCac ...
- [Java 缓存] Java Cache之 Guava Cache的简单应用.
前言 今天第一次使用MarkDown的形式发博客. 准备记录一下自己对Guava Cache的认识及项目中的实际使用经验. 一: 什么是Guava Guava工程包含了若干被Google的 Java项 ...
- ASP.NET MVC5+EF6+EasyUI 后台管理系统(40)-精准在线人数统计实现-【过滤器+Cache】
系列目录 上次的探讨没有任何结果,我浏览了大量的文章和个别系统的参考!决定用Cache来做,这可能有点难以接受但是配合mvc过滤器来做效果非常好! 由于之前的过滤器我们用过了OnActionExecu ...
- HTML5离线缓存(Application Cache)
HTML5离线缓存又名Application Cache,是从浏览器的缓存中分出来的一块缓存区,要想在这个缓存中保存数据,可以使用一个描述文件(manifest file),列出要下载和缓存的资源. ...
- 第三篇 Entity Framework Plus 之 Query Cache
离上一篇博客,快一周,工作太忙,只能利用休息日来写一些跟大家分享,Entity Framework Plus 组件系列文章,之前已经写过两篇 第一篇 Entity Framework Plus 之 A ...
- HTML5应用程序缓存Application Cache
什么是Application Cache HTML5引入了应用程序缓存技术,意味着web应用可进行缓存,并在没有网络的情况下使用,通过创建cache manifest文件,可以轻松的创建离线应用. A ...
随机推荐
- 结合ChatGPT体验新必应new bing 的惊喜:这是我第一次使用的感受
前言 最近相信大家都被 ChatGPT 刷屏了,它的爆火大家是有目共睹的,微软的新必应(New Bing) 是结合了比 ChatGPT 更强大的新一代 OpenAI 语言模式,接下来我们一起来&quo ...
- js高德地图添加点Marker,添加线段Polyline,添加一个区域Polygon(面)
高德地图JS API 实例 亲测可用 参考网站=> 阿里云数据可视化平台(下载json用的):http://datav.aliyun.com/portal/school/atlas/area_ ...
- Django中admin的一些知识点
Django中的Admin站点管理: 内容发布的部分由网站的管理员负责,包括查看.添加.修改.删除数据: Django项目中默认启用Admin管理站点:列表页选项, 编辑页选项, 重写模板. #准备工 ...
- JUC学习笔记
1 进程与线程:进程指正在运行的程序,进程拥有一个完整的.私有的基本运行资源集合.它有自己的内存空间.为了便于进程之间的通信,大多数操作系统都都支持进程间通信(IPC). IPC通信包括管道.消息队列 ...
- centos7 部署 loonflow
a workflow engine base on django 基于django的工作流引擎系统(通过http接口调用,可以作为企业内部统一的工作流引擎,提供诸如权限申请.资源申请.发布申请.请假. ...
- Windows打开代理快捷方式
最近使用电脑需要频繁打开关闭网络代理(全局代理会导致一些网站打不开),在想有没有快捷方式,一搜果然有,看来有跟我一样的使用习惯的人. 传统切换代理开关,步骤如下: 设置 => 网络和 Inter ...
- 新手必学matplotlib
Getting started Installation quick-start Install using pip: pip install matplotlib Install using con ...
- 访问第三方接口带Authorization认证
第一种方式 HttpHeaders httpHeaders = new HttpHeaders(); httpHeaders.add("Authorization", " ...
- js判断任意数值接近数组中的某个值
可以是数组,也可以是数组对象,看需求定义 let val = '' for (let i = 0; i < this.allData.length; i++) { if (this.days & ...
- Delete `␍` prettier/prettier Vue 可悬浮按钮
Delete `␍` prettier/prettier 代码格式化不一致,换行符冲突.UNIX/Linux 使用的是 0x0A(LF), DOS/Windows 一直使用 0x0D0A(CRLF) ...