feat(uffd,fc): wire balloon free-page-reporting#2541
feat(uffd,fc): wire balloon free-page-reporting#2541ValentaTomas wants to merge 12 commits intomainfrom
Conversation
PR SummaryMedium Risk Overview Potential issues: Reviewed by Cursor Bugbot for commit eedb533. Bugbot is set up for automated code reviews on this repo. 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
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.
920e8ec to
7f22709
Compare
…e comments Receiver derives freePageReporting from FC version + LD flag and never reads cfg.GetFreePageReporting(), so the proto field was dead. Removing it also kills the noisy generated pb.go diff.
A REMOVE'd page that gets a read fault before snapshot installs zero+WP+wake. The unconditional Zero->Dirty promotion stripped it from the empty bitmap while WP-async dirty scan still excludes it (WP set, no write yet), so the page fell back to the parent layer's stale content. Keep the tracker entry as Zero for that case and let WP-async surface any later write; flip the AndNot so dirty wins over empty for written pages.
…e-reporting-integration
- DiffMetadata: settle UFFD workers before sampling FC WP-async pagemap so a Zero->Write install in flight can't escape both Dirty and Empty bitmaps. - TemplateCreate: gate freePageReporting on !hugePages. Firecracker rejects balloon device + hugepages combinations, and the v1.14 rollout would otherwise auto-enable both and abort VM creation.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a092da952a
ℹ️ 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".
There was a problem hiding this comment.
Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit at claude.ai/admin-settings/claude-code.
Once credits are available, push a new commit or reopen this pull request to trigger a review.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ff748eafd3
ℹ️ 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".
Remove the !hugePages guard — hugepages and balloon FPR are not mutually exclusive in Firecracker.
There was a problem hiding this comment.
An organization admin can view or raise the cap at claude.ai/admin-settings/claude-code. The cap resets at the start of the next billing period.
Once the cap resets or is raised, push a new commit or reopen this pull request to trigger a review.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is ON. A cloud agent has been kicked off to fix the reported issue. You can view the agent here.
Reviewed by Cursor Bugbot for commit 14f995f. Configure here.

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.