mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #218] [CLOSED] feat: add mincore snapshot profiling and KVM prefault #259
Labels
No labels
bug
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/AgentENV#259
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/AgentENV/pull/218
Author: @Hygge-Gezelligheid
Created: 8/25/2026
Status: ❌ Closed
Base:
main← Head:agent/idle-page-prefault-mvp📝 Commits (2)
993795dfeat: add mincore snapshot prefault7fecb35test: cover restore prefault fallbacks📊 Changes
82 files changed (+2908 additions, -109 deletions)
View changed files
📝
Cargo.lock(+1 -1)📝
Cargo.toml(+1 -1)📝
Makefile(+3 -1)📝
config/default.toml(+17 -0)📝
crates/linux-cap/src/lib.rs(+6 -0)📝
docs/src/getting-started/quickstart.md(+2 -1)📝
docs/src/troubleshooting/common-issues.md(+15 -0)📝
src/bin/server.rs(+6 -0)📝
src/cfg.rs(+57 -0)📝
src/privileges.rs(+100 -5)➕
src/sandbox/firecracker/idle_page_tracking.rs(+738 -0)📝
src/sandbox/firecracker/instance.rs(+257 -2)📝
src/sandbox/firecracker/manifest.rs(+393 -1)➕
src/sandbox/firecracker/mincore_tracking.rs(+302 -0)📝
src/sandbox/firecracker/mod.rs(+8 -1)➕
src/sandbox/firecracker/prefault.rs(+219 -0)📝
src/sandbox/firecracker/sandbox.rs(+474 -25)📝
src/sandbox/mod.rs(+1 -0)📝
src/sandbox/ublk/device.rs(+41 -0)📝
src/template/runner.rs(+37 -7)...and 62 more files
📄 Description
Summary
Add opt-in snapshot working-set profiling based on
mincore, persist guest-physical-address working-set metadata, and pre-fault that metadata through Firecracker v1.15.1-patch-v2 before a restore resumes. The default configuration remains disabled.This Draft PR consists of
993795d1bc5ff4e563e68e7f39440cbe866bf7c9(feat: add mincore snapshot prefault) and7fecb35a57351450321e844d3ca734d2057ba164(test: cover restore prefault fallbacks).Firecracker dependency scope
PUT /vm/pre-fault-memory, dirty/resident ranges, and guest-memory regions withguest_phys_addr.config/deps_manifest.tomldeliberately remains at the released1.15.1-patch-v1asset. No v2 tag or Release exists yet, so changing it would make the installer resolve an unpublished dependency.Behavior and safety
mincore; Linux idle-page tracking is retained only as explicittracker = "idle-page"opt-in. The normal service/capability runner keeps onlyCAP_NET_ADMINandCAP_SYS_ADMIN;CAP_DAC_OVERRIDEis required only for explicit idle-page mode.Compatibility evidence
A server runtime check created a paused file-memory snapshot with the existing Firecracker v1.15.1 artifact (
snapshot version v9.0.0) and loaded it with the v2 candidate, alsov9.0.0. The v2 VM accepted guest-memory-regions, dirty-memory-ranges, and a valid KVM pre-fault request after loading the old snapshot. This is direct old-v1-to-v2 snapshot compatibility evidence for the file-memory route; it is not a full OverlayBD/AgentENV fixture run.Validation
Passed on
agentenv-labafter loading its existing Rust environment (rustc/cargo 1.95.0):cargo fmt --all -- --checkgit diff --checkand committedgit diff --check HEAD^ HEADcargo check --all-targetscargo clippy --all-targets -- -D warningsmake test-unit: AgentENV 775 passed / 6 ignored, linux-cap 4 passed, capability-runner ignored subset 4 passed, UBLK 8 passed, UBLK daemon 46 passed, installer/capability scripts passedcargo check --all-targets,cargo clippy --all-targets -- -D warnings, and full AgentENV library tests (778 passed / 6 ignored) passed.firecrackerandcpu-template-helper; the aarch64 artifact passed ELF/static-link inspection.Not executed / limitations
SwapTotal: 8388604 kB; the implementation intentionally refuses profiling in that condition and does not alter host swap. Suitable no-swap fixture infrastructure is still required.Review focus
Please review the generated v2 OpenAPI client update, the explicit capability split for idle-page mode, mincore range/GPA validation, and the pause/resume/error paths around profiling and restore pre-faulting.
No Firecracker tag, AgentENV tag, or Release has been created or published.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.