Repository navigation
Avoid synchronous fdatasync in snapshotcache writeback and eviction - #3477
Chenyi Wang (chw120) wants to merge 1 commit into
Conversation
|
I'm not sure completely dropping the write-behind is safe, if you're close to full this may OOM? It would give even better performance but I think that may be over-shooting. |
c2687c6 to
4542389
Compare
Thanks for the review! Agreed on the OOM risk. I updated this PR to keep the 8 MiB Since #3485 already covers
Happy to wait for #3485 to land and rebase this PR onto just those two fixes! Benjamin Elder (@BenTheElder) |
4542389 to
4d3648b
Compare
|
Updated this PR to drop the parts covered by #3485 and keep only the remaining non-overlapping changes (snapshotcache writeback/eviction without fdatasync, and starting VM snapshot writeback after mergeOnDemandDelta). |
Replace blocking unix.Fdatasync calls in snapshotcache.StartWriteback and post-restore eviction with cachestat polling and data-only SYNC_FILE_RANGE_WRITE, open and close one file at a time in StartWriteback so unlinked snapshot files are not held open across sleeps or sync waits, and start VM snapshot writeback after mergeOnDemandDelta so it tracks the final merged memory-ranges inode. Signed-off-by: Chenyi Wang <[email protected]>
4d3648b to
d0b7582
Compare
|
Thanks Anna Pendleton (@annapendleton). Updated |
|
The change has been included in #3485. Close the PR. |
Follows up on #3353.
Why:
snapshotcache.StartWritebackandSyncAndEvictrunfdatasyncin background goroutines while holding all snapshot files open. Under #3485, both the VM memory snapshot and each fast-path tar callStartWriteback, so thosefdatasynccalls contend on the shared ext4 journal (#1954) and keep unlinked snapshot files ((deleted)) pinned on disk until all syncs finish. Also,writeSnapshotstarted writeback beforemergeOnDemandDeltareplacedmemory-ranges, so it watched the unlinked delta file instead of the merged snapshot.StartWritebacknow pins files byFileInfoand opens/closes one file at a time while pollingcachestatand using data-onlySYNC_FILE_RANGE_WRITE(skipping unlinked/replaced inodes without holding open fds across sleeps or sync waits), and post-restore eviction usesEvictWithRetries.snapshotVMStatestarts writeback aftermergeOnDemandDelta.Local ext4 benchmark (suspend with 256MiB
memory-ranges+ 96MiBrootfs-upper.tar, followed by immediate same-node wake):main#3485only#3485+#3477tar_createupper_joinAI use: AI-assisted, I reviewed and tested it.