Repository navigation
fix(cloudhypervisor): balloon settle counts progress only past 1% of guest memory per stall window - #330
Conversation
…guest memory per stall window Any drop in memory_actual_size reset the 2 s stall window, so a guest whose anon sat above the balloon target trickled pages and held the pause for up to the one-minute cap. A hibernate of such a guest took 14.7-59.7 s against 3.8-3.9 s without the balloon, and every exec on that VM waited it out. A settling golden frees far more than 1% per window and still reaches its target.
|
Scope note: |
Hardware verification: passSetup. Testbed host, kernel 6.18 guest, CH 750aa2b, sandboxd e38c762a. The arms swap only the cocoon binary: A = 2afbc27, B = 7b71b0f. Each run logged the 1. Anon-heavy idle hibernate. 8G guest holding 5000 MiB of anon, balloon at 50%. Runs in A B B A order, twice, so n=4 per arm. Times are the hibernate child / an exec fired on the claim at hibernate start.
2. #276 guard. Snapshot taken the moment
3. Page-cache guest. Hibernate took 2145 ms on A and 2146 ms on B, and both reached the target in 0.3–0.4 s. |
waitBalloonSettled(added in #276) reset its 2 s stall window on any drop inmemory_actual_size, even a single page. A guest whose anon sits above the balloon target can only trickle pages to the balloon, so the pause ran on until the one-minute cap.Change
docs/snapshots.mddescribes the new stall rule.TestSnapshotPauseWaitsForBalloonToSettlechanges:Evidence (hardware, through sandboxd's idle hibernate, cocoon 2afbc27, CH 750aa2b)
Guest: 8G, holding 5000 MiB of anon, balloon target 50%.
The host RSS of that guest did not fall in any balloon arm, so the wait gained nothing. #276's own case, a golden settling right after boot, freed about 280 MB in under 2 s on an 8 GiB guest. That is well above the 82 MiB step, so the step does not cut it short.
Hardware run on this branch: pending. It will cover the anon-heavy hibernate time with master vs this branch, and a golden saved right after boot still reaching the balloon target. Results will be posted here.
Gates
make lint:0 issues.linux + darwin.make fmt-check: rc 0.asl -forwarder=false ./...: clean on both GOOS.go test -race ./hypervisor/...: ok.