Repository navigation
docs: the VMMs map the snapshot MAP_PRIVATE, not MAP_SHARED (#307) - #335
Conversation
…#307) The campaign note described guest memory as "a MAP_SHARED mapping of one snapshot memory file which the worker pins once via PinMemoryFile", which collapses two different mappings into one. pin_linux.go is explicit: the WORKER maps the file MAP_SHARED and mlocks it, and "each VMM maps the same file MAP_PRIVATE" — that copy-on-write relationship is the density mechanism. rossoctl#307's measurements confirm the private side directly: /proc/<pid>/maps reads `256MiB rw-p .../memfile`, Rss is 31 MiB of the 256 MiB region with 5.7 MiB Private_Dirty, and THP is madvise with AnonHugePages: 0, so 4 KiB PTEs. The density conclusion the paragraph exists to support is unaffected — 64 VMs still read one physical copy and are still charged only for pages they dirty, which is why residency measured ~0.9 MiB per VM against a 288 MiB limit. Only the mechanism was described wrongly, and the wrong description matters because it invites reasoning about shared-mapping teardown costs that do not apply: rossoctl#307 found the reap floor is RCU grace periods in kvm_vm_release, independent of whether the mapping is shared or private. Notes the correction inline rather than silently editing, since the original claim was quoted in issue threads. Refs rossoctl#307 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
rubambiza
left a comment
There was a problem hiding this comment.
Summary
Accurate one-paragraph docs correction, verified against source. The note previously said guest memory is a MAP_SHARED mapping the worker pins, conflating two mappings; the corrected text matches remote-worker/internal/vmpool/pin_linux.go exactly — the worker maps the memfile MAP_SHARED + mlocks it once (lines 37/41), and each VMM maps the same file MAP_PRIVATE, which the function's own doc comment labels "THIS IS THE DENSITY MECHANISM" (line 14). Recording the correction inline with a dated note rather than silently editing is the right call given the original was quoted in issue threads. Net change is the single file (+8/-2), the base blob is current with main, and CI is green.
Author: pdettori (MEMBER — maintainer)
Areas reviewed: Docs (Markdown), verified against pin_linux.go source
Agent/IDE config (.claude/.vscode): none
Commits: 1 commit, signed-off: yes; conventional docs: prefix: yes
CI status: passing (all 13 checks green)
Summary
One-paragraph correction to a merged note. Docs only.
docs/notes/2026-09-22-exec-throughput-campaign-results.mdsaid guest memory is "aMAP_SHAREDmapping of one snapshot memory file which the worker pins once via
PinMemoryFile". That collapsestwo different mappings into one.
pin_linux.gois explicit:MAP_SHAREDandmlocks it, once;MAP_PRIVATE— and that copy-on-write relationship is the densitymechanism, per the function's own doc comment ("THIS IS THE DENSITY MECHANISM").
#307's measurements confirm the private side directly:
/proc/<pid>/mapsreads256MiB rw-p …/memfile,Rssis 31 MiB of the 256 MiB region with 5.7 MiBPrivate_Dirty, and THPis
madvisewithAnonHugePages: 0, so 4 KiB PTEs.Why it is worth a PR
The conclusion the paragraph exists to support is unaffected — 64 VMs still read one physical copy
and are still charged only for the pages they dirty, which is why residency measured ~0.9 MiB per VM
against a 288 MiB limit and why the tier uses 8.3 GiB of 754 GiB.
But the wrong mechanism invites wrong reasoning downstream, and did: it makes shared-mapping teardown
look like a plausible cause of Destroy's cost. #307 measured that and it is not — the reap floor is RCU
grace periods in
kvm_vm_release(rcu_barrier58%,__synchronize_srcu28%), which is independent ofwhether the mapping is shared or private. A reader starting from the old sentence would spend time on a
hypothesis the data has already closed.
Corrected inline with a dated note rather than silently edited, because the original claim was quoted
in issue threads and someone tracing it should find out what changed.
Testing
make fmtandmake lintpass. No code changes.