indicogniBuild a VMM

Lab

Durability ladder

Used in chapter 18, the block-storage primer.

Follow one guest fsync() through the guest page cache, the VMM, the host page cache, the drive's cache and flash, choose how the VMM answers FLUSH, then kill the process or cut the power and see what the guest's journal finds.

Runs in browser
The durability ladder Five rungs between a guest write() and storage that survives: 1, the guest page cache in guest RAM; 2, a request in flight in the VMM; 3, the host page cache owned by macOS; 4, the SSD's volatile cache; 5, flash. A guest kernel crash wipes rung 1. Killing the VMM process wipes rungs 1 and 2. A macOS crash wipes rungs 1 to 3. A power cut wipes rungs 1 to 4. The virtio OUT request moves data past rung 1, pwrite past rung 2, fsync past rung 3, and only F_FULLFSYNC past rung 4, which is why the VMM must answer the guest's FLUSH with F_FULLFSYNC. rung wiped by 1 guest page cache 2 request in flight in the VMM 3 host page cache (macOS) 4 SSD's volatile cache 5 flash: survives virtio OUT request pwrite() returns fsync() F_FULLFSYNC guest crash, kill -9, macOS crash, power kill -9, macOS crash, power macOS crash, power power nothing guest above, host below

All labs