CLWB
CLWB is an x86 instruction that writes a modified CPU cache line back to memory while allowing it to remain cached.
Retention is optional: hardware may invalidate the line. Support is advertised by CPUID leaf 7, subleaf 0, EBX bit 24. [1]
For an ADR-backed persistent-memory mapping, cache-line writeback and a following SFENCE can establish persistence. Detected eADR can remove explicit writebacks, but not the required ordering. Instruction support alone does not establish either platform contract. [2]
A persistence operation does not make a multi-line update atomic. Data can reach persistence before an explicit request, so recovery must tolerate intermediate states. [3]
Relations
- related
- CLFLUSHOPT, Persistence domain, Asynchronous DRAM Refresh, Extended Asynchronous DRAM Refresh, Storage cache flush, Assise, SFENCE
Citations
- Intel SDM 093, Vol. 2A: CLFLUSHOPT (3-146) and CLWB (3-154).
- PMem project glossary: CLWB, CLFLUSHOPT, ADR, eADR and fences.
- PMDK 1.13.1: pmem2_get_persist_fn, flush/drain and non-transactional semantics.
Further reading
Sources & caveats
- Instruction semantics follow Intel SDM revision 093. PMDK API behavior is pinned to version 1.13.1, not asserted to be the latest release.
- Source synthesis only; no persistent-memory device, power-cut experiment or latency measurement.