Skip to content

boot: what giving memory back costs - QEMU's CPU, the host's huge pages, and using it again - #83

Merged
aledbf merged 1 commit into
mainfrom
boot/reporting-order-cost
Oct 1, 2026
Merged

aledbf merged 1 commit into
mainfrom
boot/reporting-order-cost

Conversation

@aledbf

@aledbf aledbf commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

The reclaim probe gains the costs of handing memory back. The probe is lab tooling, so nothing in the machine changes.

  • Two new columns: QEMU CPU (cumulative ms from /proc/<pid>/stat) and RAM HUGE (how much of the guest's RAM mapping the host backs with transparent huge pages, from AnonHugePages in smaps).
  • A new last step, "768 MB touched": the guest writes 768 MB to a tmpfs, which is what a workspace pays to use memory again once it was given back.

What it measured on construct (run 36931619739, 3 boots per variant, p50):

order 9 (default) order 3 order 0
guest RAM on the host a minute after the drop 346 MB 243 MB 238 MB
QEMU CPU during that minute +100 ms +130 ms +120 ms
RAM backed by huge pages after touching 768 MB 968 of 968 MB 794 of 960 MB 778 of 961 MB
768 MB touched 250 ms 290 ms 290 ms

A lower order gives about 100 MB per VM back, and only in the window after the guest frees memory. In exchange, about 180 MB of the guest's RAM ends up on 4K pages and stays there, and using memory again is about 16 % slower. The machine keeps order 9; this PR only keeps the probe that can say so again.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

…es, and using it again

page_reporting_order 0 leaves ~140 MB less of a guest's freed RAM on the
host than the default 9 (run 36881456066). Before that becomes the
machine's default, the reclaim probe says what it costs: QEMU's CPU at
each step, how much of the guest's RAM the host still backs with huge
pages, and a step that has the guest use 768 MB again.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@aledbf
aledbf merged commit 2f4b99e into main Oct 1, 2026
3 checks passed
@aledbf
aledbf deleted the boot/reporting-order-cost branch October 1, 2026 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant