Skip to content

boot: page-cache, the host's cache and the guest's, measured - #57

Merged
aledbf merged 1 commit into
mainfrom
boot/page-cache
Oct 1, 2026
Merged

aledbf merged 1 commit into
mainfrom
boot/page-cache

Conversation

@aledbf

@aledbf aledbf commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Adds a lab probe, task boot:page-cache (lab option boot:page-cache), that answers three questions nothing in the repo measured:

  1. Cold boot vs warm boot. Before each cold boot, the release's files are dropped from the host's page cache one file at a time with POSIX_FADV_DONTNEED (never drop_caches, which would also drop the other runners' cache). The probe interleaves cold and warm boots, reports p50/p95, and how much of the base image a cold boot reads.
  2. Double caching. The guest writes and reads a file. The probe measures how much of the overlay is in the host's page cache (mincore), with the default disk mode and with --disk-direct-over-backing.
  3. Whether the guest's page cache comes back to the host. The probe records QEMU's RSS at each step: idle, file written, guest cache full, guest drops its cache, file removed.

The overlay is created at 2 GiB and the guest's root filesystem is grown into it, so the file has room; the base image is not touched. A failed write in the guest fails the probe instead of being hidden.

One run on a laptop (REPS=1, v20260930.02), for orientation only; the lab runner's numbers are the ones to read:

writeback direct overlay
overlay in host cache after a 512 MB write 514 MB, kept after the guest drops and removes the file 2 MB
write 512 MB + fsync 963 ms 350 ms
re-read with the guest's cache empty 52 ms 112 ms
QEMU RSS, guest cache full → guest drops it 741 → 231 MB 738 → 212 MB

A cold boot reads 47 MB of the 830 MB base image.

Checked here: task lint, task test, and the probe end to end.

🤖 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.

Three questions nothing here measured, one probe (task boot:page-cache,
the lab's boot:page-cache):

- a boot cold against warm: the release's files dropped from the host's
  page cache first, file by file with POSIX_FADV_DONTNEED - never
  drop_caches, which takes every other runner's cache on the host - and
  how much of the base image a cold boot reads;
- what a guest's writes cost the host twice: the overlay's pages in the
  host's cache (mincore), with the disk as it is and with
  --disk-direct-over-backing;
- whether the guest's page cache comes back: QEMU's resident memory at
  each step of a file written, read, dropped and removed.

One rep on a laptop (2026-10-01, v20260930.02): a cold boot reads 47 MB
of the 830 MB base; writing 512 MB leaves 514 MB of the overlay in the
host's cache with writeback, kept after the guest drops and removes it,
and 2 MB with the overlay O_DIRECT; QEMU's RSS returns when the guest
drops its cache (free page reporting), not before. The lab's numbers are
the ones to read.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@aledbf
aledbf merged commit f8af82d into main Oct 1, 2026
7 checks passed
@aledbf
aledbf deleted the boot/page-cache branch October 1, 2026 00:53
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