什么是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 ...
随机推荐
- PostgreSQL 绑定变量浅析
今天我们要探讨的是 custom执行计划和通用执行计划.这一技术在 Oracle中被称为绑定变量窥视.但 Postgresql中并没有这样的定义,更严格地说,Postgresql叫做custom执行计 ...
- 苹果iPhone 日历查询功能异常
2022年底苹果发布了IOS16.2版本系统,此时间段内所有升级的用户都将会出现日历查询功能失效,字符错乱等诸多问题. 与客服沟通后告知,日历记录内容查询是没有时间限制的,可以无限期查询全部内容,于是 ...
- 需要登陆,请求数据 session
requests中的session模块思路:# 1. 登录 --> 等到cookie# 2.带着cookie 请求到书架的url-->书架上的内容#注意:# 两个操作要连续起来操作# 我们 ...
- video.js 注销上一个对象并重新初始化
.dispose()没有用,不知道为什么. 后来我们为video绑定不同的id,还是随机数,每次初始化都用新video的id.并不建议这样做,但是我们也没有更好的办法了.
- 【补题】The 2022 SDUT Summer Trials
比赛链接 The 2022 SDUT Summer Trials A. Ginger's number 样例恶臭(恼) 签到题 简单分解因数就会发现要求的就是\(gcd\),直接算即可,时间复杂度\( ...
- k8s证书续期10年
一.拉取脚本 git clone https://github.com/yuyicai/update-kube-cert.git cd update-kube-cert chmod 755 updat ...
- 关于JMeter WebSocket插件:JMeter WebSocket插件-关闭SignalR连接--webSocket Close报错
在浦发银行的项目中,主机运维连接成功不做任何操作的场景中,用到了webSocket协议,但是脚本运行中出现webSocke Close报错--解决方案:在webSocket Open Connecti ...
- WDA学习(27):RoadMap使用
1.20 UI Element:RoadMap使用 本实例测试创建RoadMap; 运行结果: 点击2,Input显示输入航班Id 点击3,根据input输入,查询航班信息 1.创建Component ...
- JavaSE——构造方法
package com.zhao.test3; public class Student { private String name; private int age; //如果我们自己没有写任何的构 ...
- 解决gpg: 从公钥服务器接收失败:服务器故障
xxx@xxx-virtual-machine:~/workspace/rv1126_rv1109_sdk$ sudo apt-key adv --keyserver hkp://keyserver. ...