dm-writecache
dm-writecache is a Linux device-mapper target that buffers writes on persistent memory or SSD before writing cached data to an underlying device.
Read admission: LVM distinguishes writecache from the read/write hot-spot cache type. Origin read misses do not populate writecache; reads can still hit data already cached by writes. [3] [2]
Persistence: A normal block FLUSH commits cache state without requiring every cached block to reach the origin. The administrative flush message instead requests all-block writeback and waits; these are different interfaces. [2]
Cleaning: cleaner stops admitting uncached writes but still caches updates to existing entries to preserve ordering. Enabling it is not evidence that draining has finished; inspect status and follow the documented removal sequence. [1]
Configuration: The fua and nofua writeback options apply only to persistent-memory mode. nofua uses a subsequent origin flush, not an unconditional omission of persistence handling. [1] [2]
Relations
Limitations
- A committed cache can remain necessary for recovery while the origin holds older data. The autocommit_time timer queues cache-commit work; it is not an origin-writeback deadline or an application synchronization operation. [2]
Citations
- Linux v6.12: writecache target, cleaner, commit controls and removal sequence
- Linux v6.12 dm-writecache.c: read routing, cache commit and process_flush_mesg
- LVM2 v2.03.28 lvmcache(7): distinct cache and writecache LV types
Further reading
Sources & caveats
- Version-scoped documentation and source review; no device-mapper target, hardware benchmark or power-loss experiment was run.