Repository navigation
Conversation
) Since #645 the machine boots its vmlinux through PVH. load_elf has mapped the file since QEMU 4.2, but the machine's first reset copies its 37.4 MB of segments into guest RAM on the main thread before the monitor answers: 9.1 ms p50 on the bench (lab 45257214350). 0009 copies them in a thread at the first reset and waits for it before the vCPUs start, a migration's setup, the next reset and QEMU's exit. Bench, spin's shape, against v20261123.07: first login -8.6 [-11.0, -4.0] at 60 a side (lab 45260098299); restored -0.1 [-1.1, +0.7] evicted at 40 (lab 45260694485). boot:record passes on the patched tree (lab 45261567066). The QEMU build asserts the thread runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # docs/boot-time.md # qemu/Dockerfile # qemu/README.md
Member
Author
|
Merged main, which dropped QEMU 0007 (#660). The arms measured here carried 0007. It touches only the bzImage path, which a vmlinux boot never takes, and #660 measured taking it back as within noise. So the numbers above stand for the series as it is now (inferred). 0001-0006, 0008 and 0009 apply to 11.2.0-rc0 with |
Member
Author
|
Replaced by 710: the branch merged main, which a rebase merge refuses; the same net change as one linear commit on current main, the patch byte-identical; no force-push. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The goal is a cold boot to the first SSH login in under 100 ms. Since #645 QEMU loads the release's vmlinux for PVH, and #698 asked what that load costs QEMU's start.
load_elfalready maps the file. Upstream has done that since QEMU 4.2 (816b9fe450, Garzarella, 2019), so mapping it, the change #646 made for the bzImage, was not left to do. What is left is the machine's first reset. It copies the 37.4 MB of segments from the mapping into guest RAM on the main thread, and the monitor answers nothing until the copy is done. Traced on the bench, the copy took 9.1 ms p50 (p95 9.3, 20 boots, lab 45257214350, with a probe on branchexp/698-romcopythat is never merged). #697's ledger read the vmlinux's QEMU start at +8.4 ms over a bzImage's (lab 45260129735).What
qemu/patches/0009: at the first reset, before any vCPU has run, the ELF segments that lie wholly in one RAM region are copied in arom-copythread. QEMU waits for the thread before the vCPUs start (a VM state handler that runs first), before a migration's setup, before the next reset (a snapshot load begins with one) and at exit. A machine made for an incoming migration copies nothing at reset, as before. Later resets copy on the main thread, as before.qemu/Dockerfile: a held TCG machine with named threads is given a 256 MiB stub ELF, and the build checks thatrom-copyappears. The released QEMU fails that check and the patched one passes (laptop, 3 of 3 each).docs/boot-time.mdgets the phase row and a carried row with prior art.qemu/README.mdgets the row for 0009.docs/log.mdgets the dated entry.Measured
Bench (c8id.4xlarge, nested), spin's shape and login. v20261123.07 against the same release with this QEMU (parts run 45257975711), interleaved:
The gain matches the whole traced copy. The restore does not move, as expected: under
-incoming deferthe reset copies nothing.The record
The record does not move. The patch adds no device, property,
-machineoption or RAM block.boot:recordpasses on the patched tree (lab 45261567066). A resumed guest keeps its saved kernel:rom_resetstill skips every ROM while the machine is ininmigrate, and the thread only starts for the copies it queues.Caveat
A monitor command that reads guest memory while the machine is held, before its first
cont(pmemsave,dump-guest-memory), can see a kernel that is only partly copied. The patch header says so. spin issues neither.Found along the way: #705 (not-affected). QEMU's
load_elfhits SIGFPE on a note segment withp_align0.🤖 Generated with Claude Code