mirror of
https://github.com/kvcache-ai/firecracker.git
synced 2026-11-05 01:17:43 +00:00
[PR #30] feat: add explicit dirty memory clearing API #30
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/firecracker#30
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/firecracker/pull/30
Author: @Hygge-Gezelligheid
Created: 10/28/2026
Status: 🔄 Open
Base:
v1.15.1-patch-nestedvirt← Head:feat/clear-dirty-memory📝 Commits (3)
b52c645feat: add explicit dirty memory clearing API [skip ci]e9181catest: streamline CLEAR coverage and validate native Diff [skip ci]bc2020btest: verify the shared dirty baseline across snapshot consumers [skip ci]📊 Changes
9 files changed (+923 additions, -2 deletions)
View changed files
📝
CHANGELOG.md(+7 -0)📝
docs/snapshotting/snapshot-support.md(+57 -0)📝
src/firecracker/src/api_server/parsed_request.rs(+62 -1)📝
src/firecracker/src/api_server/request/snapshot.rs(+37 -0)📝
src/firecracker/swagger/firecracker.yaml(+36 -0)📝
src/vmm/src/rpc_interface.rs(+300 -1)📝
tests/framework/http_api.py(+3 -0)➕
tests/host_tools/dirty_memory_helper.c(+66 -0)➕
tests/integration_tests/functional/test_dirty_memory_clear.py(+355 -0)📄 Description
External memory exporters can query dirty ranges, but GET preserves their logical dirty records. Add
PUT /vm/dirty-memory-ranges/clearto retire those records after committing a snapshot and establish the baseline for subsequent incremental exports.Behavior
{}and return204 No Content; require a started, paused VM with dirty tracking enabled.The cross-consumer test verifies the omitted A against the wrong S0 base, restores the standalone native Diff from the correct S1 base, then performs another CLEAR and native Diff after restore. No dirty GET occurs between the new guest writes and either native Diff. Other coverage includes request validation, preconditions, queue pages, zero writes, no-GET clearing, and asynchronous block activity during state capture.
Scope and baseline
This PR contains three CLEAR commits across nine files, based directly on
v1.15.1-patch-nestedvirtatc7e1cceb6bf643f239ddac804a535ceb8ac93cb1. It can be reviewed and merged independently of #27. Its required GET, memory-export and dirty-bitmap interfaces already exist in this target branch.Complete CLEAR change
Validation
Fresh validation of
bc2020bd372666919a554ab9954affc5cc80acfeon native x86_64 KVM with Rust 1.93.0:git diff --checkpassed.git range-diffconfirms that the three CLEAR patches are preserved; the only patch-context changes are in the changelog after removing the previous baseline's release section.Earlier aarch64 runs and the broader workspace, fault-injection, performance, hotplug and security runs were performed on the previous stacked history. They are historical evidence, not fresh results for this rebased head. The full workspace/security matrix and aarch64 were not rerun for this history separation.
Known limitations
Local fault injection previously reproduced the existing GET failure problem: a later slot failure loses KVM-only bits already consumed from preceding slots, and GET retry cannot recover them. This PR does not change that production path. Controlled async tests do not establish quiescence for arbitrary external memory writers.
Earlier broad validation was not fully green: it reported an existing rand unsoundness advisory, host/guest CPU vulnerability checks, ARM host/toolchain limitations, and unavailable ARM guest/cross-kernel test assets. The focused validation above does not resolve those findings or establish a complete security certification. Select the required minor API version before release.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.