Write-through cache
Write-through caching propagates writes to the backing store as part of completing them at the cache layer.
The guarantee is relative to that layer. Linux dm-cache write-through completes a cached write after both cache and origin devices have been updated, but lower layers can still contain volatile write caches. REQ_PREFLUSH and REQ_FUA address separate persistence requirements; write-through alone is not an end-to-end power-loss guarantee or an application transaction protocol. [2] [1]
A RAID virtual disk can report write-through to the operating system while its controller uses a different actual write policy. Check the controller-management view rather than inferring the active policy from the host label. This documented behavior is controller-specific. [4]
Recovery: A clean cache need not be coherent with a changed origin. The dm-cache documentation gives origin snapshot rollback as a passthrough use case. Passthrough requires a clean cache, sends reads to the origin and invalidates cached write hits. A write-through label alone does not establish that surviving cached bytes match the recovered origin. [2]
Relations
- related
- Write-around cache, Write-back cache, Enterprise SSD, Direct I/O, Storage cache flush, Force Unit Access, FILE_FLAG_WRITE_THROUGH, FlashTier
Limitations
- Backing-device completion must not be confused with persistence when lower-layer volatile caches are present. [2, 1]
Citations
- Linux kernel documentation. Explicit volatile write back cache control: REQ_PREFLUSH and REQ_FUA.
- Linux kernel documentation. Device-mapper cache: operating modes and on-disk metadata.
- Dell PERC H700/H800 Technical Guide. Rev. 3, March 2011, section 4.10, p. 20: OS presentation and virtual-disk policy.
Further reading
Sources & caveats
- OS-reporting example: Dell PERC H700/H800, March 2011 guide, section 4.10. This is not a universal controller behavior. [4]