什么是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 ...
随机推荐
- Cesium之影像底图加载
1. 引言 Cesium是一款三维地球和地图可视化开源JavaScript库,使用WebGL来进行硬件加速图形,使用时不需要任何插件支持,基于Apache2.0许可的开源程序,可以免费用于商业和非商业 ...
- dot & pixel & point
dpi(dot per inch): 出版质量一般要求dpi在300-600之间. 100dpi = 39.37dpc(dot per cm) 在显示屏幕上,dot=pixel,对于100dpi分辨率 ...
- MySQL联合索引的创建规则
1.索引应该按照最常用于查询的列的顺序创建.这样可以最大程度地提高查询性能. 2.如果查询中包含的列与索引中的列顺序不一致,则无法使用索引.因此,如果您有多个查询,每个查询都包含不同的列,那么最好为每 ...
- mysql查询重复的数据
---查询重复的数据 . UUID可以换成其他的需要去重的字段. 点击查看代码 select * FROM t_gzmx_reptile_receive_incre WHERE id NOT IN ( ...
- Min_25 Sieve 学习笔记
这个东西不是人想的. 解决问题:积性函数前缀和. 适用条件:可以快速计算 \(f(p)\) 的前缀和,\(f(p^k)\) 可以被表示成若干完全积性函数的线性组合(指对应项可以快速组合出来). 时空复 ...
- ChatGPT is at capacity right now.ChatGPT Plus subscriber login Add your email for a personalized login link的解决办法
原因 你的ip地区用的人过多. 解决办法 在右侧页面填入邮箱,能收到邮件立刻就能登录,如果没有,就换地区试试,不行就等等吧 邮件示例:
- Markdown格式文档图片设置居右
在Typora中设置图片居右 <p><img src="[图片路径]" align="right" /></p> left ...
- ORM框架——Dapper
1.什么是ORM ORM(Object Relational Mapping)对象关系映射,是一种为了解决面向对象与关系数据库存在的互不匹配的现象的技术,用于实现面向对象编程语言里不同类型系统的数据之 ...
- Springcloud gateway整合(集成)swagger2+finfe4j踩坑
项目使用gateway代替之前的zuul网关,需要整合swagger,踩了许多坑之后终于解决问题,话不多说直接上代码 因为使用的是阿里的东西所以注册中心选择了nacos,它的配置这里就不贴了 spri ...
- 4、kubesphere环境安装
安装步骤 选择4核8G(master).8核16G(node1).8核16G(node2) 三台机器,按量付费进行实验,CentOS7.9 安装Docker 安装Kubernetes 安装KubeSp ...