feat(fc): drain virtio-balloon free-page-hinting before pause#2552
feat(fc): drain virtio-balloon free-page-hinting before pause#2552ValentaTomas wants to merge 1 commit intofeat/uffd-fc-free-page-reporting-integrationfrom
Conversation
PR SummaryMedium Risk Overview Reviewed by Cursor Bugbot for commit 7619cc9. Bugbot is set up for automated code reviews on this repo. Configure here. |
e8bd708 to
bf00edc
Compare
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 bf00edc. Configure here.
263a0d0 to
f4e3ab0
Compare
Arm free-page-hinting on the existing balloon device (always set when the balloon is installed; pure runtime toggle), and on pause do a host-initiated hint+wait so MADV_DONTNEED-reclaimed pages are settled before the snapshot. Pages reclaimed this way generate UFFD_EVENT_REMOVE, which the orchestrator already tracks (parent FPR PR), so the snapshot captures them as removed instead of zero-filled. - fc/client.go: rename enableFreePageReporting -> installBalloon; always set FreePageHinting=true; add startBalloonHinting + describeBalloonHinting helpers. - fc/process.go: track balloonInstalled; add DrainBalloon (start + poll guest_cmd >= host_cmd, with host>0 guard against transient nil/zero responses). - sandbox.go: wire featureFlags into Sandbox; call DrainBalloon from Pause behind the flag. Failures are logged but non-fatal. Gated by free-page-hinting-timeout-ms (LD int flag, ms; default 0 = disabled). resume-build gains --fph-timeout-ms for local exercise.
f4e3ab0 to
7619cc9
Compare

Drains virtio-balloon free-page-hinting before pause so snapshots don't capture pages the guest already considers free. The balloon (from parent FPR PR) always arms
FreePageHinting=true; on pause we callstart_balloon_hintingand polldescribe_balloon_hintinguntilguest_cmd >= host_cmd(withhost > 0guard). Reclaimed pages emitUFFD_EVENT_REMOVE, already tracked by parent.Gated by
free-page-hinting-timeout-msLD flag (ms; default 0 = disabled). Operator opts in once the kernel has the FPH race fix. Stacked on parent FPR branch for the shared balloon-install path; split out from #2550.