Write-misses写缺失的处理方式对于写操作存在写入缓存缺失数据的情况这时有两种处理方式Write allocate(akaFetch 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(akaWrite-no-allocate, Write around) - Datum at the missed-write location is not loaded to cache, and is written directly to the backing store. In this approach, actually only system reads are being 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 AllocationWrite-back模式处理流程
Cache写机制Write-through与Write-back
发布时间:2026/5/25 2:33:36
Write-misses写缺失的处理方式对于写操作存在写入缓存缺失数据的情况这时有两种处理方式Write allocate(akaFetch 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(akaWrite-no-allocate, Write around) - Datum at the missed-write location is not loaded to cache, and is written directly to the backing store. In this approach, actually only system reads are being 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 AllocationWrite-back模式处理流程