Repository navigation
feat: add dirty memory clear API - #30
Open
Hygge-Gezelligheid wants to merge 1 commit into
Open
Hygge-Gezelligheid wants to merge 1 commit into
Hygge-Gezelligheid wants to merge 1 commit into
Conversation
Hygge-Gezelligheid
force-pushed
the
feat/clear-dirty-memory
branch
from
October 28, 2026 01:23
0647636 to
5ffdcc0
Compare
Hygge-Gezelligheid
changed the base branch from
v1.15.1-patch
to
v1.15.1-patch-nestedvirt
October 28, 2026 01:23
Hygge-Gezelligheid
force-pushed
the
feat/clear-dirty-memory
branch
5 times, most recently
from
October 30, 2026 07:32
59eadc7 to
5aa55d5
Compare
Add PUT /vm/dirty-memory-ranges/clear for paused microVMs with dirty tracking enabled, or succeed without clearing when tracking is disabled. Clear KVM and Firecracker dirty records, then mark activated virtio queue memory dirty using existing interfaces. Document the shared baseline for native and external snapshots and non-atomic failure semantics. Cover API validation, clearing behavior, and incremental restore across snapshot consumers. Signed-off-by: Yicheng Lin <linyc25@mails.tsinghua.edu.cn>
Hygge-Gezelligheid
force-pushed
the
feat/clear-dirty-memory
branch
from
October 30, 2026 07:34
5aa55d5 to
5d47924
Compare
Hygge-Gezelligheid
marked this pull request as ready for review
October 30, 2026 07:38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
PUT /vm/dirty-memory-ranges/clearso external snapshot consumers can clear dirty records after committing a snapshot. The endpoint accepts{}, returns204on success, and supports only PUT.With dirty tracking enabled, it clears KVM dirty logs and Firecracker bitmaps, then conservatively re-marks activated virtio queue pages as dirty. With dirty tracking disabled, it returns success without performing any clearing.
Usage constraints
mincoreto query page residency. CLEAR does not establish an incremental baseline or guarantee that the next export contains only new writes.Validation
All 9 CLEAR unit tests passed on ARM64, covering:
/clear.All 4 real-guest integration cases passed, testing the following flows with PCI both enabled and disabled:
204, with memory contents, GET results, and pause state unchanged; the VM can subsequently resume.Swagger validation and relevant formatting and static checks passed. Historical full-suite runs on x86 and ARM additionally covered an incorrect S0 base, another CLEAR/Diff/restore cycle after restoration, external-only incremental recovery, and background I/O. These results are retained as one-off validation records. x86 was not rerun in this round.