Storage cache flush
A storage cache flush requests persistence of writes buffered in the addressed storage stack, with its coverage and ordering defined by that interface.
In the Linux block layer, REQ_PREFLUSH makes previously completed writes persistent before an accompanying I/O starts; it can also be issued without a data payload. REQ_FUA instead covers persistence of the write carrying FUA before its completion, and both flags may be combined. This block-level operation does not submit data still held only in an application buffer or establish multi-file transaction atomicity. Device-mapper layers must propagate the required persistence semantics.
SCSI SYNCHRONIZE CACHE with IMMED=1 acknowledges validation before synchronization completes. SYNC_PROG=00 offers no pollable progress sense; silence is not completion evidence. Modes 01 and 10 report progress with NO SENSE and NOT READY respectively; mode 10 also rejects commands needing occupied resources, except specified discovery commands. Unsupported IMMED=1 is rejected. [4]
In Hesela's eight isolated Linux v6.12 function controls, FILEIO and IBLOCK each returned GOOD before an injected backend error when IMMED was set; non-immediate error controls reported CHECK CONDITION. All helper return values were zero. These are stubbed function observations, not device I/O, later deferred-error reporting or crash-survival tests. The separate sd_sync_cache initiator helper leaves IMMED clear. [5] [6] [8] [7]
For SYNCHRONIZE CACHE (10), zero NUMBER OF BLOCKS covers the supplied LBA through the medium's end, not no blocks. Linux v6.12 IBLOCK flushes the whole cache, so a narrow requested range does not imply less backend work. [4] [6]
Relations
- related
- Force Unit Access, Write-back cache, Write-through cache, fsync, Persistence ordering, SCSI deferred error, NVMe volatile write cache, Storage cache barrier, CLWB, CLFLUSHOPT, HORAE
Advantages
- Provides a persistence boundary for earlier completed writes in a stack that honors the request. [1]
Limitations
- A successful lower-layer flush does not certify an application's complete recovery protocol. [1, 3]
- Early acknowledgement and a quiet progress channel do not certify completed synchronization; IMMED and the device's supported reporting mode matter. [4]
- SYNCHRONIZE CACHE may complete with data in non-volatile cache, not yet on the medium, and does not require cache eviction. [4]
Citations
- Linux kernel documentation. Explicit volatile write back cache control: REQ_PREFLUSH and REQ_FUA.
- NFS stable writes: what COMMIT, flush and FUA actually promise
- Seagate SCSI Commands Reference Manual Rev. L (November 2020), section 3.55, Tables 214-215: IMMED and SYNC_PROG.
- Linux v6.12 pinned source: fd_execute_sync_cache, FILEIO status and fsync ordering.
- Linux v6.12 pinned source: iblock_end_io_flush and iblock_execute_sync_cache.
- Linux v6.12 pinned source: sd_sync_cache leaves IMMED clear.
- Hesela: eight isolated-function SCSI IMMED observations; injected outcomes, not device I/O.