Skip to content

machine: the pressure lane drops its disk from the cache before memlimit - #432

Merged
aledbf merged 1 commit into
mainfrom
fix/pressure-memlimit-cache
Nov 21, 2026
Merged

aledbf merged 1 commit into
mainfrom
fix/pressure-memlimit-cache

Conversation

@aledbf

@aledbf aledbf commented Nov 21, 2026

Copy link
Copy Markdown
Member

Why

Before the next release the gates have to be trustworthy: a lane that fails on main teaches people to re-run instead of read. task boot:pressure failed its memlimit phase on a laptop with "phase memlimit brought no Limited of memory.high" and "memory.high's reclaims did not move" (#429).

Cause

The test writes the 256 MiB second disk (lim) itself, so what of it the host still caches is charged to the test's cgroup, not QEMU's. QEMU's reads of cached pages charge nothing to QEMU's cgroup, so the memory.high set 32 MiB above QEMU's memory.current is never reached. Whether the lane passed depended on how much of the disk the host had evicted before memlimit. On a loaded host it was gone by then. On an idle one it stayed.

Evidence. The lane was run with temporary logging of QEMU's memory.current, memory.stat file and memory.events and of the disk's residency (mincore) at every phase. The test read the disk once before cpulimit, as an idle host keeps it cached after the write.

disk resident at memlimit QEMU file through memlimit memory.events high lane
main 256 MiB 17 MB, unchanged while the guest read 41 GB 0 fails with both of the issue's messages
this change 256 MiB, dropped as the phase starts 17 MB to 50 MB 33928 passes

Change

memlimit drops the disk from the host's cache (FADV_DONTNEED) before it sets memory.high, as iolimit already did for io.max. Both phases share one uncache helper.

Verified. task boot:pressure passes on the laptop (KVM, release v20261121.01). go tool task lint test mutate passes (coverage 80.5%, mutate has no non-test Go file to break).

Closes #429

🤖 Generated with Claude Code

task boot:pressure failed its memlimit phase on a laptop: no Limited
of memory.high, and memory.high's reclaims did not move (#429). The
test writes the 256 MiB second disk itself, so whatever of it the host
still caches is charged to the test's cgroup. QEMU's reads of cached
pages charge nothing to QEMU's cgroup, so the memory.high set 32 MiB
above QEMU's memory.current was never reached. Whether the lane passed
depended on how much of the disk the host had evicted by then.

Measured with QEMU's memory.stat and memory.events and the disk's
residency (mincore) at each phase, the test's own reads keeping the
whole disk cached as an idle host does: at memlimit's start 256 MiB
of the disk was resident, QEMU's file stayed at 17 MB through the
phase while the guest read 41 GB of the disk, memory.events' high
stayed 0, and the lane failed with both of the issue's messages. With
the disk dropped from the cache as the phase starts, the same setup
brought 33928 high events and QEMU's file grew to 50 MB. iolimit
already dropped the disk for io.max's sake; both phases now share it.

task boot:pressure passes (v20261121.01, laptop).

Closes #429

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aledbf
aledbf merged commit f1b71bc into main Nov 21, 2026
6 checks passed
@aledbf
aledbf deleted the fix/pressure-memlimit-cache branch November 21, 2026 21:04
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.

boot:pressure: the memlimit phase brings no Limited of memory.high on a laptop

1 participant