什么是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 ...
随机推荐
- 《爆肝整理》保姆级系列教程-玩转Charles抓包神器教程(9)-Charles如何修改请求参数和响应数据-上篇
1.简介 宏哥之前一直用postman调接口比较多(web端),也非常容易上手和操作.但有时候想要去修改APP的页面展示,造数据又会比较麻烦,你自己造相对还好些,要是让开发造,还得低眉顺眼的去求人.通 ...
- LeetCode-2055 蜡烛之间的盘子 及库函数 lower_bound 和 upper_bound学习使用
来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/plates-between-candles 题目描述 给你一个长桌子,桌子上盘子和蜡烛排成一列. ...
- LeetCode-630 课程表Ⅲ
来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/course-schedule-iii 题目描述 这里有 n 门不同的在线课程,按从 1 到 n ...
- CMakeLists.txt模板
编译动态库的模板 add_library 生成可执行程序换成add_executable 不需要调试信息的去掉 -g 不需要警告信息的去掉 -Wall 这应该是 -W all的组合 cmake_min ...
- Git提交代码报错husky > pre-commit,
拉取了新项目以后,git突然不能用了 报husky > pre-commit, 解决办法:进入你的项目显示隐藏git文件 进入git文件 找到 hooks / pre-commit ...
- 第五周作业-N67044-张铭扬
1. 搭建chrony服务完成多个主机的时间同步. [root@centos8 ~]# yum -y install chrony [root@centos8 ~]# vim /etc/chrony ...
- CSS:布局篇_用flex布局实现两边顶宽中间自适应(圣杯布局&双飞翼布局)
CSS:布局篇_用flex布局实现两边顶宽中间自适应(圣杯布局&双飞翼布局) <!DOCTYPE html> <html> <head> <title ...
- HttpClient Post 提交表单数据
运行环境 .net 4.6.1 //为防止因HTTPS证书认证失败造成API调用失败,需要先忽略证书信任问题 var sslHandler = new HttpClientHandler() { }; ...
- eclipse调整控制台长度
- iOS中的三种定时器
iOS中的三种定时器 NSTimer 一.背景 定时器是iOS开发中经常使用的,但是使用不慎会造成内存泄露,因为NSTimer没有释放,控制器析构函数dealloc也没有调用,造成内存泄露. 二.使用 ...