feat(uffd,fc): wire balloon free-page-reporting#2541
feat(uffd,fc): wire balloon free-page-reporting#2541ValentaTomas wants to merge 6 commits intofeat/uffd-remove-events-matrixfrom
Conversation
PR SummaryMedium Risk Overview Reviewed by Cursor Bugbot for commit 417ed97. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d472bdf. Configure here.
0a2570e to
99eec35
Compare
0fd4caf to
d30e0ef
Compare
bf23242 to
6d4b734
Compare
68037d2 to
ceec7d6
Compare
d38614d to
c777e5c
Compare
ceec7d6 to
9ce0941
Compare
c777e5c to
6faaefa
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6faaefab87
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
9ce0941 to
5896b7b
Compare
6faaefa to
4bb8be8
Compare
07ab37d to
4951164
Compare
345f7e9 to
db978d4
Compare
…loon Adds the FC-side integration plumbing for free page reporting on top of the UFFD REMOVE-event handling in #2520: - template-manager proto: optional bool freePageReporting (field 17). - TemplateConfig + sandbox.Config gain a FreePageReporting bool that flows from template create → build phases (base/steps/finalize) → sandbox factory → fc.Process.Create. - fc.apiClient.enableFreePageReporting calls PUT /balloon with free_page_reporting=true after entropy setup and before VM start. - fcversion.HasFreePageReporting gates rollout to FC v1.14+. - Adds free-page-reporting LaunchDarkly feature flag. - create-build CLI: --free-page-reporting flag, defaults to enabled when FC version supports it. - smoketest: opportunistically enables FPR when the FC version under test supports it. UFFD-side changes (REMOVE handling, page tracker, race tests, fix) remain in #2520; this PR is purely the production rollout path.
…rchestrator HasFreePageReporting() was added to fcversion.Info but had zero callers in the production path. Mirror the HasHugePages() pattern: let the orchestrator derive the value from the FC version (authoritative), gated by the FreePageReportingFlag LaunchDarkly flag (default false). Also emit an env.free_page_reporting span attribute alongside the existing env.huge_pages one.
Read the Removed bitmap from PageTracker and emit it as DiffMetadata.Empty so REMOVE'd pages become uuid.Nil mappings in the snapshot header (read as zero on resume). Defensively AndNot the empty set out of dirty: settle drains make these disjoint in practice (Removed pages have no PTE, WP-async only sees present pages with WP cleared), but if the invariant ever breaks the guest's last intent for a Removed page is "free, read zero on restore" — so empty must win, not stale dirty content.
4951164 to
2f6f62a
Compare

Wires Firecracker balloon free-page-reporting through the template build into
pkg/sandbox/fc. In the orchestrator path FPR turns on only whenfcInfo.HasFreePageReporting()(FC v1.14+) AND thefree-page-reportingLaunchDarkly flag are both true;cmd/create-builddefaults to the FC-version-derived value and accepts an explicit--free-page-reportingoverride.Depends on #2545 → #2520 — without the REMOVE-event handling from #2520, FC's
madvise(MADV_DONTNEED)on balloon deflate would race in-flight pagefault workers.