硬盘Cache写机制 Write-through与Write-back的区别
网络知识 2023-02-09 17:40www.1681989.comseo网站推广
上的说明,Cache写机制分为write through和write back两种。
Write-through- Write is done synchronously both to the cache and to the backg store.
Write-back (or Write-behd) – Writg is done only to the cache. A modified cache block is written back to the store, just before it is replaced.
Write-through(直写模式)在数据更新时,写入缓存Cache和后端存储。此模式的优点是操作简单;缺点是因为数据修改需要写入存储,数据写入速度较慢。
Write-back(回写模式)在数据更新时只写入缓存Cache。只在数据被替换出缓存时,被修改的缓存数据才会被写到后端存储。此模式的优点是数据写入速度快,因为不需要写存储;缺点是一旦更新后的数据未被写入存储时出现系统掉电的情况,数据将无法找回。
Write-misses写缺失的处理方式
对于写操作,存在写入缓存缺失数据的情况,这时有两种处理方式
Write allocate (aka Fetch on write) – Datum at the missed-write location is loaded to cache, followed by a write-hit operation. In this approach, write misses are similar to read-misses.
No-write allocate (aka Write-no-allocate, Write around) – Datum at the missed-write location is not loaded to cache, and is written directly to the backg store. In this approach, actually only system reads are beg cached.
Write allocate方式将写入位置读入缓存,然后采用write-hit(缓存命中写入)操作。写缺失操作与读缺失操作类似。
No-write allocate方式并不将写入位置读入缓存,而是直接将数据写入存储。这种方式下,只有读操作会被缓存。
无论是Write-through还是Write-back都可以使用写缺失的两种方式之一。只是通常Write-back采用Write allocate方式,而Write-through采用No-write allocate方式;因为多次写入同一缓存时,Write allocate配合Write-back可以提升性能;而对于Write-through则没有帮助。
处理流程图
Write-through模式处理流程
A Write-Through cache with No-Write Allocation
Write-back模式处理流程
A Write-Back cache with Write Allocation
来源:
Write-through- Write is done synchronously both to the cache and to the backg store.
Write-back (or Write-behd) – Writg is done only to the cache. A modified cache block is written back to the store, just before it is replaced.
Write-through(直写模式)在数据更新时,写入缓存Cache和后端存储。此模式的优点是操作简单;缺点是因为数据修改需要写入存储,数据写入速度较慢。
Write-back(回写模式)在数据更新时只写入缓存Cache。只在数据被替换出缓存时,被修改的缓存数据才会被写到后端存储。此模式的优点是数据写入速度快,因为不需要写存储;缺点是一旦更新后的数据未被写入存储时出现系统掉电的情况,数据将无法找回。
Write-misses写缺失的处理方式
对于写操作,存在写入缓存缺失数据的情况,这时有两种处理方式
Write allocate (aka Fetch on write) – Datum at the missed-write location is loaded to cache, followed by a write-hit operation. In this approach, write misses are similar to read-misses.
No-write allocate (aka Write-no-allocate, Write around) – Datum at the missed-write location is not loaded to cache, and is written directly to the backg store. In this approach, actually only system reads are beg cached.
Write allocate方式将写入位置读入缓存,然后采用write-hit(缓存命中写入)操作。写缺失操作与读缺失操作类似。
No-write allocate方式并不将写入位置读入缓存,而是直接将数据写入存储。这种方式下,只有读操作会被缓存。
无论是Write-through还是Write-back都可以使用写缺失的两种方式之一。只是通常Write-back采用Write allocate方式,而Write-through采用No-write allocate方式;因为多次写入同一缓存时,Write allocate配合Write-back可以提升性能;而对于Write-through则没有帮助。
处理流程图
Write-through模式处理流程
A Write-Through cache with No-Write Allocation
Write-back模式处理流程
A Write-Back cache with Write Allocation
来源:
网络推广
- 5g网络有多快:5g网络网速有多快
- dota2无法连接至steam网络 为什么无法连接dota2网络
- 无线网络信号接收器 无线网络信号接收器怎么用
- 网络延时是什么意思 网络延时是什么原因
- 无线网络不可用:无线网络不可用是什么原因
- 网络广告销售技巧 网络广告销售技巧有哪些
- 智能手机网络设置 智能手机网络设置在哪里
- 为什么找不到无线网络 为什么找不到无线网络信
- 网络这么赚钱:网络怎么能赚到钱
- 为什么无线网络连接不上 为什么无线网连不起来
- 网络上的人际交往 网络上人际交往的优势
- 支付宝网络系统异常 支付宝显示网络异常什么时
- 营销软件:营销软件有哪些
- 无法访问您要使用的功能所在的网络位置
- 网络安全基本知识 网络安全基本知识有哪些
- 什么网络电话最好用 什么网络电话最好用最便宜