From a20873f90df718b0687a0d99e650fa6f75f6fef2 Mon Sep 17 00:00:00 2001 From: Manuel de Brito Fontes Date: Mon, 23 Nov 2026 18:52:55 -0300 Subject: [PATCH 1/3] docs: the log's entries in date order, one blank line between them (#709) The split into one file an entry (#709) renders the log in date order with a blank line between entries. Eight entries sat out of date order (two 11-20 entries among the 11-19s, six 11-21 entries before the last 11-20s, under week 11's heading) and four had no blank line before the next. This commit only moves lines: the non-blank lines are the same multiset, and the week headings are unchanged. Co-Authored-By: Claude Opus 5.5 --- docs/log.md | 48 +++++++++++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/docs/log.md b/docs/log.md index cadd06bb..4299085c 100644 --- a/docs/log.md +++ b/docs/log.md @@ -313,7 +313,6 @@ Measured and not shipped: **11-13 · image · udev's coldplug keeps cpu (this change).** The coldplug filtered in `630fa2c` left out cpu, and a core attached before systemd starts is onlined by that replay reaching `40-spin-hotadd.rules` and by nothing else. spin gives a workspace its cores while its own init is PID 1, so with v20261113.03 every workspace came up with one core whatever it was sized to (spin's kvm run 43527839765, four tests "still waiting for the guest to have its floor's two cores"). `task boot:hotadd` attaches a core before systemd and reads `online` after: `0` on v20261113.03's image, `0-1` with cpu in the filter. What cpu costs the first login was not measured; it is one device per core. - ### Week 11: 2026-11-14 to 11-20 **11-19 · image · systemd from Ubuntu's source package, stage1 (this change).** The image installs Ubuntu's own systemd 259.9-0ubuntu0.1, rebuilt from its .dsc (versions.yaml `systemd-source`) by `image/systemd/Dockerfile`. The build uses Debian's `stage1` build profile (no BPF framework, audit, AppArmor, SELinux, OpenSSL, TPM2, homed, cryptsetup…) and links systemd-executor, udevd, systemctl and journalctl statically against libsystemd-shared. The packages are versioned `+spin1` and held. *Why:* PID 1 spent ~25 ms in the BPF verifier on socket-bind at every boot (#240, "measured, nothing done"), and restrict-fs failed to load under lockdown on every boot (#261). *Measured:* @@ -369,10 +368,6 @@ Bench, nested (2026-11-19): it costs nothing measurable. `boot:initcalls` in the **11-19 · machine · a place is a filter node (this change, functional).** A place's node was raw over the bound disk's top image. spin's storage compacts a chain by rewriting a bound image's backing file (`change-backing-file`), which QEMU takes only on a root node whose chain, followed by backing and filter links, contains the image: on the root it answered "'slot0' and image file are not in the same chain", on the image "Need a root block node" (QEMU 11.2.0-rc0). A place is now a `throttle` node in a group with no limits: a filter, so the chain is seen through it, and pass-through. copy-on-read, compress and preallocate are filters too, and each changes what is written. Checked on QEMU 11.2.0-rc0: bind by `blockdev-reopen`, then `change-backing-file` through the place, then a seal under an overlay. The fingerprint does not move (`-object` is not in `Contract`). Its cost per I/O is the bench's to say. -**11-20 · machine · a named CPU model, what it costs (#222).** spin-machine can show the guest a named model the fleet shares (`CanResume`, `Models`, `Baseline`, #293). The question left was its cost. The bench host is nested, and its L0 hides features the Xeon 6 has (la57, TSX, fsrm): QEMU refuses GraniteRapids-v1, SapphireRapids-v1 and Icelake-Server-v2 there ("Host doesn't support requested features", lab 44657973748, cancelled after 50 minutes of boots each waiting out its login; `lab` now refuses such a tree at its first boot). The newest model it runs, chosen on the runner (`lab tree --cpu baseline`), is Cascadelake-Server-v5. Against `-cpu host`, 20 boots each, interleaved: the cold boot's first login 327/342 → 343/353 ms (+16.4, sshd accepts +12.6; lab 44664362024); the restore's 160/170 → 161/170 evicted and 167/188 → 165/203 cached (lab 44664603720). A fleet that takes a baseline model pays ~16 ms on every cold boot for checkpoints that cross host generations. On one generation `-cpu host` with `CanResume`'s feature check is free. - -**11-20 · lab · density, the latency half (#273).** #278 answered the memory half (an idle workspace costs its host ~165-170 MiB). `lab` probe `density` boots the row's number of workspaces, logs into each, lets them settle 10 s, times one more's first login, and ends them all before the next measurement. On the bench (c8id.4xlarge, 16 vCPUs, 32 GiB, nested), 2 vCPU / 2 GiB workspaces, idle, 10 of each interleaved: with 0, 4, 8 and 16 already running the first login is 332/343, 328/340, 328/345 and 326/338 ms (lab 44667235868). Each of the crowd took ~625 ms to boot and log into. Idle workspaces do not move the first number up to 16 on this host. The 25% point is past that. Not measured yet: a CPU-bound crowd (`load=cpu`), more than 16, and metal. A first run left every crowd up until the experiment ended (m.Cleanup runs then) and measured a host carrying a growing pile of machines (lab 44665519945); the probe ends its crowd itself. - **11-19 · kernel · branch `kernel-floor`, patches 0007-0011 and a config trim (this change).** The kernel was 78.0 ms nested against 45.0 on metal, same CPU (boot:initcalls, labs 44563496308, 44563512999). Five of its gaps, each a patch: - 0007, ORC's lookup table by one merge pass instead of 59,650 binary searches: 3.5 ms on both hosts. Every block checked against the binary search, 0 differ. - 0008, init's 1,989 ftrace records freed with one memmove: 2.6 ms on both hosts. @@ -395,26 +390,16 @@ Checked against the probe it replaced on the bench fleet, `lab dispatch ssh-firs **11-19 · lab · the release report is a ladder (this change).** The report measured each release alone, through the feature matrix (eight combinations of memory, vsock and hotplug, and the image's boot variants, each timed to the serial console's prompt), and compared its report.json with the previous release's, taken on another day on another instance. For v20261119.02 it said sshd accepted 7.3% later than v20261119.01 (202.6 → 217.3 ms); the two interleaved on one host said 199 → 198 (lab 44583379559). And the goal's second number, a restore to the first login, was not in it. Now `spin-machine-dev lab ladder` boots the newest five releases on one bench host, each with the spin-machine of its own commit, interleaved: a cold boot and a restore to the first login, both into a QEMU started ahead, and save, state, the kernel and QEMU's RSS as diagnostics. report.yml runs it after each release (ladder.json beside it, the table in its notes) and weekly. A release whose spin-machine cannot run a probe is a dash with the reason. boot:compat is now `lab compat`: every release since the fingerprint last moved, fetched against its sha256 and signature, and CanResume held to QEMU's one-way promise against each one's QEMU. The feature matrix is deleted: its last answer is v20261119.02's report.json asset and the "Feature matrix" section of its notes (no row moved beyond 5%, every row 344-389 ms usable), and git has the code (boot/report.go, boot/report_test.go). *Status:* the report measures each release alone since 11-20 (#314); `lab ladder` and `lab compat` in place. +**11-20 · machine · a named CPU model, what it costs (#222).** spin-machine can show the guest a named model the fleet shares (`CanResume`, `Models`, `Baseline`, #293). The question left was its cost. The bench host is nested, and its L0 hides features the Xeon 6 has (la57, TSX, fsrm): QEMU refuses GraniteRapids-v1, SapphireRapids-v1 and Icelake-Server-v2 there ("Host doesn't support requested features", lab 44657973748, cancelled after 50 minutes of boots each waiting out its login; `lab` now refuses such a tree at its first boot). The newest model it runs, chosen on the runner (`lab tree --cpu baseline`), is Cascadelake-Server-v5. Against `-cpu host`, 20 boots each, interleaved: the cold boot's first login 327/342 → 343/353 ms (+16.4, sshd accepts +12.6; lab 44664362024); the restore's 160/170 → 161/170 evicted and 167/188 → 165/203 cached (lab 44664603720). A fleet that takes a baseline model pays ~16 ms on every cold boot for checkpoints that cross host generations. On one generation `-cpu host` with `CanResume`'s feature check is free. + +**11-20 · lab · density, the latency half (#273).** #278 answered the memory half (an idle workspace costs its host ~165-170 MiB). `lab` probe `density` boots the row's number of workspaces, logs into each, lets them settle 10 s, times one more's first login, and ends them all before the next measurement. On the bench (c8id.4xlarge, 16 vCPUs, 32 GiB, nested), 2 vCPU / 2 GiB workspaces, idle, 10 of each interleaved: with 0, 4, 8 and 16 already running the first login is 332/343, 328/340, 328/345 and 326/338 ms (lab 44667235868). Each of the crowd took ~625 ms to boot and log into. Idle workspaces do not move the first number up to 16 on this host. The 25% point is past that. Not measured yet: a CPU-bound crowd (`load=cpu`), more than 16, and metal. A first run left every crowd up until the experiment ended (m.Cleanup runs then) and measured a host carrying a growing pile of machines (lab 44665519945); the probe ends its crowd itself. + **11-20 · lab/machine · multifd channels on the checkpoint, the no-systemd floor, and spin's shape (#320, lab 44750713447, lab 44750322384).** The two experiments of the methodology review, and the first runs in spin's shape (#319). *multifd:* `spin-machine save` and `restore` move a checkpoint's memory over `--channels` threads (QEMU's multifd on mapped-ram); with QEMU started ahead, in the ladder's shape, the restore's first login reads 140.9/152.0 at one channel, 140.5/178.0 at two (inside the noise), 101.5/117.4 at eight and 93.5/114.9 at sixteen, Δp50 −47.4 [−54.4, −39.4]: the first goal number under 100 ms. In spin's shape the p50 falls 149 → 114 but ~20% of restores with channels (56 of 280) stall ~400 ms between running and the login, against 5% at one, and the p95 goes 254 → 435. *Floor:* `lab tree --edit floor` boots sshd with no systemd before it, a bound only: the ladder's shape 322 → 219 (Δ −103.5 [−108.6, −100.5]), spin's 445 → 240 (Δ −204.8); sshd accepts at 173 and 189 ms with nothing before it. *Spin's shape:* the cold first login is 445 ms against 322, Δ +122.9 [+116.6, +129.8]; accept to login 214 against 114. *Later the same day:* the stall was a guest left at 128 MiB. At 128 MiB MGLRU's `min_ttl_ms` (armed by tmpfiles at boot) forbids eviction for the first second, so the guest OOM-kills sshd-session, logind and systemd units, and the client retries (lab 44784196287: kills up to 27, failed logins up to 14 a login); a second, idle ~400 ms stall in states saved with 8 channels sat inside sshd's key authentication. spin sizes every workspace to 2048 MiB right after its start (spin's `vmm.resize`), and sized so (`plugged=2048`) neither appears: no kills, every row's gap p95 under 69 ms (lab 44788801555). Restored into a QEMU started ahead, spin's shape and login: 150/156 at one channel, 103/108 at 8, 92.7/111 at 16, Δp50 −57.4 [−59.4, −54.3], and 16 against 8 −11.0 [−13.0, −7.9] (lab 44789688221). *Status:* channels kept. Restores run side by side decide the default count: 8 since 11-20 (#332). The floor edit is kept as the bound's instrument. **11-20 · qemu/machine · the hotplug controller scans the places it has (#324, lab 44788216590).** In spin's shape the 4 hotplug disks' virtio-scsi controller made the guest scan 256 targets at boot: `virtio_scsi_init` 12.1 ms (lab 44587603255), ~460 of the boot's exits (QEMU's trace, laptop). `qemu/patches/0002` gives virtio-scsi a `max_target` property (default 255, a disk plugged above it is refused, the build asserts the property), and the machine sets it to the hotplug disks less one, so the guest scans the places a disk can be attached to and no more. Every place is still scanned, unlike `scsi_mod.scan=manual` (rejected: it loses disks); 4 disks attached to a running guest all appear. On the bench, spin's shape (`plugged=2048`, `login=spin`), 20 each against the same QEMU without the property: first login 512/531 → 503/514, Δp50 −8.9 [−15.5, −0.9], sshd accepts −10.3 [−18.8, −0.2], the console prompt −12.5 [−19.0, −5.3]. The fingerprint moves for machines with hotplug disks, so their older checkpoints boot cold. In the same run `CONFIG_SCSI_SCAN_ASYNC` (#325) read −2.6 [−8.9, +6.8]: rejected. The decompressor without its VGA cursor (#328) and an uncompressed payload (#326) are in "Measured and rejected" (docs/boot-time.md). *Status:* kept. **11-20 · machine/lab · a checkpoint's memory moves on 8 channels by default (this change, lab 44792429636).** One restore at a time, 16 channels were best in spin's shape (92.7 against 103 at 8, lab 44789688221), but each channel is a thread of QEMU's and restores share a host. `lab` probe `restore-together` lets 1, 4 and 8 restores go at once, each from its own checkpoint into its own QEMU started ahead, evicted from the page cache. On the bench (spin's shape and login, 30 bursts, first logins pooled; the pooled interval is narrower than the truth, since restores in one burst are not independent): alone 152 / 100 / 90.2 ms at 1 / 8 / 16 channels; 4 at once 184 / 140 / 143; 8 at once 400 / 329 / 337. Against 8, 16 gains −10.1 [−12.2, −7.6] alone and loses +3.2 [+1.1, +5.8] at 4 at once (+10.9 [−4.7, +30.4] at 8). The rule set before the run picked 8: it gains on 1 at every count. `machine.DefaultChannels` is 8. A Save or Load that names a count, and `spin-machine save/restore --channels`, still choose any. A fast load or a stream state stays at one thread. The release record's restore numbers measure each release at its own default, so this release's Δ against the one before it is the change. Eight restores at once take ~330-400 ms whatever the count: what a host does with a burst is its own question. *Status:* kept. -**11-21 · lab · the probes boot, size and log in as spin does, unless asked (this change).** #319 made spin's shape the probes' default, but left the guest at 128 MiB and logged in by the lane, and both made numbers spin never sees: at 128 MiB the guest OOM-kills its way through the boot (lab 44784196287), and on spin's path the cold first login read 532 ms where the lane's read 445 (labs 44785179901, 44750322384). `plugged` is now 2048 and `login` spin unless a run says otherwise; `plugged=0 login=lane` with the old shape options is the shape before. The release records measure what the probes measure, so the first record after this one is the first in spin's shape, and its pair's Δ (`against`) is measured in the same shape. The `floor` edit's sshd serves the lane, so a floor run passes `login=lane`. - -**11-21 · image/lab · where one vCPU's time goes before the first login, and what the CPU weights do (laptop leads, PR #329 closed).** With the guest sized to 2048 MiB (`plugged=2048`) one vCPU adds ~85 ms to the first login against two, on the lane and on spin's path alike (4 boots each). The guest spends ~225 ms of CPU to the login either way, with 0 ms idle at one vCPU: the second CPU used to run beside the login what one CPU runs before it, and no unit waits longer of its own. Up to the login, in ms of CPU at one vCPU on spin's path: PID 1 ~49, udevd with its workers, trigger and credentials ~41, the kernel and its threads ~31, the lingering user@1000 ~20 (gone since #327), `ssh.service` with its `sshd -t` ~20, journald ~13, logind ~13, the session ~9-12, dbus-broker ~7, the host-key generation ~5, getty ~3. `StartupCPUWeight=1` on udevd and its coldplug trigger took the lane's first login 285 → 240 ms (Δp50 −45.7 [−49.3, −35.8], 12 boots each) and did nothing on spin's path (308 against 307): there `ssh.service` and the forwarder wait for `basic.target`, which waits for udev, so its CPU is on the login's path whatever its weight. `children_max=2` and journald's `ReadKMsg=no` gained nothing. On spin's path the host keys `spin-machine-sshd-keygen` makes are not loaded (spin's own key comes first), ~5 ms of CPU `ssh.service` waits for: spin could mask the unit at its handoff. Not benched. The lever is the order spin starts the login in (docs/boot-time.md, "Open experiments"). - -**11-21 · lab · restores in a burst (lab 44792429636).** Beside picking 8 channels (above), `restore-together` showed that 8 restores let go at once take ~330-400 ms each to the first login at any channel count, against ~100 alone and ~140 four at once. Not explained (docs/boot-time.md, "Open experiments"). - -**11-21 · image · spin's login path starts from the boot's first dispatch, beside udev at the lowest weight (lab 44805051310, PR #338's edits).** docs/boot-time.md's "Open experiments" row, a bound on spin's path. ssh.service alone without default dependencies had still started right after basic.target: it is after Ubuntu's `sshd-keygen.service`, wanted by it and with default dependencies, whose `ConditionFirstBoot` never holds here: a job waits for its ordering before PID 1 checks its condition. logind and dbus-broker had none, but `PrivateTmp=` orders a unit after `systemd-tmpfiles-setup.service`. `lab` edits `login-early` (ssh.socket, ssh.service, sshd-keygen and the probe's forwarder without default dependencies, shutdown conflicts kept; logind and the broker with `PrivateTmp=no`) and `udev-startup` (udevd and its trigger at `StartupCPUWeight=1`). On the bench, spin's shape and login, v20261120.03, 20 boots each interleaved: `login-early` first login −10.8 [−16.3, −5.2], sshd accepts −33.6, accept to login +23.0, console prompt +18, because with the login early it ran beside udev's coldplug on the one vCPU. Both edits −59.4 [−65.9, −56.2], accepts −56.0, accept to login −4.6, second login +6.1 [+3.7, +7.9], console prompt +51.4 (the serial getty waits for dev-ttyS0, which the coldplug announces). On a laptop, sessions had their `XDG_RUNTIME_DIR`, no unit failed and poweroff stopped QEMU in ~123 ms as the release does. *Side effects:* logind and the bus share the machine's /tmp (read-only to logind under ProtectSystem=strict); the console prompt later; udev's coldplug finishes later. *Status:* the image's half kept (`image/`: the three `10-lane.conf`, `30-privatetmp.conf`, `20-startup.conf`, asserted by build.sh). spin's supervisor forwarder is spin's to order, proposed in docs/boot-time.md's "Open experiments". parts.yml keeps no image artifact, so the image is measured as the release with `--edit lane`, which now carries these drop-ins, and `--edit forwarder-early` orders the probe's forwarder as spin's supervisor would be. A laptop lead, 8 boots each: the image with the forwarder as spin orders its supervisor today (after basic.target) +21.3 [-46.1, +261.0], with it early -56.0 [-116.5, +169.8]: with udev at the lowest weight, basic.target can come later, and the image alone may cost spin until its supervisor moves. The bench decides. - -**11-21 · lab/machine · the restore into a QEMU started ahead, taken apart (laptop leads; the `split` probe, branch `restore-split-lab`, not for main).** 106/112 ms on the bench (lab 44798669409): running at 59, the login ~47 after. `lab` probe `split` runs the prestarted QEMU under its trace with host timestamps and reads the guest's journal and per-task CPU. *To running* (laptop, spin's shape, 8 channels, state evicted, 24 restores): spin-machine's exec and dial 2.1 ms, ~20 QMP round trips to migrate-incoming 6.0 (query-cpu-model-expansion 0.5 of it, each round trip ~0.25), the header 1.5-9 (the first read of a cold file), the RAM load 50.4, the device state 3.4 (~0.4 a virtio device), to running 1.1, the reply 1.5. The state is 181 MiB of data: the guest's ~117 MiB in use, the memmap of 2 GiB plugged, the kernel; settling 10 s before the save took off 3 MiB, so free page reporting has little to give. Read from the page cache the load is ~10 ms instead of 50 (running 29.6 against 78, 6 each), so the load evicted is the disk. `direct-io` (O_DIRECT for the channels) was within the noise evicted and +45 ms cached. *Running to the login* (laptop ~33 ms, guest clock from vmgenid's "crng reseeded due to virtual machine fork"): the accept probe's connection ~5 ms (socat's child, sshd forking an sshd-session that reads EOF), the connection to "Accepted publickey" ~22, the session and `true` ~4. A second login right after reads 25-29, so the restore costs the first login ~5 ms over a warm one here. The probes' logins were never closed (`Key.Run` gave Go a blocking socket, closed only once nothing read it): the checkpoint held the cold login's session, and the restore's vsock transport reset tore it down beside the login timed. Closing it: 37.1 → 34.8 ms after running, dropping the accept probe as well 31.5 (8 each). *On the bench* (spin's shape, v20261120.03, 20 each): `split` (lab 44809015139) read to running 58.7 ms, of it the RAM load 38.8, the QMP round trips 8.3, the dial 2.3, the device state 4.5; the login left open cost the first login ~5 ms (104 → 99.1), the accept probe ~4 more (95.3). `prestart` (lab 44809512339), the read-ahead against the release: restored into a QEMU started ahead 95.0/100 → 82.1/87.4, Δp50 −12.9 [−14.7, −9.8], running −11.9; restored −12.1 [−15.3, −8.9]; the cold boots within the noise. *Changed:* the probes close their logins; `machine.Resume` reads the state's data ahead from its first line. spin resumes through `machine.VM.Resume` (`internal/runner/qemu/checkpoint.go`), so it takes the read-ahead with the pin. *Status:* kept. - -**11-21 · lab · where a burst of restores waits (laptop leads; this change).** Lab 44792429636's samples, read again: the eight-at-once rows read ~210 ms to the first login (running 165-177) in their first three bursts, at 1, 8 and 16 channels alike, and 285-480 in every burst after; the extra is before running (1 channel: running max 168 → 369 p50, the median login 44 ms after it both times; 8 channels 166 → 272, 46 → 67 after), one and four at once at 8 and 16 channels do not move over the run, four at once at 1 channel creeps 165 → ~190, and no restore is slower for its place in the order (each index's mean rank 2.8-4.1 of 0-7). A host whose state changed during the run, which only a burst feels. `restore-together` now records what the host counted during each burst (PSI stall time of CPU, I/O and memory; `/proc/vmstat`'s direct reclaim, compaction stalls and huge-page fallbacks, MiB read; CPU busy; memory free and cached going in) and every restore's `running`, and takes `states=cached` (the disk out of the burst) and `defrag` (the host's THP defrag policy for the burst). *Laptop, i9-13900HK, not nested, 5-6 bursts a row, leads only:* 8 at once from the disk read 590-740 ms against 107-110 alone, the disk the bound (1.4 GiB at ~2.7 GB/s, I/O PSI full ~120-260 ms a burst) with or without huge pages. From the page cache: 440-445 ms under the default `madvise`, with ~3000 compaction stalls that all failed, ~2.4 GiB scanned by direct reclaim and memory PSI full ~250 ms a burst, and 85% of 20 CPUs busy; 133 ms with huge pages off for QEMU (PR_SET_THP_DISABLE, a wrapper, Δ −307 [−437, −156]); 150 under `defrag=defer` with no compaction and memory PSI 3 ms. Alone, huge pages off cost +16.0 [+8.9, +22.6] after running (the guest on 4 KiB pages), and `defer` 74.5 → 80.3 (5 each). QEMU marks guest RAM MADV_HUGEPAGE, so under `madvise` every fault of a load that finds no free 2 MiB block compacts and reclaims before it returns: one restore finds the ~90 blocks it needs, eight need ~700 at once and fight over them, and a host that has run a while (a page cache full of states, the bench after its first ~20 GiB) has none to spare. spin restores workspaces concurrently (spin-stack/spin at 1bd3414: an actor goroutine per workspace in `internal/runner/reconcile`, a per-workspace lock in `workspace.Manager.Resume`, up to 10 commands at once in `handler`), and leaves the host's THP policy as the distribution sets it. *On the bench* (lab 44810128678, v20261120.03, spin's shape, 8 channels, 30 bursts a row, every restore one sample): under `defer` against `madvise`, 1 at once 99.6 → 99.5, Δ −0.1 [−2.0, +1.6]; 8 at once from the disk 283/384 → 239/281, Δ −44.1 [−53.2, −35.2]; from the page cache 1 at once 72.3 → 72.0, 8 at once 268/317 → 193/241, Δ −74.9 [−83.2, −64.9]. *Decided:* THP defrag `defer` is a requirement of spin's host (`/sys/kernel/mm/transparent_hugepage/defrag`; `docs/memory-and-disk.md`): it gains in a burst and costs one restore alone nothing, spin never sets the policy and Ubuntu's default is `madvise`. *Not explained:* 8 at once under `defer` still read ~190-240 against ~100 alone, and from the cache barely less than from the disk. `restore-together` now records where a burst ran on the host's CPUs: each CPU's busy time (/proc/stat) and interrupts by line (/proc/interrupts), the CPUs QEMU's running threads were on, sampled every 5 ms, and the QEMUs', the job's CPU lists and irqbalance. It records them because nothing pins QEMU (spin-machine runs it with `-sandbox resourcecontrol=deny`, spin sets only a cgroup `cpu.weight`) and one CPU taking the disk's interrupts or the threads would look like this. *Where on the host's CPUs* (lab 44817486118, v20261120.04, 20 bursts): not one CPU. In the 8-at-once rows the busiest CPU held 6-7% of the busy time (16 CPUs evenly would be 6%), CPU 0 was busy 212-270 ms a burst against the others' 221-276, the interrupts were spread (the busiest CPU 7%, an NVMe queue on top), irqbalance runs, and the job and every QEMU may run on 0-15; QEMU's threads ran on every CPU about alike. What the burst is instead: the host's CPUs 72-78% busy (CPU PSI some 84-190 ms a burst), so 8 restores of ~1 CPU-burst each on 16 CPUs are near the host's capacity, and direct reclaim of the page cache that the states fill (MemFree ~2 GiB of 32 against 28 GiB cached; pgscan_direct 408k pages under `madvise`, 48k under `defer`, with 743 allocation stalls). Here `defer` read 379/445 → 302/388 at 8 at once and 83.2 → 84.0 alone. *Next:* the host keeping memory free ahead of a burst (kswapd's watermarks, `vm.watermark_scale_factor`), and the CPU a restore costs. - ---- - **11-20 · CI · the builders are images, and the apk locks are gone (this change).** The daily apk-lock refresh (`c6c29b5`) kept the locks buildable, at a price: Alpine's mirror serves only the newest build of each package, so a lock moved every two or three days (11-09, two on 11-12, 11-19, #308 on 11-20), and the lock is the first layer of QEMU's build, so each move compiled QEMU cold on its pull request (17-21 min) and again on main (12 min), since only main exports the cache. #308 was libxml2 r2 → r3, which nothing links. QEMU's and e2fsprogs' builders are now images, Alpine with the part's apk.list installed (`builder/Dockerfile`), published to ghcr and pinned by digest (`qemu-builder`, `e2fsprogs-builder`). An image keeps its packages after the mirror drops them, so nothing forces a move: refresh.yml makes them again weekly and proposes the ones whose packages moved, with the list of what did. The tag is a hash of the Alpine, the list and every package installed, so it never names two images. A part's build stops at its first step when the tree's apk.list is not the builder's. In place. **11-20 · CI · qemu.yml, kernel.yml and image.yml are parts.yml (this change).** Three workflows of the same shape, each a path-filtered `changed` job and build, and none of them a required check, since a path-filtered workflow does not report on a change outside its paths: a pull request could merge with its QEMU build red (#309's was not blocking). One workflow now, with no path filter: `changed` decides for each part, the builds run when it says so, and `parts` (`spin-machine-dev needs`) fails when one that ran did not pass, which gives a ruleset one check to require. A change that reaches all three runs one `changed` where it ran three (each a billed minute). Over the 200 runs before it (gha-optimize, 2026-11-20): build p50 1m01s cached, cold 10-22 min; `changed` 20 s. In place. @@ -447,6 +432,20 @@ Checked against the probe it replaced on the bench fleet, `lab dispatch ssh-firs ### Week 12: 2026-11-21 to 11-27 +**11-21 · lab · the probes boot, size and log in as spin does, unless asked (this change).** #319 made spin's shape the probes' default, but left the guest at 128 MiB and logged in by the lane, and both made numbers spin never sees: at 128 MiB the guest OOM-kills its way through the boot (lab 44784196287), and on spin's path the cold first login read 532 ms where the lane's read 445 (labs 44785179901, 44750322384). `plugged` is now 2048 and `login` spin unless a run says otherwise; `plugged=0 login=lane` with the old shape options is the shape before. The release records measure what the probes measure, so the first record after this one is the first in spin's shape, and its pair's Δ (`against`) is measured in the same shape. The `floor` edit's sshd serves the lane, so a floor run passes `login=lane`. + +**11-21 · image/lab · where one vCPU's time goes before the first login, and what the CPU weights do (laptop leads, PR #329 closed).** With the guest sized to 2048 MiB (`plugged=2048`) one vCPU adds ~85 ms to the first login against two, on the lane and on spin's path alike (4 boots each). The guest spends ~225 ms of CPU to the login either way, with 0 ms idle at one vCPU: the second CPU used to run beside the login what one CPU runs before it, and no unit waits longer of its own. Up to the login, in ms of CPU at one vCPU on spin's path: PID 1 ~49, udevd with its workers, trigger and credentials ~41, the kernel and its threads ~31, the lingering user@1000 ~20 (gone since #327), `ssh.service` with its `sshd -t` ~20, journald ~13, logind ~13, the session ~9-12, dbus-broker ~7, the host-key generation ~5, getty ~3. `StartupCPUWeight=1` on udevd and its coldplug trigger took the lane's first login 285 → 240 ms (Δp50 −45.7 [−49.3, −35.8], 12 boots each) and did nothing on spin's path (308 against 307): there `ssh.service` and the forwarder wait for `basic.target`, which waits for udev, so its CPU is on the login's path whatever its weight. `children_max=2` and journald's `ReadKMsg=no` gained nothing. On spin's path the host keys `spin-machine-sshd-keygen` makes are not loaded (spin's own key comes first), ~5 ms of CPU `ssh.service` waits for: spin could mask the unit at its handoff. Not benched. The lever is the order spin starts the login in (docs/boot-time.md, "Open experiments"). + +**11-21 · lab · restores in a burst (lab 44792429636).** Beside picking 8 channels (above), `restore-together` showed that 8 restores let go at once take ~330-400 ms each to the first login at any channel count, against ~100 alone and ~140 four at once. Not explained (docs/boot-time.md, "Open experiments"). + +**11-21 · image · spin's login path starts from the boot's first dispatch, beside udev at the lowest weight (lab 44805051310, PR #338's edits).** docs/boot-time.md's "Open experiments" row, a bound on spin's path. ssh.service alone without default dependencies had still started right after basic.target: it is after Ubuntu's `sshd-keygen.service`, wanted by it and with default dependencies, whose `ConditionFirstBoot` never holds here: a job waits for its ordering before PID 1 checks its condition. logind and dbus-broker had none, but `PrivateTmp=` orders a unit after `systemd-tmpfiles-setup.service`. `lab` edits `login-early` (ssh.socket, ssh.service, sshd-keygen and the probe's forwarder without default dependencies, shutdown conflicts kept; logind and the broker with `PrivateTmp=no`) and `udev-startup` (udevd and its trigger at `StartupCPUWeight=1`). On the bench, spin's shape and login, v20261120.03, 20 boots each interleaved: `login-early` first login −10.8 [−16.3, −5.2], sshd accepts −33.6, accept to login +23.0, console prompt +18, because with the login early it ran beside udev's coldplug on the one vCPU. Both edits −59.4 [−65.9, −56.2], accepts −56.0, accept to login −4.6, second login +6.1 [+3.7, +7.9], console prompt +51.4 (the serial getty waits for dev-ttyS0, which the coldplug announces). On a laptop, sessions had their `XDG_RUNTIME_DIR`, no unit failed and poweroff stopped QEMU in ~123 ms as the release does. *Side effects:* logind and the bus share the machine's /tmp (read-only to logind under ProtectSystem=strict); the console prompt later; udev's coldplug finishes later. *Status:* the image's half kept (`image/`: the three `10-lane.conf`, `30-privatetmp.conf`, `20-startup.conf`, asserted by build.sh). spin's supervisor forwarder is spin's to order, proposed in docs/boot-time.md's "Open experiments". parts.yml keeps no image artifact, so the image is measured as the release with `--edit lane`, which now carries these drop-ins, and `--edit forwarder-early` orders the probe's forwarder as spin's supervisor would be. A laptop lead, 8 boots each: the image with the forwarder as spin orders its supervisor today (after basic.target) +21.3 [-46.1, +261.0], with it early -56.0 [-116.5, +169.8]: with udev at the lowest weight, basic.target can come later, and the image alone may cost spin until its supervisor moves. The bench decides. + +**11-21 · lab/machine · the restore into a QEMU started ahead, taken apart (laptop leads; the `split` probe, branch `restore-split-lab`, not for main).** 106/112 ms on the bench (lab 44798669409): running at 59, the login ~47 after. `lab` probe `split` runs the prestarted QEMU under its trace with host timestamps and reads the guest's journal and per-task CPU. *To running* (laptop, spin's shape, 8 channels, state evicted, 24 restores): spin-machine's exec and dial 2.1 ms, ~20 QMP round trips to migrate-incoming 6.0 (query-cpu-model-expansion 0.5 of it, each round trip ~0.25), the header 1.5-9 (the first read of a cold file), the RAM load 50.4, the device state 3.4 (~0.4 a virtio device), to running 1.1, the reply 1.5. The state is 181 MiB of data: the guest's ~117 MiB in use, the memmap of 2 GiB plugged, the kernel; settling 10 s before the save took off 3 MiB, so free page reporting has little to give. Read from the page cache the load is ~10 ms instead of 50 (running 29.6 against 78, 6 each), so the load evicted is the disk. `direct-io` (O_DIRECT for the channels) was within the noise evicted and +45 ms cached. *Running to the login* (laptop ~33 ms, guest clock from vmgenid's "crng reseeded due to virtual machine fork"): the accept probe's connection ~5 ms (socat's child, sshd forking an sshd-session that reads EOF), the connection to "Accepted publickey" ~22, the session and `true` ~4. A second login right after reads 25-29, so the restore costs the first login ~5 ms over a warm one here. The probes' logins were never closed (`Key.Run` gave Go a blocking socket, closed only once nothing read it): the checkpoint held the cold login's session, and the restore's vsock transport reset tore it down beside the login timed. Closing it: 37.1 → 34.8 ms after running, dropping the accept probe as well 31.5 (8 each). *On the bench* (spin's shape, v20261120.03, 20 each): `split` (lab 44809015139) read to running 58.7 ms, of it the RAM load 38.8, the QMP round trips 8.3, the dial 2.3, the device state 4.5; the login left open cost the first login ~5 ms (104 → 99.1), the accept probe ~4 more (95.3). `prestart` (lab 44809512339), the read-ahead against the release: restored into a QEMU started ahead 95.0/100 → 82.1/87.4, Δp50 −12.9 [−14.7, −9.8], running −11.9; restored −12.1 [−15.3, −8.9]; the cold boots within the noise. *Changed:* the probes close their logins; `machine.Resume` reads the state's data ahead from its first line. spin resumes through `machine.VM.Resume` (`internal/runner/qemu/checkpoint.go`), so it takes the read-ahead with the pin. *Status:* kept. + +**11-21 · lab · where a burst of restores waits (laptop leads; this change).** Lab 44792429636's samples, read again: the eight-at-once rows read ~210 ms to the first login (running 165-177) in their first three bursts, at 1, 8 and 16 channels alike, and 285-480 in every burst after; the extra is before running (1 channel: running max 168 → 369 p50, the median login 44 ms after it both times; 8 channels 166 → 272, 46 → 67 after), one and four at once at 8 and 16 channels do not move over the run, four at once at 1 channel creeps 165 → ~190, and no restore is slower for its place in the order (each index's mean rank 2.8-4.1 of 0-7). A host whose state changed during the run, which only a burst feels. `restore-together` now records what the host counted during each burst (PSI stall time of CPU, I/O and memory; `/proc/vmstat`'s direct reclaim, compaction stalls and huge-page fallbacks, MiB read; CPU busy; memory free and cached going in) and every restore's `running`, and takes `states=cached` (the disk out of the burst) and `defrag` (the host's THP defrag policy for the burst). *Laptop, i9-13900HK, not nested, 5-6 bursts a row, leads only:* 8 at once from the disk read 590-740 ms against 107-110 alone, the disk the bound (1.4 GiB at ~2.7 GB/s, I/O PSI full ~120-260 ms a burst) with or without huge pages. From the page cache: 440-445 ms under the default `madvise`, with ~3000 compaction stalls that all failed, ~2.4 GiB scanned by direct reclaim and memory PSI full ~250 ms a burst, and 85% of 20 CPUs busy; 133 ms with huge pages off for QEMU (PR_SET_THP_DISABLE, a wrapper, Δ −307 [−437, −156]); 150 under `defrag=defer` with no compaction and memory PSI 3 ms. Alone, huge pages off cost +16.0 [+8.9, +22.6] after running (the guest on 4 KiB pages), and `defer` 74.5 → 80.3 (5 each). QEMU marks guest RAM MADV_HUGEPAGE, so under `madvise` every fault of a load that finds no free 2 MiB block compacts and reclaims before it returns: one restore finds the ~90 blocks it needs, eight need ~700 at once and fight over them, and a host that has run a while (a page cache full of states, the bench after its first ~20 GiB) has none to spare. spin restores workspaces concurrently (spin-stack/spin at 1bd3414: an actor goroutine per workspace in `internal/runner/reconcile`, a per-workspace lock in `workspace.Manager.Resume`, up to 10 commands at once in `handler`), and leaves the host's THP policy as the distribution sets it. *On the bench* (lab 44810128678, v20261120.03, spin's shape, 8 channels, 30 bursts a row, every restore one sample): under `defer` against `madvise`, 1 at once 99.6 → 99.5, Δ −0.1 [−2.0, +1.6]; 8 at once from the disk 283/384 → 239/281, Δ −44.1 [−53.2, −35.2]; from the page cache 1 at once 72.3 → 72.0, 8 at once 268/317 → 193/241, Δ −74.9 [−83.2, −64.9]. *Decided:* THP defrag `defer` is a requirement of spin's host (`/sys/kernel/mm/transparent_hugepage/defrag`; `docs/memory-and-disk.md`): it gains in a burst and costs one restore alone nothing, spin never sets the policy and Ubuntu's default is `madvise`. *Not explained:* 8 at once under `defer` still read ~190-240 against ~100 alone, and from the cache barely less than from the disk. `restore-together` now records where a burst ran on the host's CPUs: each CPU's busy time (/proc/stat) and interrupts by line (/proc/interrupts), the CPUs QEMU's running threads were on, sampled every 5 ms, and the QEMUs', the job's CPU lists and irqbalance. It records them because nothing pins QEMU (spin-machine runs it with `-sandbox resourcecontrol=deny`, spin sets only a cgroup `cpu.weight`) and one CPU taking the disk's interrupts or the threads would look like this. *Where on the host's CPUs* (lab 44817486118, v20261120.04, 20 bursts): not one CPU. In the 8-at-once rows the busiest CPU held 6-7% of the busy time (16 CPUs evenly would be 6%), CPU 0 was busy 212-270 ms a burst against the others' 221-276, the interrupts were spread (the busiest CPU 7%, an NVMe queue on top), irqbalance runs, and the job and every QEMU may run on 0-15; QEMU's threads ran on every CPU about alike. What the burst is instead: the host's CPUs 72-78% busy (CPU PSI some 84-190 ms a burst), so 8 restores of ~1 CPU-burst each on 16 CPUs are near the host's capacity, and direct reclaim of the page cache that the states fill (MemFree ~2 GiB of 32 against 28 GiB cached; pgscan_direct 408k pages under `madvise`, 48k under `defer`, with 743 allocation stalls). Here `defer` read 379/445 → 302/388 at 8 at once and 83.2 → 84.0 alone. *Next:* the host keeping memory free ahead of a burst (kswapd's watermarks, `vm.watermark_scale_factor`), and the CPU a restore costs. + +--- + **11-21 · CI · a release is measured at its tag and recorded by main (this change).** report.yml checked out the release's tag and ran `releases measure`, which wrote the record and the page with the tag's code, and `releases propose` put them on main (#337). v20261120.04's proposal (#350) failed main's TestTheCommittedPageIsTheRecords: #342 had changed `lab.Chart` after the tag, so the tag's page was not the one main writes from the same records, and it was fixed by hand with main's `releases doc` (75a3b24). Measuring stays at the tag, which boots each release with its own spin-machine and the tag's probes, and `releases measure` now only keeps the ladders. A second checkout of main builds its own spin-machine-dev, `releases record` (now taking every ladder.json) writes the records and the page, and `propose` runs there. Functional: no boot number moves. **11-21 · lab · what we carry, and what it earns (this change, lab 44818953987).** The reverse of a kept change: every boot-time modification the tree carries, with the shape and host it was kept on, in docs/boot-time.md's section of that name, grouped for removal one arm a group. Found before the bench: 15 masks and 1 disabled generator name units the image does not have (deleted, #352). The 5 masks of `ConditionNeedsUpdate` units are load-bearing, because the image has no `/etc/.updated`, and unmasked they rebuild hwdb.bin and the linker cache at every boot (first login +260 ms, QEMU's RSS +90 MiB, laptop). *Measured* (prestart, spin's shape, 20 each against v20261120.04, the removal's Δp50 of the cold first login): every kernel patch +67.5 [+62.5, +72.4]; SeaBIOS for qboot +68.5; the 16 other masks +57.5; the generators +16.7; the coldplug filter +14.9, and without it a restore +464 (a guest saved with its coldplug still running, a guess); QEMU 0001 with qboot's PAM patch +11.5 [+6.7, +20.2]; `driver_async_probe` with `rcu_expedited` −1.4 [−4.9, +3.1]; kernel 0006, 0009, 0011 and the in-doubt options +1.2 [−4.5, +8.3]; PID 1's quiet logging +2.4 [−2.3, +7.8]. In one vCPU what runs before the login is on its path, so most of what was kept on two still earns. *Status:* the command-line pair deleted (#352); A1 and the logging measured again at 40 boots, cold; the rest kept, with what it earns in the table. A1 deleted 11-20 (#345), the logging 11-20 (#354). @@ -650,12 +649,19 @@ Checked against the probe it replaced on the bench fleet, `lab dispatch ssh-firs **11-23 · image · the update stamps written at build, the five units of `ConditionNeedsUpdate` unmasked (#513, labs 45120950183, 45120950314, 45120950141, this change).** The image had no `/etc/.updated` or `/var/.updated`, so `ldconfig`, `systemd-sysusers`, `systemd-hwdb-update`, `systemd-journal-catalog-update` and `systemd-update-done` were masked: without the stamps they rebuild the caches in every boot (+260 ms, laptop, 11-21). *Changed:* `image/build.sh` writes both stamps last, with `/usr`'s mtime and `TIMESTAMP_NSEC=`, as `systemd-update-done` does, and fails an image whose stamps' mtime is not `/usr`'s; the five masks are gone from optimize-systemd.sh; `boot:workspace` asserts each unit checked its condition and skipped. `/usr`'s mtime in the release is 0 (`SOURCE_DATE_EPOCH`), which first failed the arm's setup through `expr`'s exit status on a result of 0. *Measured* (bench, nested, spin's shape and login, against v20261123.04 with the stamps and the unmasks in its overlay, branch `exp-batch3`): first login −0.3 [−6.8, +4.5], sshd accepting −1.3 [−7.7, +1.1], 20 a side (lab 45120950183); restored +0.2 [−2.1, +0.9] evicted, −1.3 [−4.5, −0.4] cached, cold login +1.2 [−2.6, +7.3] (lab 45120950314); `boot:workspace` on the overlay: the five units' conditions false and no unit failed (lab 45120950141, whose other failures are #509's and #512's checks, which v20261123.04 predates). The overlay measures the stamps and unmasks as files of the overlay, not of the base, which only changes where their few blocks are read from. *Status:* in place, a functional change: a `/usr` change made later is applied at the next boot. **11-23 · image · the pressure sender started by the boot's rest, its timer deleted (#401, labs 45120950183, 45120950314, 45120692382, 45120950141, this change).** The sender waited for a timer 10 s after the boot because, ordered after `multi-user.target` alone, it started beside the first login and cost it 2.6-3.3 ms (11-21). Since #581, `multi-user.target` is started by `spin-machine-boot-rest.service` once the first login's units are up, the first of #401's arms. *Changed:* `spin-machine-pressure.service` is `WantedBy=multi-user.target`, enabled by optimize-systemd.sh; `spin-machine-pressure.timer` is deleted; build.sh checks the want and refuses the timer; the lab's `pressure` edit makes the same want; `boot:workspace` asserts the sender runs. *Measured* (bench, nested, spin's shape and login, against v20261123.04 with the change in its overlay, branch `exp-batch3`): first login −0.8 [−7.8, +4.8], sshd accepting −0.2 [−9.1, +3.6], 20 a side (lab 45120950183); restored −0.8 [−2.9, +2.1] evicted, −0.4 [−3.6, +0.8] cached, the state +2.1 MiB because the sender is running at the save (lab 45120950314). In 5 ledgers it started at 0.37-0.38 s on the kernel's clock, after the login's end at ~0.29 s (lab 45120692382); in `boot:workspace` on two vCPUs at 0.29 s (lab 45120950141). *Status:* in place. A guest's first ~0.4 s go unreported, not its first 10 s. + **11-23 · machine · `Unshared` refuses a pool whose CPUs differ in what taking features away leaves as it is (#587, this change).** *Why:* `Unshared` compared only the vendor and the model, so a pool whose hosts differ in stepping or physical address bits got a `CPUWithout` as if it made them share one CPU, and every cross-host resume was then refused by `CanResume`. *Read* (QEMU 11.2.0-rc0's `target/i386/cpu.c`, `host-cpu.c`, `kvm/kvm-cpu.c`, 2026-11-23): under `host`, `family`, `model`, `stepping` and `model-id` are the host's (`host_cpu_instance_init`), `phys-bits` and `guest-phys-bits` the host's and KVM's whenever `lm` is on, `pmu` is set by `kvm_cpu_max_instance_init`, and the cache switches by the machine type and `-cpu`. No feature taken away moves any of them. `level` and `xlevel` can move: `kvm_cpu_max_instance_init` starts the minimum leaves at KVM's, and `x86_cpu_expand_features` raises them for each feature word that is on (AVX10 to 0x24, APX to 0x29, SVM to 0x8000000A). Two hosts' levels can then agree or differ either way once `CPUWithout` is applied, and the record does not hold KVM's own leaf to say which. *Changed:* `Unshared` refuses, naming each, a pool whose hosts differ in any property but `level` and `xlevel`, and leaves those two to the records of the machines started with `CPUWithout`. *Status:* in place; spin-stack/spin#1417 told. + **11-23 · machine · a state of another length than its checkpoint wrote is refused before QEMU reads it (#546, CI run 45111149822, this change).** *Why:* a failed load says only that it failed. QEMU 11.2.0-rc0 ends every failure at `process_incoming_migration_co`'s `fail:` label, and `qemu_fill_buffer` reports a file that ends early and a host's failed read both as `-EIO` (read 2026-11-22). So spin kept a truncated state's memory and retried it forever. *Changed:* `Checkpoint` records the state file's length in `Saved.Length`. `Resume` fstats the file it is handed after `CanResume` and returns a `*Refusal` (part `state length`) before QEMU is asked anything. It costs one `fstat`. It does not catch bytes changed in place, which stay a plain error. `boot:record`'s "a truncated state" now wants that refusal and the state never read. *Compatibility:* the field is new and optional. A `Saved` without it, every checkpoint a released spin-machine wrote, resumes without the check, and the machine's record (`Saved.From`) does not move. In CI run 45111149822, `boot:record` refused a real state cut to half its length, `state length: checkpoint 8597660207, here 4298830103 (same)`, with the state never read. `boot:compat` resumed v20261123.04 and refused v20261123.03 first, by `cpu x-legacy-cpuid2-cache` as before (#586), so this change refuses no release main did not. *Status:* in place. + **11-23 · lab · a workspace's memory at boot beats the same memory plugged during it (#561, labs 45110554589, 45111507862, 45110570912, 45110562994, 45110580480, spin-stack/spin#1660, this change).** spin boots 128 MiB and plugs 2048 through virtio-mem right after the start. #561's lead (−15 nested, −8 metal) came from separate runs, so a tree now takes probe options of its own (`--opt` in a tree spec), and the two shapes ran as two trees of one interleaved run: `plug` (the release, `memory=128 plugged=2048`) and `start` (`memory=2048 plugged=0`), v20261123.04, 1 of 16 vCPUs, ceilings kept, spin's login. *Cold first login:* nested −2.5 [−7.3, +2.0] at 40 a side (lab 45110554589), within noise, then −5.5 [−10.9, −0.7] at 80 a side (lab 45111507862); metal −7.0 [−11.4, −3.4] at 40 (lab 45110570912). sshd accepting −8.3 nested and −7.6 metal, accept to login and the second login unmoved. *Restore* (nested, 20 a side, lab 45110562994): the state −17.6 MiB [−17.8, −17.3], `running` −2.4 [−3.5, −0.8], the restored login −2.5 [−3.7, −1.0] evicted and −2.2 cached. QEMU's RSS at the cold login −26 MiB. *Where it goes* (ledger, traceable kernel, 3 boots each, lab 45110580480): plugged, `kworker/0:1` runs ~7.8-8.0 ms of the vCPU in the kernel's window before PID 1, inferred to be the onlining of the plugged blocks; at boot it runs 0.3 ms, the kernel's own setup (`swapper/0`) takes ~4.5 ms more for the larger memory map, and PID 1 comes 3.4 [−5.9, −2.1] ms sooner. The rest of the cold gain is after PID 1 and the ledger does not pin it at 3 boots. *Decided:* a gain on both goal numbers, and the boot shape is spin's: spin-stack/spin#1660 proposes `canonicalMemory` at the workspace's least, 2048 MiB, with virtio-mem kept for growth to 8 GiB (invariant 3). Base RAM is in the machine's record, so checkpoints from before the change boot cold once. The probes keep spin's shape until spin changes it. *Status:* the tree option is in place; #561 closes here and the decision is spin's. + **11-23 · lab · where a cold boot's EPT violations land (#568, lab 45111606645, this change).** #565 counted 172 EPT violations in a cold boot at ~115 µs each nested and asked whether prefaulting the base memory in a QEMU started ahead would take them off the path. `exits` now keeps a histogram of `kvm_page_fault` by guest-physical address in 128 MiB buckets. *Found* (bench, nested, spin's shape and login, v20261123.04, 3 boots, the same in each): 171 violations, 18.9 ms of the L1's time. 52 in the base (0-128 MiB) and 6 in the bucket above it, 48-51 in the memory virtio-mem plugs (QEMU puts its device memory at 4 GiB when there is no RAM above 4 GiB), 39 in the PCIe ECAM at 0xB0000000, 9 in 0xF8000000-0xFFFFFFFF (IOAPIC, local APIC, flash) and 17 in the 64-bit BARs at 12 GiB. The MMIO ones are inferred from the addresses: KVM's first fault on an MMIO page installs the misconfigured entry that every later access exits through. *Decided:* closed as off the goal's clock. Prefaulting the base could win only the base's ~58 faults, ~6 ms at most, and only in `prestart`, because `ssh-first` starts before QEMU's exec and a prefault there is on its path. The plugged faults cannot be prefaulted without zeroing all that is plugged. With the memory at boot (#561) they become base faults, and the split is the same question. *Status:* the histogram is kept in `exits`. + **11-23 · lab · a guest that drops its page cache before its save does not make a smaller state (#276, lab 45110967817, branch archived as `archive/drop-caches-276`).** #276's last idea: most of a restored state might be the guest's clean page cache, so a guest asked to drop it right before spin's save would leave less for the restore to load. *Measured* with a `restore-first` option on the experiment's branch, a tree each: `drop=0` ran `sync; echo 1 > /proc/sys/vm/drop_caches` as root after the boot had finished and saved at once, `drop=3` waited 3 s first, which leaves free page reporting its 2 s delay (bench, nested, spin's shape and login, v20261123.04, 20 a side). The state read 183 MiB on all three trees: −0.1 [−0.4, +0.3] at once, −0.0 [−0.3, +0.4] after 3 s. `running` did not move, −0.9 [−2.0, +0.9]. The restored login was worse, +4.7 [+3.5, +7.3] evicted at once, +5.6 [+4.6, +7.6] after 3 s, +6.5 and +6.4 cached. *The instrument saw the drop:* the restored login is the side that moved, as a guest whose cache was emptied must read the login's files from its disk again (inferred: the probe does not read the guest's cache). *Why the state does not shrink* (inferred, not measured): a save writes every page that is not zeros, and a freed page keeps its bytes until something gives it back to the host. Free page reporting gives back only free blocks of `page_reporting_order` (2 MiB here), and a page cache freed 4 KiB at a time beside the boot's live pages leaves few whole ones, even after 3 s. Waiting 3 s with no drop had moved nothing either (docs/measuring.md, "When a checkpoint is taken"). *Decided:* rejected, with its row in docs/boot-time.md. Nothing is asked of spin before a checkpoint. #276's three ideas are answered, and the restore stands at 78-80 ms, under the goal. + **11-23 · lab · a guest's synced writes on a saturated host disk do not stall QMP on the bench (#391, labs 45111443524, 45112573850, probe archived as `archive/qmp-stall-391`).** On a laptop with a 97% full disk, query-status reached 175-950 ms beside small synced writes, and #402 did not reproduce that case. A `stall` probe on the experiment's branch booted spin's shape, logged in, started a row's load, and timed 200 query-status round trips 100 ms apart, sampling QEMU's main thread and its monitor's I/O thread (`stat` and `wchan`) every 0.5 ms across each, with both kernel stacks taken past 20 ms. The rows: the guest's 4 KiB `dd oflag=dsync` writes (fio's `--bs=4k --fsync=1`; the image has no fio); four host streams of 1 MiB O_DIRECT writes on the scratch NVMe the overlay is on; both; and the guest's writes beside four buffered host streams flushed each GiB, so that dirty-page throttling and writeback are in play. *Measured* (bench, nested, spin's shape and login, v20261123.04, 3 boots a row, two runs): the slowest round trip of all 2,400 was 1.2 ms, and none passed 20 ms. p50 0.24-0.37 ms with the guest writing alone, 0.41-0.56 with the host disk busy. *The load was real:* the disk read 99-100% busy from its io_ticks in every busy row, and the guest's writes fell from 113,700-118,400 a row to 2,700-3,100 beside O_DIRECT and 1,500-2,100 beside buffered writes. QEMU's disks are `aio=io_uring` on the main loop's ring, so a slow write waits in the kernel and not in the main thread. *Decided:* the case does not stall QMP on the host kind the goal is measured on, so no `iothread=` arm was measured and the probe was removed with its question. The laptop's stalls stand as #402 explained them: the main thread blocked in the host, in cgroup reclaim at `memory.high`, waiting for the mmap lock under reclaim, or with QEMU's cgroup throttled by `cpu.max`. + **11-23 · lab · density on metal, and a CPU-bound crowd on the bench (#563 section 2, labs 45110655407, 45110663095, 45110670764, 45110678888, 45110688511, this change).** #273 measured an idle crowd on the bench up to 16. #563 asks what a metal host carries, for spin's metal-or-nested cost model, and needs no new code: `density` as it stands, spin's shape and login, v20261123.04. *Bench, nested, 16 CPUs, `load=cpu`, 10 a row:* the first login read 387/417 empty, 378/431 beside 4 busy workspaces, 441/450 beside 8, 1015/1215 beside 16, 941/1196 beside 24. *Metal, c8i.metal-48xl, 192 CPUs:* `load=cpu`, 337/447 empty, 331/488 at 16, 335/344 at 32, 336/341 at 48 (10 a row), and in a second run 342/363 empty, 327/366 at 64, 466/486 at 96 (8 a row; a crowd of 96 took 83 s to boot, past what 10 rows fit in bench-metal's 60 minutes). `load=idle`: 345/368, 336/343, 329/341, 334/352 at 0-48, and 342/356, 328/350, 331/340 at 0, 64 and 96. *Read* by #563's line, a p95 within 25% of the empty host's in the same run: nested, up to 8 busy workspaces of 16 CPUs; metal, up to 64 busy of 192, not 96, and every idle crowd measured. The rows of one host are two runs, so a row compares only with the empty row of its own run. The empty metal row's 447 p95 in the first run is one slow boot of ten. *Not measured:* busy crowds between 64 and 96, and workspaces of more than one vCPU. *Status:* rows in docs/boot-time.md ("The bench fleet is nested, not metal"). Section 1 of #563 (the I/O tax) needs new probes and equal storage on both hosts, and stays open in #563. **11-23 · systemd · the executors' sandbox, a bound: −14 ms (#574 experiment 4, labs 45120692382, 45121038332, #637, #638, this change).** Read first, a release ledger (v20261123.04, spin's shape and login, 5 boots): before the first login the executors spend journald 6.0 ms, logind 10.3 and `user@0` 2.8, p50, beside the units' own binaries. *The bound:* one drop-in each for journald, logind and `user@` emptying `SystemCallFilter=`, `SystemCallArchitectures=`, `SystemCallErrorNumber=`, `RestrictAddressFamilies=`, `RestrictNamespaces=`, `RestrictRealtime=`, `RestrictSUIDSGID=`, `MemoryDenyWriteExecute=`, `LockPersonality=` and every `Protect*=`; `PrivateTmp=`, `IPAddressDeny=` and `DeviceAllow=` kept. udevd was left out: it starts after the first login since #581. *Measured* (bench, nested, 60 a side, branch `exp-batch3`): first login 374 → 360, −14.1 [−18.5, −11.5]; sshd accepting −13.2 [−16.0, −10.9]; accept to login −2.1 [−3.1, −0.1]. *Status:* a bound, not carried. #637 splits it into the seccomp and namespace halves and proposes one seccomp filter per unit in systemd. #574 closed with its five experiments: #579 in (−6.5), #580 rejected, #581 in (−21.5), #460 in (the kernel's), this bound to #637. The runner-up, the dynamic linker's share, is #638. @@ -663,6 +669,7 @@ Checked against the probe it replaced on the bench fleet, `lab dispatch ssh-firs **11-23 · image · the volatile journal holds 8 MB, not 4 (#514, labs 45121159504, 45121159741, 45121159883, 45120692139, this change).** *Found:* `/run` is a tmpfs of 20% of the RAM at its mount, and the guest mounts it at 128 MiB, before spin sizes it to 2 GiB: 19 MiB in spin's shape, whatever the guest grows to. Ubuntu's default cap, 10% of `/run`, would be ~2 MB there. *Measured* (bench, nested, spin's shape: 1 vCPU, 128 MiB sized to 2048 right after the start, a guest running `docker build --no-cache` of 20 `RUN` steps for 10 minutes, branch `exp-batch3`'s `boot:exp-journal`): the journal grows ~0.4 MB a minute, mostly systemd's and dockerd's lines for each build step. At 4 MB the oldest entry was the kernel's first line for 8 minutes, then the boot's first 90 s were gone by the end (lab 45121159741). At 8 MB the whole journal was kept, 3.6 MB used (lab 45121159883). A first try at 16 MB was left: it is 84% of `/run`, near journald's 15% keep-free. The first login, 8 MB against 4 MB in v20261123.04's overlay: −2.2 [−12.1, +6.4], 20 a side (lab 45121159504), and 16 MB −0.2 [−5.6, +9.1] (lab 45120950183). *Status:* in place; a busy workspace keeps ~15-20 minutes. **11-23 · image · the dynamic linker's share of PID 1, journald, logind and `user@0` is ~1 ms (labs 45180400607, 45180856158, #638, this change).** #574's runner-up: the four map and relocate `libsystemd-shared` (PID 1 and `user@0` also `libsystemd-core`), and nobody had measured ld.so's share before porting to v262's multicall build (#42304) or a static one (#42820). *Instrument* (branch `exp-ldso`, tagged `archive/exp-ldso`, its `ldso` edit): `LD_DEBUG=statistics` for PID 1 from spin's handoff, which execs it (`systemd.setenv=` does not reach PID 1), and for journald, logind and `user@0` from a drop-in each. PID 1 and journald report on `/dev/kmsg` with `printk.devkmsg=on`, logind and `user@0` on their stderr, the journal: the first run had logind's on `/dev/kmsg` too, its `DevicePolicy=` refused the executor the open, and logind failed at STDERR (lab 45180400607, discarded). glibc 2.43 counts in TSC cycles, 2700 MHz in every boot. *Measured* (bench, nested, spin's shape and login, v20261123.05 on its traceable kernel, the ledger with and without the edit, 8 a side, lab 45180856158), ld.so's total start-up, p50 [range]: PID 1 0.48 [0.46, 0.56] ms, of it loading objects 0.32 and relocation 0.08; journald 0.20 [0.14, 0.31]; logind 0.20 [0.11, 0.31]; `user@0` 0.21 [0.15, 0.36]. Relocations: PID 1 and `user@0` 2,522 symbol (911 from cache) and 16,589 relative; journald 1,157 and 10,518; logind 1,238 and 11,297. Objects at start, from the release's image (`ldd`): 7 for PID 1 and `user@0` (the binary, libsystemd-core, libsystemd-shared, libc, libm, libcrypt, ld.so), 6 for journald and logind, all `BIND_NOW`. The four come to ~1.1 ms, under #638's ~5 ms, so no build was made. *The instrument:* against the ledger alone in the same run, first login +3.4 [−23.0, +11.9], PID 1's CPU −1.1 [−5.1, +0.6], unattributed +0.3 [−0.1, +1.1]; each ld.so total is well inside the trace's wall time from the process's exec to its first sleep. It does not see the kernel's execve before ld.so runs, nor the libraries' pages faulted in later by `main`, which a static build would partly pay too (not measured). `user@0`'s environment generator inherits the variable and reports 0.13 ms more. *Inferred:* the multicall build would not reach even that: it keeps libsystemd-core and libsystemd-shared dynamic, leaves journald and logind alone and makes the executor, static here, dynamic. *Status:* measured and rejected; #638 closed. + **11-23 · qemu · a bzImage mapped, not read into QEMU's heap (#646, labs 45182382388, 45182382864, 45183618987, this change).** `x86_load_linux` read the whole 16.7 MB bzImage into a buffer that only fw_cfg reads, 6.2-6.9 ms of QEMU's init traced (labs 45177818419, 45177817516, #611), and qboot copies the same bytes again by fw_cfg DMA. `qemu/patches/0007` maps the file read-only (`g_mapped_file_new_from_fd`), as upstream has mapped the initrd since 4.2; a kernel with a dtb appended keeps its buffer. The setup header QEMU patches is already a copy of its own, so nothing writes to the mapping. The QEMU build asserts that a held TCG machine's maps name a stub bzImage given to it; the published QEMU fails that check. *Prior art* is in docs/boot-time.md's row: Garzarella's 2019 series mapped the ELF kernel and the initrd but not the bzImage. *Measured* (bench, nested, spin's shape and login, v20261123.05 against the same release with the patched QEMU, parts run 45180746171, 40 a side, interleaved): first login 380 → 367, −13.4 [−16.9, −7.3], sshd accepting −13.3 [−18.7, −7.5], the console prompt −10.6 [−14.2, −6.3]; QEMU's anonymous RSS −15.9 MiB and its file RSS +16.1, total unmoved (lab 45182382388). Restored, 40 a side: login −9.3 [−11.2, −6.1] evicted and −7.7 [−8.9, −5.1] cached, `running` −8.8 and −7.9, the state unmoved (lab 45182382864): a restore starts QEMU, which loads the kernel into fw_cfg there too. The gain is twice the traced read; what else the anonymous buffer cost nested (its page faults, presumably) was not measured. *A lead, not a decision:* an uncompressed payload (#326's kernel patch, renumbered, branch `exp/646-uncompressed`, parts run 45180892535) against LZ4, both on the patched QEMU: first login −4.0 [−7.9, +0.3], within noise at 40, QEMU's RSS +32 MiB (lab 45183618987). The mapping removes the "+6-7 in QEMU's start" half of #326's rejection; whether the rest is a gain needs more boots, which is #645's. *Status:* in place; the record does not move, as the kernel reaches the guest through fw_cfg. **11-23 · systemd · the executors' sandbox costs its system call allow-list, not its number of filters (labs 45228294512, 45229454155, 45231419187, 45235103665, 45235485857, 45238003981, 45239372741, #637, #673, #686, this change).** #637 split #574's bound and asked for one seccomp filter per unit. *The split* (bench, nested, spin's shape and login, v20261123.06, 60 a side, branch `exp/637-split`, tag `archive/exp-637`): the seccomp settings emptied in journald, logind and `user@` read first login −12.0 [−21.8, −2.1], sshd accepting −13.8 [−19.4, −4.9]; the namespace ones (`ProtectSystem=`, `ProtectHome=`, `ProtectControlGroups=`, `ProtectKernelTunables=`, `ProtectProc=`) +0.3 [−9.4, +7.2] (lab 45228294512). *Fewer filters:* the executor applies `SystemCallArchitectures=` after seven other settings, so each of those loads a filter for i386 and x32 too, which the architecture filter then kills; the kernel has neither ABI. Applied first, journald carries 8 filters, not 17, and logind 13, not 26. `boot:seccomp` (on the tag) runs a probe as each unit's `ExecStartPost=`, with the unit's sandbox, over 3435 calls: every native number with zero arguments and no capabilities, each x32 number, and the calls the settings decide by argument; the table was the release's (labs 45235103665, 45235485857). First login −0.4 [−6.1, +2.7] against systemd rebuilt with a comment only (lab 45231419187). *Where it goes:* an instrument patch timing the executor's steps (thread CPU, one boot, 2 vCPUs): journald's executor 6.7-7.2 ms, `SystemCallFilter=@system-service` 3.7-4.0 of it, its `seccomp_load()` 1.1-1.2; the other seccomp settings ~0.6 together (labs 45238003981, 45239372741). So one filter per unit would reach about the 0.6 ms (inferred). *Found on the way:* the lab's packages edit gave `/usr` the package's mtime, newer than the image's update stamps (#513), so every `--systemd` tree ran ldconfig, sysusers, the hwdb and the catalog before the login: both arms ~658 ms (lab 45229454155); fixed in #673. *Status:* rejected, #637 closed; building the allow-list once is #686. @@ -672,10 +679,13 @@ Checked against the probe it replaced on the bench fleet, `lab dispatch ssh-firs **11-23 · kernel, qemu, machine · the kernel entered as its vmlinux through PVH, moving itself to a random base (#645, parts runs 45192017068, 45216245888, labs 45213668842, 45213683698, 45219768990, 45219785493, 45219801969, 45221660056, 45225297602, parts run 45222305257, #660, this change).** *Why:* a bzImage's decompressor spent ~21 ms (bench) on a copy, LZ4 and parse_elf before the kernel's clock, and it was the only thing that randomized the kernel; PVH skipped it and left the kernel at its linked address (11-19). *The bound first*, a vmlinux through PVH with no KASLR at all, against the same build as a bzImage: first login −18.9 [−22.8, −12.4], restored −3.6 [−5.1, −2.1] evicted, at 40 a side. *Two paths with KASLR kept:* QEMU applying the relocations (Holmes et al., EuroSys '22; Firecracker's design) or the kernel applying its own (Hou Wenlong's RFC, 2026-01-26). The kernel's own was chosen: no relocation format for QEMU to parse, nothing on QEMU's command line, the decompressor's entropy code (#645, issuecomment-7106937337). *Carried:* the RFC as kernel 0014-0018, made checkpatch --strict clean with each change noted in its header; 0019, which sets `KASLR_FLAG` once the kernel moved (without it `RANDOMIZE_MEMORY` left the regions where they were: the lowest vmalloc address ffffc90000000000 and the direct map ffff888000000000 at every one of 10 boots, lab 45225297602; with it, 10 distinct bases of each, lab 45221660056); 0020, because the RFC reads RDRAND from CPUID leaf 1's EDX and the TSC from its ECX, the wrong way round, so its virtual base was drawn from the i8254 and a hash of `boot_params` alone, on a guest that has `rdrand` and `tsc` and no `ds_cpl` (lab 45225297602); QEMU 0008, a random physical base from `XEN_ELFNOTE_PHYS32_RELOC`. The relocation table needs 0xc7000 bytes of the 1 MiB reserved: a 512 KiB reserve failed the link naming that size (parts run 45222305257). The machine boots a release's vmlinux when it carries both Xen notes and its bzImage otherwise, so a release from v20261119.02 to v20261123.06 boots as it did. *Measured* (bench, spin's shape and login, against v20261123.06, 60 a side, the kernel without 0020): first login 368 → 352, −16.8 [−20.9, −13.0], sshd accepting −16.7 [−20.2, −12.7], QEMU's RSS −13.8 MiB (lab 45219785493); restored −4.4 [−17.5, −2.0] evicted, −4.3 [−14.0, +10.2] cached, the state −31.9 MiB, the save −14.6 (lab 45219801969). *Status:* kept. What the bzImage, `KERNEL_LZ4` and QEMU 0007 still serve is #660. **11-23 · release · v20261123.07 holds #645's cold gain; its record's 20 a side did not see it (labs 45252584128, 45219785493, release run 45241645340, #694).** *Why:* the record read the cold first login at −3.5 [−12.9, +2.9], within noise, against #645's −16.8 [−20.9, −13.0], and spin was about to be told what the bump gains. *Ruled out* (read from the artefacts): the lab arm and the release boot the same machine. QEMU (`f271a946…`), qboot, `pvh.bin` and `linuxboot_dma.bin` are byte-identical, `spin-machine args` prints one command line but for paths, and both vmlinux files are stripped, 40,165,128 bytes, with the same two LOAD segments and the same config; the release's adds 0020. QEMU's RSS moves the same in both (anonymous −34.0 MiB, file +19.9/+20.1). *Measured* (bench, nested, spin's shape and login, both releases as published, each with its own spin-machine, 60 a side, interleaved): first login 378 → 359, −18.6 [−23.6, −14.0], sshd accepting −15.3 [−21.2, −12.6], the console prompt −18.7 [−24.0, −12.8] (lab 45252584128). The record's run disagreed with itself: its `restore-first` cold boot, the same boot at 40 a side, read −14.2 [−19.9, −8.6]; its 20 `.07` boots sat at a p50 of 370 where the lab's sit at 352-359, and 20 a side drawn from lab 45219785493's samples reach −3.5 in 5 of 100,000 draws. *Status:* the gain stands at ~−17 to −19 ms cold. How many boots the record takes is #694. + **11-23 · lab · the ledger's kernel_zero on the kernel's sched clock (#644, labs 45229897350, 45230233764, this change).** The ledger's `kernel_zero` landed 19.5 ms (bench) and 12.6 ms (metal) after a port write at the sched clock's 0 (#611). *Found:* the ledger took CLOCK_MONOTONIC's 0, the trace's clock, for the kernel's. CLOCK_MONOTONIC runs on jiffies from timekeeping_init until the switch to kvm-clock and loses the ticks it misses. The kernel prints both clocks at one tick at late_initcall ("sched_clock: Marking stable"), and their difference was the whole error in all 24 boots of labs 45177818419 and 45177817516, to within 0.15 ms. *Changed:* the ledger moves the trace and the journal forward by that lag (`monotonic_lag`, 18-25 ms nested, 11-14 metal) and refuses a journal without the line. *Checked:* with the marker kernel, `kernel_zero` lands 0.03 to 0.14 ms before QEMU's trace stamps the marker, 10 boots on bench and 10 on metal (spin's shape, v20261123.04). *What moved*, recomputed from the runs' kept journals: docs/measuring.md's split of lab 45110630795, `kernel_zero` 97-114 → 77-95 and `qemu_start` 49.4 → 29.3 (`before_qemu` and `guest_to_zero` do not move); QEMU's exec to the kernel's clock untraced on the workspace's machine is 73.4 ms on bench and 68.7 on metal (labs 45177818419, 45177817516), against firmware-stages' 73.7; PID 1 in #561's ledgers −3.4 → −4.0 ms; the pressure sender's start 0.37-0.38 → 0.39-0.40 s (docs/image.md). #611's comment is corrected. No cold-budget row used the ledger's anchor. Two of its rows use clocks with errors of their own, now noted beside them: firmware-stages' anchor is ~2.8 ms late on bench (#665), and dmesg's clock reads the kernel 13-15 ms short from late_initcall on (#666). *Status:* in place. **11-23 · qemu · the vmlinux copied into guest RAM beside QEMU's main loop (#698, labs 45257214350, 45260098299, 45260694485, parts run 45257975711, this change).** *Why:* since #645 QEMU loads the vmlinux through `load_elf`. #698 asked whether it read the 40 MB file into ROM blobs at start, as `x86_load_linux` read a bzImage before 0007. It does not: `load_elf` has mapped the file since QEMU 4.2 (816b9fe450, Garzarella, 2019), and the blobs point into the mapping. What it does is copy the 37.4 MB of segments into guest RAM at the machine's first reset, on the main thread, before the main loop answers the monitor. *The phase,* a probe that traces QEMU's reset (`romcopy`, branch `exp/698-romcopy`, never merged): 9.1 ms p50, p95 9.3, 20 boots, bench, spin's shape (lab 45257214350); the ledger read the vmlinux's QEMU start +8.4 against a bzImage's (lab 45260129735, #697). On a laptop half the copy is faulting in the destination's huge pages and half the copy, and a `pread` into guest RAM was no faster than the mapping's `memcpy`, so no cheaper copy was built. *Carried:* QEMU 0009 copies the segments 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; a machine made for an incoming migration copies nothing at reset, as before. *Measured* (bench, spin's shape and login, v20261123.07 against the same release with 0009's QEMU, interleaved): first login 351 → 342, −8.6 [−11.0, −4.0], sshd accepting −9.1 [−12.4, −5.9], the console prompt −7.7 [−11.4, −5.5], QEMU's RSS unmoved, 60 a side (lab 45260098299); restored −0.1 [−1.1, +0.7] evicted, −0.3 [−2.1, +0.9] cached, the state unmoved, the same run's cold login −6.9 [−12.9, −0.8], 40 a side (lab 45260694485). The gain is the whole traced copy. The record does not move: the patch adds no device, property or RAM block, and `boot:record` passed on the patched tree (lab 45261567066). A stub ELF whose notes have `p_align` 0 kills QEMU 11.2 with SIGFPE in `load_elf`, found while writing the build check (#705, not affected). *Status:* kept. + **11-23 · qemu · QEMU 0007 deleted: no release from v20261123.07 boots a bzImage (#660, parts run 45256311661, labs 45258887660, 45258106255, this change).** 0007 mapped a bzImage given to `-kernel` instead of reading it into QEMU's heap (#646, the 11-23 entry above). Since #645 the machine enters a release's vmlinux through PVH (`machine.OpenRelease` picks it by its two Xen notes), and QEMU's ELF loader maps that file without 0007. A release from .06 or before boots its bzImage with the QEMU it shipped, which carries 0007; only a lab tree of a new QEMU with an old release's kernel pays the read again. *Measured* (bench, nested, spin's shape and login, v20261123.07 against the same release with QEMU built without 0007, 40 a side, interleaved): first login +3.6 [−3.3, +7.8], sshd accepting −1.6 [−6.7, +5.6], QEMU's RSS +0.3 [−1.6, +2.1] MiB, its file RSS +0.2 [+0.2, +0.3], a different binary's pages (inferred) (lab 45258887660); restored login −0.4 [−1.5, +0.9] evicted, −0.1 [−0.9, +0.9] cached, the state unmoved (lab 45258106255). Neither number moves, as #660 expected: 0007 touched nothing on the PVH path. The QEMU build's check of the mapping goes with it. *Status:* deleted. The bzImage and `CONFIG_KERNEL_LZ4` stay until spin's `hack/machine/place.go` stops requiring `kernel/bzImage` (spin-stack/spin#1689). + **11-23 · lab · the traceable kernel is a vmlinux entered through PVH, as the release's (#697, lab 45260129735, this change).** *Why:* since #645 the release boots its vmlinux through PVH, and its traceable kernel was still a bzImage, so v20261123.07's published ledger read firmware, entry and setup at 47.1 ms against .06's 45.0, where the release had dropped its decompressor. *Changed:* `release traceable-kernel` publishes a self-randomizing vmlinux, checked as the release's, and no bzImage; `traceable:TAG` places whichever the release published; the ledger records `pvh` and names the window by it. *Proof* (bench, spin's shape, v20261123.07, 10 boots a tree, interleaved, the old traceable bzImage against the new traceable vmlinux): firmware, entry and setup 44.3 → 19.4, −24.9 [−25.8, −23.4]; QEMU's start and held start 41.9 → 50.3, +8.4, the vmlinux's load (#698); the kernel's 0 −16.8 [−18.2, −15.1]; first login −21.6 [−32.9, −11.0]. *Status:* in place. **11-23 · kernel · the boot's device-setup exits as one change: kernel 0021-0025 (#627, parts run 45256426877, labs 45260781177, 45261629539, this change).** *Why:* five patches each removed the VM exits their changelogs counted (#590, #591, #592), and none moved the first login alone; as a bound the five read −7.4 [−12.1, −2.8] at 60 a side (lab 45114405201). #627 asked whether "the boot's MMIO exits in device setup" is one change and, if so, for one arm at 120 a side, the set chosen before the run. *Changed:* the bound's five, from `archive/exp-batch2-bound`, as 0021-0025 after #645's 0014-0020; they apply to 7.3.6 with no fuzz. The build asserts each on its vmlinux (kernel/README.md); checkpatch `--strict` and sparse pass. 0022 keeps the risk #627 named: upstream a2f1e22390ac took out `pci_restore_state()`'s refusal of a state never saved, so its gate (AER, EEH, s390, Xen pcifront, `reset_root_port`) has to grow by hand with whatever calls error handlers next; it stayed in the set because the set was fixed before the run. *Measured* (bench, nested, spin's shape and login, against v20261123.07, interleaved): first login −9.4 [−14.2, −5.7], sshd accepting −9.5 [−14.4, −5.5], console prompt −10.4 [−14.2, −7.8], second login +0.3 [−0.1, +0.6], QEMU RSS −1.7 MiB [−1.8, −0.1], 120 a side (lab 45260781177). `restore-first`, 60 a side (lab 45261629539): restored login −0.4 [−2.0, +1.7] evicted and +0.2 [−6.6, +7.3] cached, the state +0.0 MiB [−0.1, +0.2], all within noise; its cold row −11.8 [−18.5, −3.2] evicted. The same set against v20261123.06 had read −9.2 [−12.2, −6.0] (lab 45231943664), before 7.3.6 and #645. *Status:* in place; reaches the goal number with the next release. From 4e67a2d966d544f776916418ed630296165ce517 Mon Sep 17 00:00:00 2001 From: Manuel de Brito Fontes Date: Mon, 23 Nov 2026 18:57:13 -0300 Subject: [PATCH 2/3] docs: internal/docsrec and spin-machine-dev docs, the log and the tables from files (#709) docsrec reads the log's entries (docs/log/-.md, YAML front matter and the prose) and the experiments' records (docs/experiments/*.json, one a table row) and renders the log and docs/boot-time.md's tables. spin-machine-dev docs log, docs tables and docs site render them; docs split is the migration, run once in the next commit and deleted there. TestSplitGivesTheTextBack is the migration's proof, against frozen copies of docs/log.md (the previous commit's) and docs/boot-time.md: the split's files render the whole log and every one of the nine tables byte for byte. Co-Authored-By: Claude Opus 5.5 --- cmd/spin-machine-dev/docs.go | 203 +++++ cmd/spin-machine-dev/main.go | 2 +- go.mod | 3 +- go.sum | 2 + internal/docsrec/docsrec.go | 65 ++ internal/docsrec/html.go | 52 ++ internal/docsrec/log.go | 217 +++++ internal/docsrec/split.go | 238 ++++++ internal/docsrec/split_test.go | 91 +++ internal/docsrec/tables.go | 241 ++++++ internal/docsrec/testdata/split/boot-time.md | 517 ++++++++++++ internal/docsrec/testdata/split/kinds.txt | 711 ++++++++++++++++ internal/docsrec/testdata/split/log.md | 815 +++++++++++++++++++ 13 files changed, 3155 insertions(+), 2 deletions(-) create mode 100644 cmd/spin-machine-dev/docs.go create mode 100644 internal/docsrec/docsrec.go create mode 100644 internal/docsrec/html.go create mode 100644 internal/docsrec/log.go create mode 100644 internal/docsrec/split.go create mode 100644 internal/docsrec/split_test.go create mode 100644 internal/docsrec/tables.go create mode 100644 internal/docsrec/testdata/split/boot-time.md create mode 100644 internal/docsrec/testdata/split/kinds.txt create mode 100644 internal/docsrec/testdata/split/log.md diff --git a/cmd/spin-machine-dev/docs.go b/cmd/spin-machine-dev/docs.go new file mode 100644 index 00000000..29569ca8 --- /dev/null +++ b/cmd/spin-machine-dev/docs.go @@ -0,0 +1,203 @@ +// SPDX-License-Identifier: Apache-2.0 + +package main + +import ( + "fmt" + "os" + "path/filepath" + "strconv" + "strings" + + "github.com/spf13/cobra" + + "github.com/spin-stack/machine/internal/docsrec" +) + +// docsCommand renders the pages that the log's entries and the experiments' records add up to. +// The pages are never committed (spin-stack/machine#709). +func docsCommand() *cobra.Command { + c := &cobra.Command{ + Use: "docs", + Short: "The log and boot-time.md's tables, rendered from docs/log and docs/experiments", + Long: `The log is one file an entry under docs/log, and the tables of docs/boot-time.md are one record +a row under docs/experiments. A pull request adds files of its own, so two in flight never touch +the same one. log and tables render the pages to stdout or --out; site writes both as web pages, +which pages.yml publishes beside the releases' page. Every verb refuses a file that does not parse.`, + } + c.AddCommand(docsLog(), docsTables(), docsSite(), docsSplit()) + return c +} + +// readLog is the repository's log. +func readLog() (docsrec.Log, error) { + root, err := repo() + if err != nil { + return docsrec.Log{}, err + } + l, err := docsrec.ReadLog(filepath.Join(root, docsrec.LogDir)) + if err != nil { + return docsrec.Log{}, couldNot(err) + } + return l, nil +} + +// readRecords is the repository's experiments. +func readRecords() ([]docsrec.Record, error) { + root, err := repo() + if err != nil { + return nil, err + } + records, err := docsrec.ReadRecords(filepath.Join(root, docsrec.ExperimentsDir)) + if err != nil { + return nil, couldNot(err) + } + return records, nil +} + +// writePage writes text to out, or to stdout when out is empty. +func writePage(c *cobra.Command, out, text string) error { + if out == "" { + _, err := fmt.Fprint(c.OutOrStdout(), text) + return err + } + if err := os.WriteFile(out, []byte(text), 0o644); err != nil { //nolint:gosec // a page to read + return couldNot(fmt.Errorf("writing %s: %w", out, err)) + } + return nil +} + +func docsLog() *cobra.Command { + var out string + c := &cobra.Command{ + Use: "log [--out FILE]", + Short: "The log as one page: docs/log's head, its entries by date under their weeks, and rework.md", + Args: cobra.NoArgs, + RunE: func(c *cobra.Command, _ []string) error { + l, err := readLog() + if err != nil { + return err + } + return writePage(c, out, l.Markdown()) + }, + } + c.Flags().StringVar(&out, "out", "", "the file to write; stdout when not given") + return c +} + +func docsTables() *cobra.Command { + var out string + c := &cobra.Command{ + Use: "tables [--out FILE]", + Short: "boot-time.md's tables, carried, measured and rejected, and open, from docs/experiments", + Args: cobra.NoArgs, + RunE: func(c *cobra.Command, _ []string) error { + records, err := readRecords() + if err != nil { + return err + } + return writePage(c, out, docsrec.TablesMarkdown(records)) + }, + } + c.Flags().StringVar(&out, "out", "", "the file to write; stdout when not given") + return c +} + +func docsSite() *cobra.Command { + var out string + c := &cobra.Command{ + Use: "site --out OUT", + Short: "Write the log and the tables as web pages, OUT/log.html and OUT/experiments.html", + Args: cobra.NoArgs, + RunE: func(c *cobra.Command, _ []string) error { + l, err := readLog() + if err != nil { + return err + } + records, err := readRecords() + if err != nil { + return err + } + if err := os.MkdirAll(out, 0o755); err != nil { + return couldNot(fmt.Errorf("making %s: %w", out, err)) + } + for _, p := range []struct{ name, title, markdown string }{ + {"log.html", "Log", l.Markdown()}, + {"experiments.html", "Experiments", docsrec.TablesMarkdown(records)}, + } { + html, err := docsrec.HTML(p.title, p.markdown) + if err != nil { + return couldNot(err) + } + if err := writePage(c, filepath.Join(out, p.name), html); err != nil { + return err + } + } + say(c, "wrote %s/log.html (%d entries) and %s/experiments.html (%d records)", out, len(l.Entries), out, len(records)) + return nil + }, + } + c.Flags().StringVar(&out, "out", "", "the directory the pages are written in") + _ = c.MarkFlagRequired("out") + return c +} + +func docsSplit() *cobra.Command { + var kinds string + c := &cobra.Command{ + Use: "split --kinds FILE", + Short: "Turn docs/log.md and boot-time.md's tables into docs/log and docs/experiments, once (#709)", + Args: cobra.NoArgs, + RunE: func(c *cobra.Command, _ []string) error { + root, err := repo() + if err != nil { + return err + } + read := func(p string) (string, error) { + data, err := os.ReadFile(filepath.Join(root, p)) + if err != nil { + return "", couldNot(fmt.Errorf("reading %s: %w", p, err)) + } + return string(data), nil + } + k := docsrec.Kinds{} + list, err := os.ReadFile(kinds) + if err != nil { + return couldNot(err) + } + for _, l := range strings.Split(strings.TrimSpace(string(list)), "\n") { + n, kind, _ := strings.Cut(l, " ") + i, err := strconv.Atoi(n) + if err != nil { + return couldNot(fmt.Errorf("%s: %q is not N issue|pr", kinds, l)) + } + k[i] = kind + } + log, err := read("docs/log.md") + if err != nil { + return err + } + bootTime, err := read("docs/boot-time.md") + if err != nil { + return err + } + files, err := docsrec.Split(log, bootTime, k) + if err != nil { + return couldNot(err) + } + for name, data := range files { + p := filepath.Join(root, name) + if err := os.MkdirAll(filepath.Dir(p), 0o755); err != nil { + return couldNot(err) + } + if err := os.WriteFile(p, data, 0o644); err != nil { //nolint:gosec // documentation + return couldNot(err) + } + } + say(c, "wrote %d files", len(files)) + return nil + }, + } + c.Flags().StringVar(&kinds, "kinds", "", "lines of N issue|pr, every number of the repository") + return c +} diff --git a/cmd/spin-machine-dev/main.go b/cmd/spin-machine-dev/main.go index eb25bdbd..cac12d61 100644 --- a/cmd/spin-machine-dev/main.go +++ b/cmd/spin-machine-dev/main.go @@ -92,7 +92,7 @@ func root() *cobra.Command { shellCmd(), vsockCmd("/dev/vhost-vsock"), menuconfigCmd(), cleanCmd(), outdatedCmd(), bumpCmd(), refreshCmd(), releaseCmd(), - releasesCommand(), + releasesCommand(), docsCommand(), osvCmd(), cvesCmd(), patchedCmd(), failedCmd(), diff --git a/go.mod b/go.mod index ba1464bb..0b855147 100644 --- a/go.mod +++ b/go.mod @@ -9,6 +9,8 @@ require ( github.com/spf13/cobra v1.10.2 github.com/spf13/pflag v1.1.0 github.com/spin-stack/go-tools v0.20261122.6 + github.com/yuin/goldmark v1.8.7 + go.yaml.in/yaml/v3 v3.0.6 golang.org/x/crypto v0.59.0 golang.org/x/sys v0.50.0 ) @@ -22,7 +24,6 @@ require ( github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.1 // indirect github.com/sirupsen/logrus v1.9.4 // indirect - go.yaml.in/yaml/v3 v3.0.6 // indirect golang.org/x/sync v0.24.0 // indirect ) diff --git a/go.sum b/go.sum index 79cf3d10..fb250ab8 100644 --- a/go.sum +++ b/go.sum @@ -45,6 +45,8 @@ github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHo github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= +github.com/yuin/goldmark v1.8.7 h1:XT/tNqCIbabh0ln675w4x3dv04kQBKi8NwYqi9IJaxI= +github.com/yuin/goldmark v1.8.7/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= go.yaml.in/yaml/v3 v3.0.6 h1:zcDfvjXEqTQmpjniUBLc91xYJMB2c4QOFxEF/LCEckM= go.yaml.in/yaml/v3 v3.0.6/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= diff --git a/internal/docsrec/docsrec.go b/internal/docsrec/docsrec.go new file mode 100644 index 00000000..bc69584f --- /dev/null +++ b/internal/docsrec/docsrec.go @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: Apache-2.0 + +// Package docsrec reads the log's entries, one file an entry under docs/log, and the experiments' +// records, one file a row under docs/experiments, and renders what they add up to: the log, and +// the tables of docs/boot-time.md. The pages are rendered, never committed (spin-stack/machine#709): +// every pull request that decided something appended to one docs/log.md and edited one table, so +// any two in flight conflicted once one merged, and each conflict became a replacement PR. A pull +// request now adds files of its own, which no other edits. +package docsrec + +import ( + "fmt" + "regexp" + "slices" + "strconv" + "time" +) + +// The directories, relative to the repository's root. +const ( + LogDir = "docs/log" + ExperimentsDir = "docs/experiments" +) + +// dateLayout is how a date is written in an entry's front matter, a record and a file name. +const dateLayout = "2006-01-02" + +// runID is a GitHub Actions run id, as a lab, report, compat or parts run is cited: every one is +// eleven digits, and no commit, count or measurement in the prose is. +var runID = regexp.MustCompile(`\b\d{11}\b`) + +// slug is the part of a file name after its date or issue. +var slug = regexp.MustCompile(`^[a-z0-9]+(-[a-z0-9]+)*$`) + +// parseDate reads a YYYY-MM-DD date, the only form a date is kept in. +func parseDate(s string) (time.Time, error) { + d, err := time.Parse(dateLayout, s) + if err != nil { + return time.Time{}, fmt.Errorf("date %q is not YYYY-MM-DD", s) + } + return d, nil +} + +// checkRefs holds the issues, pull requests and runs a file lists to its text: each issue and pull +// request is cited there as #N, and every run id the text cites is listed. A list is what a program +// reads instead of the prose, so it must say what the prose says. +func checkRefs(text string, issues, prs, runs []int) error { + for _, n := range slices.Concat(issues, prs) { + if !regexp.MustCompile(`#` + strconv.Itoa(n) + `\b`).MatchString(text) { + return fmt.Errorf("issues and prs: #%d is listed but the text does not cite it", n) + } + } + for _, id := range runID.FindAllString(text, -1) { + n, _ := strconv.Atoi(id) + if !slices.Contains(runs, n) { + return fmt.Errorf("runs: the text cites run %s, which runs does not list", id) + } + } + for _, n := range runs { + if !regexp.MustCompile(`\b` + strconv.Itoa(n) + `\b`).MatchString(text) { + return fmt.Errorf("runs: %d is listed but the text does not cite it", n) + } + } + return nil +} diff --git a/internal/docsrec/html.go b/internal/docsrec/html.go new file mode 100644 index 00000000..504ccfa8 --- /dev/null +++ b/internal/docsrec/html.go @@ -0,0 +1,52 @@ +// SPDX-License-Identifier: Apache-2.0 + +package docsrec + +import ( + "bytes" + "fmt" + "html/template" + + "github.com/yuin/goldmark" + "github.com/yuin/goldmark/extension" + "github.com/yuin/goldmark/parser" +) + +// page is a rendered page's frame: a page that fetches nothing, whose tables stay readable when a +// cell runs to a paragraph. +var page = template.Must(template.New("page").Parse(` + + + + +{{.Title}} - spin-machine + + + +

Releases · Log · Experiments

+{{.Body}} + + +`)) + +// HTML is markdown, GitHub's flavour, as a web page titled title. +func HTML(title, markdown string) (string, error) { + md := goldmark.New(goldmark.WithExtensions(extension.GFM), goldmark.WithParserOptions(parser.WithAutoHeadingID())) + var body bytes.Buffer + if err := md.Convert([]byte(markdown), &body); err != nil { + return "", fmt.Errorf("rendering %s: %w", title, err) + } + var out bytes.Buffer + if err := page.Execute(&out, struct { + Title string + Body template.HTML + }{title, template.HTML(body.String())}); err != nil { //nolint:gosec // goldmark's output of the repository's own prose + return "", fmt.Errorf("rendering %s: %w", title, err) + } + return out.String(), nil +} diff --git a/internal/docsrec/log.go b/internal/docsrec/log.go new file mode 100644 index 00000000..d8b49ac1 --- /dev/null +++ b/internal/docsrec/log.go @@ -0,0 +1,217 @@ +// SPDX-License-Identifier: Apache-2.0 + +package docsrec + +import ( + "bytes" + "cmp" + "errors" + "fmt" + "os" + "path/filepath" + "slices" + "strings" + "time" + + "go.yaml.in/yaml/v3" +) + +// The log's two hand-written files. README.md is the page's head, which GitHub also shows under the +// directory's listing; rework.md is section 2, read as a narrative. +const ( + logHead = "README.md" + logRework = "rework.md" +) + +// Entry is one dated entry of the log, docs/log/-.md: YAML front matter, then the +// prose. Rendered, it is one paragraph or more opening with **MM-DD · area · title.** +type Entry struct { + // Date is the entry's day, YYYY-MM-DD, as its file name starts. + Date string `yaml:"date"` + // Days is the head's day when the entry spans more than one, such as 09-29/30. It starts with + // Date's month and day. + Days string `yaml:"days,omitempty"` + // Order places the entry among its day's entries, lowest first; entries with the same order + // follow their file names. An entry may say "the entry above". + Order int `yaml:"order"` + // Area is the part of the machine the entry is about: kernel, qemu, image, lab, machine, ... + Area string `yaml:"area"` + // Title is the head after the area, without its closing period. + Title string `yaml:"title"` + Issues []int `yaml:"issues,flow,omitempty"` + PRs []int `yaml:"prs,flow,omitempty"` + Runs []int `yaml:"runs,flow,omitempty"` + + // Body is the prose after the head: on the head's line, or from the next when it starts with a + // newline. + Body string `yaml:"-"` + // File is the entry's file name. + File string `yaml:"-"` + + day time.Time +} + +// head is the entry's bold opening. +func (e Entry) head() string { + day := e.Days + if day == "" { + day = e.day.Format("01-02") + } + return "**" + day + " · " + e.Area + " · " + e.Title + ".**" +} + +// markdown is the entry as the log shows it. +func (e Entry) markdown() string { + if strings.HasPrefix(e.Body, "\n") { + return e.head() + e.Body + } + return e.head() + " " + e.Body +} + +// ParseEntry reads one entry, named name, and refuses one a field of which is missing or does not +// agree with the file name or the prose. +func ParseEntry(name string, data []byte) (Entry, error) { + e, err := parseEntry(name, data) + if err != nil { + return Entry{}, fmt.Errorf("%s: %w", name, err) + } + return e, nil +} + +func parseEntry(name string, data []byte) (Entry, error) { + rest, ok := bytes.CutPrefix(data, []byte("---\n")) + if !ok { + return Entry{}, errors.New("does not open with front matter (---)") + } + front, body, ok := bytes.Cut(rest, []byte("\n---\n")) + if !ok { + return Entry{}, errors.New("its front matter is not closed (---)") + } + var e Entry + dec := yaml.NewDecoder(bytes.NewReader(front)) + dec.KnownFields(true) + if err := dec.Decode(&e); err != nil { + return Entry{}, fmt.Errorf("front matter: %w", err) + } + e.File = name + e.Body = strings.TrimRight(string(body), " \n") + day, err := parseDate(e.Date) + if err != nil { + return Entry{}, err + } + e.day = day + base, ok := strings.CutSuffix(name, ".md") + if !ok || !strings.HasPrefix(base, e.Date+"-") || !slug.MatchString(strings.TrimPrefix(base, e.Date+"-")) { + return Entry{}, fmt.Errorf("the file is not named %s-.md, a slug of a-z, 0-9 and -", e.Date) + } + if e.Days != "" && !strings.HasPrefix(e.Days, day.Format("01-02")+"/") { + return Entry{}, fmt.Errorf("days %q does not start with the date's %s/", e.Days, day.Format("01-02")) + } + if e.Order < 1 { + return Entry{}, errors.New("order: required, the entry's place among its day's, from 1") + } + for _, f := range []struct{ name, v string }{{"area", e.Area}, {"title", e.Title}, {"the prose", strings.TrimSpace(e.Body)}} { + if f.v == "" { + return Entry{}, fmt.Errorf("%s: required", f.name) + } + } + if err := checkRefs(e.Title+"\n"+e.Body, e.Issues, e.PRs, e.Runs); err != nil { + return Entry{}, err + } + return e, nil +} + +// Log is the log as its files hold it. +type Log struct { + // Head and Rework are README.md and rework.md as written. + Head, Rework string + // Entries are in the log's order. + Entries []Entry +} + +// ReadLog reads the log's directory. Every file in it is the head, section 2 or an entry; anything +// else is refused rather than left out of the page. +func ReadLog(dir string) (Log, error) { + files, err := os.ReadDir(dir) + if err != nil { + return Log{}, fmt.Errorf("reading the log: %w", err) + } + var l Log + for _, f := range files { + path := filepath.Join(dir, f.Name()) + data, err := os.ReadFile(path) + if err != nil { + return Log{}, fmt.Errorf("reading the log: %w", err) + } + switch f.Name() { + case logHead: + l.Head = string(data) + case logRework: + l.Rework = string(data) + default: + e, err := ParseEntry(f.Name(), data) + if err != nil { + return Log{}, fmt.Errorf("reading the log: %s: %w", dir, err) + } + l.Entries = append(l.Entries, e) + } + } + if l.Head == "" || l.Rework == "" { + return Log{}, fmt.Errorf("reading the log: %s needs %s and %s", dir, logHead, logRework) + } + slices.SortFunc(l.Entries, func(a, b Entry) int { + return cmp.Or(a.day.Compare(b.day), cmp.Compare(a.Order, b.Order), strings.Compare(a.File, b.File)) + }) + return l, nil +} + +// The log's weeks. They ran Monday to Sunday from the first commit, and the log was first written +// on 2026-11-13, which ends week 10; from then on a week runs Saturday to Friday. +var ( + firstWeek = time.Date(2026, 9, 7, 0, 0, 0, 0, time.UTC) + weeksMove = time.Date(2026, 11, 14, 0, 0, 0, 0, time.UTC) +) + +// week is the number of the log's week that holds day, and its first and last days. +func week(day time.Time) (n int, first, last time.Time) { + days := func(a, b time.Time) int { return int(b.Sub(a).Hours() / 24) } + if day.Before(weeksMove) { + k := days(firstWeek, day) / 7 + first = firstWeek.AddDate(0, 0, 7*k) + last = first.AddDate(0, 0, 6) + if !last.Before(weeksMove) { + last = weeksMove.AddDate(0, 0, -1) + } + return k + 1, first, last + } + before := (days(firstWeek, weeksMove) + 6) / 7 + k := days(weeksMove, day) / 7 + first = weeksMove.AddDate(0, 0, 7*k) + return before + 1 + k, first, first.AddDate(0, 0, 6) +} + +// weekHeading is a week's heading, its last day without the year when the year is the first's. +func weekHeading(day time.Time) string { + n, first, last := week(day) + end := last.Format("01-02") + if last.Year() != first.Year() { + end = last.Format(dateLayout) + } + return fmt.Sprintf("### Week %d: %s to %s", n, first.Format(dateLayout), end) +} + +// Markdown is the log as one page: the head, each week's heading and entries, and section 2. +func (l Log) Markdown() string { + var b strings.Builder + b.WriteString(l.Head) + heading := "" + for _, e := range l.Entries { + if h := weekHeading(e.day); h != heading { + heading = h + b.WriteString("\n" + h + "\n") + } + b.WriteString("\n" + e.markdown() + "\n") + } + b.WriteString("\n" + l.Rework) + return b.String() +} diff --git a/internal/docsrec/split.go b/internal/docsrec/split.go new file mode 100644 index 00000000..3c64fa07 --- /dev/null +++ b/internal/docsrec/split.go @@ -0,0 +1,238 @@ +// SPDX-License-Identifier: Apache-2.0 + +package docsrec + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "regexp" + "slices" + "strconv" + "strings" + "time" + + "go.yaml.in/yaml/v3" +) + +// Kinds says whether each number of this repository is an issue or a pull request. +type Kinds map[int]string + +// localRef is a #N of this repository: not owner/repo#N, and not after the name of another +// project, as in "go-tools #131" or "upstream #42858". +var localRef = regexp.MustCompile(`(?:^|([A-Za-z-]+) |[^\w/#\s])#(\d+)\b`) + +var otherProjects = []string{"upstream", "go-tools", "spin", "Firecracker", "linux-loader"} + +// refs are the issues, pull requests and runs text cites. +func (k Kinds) refs(text string) (issues, prs, runs []int) { + for _, m := range localRef.FindAllStringSubmatch(text, -1) { + if slices.Contains(otherProjects, m[1]) { + continue + } + n, _ := strconv.Atoi(m[2]) + switch k[n] { + case "issue": + issues = append(issues, n) + case "pr": + prs = append(prs, n) + } + } + for _, id := range runID.FindAllString(text, -1) { + n, _ := strconv.Atoi(id) + runs = append(runs, n) + } + for _, s := range []*[]int{&issues, &prs, &runs} { + slices.Sort(*s) + *s = slices.Compact(*s) + } + return issues, prs, runs +} + +// first is the first issue or pull request text cites, or 0. +func (k Kinds) first(text string) int { + for _, m := range localRef.FindAllStringSubmatch(text, -1) { + n, _ := strconv.Atoi(m[2]) + if !slices.Contains(otherProjects, m[1]) && k[n] != "" { + return n + } + } + return 0 +} + +var ( + parenthetical = regexp.MustCompile(`\([^()]*\)`) + notSlug = regexp.MustCompile(`[^a-z0-9]+`) +) + +// slugOf is a file name's slug for text: its first words outside parentheses. +func slugOf(text string, words int) string { + text = strings.NewReplacer("'", "", "’", "").Replace(text) + s := strings.ToLower(parenthetical.ReplaceAllString(text, "")) + if strings.Trim(notSlug.ReplaceAllString(s, ""), "-") == "" { + s = strings.ToLower(text) + } + parts := strings.Split(strings.Trim(notSlug.ReplaceAllString(s, "-"), "-"), "-") + if len(parts) > words { + parts = parts[:words] + } + return strings.Join(parts, "-") +} + +// unique makes name unique among taken by a numbered suffix. +func unique(taken map[string]bool, name, ext string) string { + n := name + ext + for i := 2; taken[n]; i++ { + n = fmt.Sprintf("%s-%d%s", name, i, ext) + } + taken[n] = true + return n +} + +var ( + entryHead = regexp.MustCompile(`^\*\*(\d\d)-(\d\d)(/[\d-]+)? · (.+?) · (.+?)\.\*\*( .*)?$`) + weekLine = regexp.MustCompile(`^### Week \d+: (\d{4})-(\d\d)-`) +) + +// Split turns docs/log.md and the tables of docs/boot-time.md into the files that replace them, +// keyed by their paths in the repository. It is the migration of spin-stack/machine#709, run once. +// +// The log's entries carry their month and day only. Each takes its year from the week heading it +// is under, which names it, a year later when its month comes before the heading's. +func Split(log, bootTime string, k Kinds) (map[string][]byte, error) { + files := map[string][]byte{} + if err := k.splitLog(log, files); err != nil { + return nil, err + } + if err := k.splitTables(bootTime, files); err != nil { + return nil, err + } + return files, nil +} + +func (k Kinds) splitLog(log string, files map[string][]byte) error { + lines := strings.Split(log, "\n") + s1 := slices.Index(lines, "## 1. Chronological log") + s2 := slices.Index(lines, "## 2. Rework cycles") + if s1 < 0 || s2 < s1 { + return errors.New("docs/log.md: no sections 1 and 2") + } + files[LogDir+"/"+logHead] = []byte(strings.Join(lines[:s1+3], "\n") + "\n") + files[LogDir+"/"+logRework] = []byte(strings.Join(lines[s2:], "\n")) + + type raw struct { + e Entry + lines []string + } + var entries []*raw + var year int + var month time.Month + for i, l := range lines[s1+3 : s2] { + if m := weekLine.FindStringSubmatch(l); m != nil { + year, _ = strconv.Atoi(m[1]) + mo, _ := strconv.Atoi(m[2]) + month = time.Month(mo) + continue + } + m := entryHead.FindStringSubmatch(l) + if m == nil { + if len(entries) > 0 { + entries[len(entries)-1].lines = append(entries[len(entries)-1].lines, l) + } else if strings.TrimSpace(l) != "" { + return fmt.Errorf("docs/log.md:%d: text before the first entry", s1+4+i) + } + continue + } + mo, _ := strconv.Atoi(m[1]) + day, _ := strconv.Atoi(m[2]) + y := year + if time.Month(mo) < month { + y++ + } + e := Entry{ + Date: time.Date(y, time.Month(mo), day, 0, 0, 0, 0, time.UTC).Format(dateLayout), + Area: m[4], + Title: m[5], + } + if m[3] != "" { + e.Days = m[1] + "-" + m[2] + m[3] + } + first := strings.TrimPrefix(m[6], " ") + entries = append(entries, &raw{e: e, lines: []string{first}}) + } + taken := map[string]bool{} + orders := map[string]int{} + for _, r := range entries { + e := r.e + e.Body = strings.TrimRight(strings.Join(r.lines, "\n"), " \n") + orders[e.Date] += 10 + e.Order = orders[e.Date] + e.Issues, e.PRs, e.Runs = k.refs(e.Title + "\n" + e.Body) + var front bytes.Buffer + enc := yaml.NewEncoder(&front) + enc.SetIndent(2) + if err := enc.Encode(e); err != nil { + return fmt.Errorf("writing the entry %s %s: %w", e.Date, e.Title, err) + } + name := unique(taken, e.Date+"-"+slugOf(e.Title, 8), ".md") + files[LogDir+"/"+name] = []byte("---\n" + front.String() + "---\n" + e.Body + "\n") + } + return nil +} + +func (k Kinds) splitTables(bootTime string, files map[string][]byte) error { + lines := strings.Split(bootTime, "\n") + taken := map[string]bool{} + for _, t := range Tables { + at := slices.Index(lines, strings.Repeat("#", t.Level)+" "+t.Heading) + if at < 0 { + return fmt.Errorf("docs/boot-time.md: no heading %q", t.Heading) + } + header := strings.SplitN(t.Markdown(nil), "\n", 2)[0] + for at < len(lines) && lines[at] != header { + at++ + } + if at == len(lines) { + return fmt.Errorf("docs/boot-time.md: %q has no table", t.Heading) + } + for i, l := range lines[at+2:] { + if !strings.HasPrefix(l, "|") { + break + } + cells := strings.Split(strings.TrimSuffix(strings.TrimPrefix(l, "| "), " |"), " | ") + if len(cells) != len(t.columns) { + return fmt.Errorf("docs/boot-time.md:%d: %d cells, %q has %d columns", at+3+i, len(cells), t.Heading, len(t.columns)) + } + byField := map[string]string{} + for j, c := range t.columns { + byField[c.field] = cells[j] + } + r := Record{ + Decision: t.Decision, Section: t.Section, Order: 10 * (i + 1), + Change: byField["change"], Where: byField["where"], Result: byField["result"], + Evidence: byField["evidence"], Shape: byField["shape"], Source: byField["source"], + Number: byField["number"], Phase: byField["phase"], DecidedBy: byField["decided_by"], + State: byField["state"], + } + if d := byField["date"]; d != "" { + // The tables began with the repository on 2026-09-07 and have not seen a new year. + r.Date = "2026-" + d + } + r.Issues, r.PRs, r.Runs = k.refs(l) + name := slugOf(r.Change, 6) + if n := k.first(r.Change); n > 0 { + name = strconv.Itoa(n) + "-" + name + } + var data bytes.Buffer + enc := json.NewEncoder(&data) + enc.SetEscapeHTML(false) + enc.SetIndent("", " ") + if err := enc.Encode(r); err != nil { + return fmt.Errorf("writing the record %q: %w", r.Change, err) + } + files[ExperimentsDir+"/"+unique(taken, name, ".json")] = data.Bytes() + } + } + return nil +} diff --git a/internal/docsrec/split_test.go b/internal/docsrec/split_test.go new file mode 100644 index 00000000..7fbd0265 --- /dev/null +++ b/internal/docsrec/split_test.go @@ -0,0 +1,91 @@ +// SPDX-License-Identifier: Apache-2.0 + +package docsrec + +import ( + "os" + "path/filepath" + "strconv" + "strings" + "testing" +) + +// TestSplitGivesTheTextBack is the migration's proof: the files Split makes from docs/log.md and +// docs/boot-time.md, as they stood before it, render the log and every table byte for byte. +func TestSplitGivesTheTextBack(t *testing.T) { + read := func(name string) string { + data, err := os.ReadFile(filepath.Join("testdata/split", name)) + if err != nil { + t.Fatal(err) + } + return string(data) + } + kinds := Kinds{} + lines := strings.Split(strings.TrimSpace(read("kinds.txt")), "\n") + for _, l := range lines { + n, kind, _ := strings.Cut(l, " ") + i, err := strconv.Atoi(n) + if err != nil { + t.Fatalf("kinds.txt: %q", l) + } + kinds[i] = kind + } + log, bootTime := read("log.md"), read("boot-time.md") + files, err := Split(log, bootTime, kinds) + if err != nil { + t.Fatal(err) + } + root := t.TempDir() + for name, data := range files { + p := filepath.Join(root, name) + if err := os.MkdirAll(filepath.Dir(p), 0o755); err != nil { + t.Fatal(err) + } + if err := os.WriteFile(p, data, 0o644); err != nil { + t.Fatal(err) + } + } + l, err := ReadLog(filepath.Join(root, LogDir)) + if err != nil { + t.Fatal(err) + } + if got := l.Markdown(); got != log { + diff(t, "docs/log.md", log, got) + } + n := 0 + for _, line := range strings.Split(log, "\n") { + if entryHead.MatchString(line) { + n++ + } + } + if len(l.Entries) != n { + t.Errorf("%d entries from a log with %d heads", len(l.Entries), n) + } + records, err := ReadRecords(filepath.Join(root, ExperimentsDir)) + if err != nil { + t.Fatal(err) + } + for _, tb := range Tables { + got := tb.Markdown(records) + header := strings.SplitN(got, "\n", 2)[0] + "\n" + at := strings.Index(bootTime, "#"+" "+tb.Heading+"\n") + start := at + strings.Index(bootTime[at:], header) + end := start + strings.Index(bootTime[start:], "\n\n") + 1 + if want := bootTime[start:end]; got != want { + diff(t, tb.Heading, want, got) + } + } + t.Logf("%d entries, %d records", len(l.Entries), len(records)) +} + +func diff(t *testing.T, what, want, got string) { + t.Helper() + w, g := strings.Split(want, "\n"), strings.Split(got, "\n") + for i := range min(len(w), len(g)) { + if w[i] != g[i] { + t.Errorf("%s: line %d differs:\nwant %q\ngot %q", what, i+1, w[i], g[i]) + return + } + } + t.Errorf("%s: %d lines, want %d", what, len(g), len(w)) +} diff --git a/internal/docsrec/tables.go b/internal/docsrec/tables.go new file mode 100644 index 00000000..cc3fed5b --- /dev/null +++ b/internal/docsrec/tables.go @@ -0,0 +1,241 @@ +// SPDX-License-Identifier: Apache-2.0 + +package docsrec + +import ( + "bytes" + "cmp" + "encoding/json" + "errors" + "fmt" + "maps" + "os" + "path/filepath" + "slices" + "strings" +) + +// Record is one row of docs/boot-time.md's tables, docs/experiments/[-].json: a change +// the machine carries, one measured and rejected, or one still open. Its table's columns say which +// of the text fields it has; each holds its cell as the table shows it. +type Record struct { + // Decision is carried, rejected or open, and with Section names the record's table. + Decision string `json:"decision"` + // Section is a rejected change's part of the machine: kernel, firmware, image, login, restore, + // qmp or memory. + Section string `json:"section,omitempty"` + // Order places the row in its table, lowest first; rows with the same order follow their file + // names. The split left gaps of 10, so a row goes between two without moving either. + Order int `json:"order"` + // Date is when a rejected change was decided, YYYY-MM-DD. + Date string `json:"date,omitempty"` + + Change string `json:"change"` + Where string `json:"where,omitempty"` + Result string `json:"result,omitempty"` + Evidence string `json:"evidence,omitempty"` + Shape string `json:"shape,omitempty"` + Source string `json:"source,omitempty"` + Number string `json:"number,omitempty"` + Phase string `json:"phase,omitempty"` + DecidedBy string `json:"decided_by,omitempty"` + State string `json:"state,omitempty"` + + Issues []int `json:"issues,omitempty"` + PRs []int `json:"prs,omitempty"` + Runs []int `json:"runs,omitempty"` + + // File is the record's file name. + File string `json:"-"` +} + +// cells is each text field by its JSON name. Date's cell is its month and day, as the tables have +// always shown it. +func (r Record) cells() map[string]string { + date := r.Date + if len(date) == len(dateLayout) { + date = date[5:] + } + return map[string]string{ + "change": r.Change, "where": r.Where, "result": r.Result, "evidence": r.Evidence, + "shape": r.Shape, "source": r.Source, "date": date, "number": r.Number, "phase": r.Phase, + "decided_by": r.DecidedBy, "state": r.State, + } +} + +// column is one column of a table: its heading and the record's field it shows. +type column struct{ heading, field string } + +var ( + carriedColumns = []column{ + {"Item", "change"}, {"Where", "where"}, {"Earns (Δp50 of taking it back)", "result"}, + {"Evidence", "evidence"}, {"Run", "source"}, + } + rejectedColumns = []column{ + {"Idea", "change"}, {"Result", "result"}, {"Shape", "shape"}, {"Source", "source"}, {"Date", "date"}, + } + openColumns = []column{ + {"Experiment", "change"}, {"Number", "number"}, {"Phase, p50, ceiling", "phase"}, + {"Decided by", "decided_by"}, {"State", "state"}, + } +) + +// Table is one of docs/boot-time.md's tables, under the heading it has there. +type Table struct { + Decision, Section string + // Level and Heading are the heading's level (2 or 3) and text. + Level int + Heading string + columns []column +} + +// Tables are the tables in the order boot-time.md has them. "Measured and rejected" is a heading of +// its own above its sections. +var Tables = []Table{ + {"carried", "", 2, "What the machine carries", carriedColumns}, + {"rejected", "kernel", 3, "Kernel and its command line", rejectedColumns}, + {"rejected", "firmware", 3, "Firmware, QEMU and the machine", rejectedColumns}, + {"rejected", "image", 3, "systemd and the image", rejectedColumns}, + {"rejected", "login", 3, "The login", rejectedColumns}, + {"rejected", "restore", 3, "The restore and checkpoints", rejectedColumns}, + {"rejected", "qmp", 3, "QMP and vsock", rejectedColumns}, + {"rejected", "memory", 3, "Memory and the host", rejectedColumns}, + {"open", "", 2, "Open experiments", openColumns}, +} + +// table is the table r belongs in. +func (r Record) table() (Table, error) { + for _, t := range Tables { + if t.Decision == r.Decision && t.Section == r.Section { + return t, nil + } + } + if !slices.Contains([]string{"carried", "rejected", "open"}, r.Decision) { + return Table{}, fmt.Errorf("decision %q is not carried, rejected or open", r.Decision) + } + if r.Decision == "rejected" { + return Table{}, fmt.Errorf("section %q is not kernel, firmware, image, login, restore, qmp or memory", r.Section) + } + return Table{}, fmt.Errorf("section: a %s record has none", r.Decision) +} + +// ParseRecord reads one record, named name, and refuses one whose table is unknown, which lacks a +// cell its table shows or has one it does not, or whose lists do not agree with its text. +func ParseRecord(name string, data []byte) (Record, error) { + r, err := parseRecord(name, data) + if err != nil { + return Record{}, fmt.Errorf("%s: %w", name, err) + } + return r, nil +} + +func parseRecord(name string, data []byte) (Record, error) { + var r Record + dec := json.NewDecoder(bytes.NewReader(data)) + dec.DisallowUnknownFields() + if err := dec.Decode(&r); err != nil { + return Record{}, err + } + r.File = name + if base, ok := strings.CutSuffix(name, ".json"); !ok || !slug.MatchString(base) { + return Record{}, errors.New("the file is not named [-].json, a slug of a-z, 0-9 and -") + } + t, err := r.table() + if err != nil { + return Record{}, err + } + if r.Order < 1 { + return Record{}, errors.New("order: required, the row's place in its table, from 1") + } + if r.Date != "" { + if _, err := parseDate(r.Date); err != nil { + return Record{}, err + } + } + cells := r.cells() + for _, c := range t.columns { + if strings.TrimSpace(cells[c.field]) == "" { + return Record{}, fmt.Errorf("%s: required, the table's %q", c.field, c.heading) + } + if strings.Contains(cells[c.field], "\n") { + return Record{}, fmt.Errorf("%s: a cell is one line", c.field) + } + delete(cells, c.field) + } + for _, field := range slices.Sorted(maps.Keys(cells)) { + if cells[field] != "" { + return Record{}, fmt.Errorf("%s: %q has no such column", field, t.Heading) + } + } + var text strings.Builder + all := r.cells() + for _, field := range slices.Sorted(maps.Keys(all)) { + text.WriteString(all[field] + "\n") + } + if err := checkRefs(text.String(), r.Issues, r.PRs, r.Runs); err != nil { + return Record{}, err + } + return r, nil +} + +// ReadRecords reads every record in dir, in the order their tables show them. +func ReadRecords(dir string) ([]Record, error) { + files, err := os.ReadDir(dir) + if err != nil { + return nil, fmt.Errorf("reading the experiments: %w", err) + } + var records []Record + for _, f := range files { + data, err := os.ReadFile(filepath.Join(dir, f.Name())) + if err != nil { + return nil, fmt.Errorf("reading the experiments: %w", err) + } + r, err := ParseRecord(f.Name(), data) + if err != nil { + return nil, fmt.Errorf("reading the experiments: %s: %w", dir, err) + } + records = append(records, r) + } + slices.SortFunc(records, func(a, b Record) int { + return cmp.Or(cmp.Compare(a.Order, b.Order), strings.Compare(a.File, b.File)) + }) + return records, nil +} + +// Markdown is t's rows among records, under its header row. +func (t Table) Markdown(records []Record) string { + var b strings.Builder + row := func(cells []string) { b.WriteString("| " + strings.Join(cells, " | ") + " |\n") } + var headings, rule []string + for _, c := range t.columns { + headings, rule = append(headings, c.heading), append(rule, "---") + } + row(headings) + b.WriteString("|" + strings.Join(rule, "|") + "|\n") + for _, r := range records { + if r.Decision != t.Decision || r.Section != t.Section { + continue + } + cells := r.cells() + var line []string + for _, c := range t.columns { + line = append(line, cells[c.field]) + } + row(line) + } + return b.String() +} + +// TablesMarkdown is every table as one page, each under its heading in boot-time.md. +func TablesMarkdown(records []Record) string { + var b strings.Builder + b.WriteString("# Experiments\n\nThe tables of docs/boot-time.md, rendered from docs/experiments by " + + "`spin-machine-dev docs tables`. docs/boot-time.md says how each is read.\n") + for _, t := range Tables { + if t.Decision == "rejected" && t.Section == Tables[1].Section { + b.WriteString("\n## Measured and rejected\n") + } + b.WriteString("\n" + strings.Repeat("#", t.Level) + " " + t.Heading + "\n\n" + t.Markdown(records)) + } + return b.String() +} diff --git a/internal/docsrec/testdata/split/boot-time.md b/internal/docsrec/testdata/split/boot-time.md new file mode 100644 index 00000000..d3c30fb9 --- /dev/null +++ b/internal/docsrec/testdata/split/boot-time.md @@ -0,0 +1,517 @@ +# Boot time: where it stands + +This page follows the goal's two numbers (AGENTS.md, "The goal"). It says where each stands and where +its time goes. It lists what the machine carries for them and what each +item earns, what was tried and rejected, and what is open. `docs/log.md` tells each change, dated. +Each release's own numbers are in `docs/releases.md`. What the guest's memory and disk cost is in +`docs/memory-and-disk.md`. How a number is measured is [measuring.md](measuring.md), and the lab's +commands are in `docs/cli.md`, "Measuring". + +Every number here comes from the bench fleet (spin-stack/ci: AWS c8id.4xlarge, Xeon 6975P-C, +nested KVM, scratch on local NVMe) in spin's shape, as p50 or p50/p95 in ms, unless a row says +otherwise. An interval is the bootstrap 95% interval of a Δp50. + +## Where the two numbers stand + +| Number | Probe | p50/p95 | Over 100 ms | Run | +|---|---|---|---|---| +| Cold boot to the first SSH login | `ssh-first`: from before QEMU's exec to `true` run over SSH | 456/477 | +356 | report 44811347183, v20261120.04 | +| The same, QEMU started ahead | `prestart`, `prestarted boot`: from the request | 428/440 | +328 | the same | +| A checkpoint restored to the first login | `restore-first`, `evicted`: the state read from NVMe, out of the page cache | 108/111 | +8 | the same | +| The same, QEMU started ahead | `prestart`, `restored into prestarted` | 83.2/87.1 | under | the same | + +**The cold number's probe stopped adding work on 11-22 (#450).** `ssh-first` used to close the +connection that timed `accepts` and log in on a new one, and on spin's path sshd started a session +for the closed one beside the first login. It now logs in over the connection accepted. In one +run, the probe's two versions as rows of one tree: accept to login −4.3 [−5.4, −3.0], first login +−4.4 [−9.1, +0.3] (bench, spin's shape and login, v20261122.01, 40 each, lab 44987441326). A +release measured with the new probe reads ~4 ms lower without the machine having changed. + +These are the release's numbers, booted interleaved with v20261120.03 (`docs/releases.md`). Two +runs are two machines, so compare a new number only with one booted in the same run (`docs/measuring.md`, +rule 3). + +**The restore is under 100 ms when QEMU is started ahead, and the cold boot is not close.** A +cold boot cannot reach 100 ms by userspace work alone: QEMU, the firmware and the kernel take +~140 ms before PID 1 runs (budget below), ~150 once two of its clocks are corrected (#665, #666). Without systemd, sshd accepted at 189 ms in spin's shape +(lab 44750322384, 2026-11-20). Every phase before PID 1 has to shrink as well. + +### What spin runs, and what the probes boot + +The probes boot and log in as spin does, unless a run asks otherwise (docs/cli.md, "Measuring"): + +- **The shape.** spin (spin-stack/spin, `internal/runner/vmm/vmm.go`) boots 1 vCPU and 128 MiB, + with ceilings of 16 vCPUs and 8 GiB. Its hotplug controller has 16 targets, 4 of them for disks + attached while it runs and the rest for the extensions it boots with + (`internal/runner/qemu/spec.go`, `controllerTargets`, since spin's c0ffbc0 of 2026-11-20). The + probes boot 16 too. Against the 4 they booted before, 16 read within noise: first login −3.8 + [−11.1, +4.5] (lab 44847364468, 2026-11-21), so the budget's rows taken with 4 stand. +- **The memory.** spin sizes every workspace through virtio-mem right after it starts, to 2048 MiB + unless the workspace asks for more (`installconfig.MinMemoryMB`, the least and the default). The + probes plug 2048 (`plugged=2048`). A guest left at 128 MiB runs its OOM killer through every boot + (lab 44784196287). +- **The login.** spin turns off systemd's vsock sshd (`systemd.ssh_auto=0`). It reaches a + long-running `ssh.service` as root through its supervisor's forwarder to 127.0.0.1:22 + (`login=spin`). The image's own vsock lane is `login=lane`. +- **Checkpoints.** A checkpoint is mapped-ram, saved and loaded on 8 multifd channels + (`machine.DefaultChannels`). Before the RAM load, the resume reads the state ahead. +- **The host.** spin's host must set THP defrag to `defer`, and spin does not set it + (`docs/memory-and-disk.md`, "What the host must set"). The probes leave the bench host's policy + as it is, unless `restore-together` is given `defrag=`. +- **The host key.** Before it execs systemd, spin's vminitd places the workspace's host key at + `/run/spin/ssh/ssh_host_ed25519_key` with a drop-in naming it sshd's only `HostKey`, and the + image's keygen then does not run (#515). `login=spin` does the same from a shell as PID 1, a + stand-in that costs 6-8 ms of its own before systemd (docs/measuring.md, "The ledger"; #575). +- **Still not spin's.** spin boots `/sbin/vminitd` from its own initrd before systemd. Its + supervisor starts `ssh.service` when it installs the user CA. The probes boot the image's init + behind the handoff's shell. + +Most numbers taken before 2026-11-21 used another shape (2 vCPUs, 2 GiB, no ceilings, the +"ladder" shape) and another login (the lane). The "Shape" column of each row below says which. A +row marked spin from before that date passed spin's shape options by hand (#319). Read a number +in the ladder shape as a lead in spin's shape. + +### The bench fleet is nested, not metal + +On a c8i.metal-48xl (the same CPU), the cold first login read 332 ms against 378-392 nested +(v20261114.02, ladder shape, lab 44537498507), so nesting costs ~50-60 ms. Most of that is VM +exits: the PCI walk takes 5.00 ms nested against 2.22 on metal, about 29 µs an exit against 13 +(labs 44535161371, 44535156851). A production host that is not nested starts closer to the goal. + +**Both hosts make the same exits, and the nested ones cost more** (#565, the `exits` probe, +v20261122.06, labs 45082640147 and 45082640186). A cold boot to the first login makes ~10,400 +exits on either host: CPUID 3805, MMIO 3138, MSR writes 1169 (1043 of them the TSC deadline), +preemption timer 827, port I/O 667, interrupts 424, HLT 334, EPT violations 172. The nested L1 +spends 78.7 ms on them against 48.3 on metal. Removing 1541 CPUID exits moved the first login +−10.3 ms, ~6.7 µs an exit. EC2 gives the L1 EPT, VMCS shadowing and APICv, all on, so no L1 +setting is left to turn. Every exit removed counts at ~5-15 µs nested. #565 ranks the levers. + +**The EPT violations are half guest RAM first touched, half MMIO first touched** (#568, `exits`, +v20261123.04, lab 45111606645, 3 boots, the same counts in each). Of 171 at ~110 µs each nested +(18.9 ms), 52 land in the 128 MiB base and 6 just above it, 48-51 in the memory virtio-mem plugs +from 4 GiB, and ~65 at MMIO addresses, where KVM's first fault on a page installs the entry that +every later access exits through as EPT_MISCONFIG: 39 in the PCIe ECAM at 2.75 GiB, 9 below 4 GiB +(the IOAPIC, the local APIC, the flash), 17 in the 64-bit BARs at 12 GiB. Prefaulting the base +in a QEMU started ahead could win at most the base's ~58 × 110 µs, ~6 ms, of `prestart` alone, +since `ssh-first`'s clock starts before QEMU's exec. That is under the noise and off both goal +numbers, so it was not built. + +**Density: a host's first login holds until about a third to a half of its CPUs are busy** (#563, +section 2, `density`, v20261123.04, spin's shape and login, 2026-11-23). Each row boots that many +workspaces first, logs into each, lets them settle 10 s, and times one more's first login. Under +`load=cpu` every crowd workspace keeps its one vCPU busy. The line #563 reads is a first login p95 +within 25% of the empty host's in the same run. + +| host | load | crowd: first login p50/p95 | within 25% | runs | +|---|---|---|---|---| +| nested c8id.4xlarge, 16 CPUs | cpu | 0: 387/417; 4: 378/431; 8: 441/450; 16: 1015/1215; 24: 941/1196 | up to 8 | lab 45110655407, 10 a row | +| metal c8i.metal-48xl, 192 CPUs | cpu | 0: 337/447; 16: 331/488; 32: 335/344; 48: 336/341 | up to 48 | lab 45110663095, 10 a row | +| the same | cpu | 0: 342/363; 64: 327/366; 96: 466/486 | up to 64, not 96 | lab 45110670764, 8 a row | +| the same | idle | 0: 345/368; 16: 336/343; 32: 329/341; 48: 334/352 | all | lab 45110678888, 10 a row | +| the same | idle | 0: 342/356; 64: 328/350; 96: 331/340 | all | lab 45110688511, 8 a row | + +Idle workspaces cost a metal host nothing up to 96, as they cost the bench nothing up to 16 (lab +44667235868). Busy ones moved the first login at 16 of the bench's 16 CPUs, and at 96 of metal's +192 (+124 ms p50). The metal empty row's p95 of 447 in lab 45110663095 is one slow boot of ten. +Between 64 and 96 is unmeasured. The crowd boots one at a time, ~0.8 s each on metal's EBS +scratch and ~0.75-1.1 s on the bench's NVMe. Section 1 of #563, what nesting costs a running +workspace's I/O, needs `io` and `build` probes and equal storage on both hosts, and is open. + +## Where the time goes + +Each table splits one number into phases, in spin's shape, and gives each phase a source. A phase +"by difference" is two numbers of one run subtracted. A phase marked "approximate" comes from +another run or another release. The last column is one way to spend 100 ms. It is an allocation, +not a measurement: it says how far each phase has to move. + +### Cold boot + +| Phase | p50 | Source | How well known | For 100 ms | +|---|---|---|---|---| +| QEMU's exec to a guest ready to run | ~28 | cold 456 less the boot into a QEMU started ahead, 428 (report 44811347183) | by difference, one run | 0, started ahead | +| … of it, QMP: QEMU's main loop free to `cont` answered, 14 commands | 6.2 | `transport` `cold_qmp`, lab 44912471522 (v20261121.01); 4.5 of it QEMU waiting on spin-machine's next command | measured | | +| … of it, the reset copying the vmlinux's 37.4 MB of segments into guest RAM, before the main loop | 9.1 before QEMU 0009, now beside the main loop | `romcopy` (a probe on branch `exp/698-romcopy`, not on main) `rom_copy`, lab 45257214350 (v20261123.07, 20 boots, p95 9.3); the ledger read the vmlinux's QEMU start +8.4 against a bzImage's (lab 45260129735, #697) | measured | | +| qboot and the bzImage's decompression, to the kernel's clock | 33.6 | `boot:firmware-stages`, lab 44787491631 (v20261120.02's kernel); ~21 of it is the decompression KASLR needed, which the machine no longer runs since #645 (first login −18.6, "What the machine carries"). Its end, KVM_SET_CLOCK plus the sched offset, is 2.8 ms after the kernel's 0 on bench, so ~31 (#665) | measured, another run; its anchor late | 5 | +| The kernel's clock to "Freeing unused kernel image" | 79.9 | report 44811347183, on dmesg's clock, which from late_initcall on is 13-15 ms behind the kernel's on bench, so ~93 (#666) | measured on a clock that reads short | 25 | +| PID 1 to sshd accepting | ~255 | sshd accepts 396 (lab 44841266997) less the three rows above; ~244 with the two corrections above | by difference, across runs | 35 | +| sshd's accept to the first login | 68.4 | `ssh-first` `accept_to_login`, lab 44841266997 | measured | 35 | +| … of it, what any login costs (a second login) | 35.9 | `ssh-first` `second_login`, the same | measured | | +| … of a login, vsock: 10 round trips of 57.5 µs through the forwarder | 0.6 | `transport` `login_turns`, `forward_rtt`, lab 44912471522 | measured | | +| **Total** | **465** | lab 44841266997, v20261120.04 (456 in the report's run) | | **100** | + +**PID 1 to sshd is more than half the cold boot.** On one vCPU, everything systemd starts before +sshd accepts is on the login's path. The groups in "What the machine carries" show how much +masks, generators and the coldplug filter took off it. The no-systemd floor accepted at 189 ms in +spin's shape. Before PID 1, ~140 ms of QEMU, firmware and kernel remain (~150 corrected, #665, #666), ~113 of them with QEMU +started ahead. Each phase from the first row to the fourth has to shrink to reach 100 ms. + +### Restore, QEMU started ahead + +| Phase | p50 | Source | How well known | For 100 ms | +|---|---|---|---|---| +| spin-machine's exec and its dial | 2.3 | `split` (a probe on branch `restore-split-lab`, not on main), lab 44809015139 (v20261120.03) | measured, one run | 1 | +| QMP round trips to `migrate-incoming` (17 of them) | 6.7 | `transport` `restore_qmp`, lab 44912471522 (v20261121.01); 5.2 of it QEMU waiting on spin-machine. The read-ahead runs beside it | measured, one run | 3 | +| The RAM load (8 channels, 181 MiB of data, evicted) | 38.8 before the read-ahead; ~27 after it | the same; the read-ahead −11.9 to running (lab 44809512339) | measured, then by difference | 25 | +| Device state and `cont` | 4.5 | the same | measured, one run | 3 | +| … after it, the guest running to the restore's last answer (`remove-fd`, `query-status`) | 2.7 | `transport` `restore_after`, lab 44912471522 | measured, one run | | +| Running to the first login | ~35 | 83.2 less running (~47); laptop: the connection ~5, to "Accepted publickey" ~22, the session ~4 | by difference; split on a laptop | 35 | +| **Total** | **83.2** | report 44811347183 | | **67** | + +A restore that starts QEMU itself adds ~25 ms (108 against 83.2). From the page cache, the RAM +load is ~10 ms instead of ~50 on a laptop, so the evicted load is the disk. Eight restores let go +at once read ~190-240 ms each under `defer`, against ~100 alone ("Open experiments", the burst). + +### Restore, QEMU started by the restore + +This is the goal's second number, `restore-first`'s evicted row. The rows come from lab +44976494418 (v20261122.01's parts, main's spin-machine at ee1be0f, 30 restores). + +| Phase | p50 | Source | How well known | +|---|---|---|---| +| The monitor's socket listening | 2.5 | `listening`. `machine.Start` binds it before QEMU exists, so it no longer marks QEMU's start | measured | +| QEMU's exec to its first answer | ~19.5 | `transport`, lab 44912471522 (v20261121.01). `spin-machine restore` waits on it in its dial | measured, another run | +| The first answer to `spin-machine restore` returning: 17 QMP commands, the load, device state, `cont` | ~49 evicted, ~35 cached | `running` 70.8 evicted and 57.0 cached, less the two rows above | by difference | +| Running to the first login | 40.2 | `login` 111 less `running` 70.8 | by difference | +| **Total** | **111** evicted, 95.2 cached | the same | | + +The evicted row read 16 ms more than the cached one, and that was the disk. The read-ahead +started in `Resume`, after the dial had waited ~19.5 ms for QEMU. Started before the dial, it +runs beside QEMU's start: `running` 62.7, login 101, 6 ms over the cached row ("What the machine +carries"). Asked for by four goroutines instead of one, the evicted row is level with the cached +one, login 96.2 against 96.3 (lab 44976924478). What is left of the restore is not the disk. + +**About a third of the restored login is sshd sleeping.** On a laptop, a restored login of +32 ms split into 4.6 ms to the server's banner, ~5 ms of key exchange, 14.5 ms from the signed +`userauth` request to its success, and ~4.7 ms for the channel, `exec` and exit. ~12 ms of the +14.5 are OpenSSH's minimum time for a userauth request (`auth2.c`, `ensure_minimum_time_since`): +5 ms plus 0-4.2 ms after the key query, and again after the signed request that succeeds, because +the flag it checks is set only after the sleep. sshd logs both at `LogLevel DEBUG3`. With every +`nanosleep` in sshd returning at once, a bound and not a candidate, the restored login read −13.4 +[−15.2, −10.5] on the bench and the cold login −3.2 [−13.7, +2.7], within noise (lab +44980029214). On a cold boot the vCPU still has boot work to run while sshd sleeps. ("Open +experiments", #457.) + +## What the machine carries + +This table lists every change the tree makes for boot time, with what it earns in spin's shape. +It is the current state. `docs/log.md` tells how each change came in. A row's evidence is one of +these: + +- *measured*: its own arm, in spin's shape; +- *group*: an arm that took back its group (below); +- *ladder*, *lane*, *runner* or *laptop*: measured in another shape, on another login, on the lab + runner of 2026-09 (Ryzen 9 5900X), or as a lead; +- *mechanism*: what it removes is visible, but no goal number has timed it; +- *unmeasured*. + +A row that is not *measured* or *group* is a candidate for deletion, which rule 5 of +`docs/measuring.md` decides. +Functional rows (security, correctness, a consumer's contract) are listed so that nobody takes +them for boot time. + +| Item | Where | Earns (Δp50 of taking it back) | Evidence | Run | +|---|---|---|---|---| +| Kernel patches 0001-0005, 0007, 0008, 0010 | kernel/patches | cold +67.5 [+62.5, +72.4], with 0006, 0009 and 0011 (since deleted, worth nothing) | group A | lab 44818953987 | +| Kernel 0012 (vmlinux BTF parsed on first use) and 0013 (the verifier asks for it only where a kernel type enters a program) | kernel/patches | cold −6.4 [−9.4, −1.0] at 60 a side (lab 45118194310, the kernel carried); before the review's fixes −10.0 [−12.7, −3.3] at 60 and −6.3 [−9.1, −4.6] at 120 (labs 45114405201, 45115330128); restored −1.0 [−6.0, +4.2] evicted, the state 1.3 MiB smaller (lab 45115341056) | measured | lab 45118194310 | +| Kernel 0021-0025, the boot's device-setup exits as one change (#627): the IOAPIC table read once (#590), the state save at add only where error recovery can restore it (#591 a), virtio-pci's vendor capabilities walked once (#591 b), `queue_select` written only on a change and an unchanged MSI message not rewritten (#592). 0022's gate has to grow with whatever calls error handlers next (its changelog). Alone each was within noise ("Measured and rejected") | kernel/patches | against v20261123.07: first login −9.4 [−14.2, −5.7], sshd accepting −9.5 [−14.4, −5.5], 120 a side (lab 45260781177); restored −0.4 [−2.0, +1.7] evicted and +0.2 [−6.6, +7.3] cached, the state +0.0 MiB [−0.1, +0.2], 60 a side (lab 45261629539); 838 exits fewer, 366 of them MMIO (3 a side, lab 45114428660) | measured | labs 45260781177, 45261629539 | +| `BLK_DEV_LOOP_MIN_COUNT=0`, `SERIAL_8250_RUNTIME_UARTS=1` | kernel/config-7.3-x86_64 | cold +5.3 [−3.2, +15.0]: inside the noise, but the upper bound does not rule out its ~2-4 ms ceiling | measured, 40 a side | lab 44839538785 | +| `VT=n`, `X86_MSR=n`, `X86_CPUID=n` | kernel/config-7.3-x86_64 | function: dead code, less surface | - | kernel/Dockerfile | +| qboot instead of SeaBIOS | qemu, `machine.DefaultBIOS` | cold +68.5 [+62.7, +71.7] | group F | lab 44818953987 | +| QEMU 0001 (device creation in one memory transaction) | qemu/patches | restored +11.7 [+0.9, +19.3], running +6.8 [+1.2, +8.8]: a restore starts QEMU too; cold +0.2 [−8.7, +7.1]. With `pam.patch`, cold +11.5 [+6.7, +20.2] (group B, lab 44818953987) | measured, 20 a side | lab 44993254745 | +| qboot `pam.patch` (PAM in three writes) | qemu/qboot | cold +3.9 [−3.4, +8.0]: inside the noise, and the upper bound over +5 keeps it (rule 5 of docs/measuring.md) | measured, 40 a side | lab 44993790452 | +| QEMU 0002, virtio-scsi `max_target`, which spin-machine passes | qemu/patches, machine | cold −8.9 [−15.5, −0.9] when it came in | measured | lab 44788216590 | +| QEMU 0009 (the vmlinux's segments copied into guest RAM in a thread beside the main loop at the machine's first reset, #698) | qemu/patches | first login −8.6 [−11.0, −4.0], 351 → 342, sshd accepting −9.1 [−12.4, −5.9], the console prompt −7.7 [−11.4, −5.5], QEMU's RSS unmoved, 60 a side (lab 45260098299); restored −0.1 [−1.1, +0.7] evicted, −0.3 [−2.1, +0.9] cached, and the same run's cold login −6.9 [−12.9, −0.8], 40 a side (lab 45260694485): a restore's reset copies nothing. The copy it moves off the main thread was 9.1 ms (p50 of 20, p95 9.3, lab 45257214350), and the gain is all of it. Prior art: QEMU has mapped an ELF kernel instead of reading it since 4.2 (Stefano Garzarella, `816b9fe450`, [qemu-devel 2019-07-24](https://patchew.org/QEMU/20190724143105.307042-1-sgarzare@redhat.com/20190724143105.307042-3-sgarzare@redhat.com), 2019), so #698's first candidate, mapping the file, was already upstream; what was left is the copy into guest RAM, which any loader pays: Firecracker and Cloud Hypervisor read each PT_LOAD straight into guest memory ([rust-vmm/linux-loader](https://github.com/rust-vmm/linux-loader)), one copy as QEMU's. A `pread` into guest RAM against the mapping's `memcpy` was no faster on a laptop (9-11 ms each, not nested), where half the copy was faulting in the destination's huge pages and half the copy itself. No ROM copy off the main thread found in QEMU 11.2's tree or by a web search of qemu-devel (2026-11-23) | measured | labs 45260098299, 45260694485 | +| The kernel entered as its vmlinux through PVH, randomizing itself: kernel 0014-0017 (Hou Wenlong's RFC, less its decompressor patch, deleted with the bzImage in #660; [the cover letter](https://lkml.iu.edu/2601.3/01845.html), lore `cover.1769434279.git.houwenlong.hwl@antgroup.com`, 2026-01-26, unchanged on 7.3.5), 0019 (sets `KASLR_FLAG`, without which `RANDOMIZE_MEMORY` did nothing), 0020 (RDRAND and TSC read from the registers that hold them), QEMU 0008 (a random physical base from `XEN_ELFNOTE_PHYS32_RELOC`), #645 | kernel/patches, qemu/patches, machine | first login −16.8 [−20.9, −13.0], 368 → 352, sshd accepting −16.7 [−20.2, −12.7], QEMU's RSS −13.8 MiB, 60 a side (lab 45219785493); restored −4.4 [−17.5, −2.0] evicted, −4.3 [−14.0, +10.2] cached, within noise, the state −31.9 MiB, the save −14.6 (lab 45219801969). As released, v20261123.07 against v20261123.06, each with its own spin-machine: first login −18.6 [−23.6, −14.0], 378 → 359, sshd accepting −15.3 [−21.2, −12.6], 60 a side (lab 45252584128); the release record's −3.5 [−12.9, +2.9] at 20 a side was a shifted run (#694). The bound, the same vmlinux entered with no KASLR at all: −18.9 [−22.8, −12.4] cold, −3.6 [−5.1, −2.1] restored evicted at 40 a side (labs 45213668842, 45213683698), so KASLR without the decompressor costs ~2 ms against no KASLR (inferred across runs; Hou measured ~2 ms too). Arms booted the kernel without 0020. KASLR across 10 boots (lab 45221660056): `_text` 10 distinct, the physical base 8, the direct map and vmalloc each 10 distinct 1 GiB-aligned bases. Entropy: the virtual base the decompressor's slot rule and seed sources once 0020 is in, the physical base QEMU's `getrandom` over the decompressor's range, the regions the kernel's own (#645, "entropy"). Chosen over QEMU applying the relocations (Holmes et al., "KASLR in the age of MicroVMs", EuroSys '22, 20-25 ms over an LZ4 bzImage; Firecracker #5661, parked; rust-vmm/linux-loader #84, open): no relocation format for QEMU to parse, nothing new on its command line, the kernel's own entropy code | measured, 60 a side | labs 45219785493, 45219801969, 45252584128 | +| qboot `no-pci-walk.patch` | qemu/qboot | cold +5.2 [−1.7, +9.2]: inside the noise, and the upper bound over +5 keeps it; 5.0 ms nested in `firmware-stages` | measured, 40 a side | lab 44993790452 | +| qboot `mtrr.patch`, `write-pointer.patch` | qemu/qboot | function: write-back mappings, vmgenid | - | - | +| `hpet=off` | machine | nothing on record: a timer the guest would enumerate and then not use | unmeasured | - | +| ICH9 `sata=off`, `smbus=off` | machine | kernel to init 62.3 → 60.6 (09-08) | laptop, 400 boots | `fa1803f` | +| Hotplug disks on virtio-scsi, not PCIe root ports | machine | boot −31, attach 135 → 1.5 (09-29) | runner | #25 | +| Every machine started held, so QEMU can start ahead | machine | the "QEMU started ahead" rows: ~28 ms cold, ~25 restored | measured | report 44811347183 | +| Checkpoints on 8 multifd channels | machine | restored into a QEMU started ahead 150 → 103 against 1 channel; 16 channels lose to 8 when 4 restore at once, +3.2 [+1.1, +5.8] | measured | labs 44789688221, 44792429636 | +| The resume reads the state ahead | machine | restored into a QEMU started ahead −12.9 [−14.7, −9.8] | measured | lab 44809512339 | +| `spin-machine restore` reads the state ahead before its dial (`machine.ReadAhead`), beside QEMU's start | cmd/spin-machine, machine | restored −9.3 [−12.2, −7.3] evicted, cached −0.2 [−2.2, +1.5] | measured, 30 a side | lab 44976494418 | +| The read-ahead asked for by four goroutines, each every fourth 128 KiB piece | machine | restored −6.2 [−9.1, −4.3] evicted against one goroutine, cached −0.5 [−1.6, +1.9] | measured, 30 a side | lab 44976924478 | +| CPUID leaf 2 with QEMU's cache descriptors (`x-consistent-cache=off`), so glibc does not walk leaf 4 at every process start; `x-legacy-cpuid2-cache=off` (qemu/patches/0006) makes them leaf 4's caches, first login +0.6 [−6.1, +5.5] (lab 45101932173, #586) | machine/shape.go | first login −10.3 [−14.2, −4.0], 40 a side; CPUID exits 3727 → 2176; restored +1.0 [−3.9, +4.4] evicted, in noise | measured | labs 45083473790, 45083473855, 45083754801 | +| `pci=lastbus=0` | machine/cmdline.go | kernel to init 87.6 → 51.1 (2026-09): 8192 configuration reads, each an exit | runner, mechanism | log.md, 09 | +| `no_timer_check`, `tsc=reliable` | machine/cmdline.go | nothing on record (09-07) | unmeasured | - | +| `TERM=dumb` | machine/cmdline.go | 687 → 19 ms to systemd's first line (09-10), while systemd queries the console | laptop, mechanism | `b5f361f` | +| `rootfstype=ext4` | machine/cmdline.go | lead (11-19) | laptop | - | +| `quiet`, `loglevel=3`, `panic=1`, `net.ifnames=0`, `biosdevname=0`, cgroup v2, `memhp_default_state` | machine/cmdline.go | console, function | - | - | +| systemd built from Ubuntu's source with the `stage1` profile | image/systemd | first login −47, −38, −47: no BPF verifier in PID 1 | ladder | labs 44531842773, 44537549305, 44538877783 | +| systemd's drop-in candidate names derived once per unit, not once per lookup directory: upstream #42858 (v262), backported to 259 | image/systemd/0001-dropin-derive-candidate-names-once.patch | first login −6.5 [−9.9, −1.3], 100 a side against systemd rebuilt without it; PID 1's CPU before the login 56.0 → 52.4, p50 of 5 ledgers. Prior art: Eric Curtin's PR, `manager_enumerate()` 45.35 → 38.81 ms (50 runs, ~270 units, a container); Yocto's backport to 259.5 | measured | labs 45090299768, 45090326943 | +| systemd's tools linked static | image/systemd | −10 and −1, inside the noise | ladder | the same | +| SELinux off, `pcre2` on | image/systemd | function | - | - | +| `-O ^orphan_file` | image/build.sh | lead (11-19) | laptop | - | +| `lazy_itable_init=0` | image/build.sh | function: no 16 MiB of zeros in every overlay | - | - | +| 16 more unit masks (journal-flush, fsck-root, modules-load, pstore, random-seed, four modprobe@, …) | optimize-systemd.sh | cold +57.5 [+49.0, +63.0] | group C-masks | lab 44818953987 | +| 8 generators disabled, 3 tmpfiles rules masked | optimize-systemd.sh | cold +16.7 [+11.6, +23.3] | group C-generators | lab 44818953987 | +| udev's coldplug filtered (`10-coldplug.conf`), `cpu` kept for hot-added cores | image | cold +14.9 [+8.2, +19.8]; restored +463.7, which was not the coldplug but QEMU's TSC, a guest saved with its tick running (#452, QEMU 0005) | group C-coldplug | lab 44818953987 | +| ssh.socket, ssh.service and sshd-keygen without default dependencies; logind and dbus-broker without PrivateTmp; udev at `StartupCPUWeight=1` | image drop-ins | −59.4 [−65.9, −56.2] with the probe's forwarder early as well (lab 44805051310, `login-early` and `udev-startup`). In a second run, the image's half alone (`--edit lane`) −17.4 [−25.0, −8.5] and with the forwarder early as well −68.5 [−78.0, −61.8] (lab 44807457606). Each run against its own release, v20261120.03 | measured | labs 44805051310, 44807457606 | +| ssh.service without Ubuntu's `sshd -t` before it starts (`20-no-config-test.conf`); the check stays on reload | image drop-in | −3.2 [−7.2, −0.8], sshd accepting −2.4 [−6.4, −1.1], 60 boots a side | measured | lab 44977044826 | +| udevd and its coldplug not before sysinit.target (copies of the units without that line), so basic.target does not wait for udevd's start at the lowest weight | configure-system.sh | cold −48.6 [−51.7, −42.6], restored −2.0 [−8.0, +4.7] p95 114 against 114, cached p95 126 against 128, with QEMU 0005, 30 a side; prestart cold −44.7 [−53.4, −39.4], restored into prestarted −1.3 [−4.1, +3.6] p95 98.8 against 101. Without 0005 the restored p95 is 539-548 | measured | labs 44987412171, 44987412210 | +| The boot's default target holds only what the first login needs (`spin-machine-login.target`), and `multi-user.target` starts once its units are up (`spin-machine-boot-rest.service`, `Type=idle`) | image, docs/image.md "The first login's target" | first login −21.5 [−26.4, −15.5], sshd accepting −10.0 [−16.2, −3.7], accept to login −10.7 [−12.9, −8.2], second login +0.0 [−0.8, +0.6]; restored +1.1 [−6.0, +5.2] evicted, +2.2 [−10.6, +12.9] cached. The console prompt +15.5 [+11.5, +19.0], since the getty now follows the login: nothing a workspace does waits for it. With spin's supervisor off `basic.target` (spin-stack/spin#1653) the first login −45.3 [−50.2, −39.4] but the second +43.7 [+41.1, +46.1] | measured, v20261123.02, 40 a side | labs 45098372930, 45098372897 | +| QEMU 0005: a machine made for an incoming migration writes its TSC only from the migration, so KVM takes the checkpoint's TSC as given | qemu/patches | correctness: without it a guest saved with its tick running sleeps until its old TSC deadline, ~450 ms (#452). Alone it moves neither number: cold −3.0 [−5.8, +0.1], restored −1.9 [−7.6, +2.0] | measured | lab 44987412171 | +| logind, its Varlink socket, `user-runtime-dir@`, `user@` without default dependencies; `dbus.socket` without sysinit | image drop-ins, configure-system.sh | cold +16.5 [+9.8, +20.4], prestarted +11.0 [+6.2, +18.8], restored in noise; lane 478 → 402 (11-13) | measured | lab 45034963004, lab 43518915618 | +| Sessions of class `user-early-light` | configure-system.sh | lane 472 vs 436 | lane, mechanism: a root session would start `user@0` | lab 43518044150 | +| Sessions of class `user-early` and root lingering, so a login waits for its user manager and root's starts in the boot (#467) | configure-system.sh | correctness: the first login's own `systemctl --user` failed 10 of 10 on v20261122.03 and passed 10 of 10 with it (lab 45032247920). First login +4.7 [−0.2, +12.2] at 40 a side, sshd accepting +5.6 [+1.1, +10.1]; restored −10.8 [−15.9, −6.6] evicted, −12.3 [−15.1, −5.5] cached. The lane's login as spin, whose manager does not linger, +29.7 [+22.8, +42.1] | measured | labs 45031644179, 45031644114, 45031687433 | +| The user manager's sockets' environment from `environment.d/10-user-sockets.conf`, not two `systemctl --user set-environment` | image | with the row above: first login +19.6 [+15.9, +25.6] without it (lab 45031644179); with class `user-early` alone, −17.1 [−27.0, −10.7] (lab 45030778365) | measured | labs 45031644179, 45030778365 | +| Root's manager without the XDG autostart generator, which turns a graphical session's `.desktop` files into user units (#527) | optimize-systemd.sh | first login −3.8 [−6.2, −0.7], accept to login −6.1 [−9.0, −0.3], 100 boots a side; restored −1.7 [−4.4, +2.2] evicted, in noise | measured | labs 45070150688, 45070973943 | +| Host keys made from the boot's first dispatch | spin-machine-sshd-keygen.service | cold −0.8 [−10.5, +3.5], restored in noise: not a gain in spin's shape, where they are no longer made (the row below); kept for the lane, 489 → 468 (#515) | measured | lab 45034963004, lab 43483372488 | +| No host key made when spin's handoff has placed its own at `/run/spin/ssh/ssh_host_ed25519_key` (#515) | spin-machine-sshd-keygen.service | first login −6.9 [−9.6, −2.4], sshd accepting −6.8 [−10.4, −1.8], 120 a side, both arms with `--edit spin-handoff`; restored in noise, 20 a side. Prior art: RHEL's cloud-init conditions `sshd-keygen@` off while it provisions the keys (git.centos.org rpms/cloud-init, `ci-Inhibit-sshd-keygen-.service-if-cloud-init-is-active.patch`), for function and unmeasured | measured | labs 45086250796, 45085877238 | +| sshd without OpenSSH's userauth minimum time on a login: a request that authenticated, or a public key query answered with `PK_OK`, does not wait; a failure still does (#457) | image/openssh | restored −13.6 [−14.9, −9.8] evicted, −13.6 [−16.2, −11.4] cached; cold −9.4 [−15.8, −2.6], the second login −10.9 [−12.3, −9.0] | measured, 30 a side | labs 44983986606, 44983986575 | +| An Ed25519 host key only, no ECDSA | spin-machine-sshd-keygen.service | −5.0 [−8.3, −1.8], sshd accepting −4.4 [−6.9, −1.9], 60 boots a side | measured | lab 44979726719 | +| MOTD and `pam_motd` off; `mlkem768x25519-sha256` alone | configure-system.sh | −12 on the first login; 104 → 40 a login against sntrup761 | ladder, mechanism: a root login runs the same PAM and kex | #240, lab 43479854381 | +| journald volatile, 8 MB, its flush masked | optimize-systemd.sh | cold +6.1 [+2.3, +15.8], prestarted +6.5 [+3.1, +13.1], restored in noise; 8 MB against 4 MB, first login −2.2 [−12.1, +6.4], 20 a side | measured | labs 45034963004, 45121159504 | +| docker and containerd started by their sockets, not at boot (deferred: the first `docker` command waits for them, docs/image.md) | optimize-systemd.sh | cold +13.9 [+11.4, +18.2], restored +55.7 [+12.0, +73.9], into prestarted +40.7 [+33.5, +59.0] | measured | lab 45034963004 | +| timedated, firstboot, machine-id-commit masked | optimize-systemd.sh | function: time from the host, no first-boot prompt, no identity | - | - | +| `10-seats.conf`, the getty's TERM, `/tmp`'s size | image drop-ins | function | - | - | +| The pressure probe's sender, started with `multi-user.target` by the boot's rest, at the lowest priority | spin-machine-pressure.service | function (docs/machine.md, "Pressure"); from the boot's rest in place of a timer 10 s after the boot: first login −0.8 [−7.8, +4.8], restored −0.8 [−2.9, +2.1] evicted, 20 a side; it starts at 0.37-0.38 s, after the login. Before #581, after multi-user.target beside the first login, sshd accepting to login +2.6 to +3.3 in three runs | measured | labs 45120950183, 45120950314, 45120692382; 44921602512, 44924252325, 44924755505 | + +**What holds each patch.** Every patch the table names, and QEMU's 0003 and 0004, which are not +for boot time, has a test that fails when the patch is lost or rebased into doing nothing, since +either still builds and boots. QEMU's are in qemu/README.md ("The patches"), qboot's in +qemu/qboot/README.md, the kernel's in kernel/README.md. OpenSSH's is held by its build, which +looks for the patched condition in the `auth2.c` it compiles, and by `boot:sshd-delay`. The qemu, +qboot, kernel and openssh-source entries of `versions.yaml` name the checks a bump runs. + +**What only the lane uses.** spin's path earns nothing from `sshd-vsock.socket.d/10-lane.conf`, +`sshd@.service.d/10-lane.conf`, `sshd@.service.d/keygen.conf` or the masked +`systemd-nologin.conf`. The probes still offer `login=lane`, and the no-systemd floor uses it. +Whether the image keeps a vsock login of its own is the maintainer's decision ("Open questions"). + +**What spin does, not the image.** spin no longer lingers its user (cold −36.1 [−45.8, −23.6], +labs 44785179901, 44785565313). Its supervisor's forwarder order is the proposal in "Open +experiments". + +### How the groups were decided + +The groups were decided by one `prestart` run in spin's shape, 20 boots each, against +v20261120.04 as published (lab 44818953987). The base read 453/464 cold, 124/144 restored and +93.0/120 restored into a QEMU started ahead. Each cell is the Δp50 of taking the group back. + +| Arm | Takes back | Tree | Cold | Restored | Into prestarted | +|---|---|---|---|---|---| +| A | every kernel patch | `--kernel run:44812049304` | +67.5 [+62.5, +72.4] | +8.1 [−8.4, +20.1] | +12.1 [−6.5, +21.2] | +| A1 | 0006, 0009, 0011 | `--kernel run:44812044088` | +1.2 [−4.5, +8.3]; at 40 boots −2.5 [−8.4, +1.8] | −5.2 | +1.3 | +| A2 | `DEFERRED_STRUCT_PAGE_INIT` | `--kernel run:44837940315` (lab 44839538785, 40 boots) | −2.5 [−9.3, +3.8] | +1.1 | −4.0 | +| A3 | the loop and 8250 counts | `--kernel run:44837906170` (lab 44839538785, 40 boots) | +5.3 [−3.2, +15.0] | +1.7 | −4.6 | +| B | QEMU 0001, qboot's `pam.patch` | `--qemu run:44812062232` | +11.5 [+6.7, +20.2] | +4.4 | +0.9 | +| C-masks | 16 unit masks | `--edit carry-masks` | +57.5 [+49.0, +63.0] | −0.7 | +0.1 | +| C-generators | 8 generators, 3 tmpfiles rules | `--edit carry-generators` | +16.7 [+11.6, +23.3] | −5.3 | −1.3 | +| C-logging | PID 1's quiet logging, the printk sysctl | `--edit carry-logging` | +2.4 [−2.3, +7.8]; at 40 boots −1.8 [−7.7, +3.2] | −4.0 | +0.6 | +| C-coldplug | the coldplug filter | `--edit carry-coldplug` | +14.9 [+8.2, +19.8] | +463.7 | +358.0 | +| E | `rcu_expedited`, `driver_async_probe` | `--append 'driver_async_probe= rcupdate.rcu_expedited=0'` | −1.4 [−4.9, +3.1] | +1.4 | +1.7 | +| F | qboot, for SeaBIOS | `--boot --bios=bios-256k.bin` | +68.5 [+62.7, +71.7] | −1.9 | +7.4 | + +A1, A2, C-logging and E were deleted (#345, #356, #354, #352); `--edit carry-logging` went with `fast-boot.conf`, the last file it edited (2026-11-22). The rest earn what the cold column +says. On one vCPU, every unit, generator and exit before the login is on the login's path. The +`carry-*` edits stay in `internal/lab`, so the ablation can run again when the shape, the kernel or +systemd moves. An edit checks what it undoes, so an edit whose item was deleted fails on later +releases. + +## Measured and rejected + +An idea already here needs a new reason, not a new run. The tables group ideas by the part they +touch, oldest first within a group. The "Shape" column says which shape a row was measured in, +and a row measured in another shape than spin's has such a reason. + +### Kernel and its command line + +| Idea | Result | Shape | Source | Date | +|---|---|---|---|---| +| Trim the 8250 driver | 154 µs | runner | `c03ed89` | 09-10 | +| Modular kernel | 0.57 ms; breaks "a release is one machine" | runner | `1a8e25c` | 09-10 | +| ACPI params (acpi=noirq, pnpacpi=off, …) | 69.9 vs 68.6 ms, slower | runner | `64d2901` | 09-10 | +| initcall_blacklist ksm/kcompactd | 0; event_trace's 6 ms is the profiler | runner | `64d2901` | 09-10 | +| `CONFIG_XFRM=n` | moves BTF's 9 ms first parse elsewhere | runner | `e285dec` | 09-10 | +| A generous vCPU ceiling | maxcpus=16 +5 ms, 64 +9 ms of kernel; the ceiling stays (invariant) | runner | `f32d527` | 09-10 | +| MICROVM | no ACPI CPU hotplug | - | `b151186` | 09-10 | +| `CONFIG_VT=n` for speed | 0 to login; 0.31 ms of kernel | runner | `e2f6b8f`, `9b5f0dd` | 09-26 | +| KSM and THP off | −0.50 ms | runner | `cda04b1` | 09-26 | +| COMPACTION off | impossible: virtio-mem needs CONTIG_ALLOC | - | `cda04b1` | 09-26 | +| erofs removed for speed | noise (100.46 vs 102.22) | runner | `5a3d509` | 09-26 | +| Smaller TCP hash tables | moved nothing | runner | `dae6a14`, #48 | 09-26 | +| ZRAM | the runaway killed later (20 vs 14 s), worst login 3.8 s | runner | kernel/Dockerfile, `430d2b3` | 09-28 | +| `pci=noearly` | the guest does not boot | - | #240 | 11-12 | +| A configuration-space snapshot over fw_cfg (QEMU and kernel) | 209 vs 211 with 0005 | ladder | lab 43514884598 | 11-13 | +| `scsi_mod.scan=manual` | kernel −9.3, but since Linux 5.10 a disk added at run time, at boot, or under `-S` never appears, silently. `max_target` took its place | spin | lab 44570773103; `drivers/scsi/virtio_scsi.c`, `scsi_scan.c` | 11-19 | +| `CONFIG_SCSI_SCAN_ASYNC` | −2.6 [−8.9, +6.8]: the scan is waited for before "Freeing", and `max_target` leaves it little | spin | #325, lab 44788216590 | 11-20 | +| The decompressor without `X86_VERBOSE_BOOTUP` | to the kernel's clock 35.1 → 32.4 ms, under the 3 ms set before the run | spin | #328, lab 44787878809 | 11-20 | +| An uncompressed bzImage payload, KASLR kept | to the kernel's clock −3 ms, but +3.3 in qboot's copy and +6-7 in QEMU's start | laptop | #326 | 11-20 | +| The same on QEMU 0007, which maps the bzImage and so no longer reads the 40 MB file in its start (#646, a lead for #645) | first login −4.0 [−7.9, +0.3], sshd accepting −2.9 [−6.9, +2.4] at 40 a side against LZ4 on the same QEMU; QEMU's RSS +32.0 MiB (+22.2 file, +9.9 anonymous). The QEMU half of the 11-20 rejection is gone; what is left is under the interval at 40 | spin | lab 45183618987 | 11-23 | +| The bzImage's decompression made cheaper, in general | ~21 ms before the kernel's clock with the bzImage against PVH; most of it is the copy and relocation KASLR needs, and KASLR stays. No candidate left | spin | lab 44787491631 | 11-20 | +| The bzImage beside the vmlinux, `KERNEL_LZ4` (its compression) and kernel 0018 (its decompressor reading `.data.reloc`), shipped since 11-19 | no release booted the bzImage after #645: spin's place.go was its last reader (spin-stack/spin#1689). Deleted: the build makes vmlinux alone, and a release from #660 on has no `kernel/bzImage`. The boot path is unchanged: first login −4.3 [−14.4, +7.4] at 20 a side, within noise, sshd accepting −5.3 [−11.1, +7.0], QEMU's RSS −1.7 MiB (the arm's kernel is also 7.3.6, main's, against .07's 7.3.5) | spin | #660, lab 45262046768 | 11-23 | +| `driver_async_probe` for rng, balloon and vsock; `rcupdate.rcu_expedited=1` (carried since 11-13 and 09-07) | taken back −1.4 [−4.9, +3.1]: one vCPU has no second CPU to probe on. Deleted | spin | lab 44818953987, #352 | 11-21 | +| Kernel 0006 (BTF parsed in the background), 0009 (a booting AP polled by local_clock()), 0011 (queue_select written only on a change) | taken back −2.5 [−8.4, +1.8] at 40 boots. Deleted | spin | labs 44818953987, 44822157367, #345 | 11-21 | +| `DEFERRED_STRUCT_PAGE_INIT` (carried since 11-13, for 2 GiB at boot) | taken back −2.5 [−9.3, +3.8] at 40 boots: spin boots 128 MiB, which the kernel does not defer, and plugged memory is never deferred. Deleted | spin | lab 44839538785, #356 | 11-21 | +| vmlinux BTF parsed on first use, not at the first kfunc registration (a kernel patch on branch `exp/btf-first-use`) | kernel to "Freeing" −7.2 [−8.6, −6.2], inet_init 6.85 → 0.14 ms (lab 44982285400, 10 boots), but the first login −1.5 [−3.1, +1.6] at 60 boots (lab 44982285406): journald's `DeviceAllow=` and `IPAddressDeny=` load cgroup BPF programs at its start, and `bpf_check()` parses the BTF there, before the login. A verifier that asks for BTF only when a program needs it is the next step | spin | labs 44982285400, 44982285406 | 11-22 | +| `CONFIG_HZ_250` for `HZ_1000` (#567), as Firecracker's and Cloud Hypervisor's guest configs build | every exit −587 [−608, −445] (MSR writes 1018 → 755, preemption timer 691 → 482, HLT 332 → 298, 3 a side, lab 45111418504), but the first login −0.6 [−5.9, +3.1] at 60 a side (lab 45111452844): a tick's exits are handled in ~1-1.5 µs each in the L1, not the ~7 µs a nested MMIO or port exit costs | spin | labs 45111418504, 45111452844 | 11-23 | +| virtio-pci writes `queue_select` only when the queue changes, a second time and alone (#592 lever 1, a kernel patch on branch `exp/592-l1-queue-select`; first as 0011) | 68 MMIO exits fewer (91 → 23 writes, 3 a side, lab 45113437048), the first login −2.8 [−6.6, +3.4] at 60 a side (lab 45114405201) and +0.6 [−1.8, +2.3] at 120 (lab 45115330128). The vector read-back stays: virtio 1.2 §4.1.5.1.2 makes it how a device refuses a vector | spin | labs 45113437048, 45114405201, 45115330128 | 11-23 | +| x86's `msi_set_affinity` skips the message write when the vector and destination did not change (#592 lever 2, a kernel patch on branch `exp/592-l2-msix-once`) | 56 MMIO exits fewer (`__pci_write_msi_msg` 168 → 112, 3 a side, lab 45113437048), the first login −0.1 [−3.1, +4.5] at 60 a side (lab 45114405201) | spin | labs 45113437048, 45114405201 | 11-23 | +| `pci_save_state()` at a device's add kept only where an error handler can restore it (#591 a, a kernel patch on branch `exp/591a-no-save-state`) | 128 MMIO exits fewer, the host's handling −3.3 [−6.2, −2.1] ms (3 a side, lab 45113437048), but the first login −4.3 [−6.8, +0.5] at 60 a side (lab 45114405201) and −1.3 [−3.5, +1.3] at 120 (lab 45115330128). Its gate has to grow by hand: upstream a2f1e22390ac took out `pci_restore_state()`'s refusal of a state never saved | spin | labs 45113437048, 45114405201, 45115330128 | 11-23 | +| virtio-pci's vendor capabilities walked once per device (#591 b, a kernel patch on branch `exp/591b-virtio-caps-once`) | 114 MMIO exits fewer (3 a side, lab 45113437048). The first login −5.8 [−8.2, −0.6] at 60 a side (lab 45114405201), three times what 114 exits can cost, and +0.9 [−1.8, +2.7] at 120 (lab 45115330128) | spin | labs 45113437048, 45114405201, 45115330128 | 11-23 | +| The IOAPIC's redirection table read once at boot, and written back only where it was masked (#590, a kernel patch on branch `exp/590-ioapic-once`) | IOAPIC accesses 589 → 205 and the host's handling −3.1 [−6.2, −1.1] ms (3 a side, lab 45113437048), but the first login −4.5 [−7.8, +0.4] at 60 a side (lab 45114405201) and −2.0 [−4.3, +0.6] at 120 (lab 45115330128). With the four other exit patches of #591 and #592, as a bound, −7.4 [−12.1, −2.8], and as one change −9.4 [−14.2, −5.7] at 120 a side: carried as 0021-0025 (#627, "What the machine carries") | spin | labs 45113437048, 45114405201, 45115330128 | 11-23 | + +### Firmware, QEMU and the machine + +| Idea | Result | Shape | Source | Date | +|---|---|---|---|---| +| `usb=off`, `vmport=off`, `smm=off`, `i8042=off` | 63.0/62.6/62.3/62.5 vs 62.9 ms | laptop | `fa1803f` | 09-08 | +| A named CPU model instead of `host`, for memories that resume on any host (`--cpu baseline`) | the newest model a nested c8id runs is Cascadelake-Server-v5, not SapphireRapids or GraniteRapids; cold first login +27.2 [+13.0, +30.8], sshd accepting +23.1 [+9.7, +28.5], warm login and RSS unmoved; the cause is not measured. `host` with a pool's common features is the next candidate (spin-stack/spin#1417) | spin | lab 44855890737 | 11-21 | +| Less guest RAM (512 MiB) | 1241 vs 1256 ms, nothing | runner | `80f984b` | 09-10 | +| `cache=none` on disks | breaks the shared base's caching, fails on tmpfs | - | `8b7391a` | 09-07 | +| Overlay O_DIRECT | small reads 1490 vs 530 ms | runner | docs/memory-and-disk.md | 10-01 | +| Board init wrapped in one memory transaction | the guest prints nothing | runner | `f10383b`, lab 36662499370 | 09-30 | +| Base on virtio-pmem and DAX | ~155 MB less per VM, but a side channel | runner | #63, #65 | 10-01 | +| Remove virtio-rng | −13.6 ms to the console prompt, never on a goal number; what seeds the RNG without it is open ("Open questions") | ladder | lab 43321809471 | 11-12 | +| QEMU copies the kernel's ELF segments on threads | laptop QEMU start 30.9 → 21.6; nested it adds nothing | ladder | labs 44580080420, 44581350077, #290 | 11-19 | +| A 1 MiB readahead on the root disk (`opt_io_size=524288` on virtio-blk), for fewer requests and so fewer notifications (#566) | iowrite16 exits 895 → 927 (3 a side, lab 45098880914); first login +1.4 [−2.7, +8.0] at 40 a side. The boot's reads are not readahead-bound (inferred) | spin | lab 45098879979, #592 | 11-23 | +| QEMU's start from its exec to its first trace event made cheaper (#647) | 9.7 ms on bench (lab 45177818419), no part of it over ~2 ms. The release's QEMU is static-pie on musl, so there is no dynamic loader to time (`LD_DEBUG` reads nothing): musl relocates its 59,700 relative relocations itself. On the laptop the phase read 4.7-5.4 ms p50, 40 starts each: a trivial static-pie binary's exec 0.23, QEMU's `-version` (exec, relocation, constructors, QOM type registration, the first options) 2.0, `-sandbox` dropped −0.7 to −0.9 (libseccomp builds its filter at run time), and the rest is option parsing, the trace's and the main loop's start and the machine object up to its first address space. perf over 200 `-version` runs: the relocation 7% of it, the kernel's page faults (copy-on-write, file fault-around, zeroing) ~15%, nothing else over 2%. From exec to held, malloc (musl's mallocng) is ~2.3 of 17 ms of the main thread's CPU. Candidates and their ceilings, each inferred at ~2× the laptop on bench: a filter compiled at build time as Firecracker's seccompiler does, ≤~1.5 ms; a non-PIE binary, no relocation and fewer copy-on-write faults, ≤~1 ms and it gives up ASLR of QEMU's image; DT_RELR, ≤~0.3 ms. Every one is under the ±4-5 ms that 60 boots a side resolve, so none was built. Another allocator is a lead across all of QEMU's start, not this phase (#669) | spin, laptop | lab 45177818419, #647 | 11-23 | +| QEMU 0007 kept once no release boots a bzImage: `-kernel` mapped a bzImage read-only instead of reading it into QEMU's heap (#646, carried from 11-23). From v20261123.07 the machine enters the vmlinux through PVH, which QEMU's ELF loader maps without it (#645) | taken back, against v20261123.07: first login +3.6 [−3.3, +7.8], sshd accepting −1.6 [−6.7, +5.6], QEMU's RSS +0.3 [−1.6, +2.1] MiB (lab 45258887660); restored −0.4 [−1.5, +0.9] evicted, −0.1 [−0.9, +0.9] cached, the cold boot of the same run +2.7 [−3.1, +8.7] (lab 45258106255), 40 a side, all within noise. A release before .07 boots its bzImage with its own QEMU, which carries 0007. When it came in, on a bzImage: first login −13.4 [−16.9, −7.3], restored −9.3 [−11.2, −6.1] evicted (labs 45182382388, 45182382864). Deleted | spin | labs 45258887660, 45258106255, parts run 45256311661, #660 | 11-23 | +| Lower the vCPU ceiling, drop the balloon or ACPI | not tried: an invariant | - | AGENTS.md | 11-13 | + +### systemd and the image + +| Idea | Result | Shape | Source | Date | +|---|---|---|---|---| +| Mask udev | saves 0, and boots never reach a login (10 s ttyS0 timeout) | runner | `4cbd229`, `80f984b` | 09-10 | +| agetty tweaks (TTYReset, --noissue, --delay 0, …) | within the noise of agetty's sleep(1) | runner | `80f984b` | 09-10 | +| chrony or another time daemon | 10 ms; cannot know it was restored | runner | `c7af4d3` | 09-10 | +| systemd-timesyncd | SNTP only, no refclock | - | `c7af4d3` | 09-10 | +| 19 udev rules masked; loop and 8250 counts as command-line parameters | 0 to the console prompt | runner | `e2f6b8f` | 09-26 | +| A console unit instead of serial-getty | +340 ms until TERM=dumb, then equal | runner | `c6e48de`, `7b08e5a` | 09-26 | +| Fewer unit files | 300 extra: 236 vs 246 | runner | `9fab3f1` | 09-26 | +| systemd-oomd | the kernel always beat it | runner | `337c08d` | 09-28 | +| CPUWeight/IOWeight/MemoryLow on ssh.service | no change | runner | `f7cd1ab` | 09-28 | +| Getty without BindsTo dev-ttyS0 | 342 vs 345 | ladder | lab 43303190733 | 11-12 | +| The serial getty at `StartupCPUWeight=1`, out of the first login's way | +2.7 [−4.3, +7.9] at 60 boots | spin | lab 44977226981 | 11-22 | +| Mask four varlink sockets nothing uses (factory-reset, mute-console, sysext, creds) | −0.8 [−4.8, +4.3] at 60 boots | spin | the same | 11-22 | +| Keygen wanted by multi-user.target | 518 vs 514 | ladder | lab 43312419007 | 11-12 | +| Mask sshd-socket- and run-generators | login 489, no change | ladder | lab 43483372488 | 11-13 | +| Mask 11 always-failing units | 484, no change | ladder | lab 43483372488 | 11-13 | +| Mask `modprobe@drm` (logind is ordered after it) | 327/345 vs 328/337. It is masked all the same, since 09-07, one of the 16 masks of group C-masks | ladder | lab 44558035927 | 11-19 | +| Mask `systemd-udev-load-credentials` | −8 then −6 ms, p95 unchanged: not separable at 20 boots | ladder | labs 44537549305, 44538877783 | 11-19 | +| systemd with `-Db_lto=true` | Ubuntu already passes `-flto=auto`: the same packages | - | image/systemd/Dockerfile | 11-19 | +| Masks of 15 units and a generator the image does not have | they masked nothing. Deleted without a run; image/build.sh refuses such a mask | - | #352 | 11-21 | +| PID 1's `LogLevel=err`, `LogTarget=journal`, `ShowStatus=no`, `StatusUnitFormat=name`; `kernel.printk = 3 3 3 3` | taken back −1.8 [−7.7, +3.2] at 40 boots; the console stays quiet through the command line. Deleted | spin | labs 44818953987, 44822157367, #354 | 11-21 | +| logind, `user-runtime-dir@` and `user@` at `StartupCPUWeight=1000`, the units user@0's chain is (#553) | −3.6 [−10.3, +0.6] at 40 boots (−9.2 [−16.1, −0.3] at 30 in a screening run of three arms, lab 45082870346). Accept to login −7.7, sshd accepting +8.8: logind and the manager come sooner and `sysinit.target` later, on the one vCPU | spin | lab 45083184310 | 11-22 | +| `spin-machine-sshd-keygen` and `systemd-udev-load-credentials` at `StartupCPUWeight=1` (#553) | sshd accepting +22.6 [+15.9, +33.5], first login +3.4 [−3.2, +14.6] at 30 boots: ssh.service waits for the keygen, and the forwarder for ssh.service. With the arm above, first login +6.0 [+0.5, +15.1] | spin | lab 45082870346 | 11-22 | +| Mask `systemd-udev-load-credentials` again, in spin's shape on one vCPU (it was −8 and −6 on two) | −2.1 [−6.3, +0.3] at 60 boots: not separable | spin | lab 44977044826 | 11-22 | +| `systemd-user-sessions` without its ExecStart (it removes a /run/nologin the image never writes), its ExecStop kept | −0.6 [−5.2, +1.5] at 60 boots | spin | the same | 11-22 | +| Mask `sshd-socket-generator`, again on spin's path | +0.8 [−4.0, +4.7] at 60 boots | spin | the same | 11-22 | +| `DefaultMemoryAccounting=no`, for cheaper unit cgroups | +4.1 [+0.8, +7.1] at 60 boots, worse; sshd accepting +6.2 [+2.2, +8.0]. The cause is not measured | spin | the same | 11-22 | +| No unit made for a `RequiresMountsFor=` prefix with no unit file (`unit_add_mount_dependencies` checks the unit name map before it loads one) | −1.0 [−4.3, +3.9] at 100 boots, and PID 1's CPU before the login 57.2 against 56.0, p50 of 5: not separable. Whether the stubs went in those boots was not observed (no debug boot of the arm). The patch and an upstream draft, not sent, are #580 | spin | labs 45090299768, 45090326943 | 11-23 | +| The rest of the boot started by a timer 2 s after the boot, in place of `Type=idle` (#574) | −66.5 [−75.2, −56.1] against idle's −59.2 [−69.1, −47.4] in the same run, both with the supervisor early: the timer starts the rest at an arbitrary time whatever the login, and docker's socket waits for it | spin | lab 45090246267 | 11-23 | +| The rest of the boot started from sshd's PAM stack at the first session (#574) | −52.0 [−61.6, −37.4], accept to login +15.3 [+10.8, +21.7]: it runs beside the login's last steps, and every login pays its `pam_exec` | spin | lab 45090246267 | 11-23 | +| `pam_selinux` (twice) and `pam_mail` out of sshd's PAM stack: SELinux is off and there is no mail | −1.9 [−4.9, +2.8] at 60 boots | spin | lab 44979726719 | 11-22 | +| `nsswitch.conf` without the `db` entries libnss-db would serve (kept since 09, never measured); reverted to Ubuntu's | taking it back +0.8 [−8.4, +5.2] cold, restored in noise | spin | lab 45034963004 | 11-22 | +| The manager's timeouts at 15 s and 10 s, the watchdogs off (`fast-boot.conf`); reverted to systemd's defaults | taking it back +0.3 [−5.2, +3.3] cold, restored in noise | spin | lab 45034963004 | 11-22 | +| containerd's CRI-enabled config replaced by containerd.io's own (#510); reverted to the package's | first login −4.9 [−12.2, +1.6] at 20 boots, restored login −0.6 [−2.1, +1.5] evicted: containerd starts at the first docker command, after the login | spin | labs 45111391250, 45112037022 | 11-23 | +| The image's `containerd.socket` out of the boot transaction, Docker's own `docker.socket` on both sides (#509) | first login +7.4 [−4.7, +15.3], sshd accepting +7.5 [−6.6, +14.9] (lab 45111146715); prestart cold −1.1 [−8.0, +9.0], prestarted +4.5 [−4.6, +9.9], restored −0.1 [−1.0, +1.7], restored into prestarted −0.5 [−1.8, +0.7] (lab 45111146865): all within noise. The socket starts in `sockets.target`, after the first login since #581. Kept: nothing to gain, and a tool that dials containerd's socket before docker has run would lose its start | spin | lab 45111146715, 45111146865 (20 a side, v20261123.04) | 11-23 | +| PID 1, journald, logind and `user@0` linked without the dynamic linker: v262's multicall build (#42304) or a static one (#42820), for their ld.so start-up (#638) | ld.so's own start-up, `LD_DEBUG=statistics`, p50 [range] of 8 boots: PID 1 0.48 [0.46, 0.56] ms, journald 0.20 [0.14, 0.31], logind 0.20 [0.11, 0.31], `user@0` 0.21 [0.15, 0.36]; 1.1 ms for the four, under #638's 5 ms threshold, so no build was run. Relocation 0.08-0.11 ms each (2,522 symbol and 16,589 relative relocations in PID 1 and `user@0`). The instrument moved nothing: first login +3.4 [−23.0, +11.9], PID 1's CPU −1.1 [−5.1, +0.6]. The multicall build keeps libsystemd-core and libsystemd-shared dynamic and leaves journald and logind as they are; the static one has no PAM for `user@`'s `PAMName=` | spin | lab 45180856158 | 11-23 | +| journald's, logind's and `user@`'s seccomp and sandbox settings, split from #574's bound (−14.1 [−18.5, −11.5]), and one seccomp filter per unit (#637) | the seccomp half carries it, −12.0 [−21.8, −2.1]; the namespace half +0.3 [−9.4, +7.2] (lab 45228294512). Fewer filters do not: `SystemCallArchitectures=` applied first takes journald's 17 → 8 and logind's 26 → 13, the same answer to 3435 calls (`boot:seccomp`, labs 45235103665, 45235485857), and read −0.4 [−6.1, +2.7] against systemd rebuilt without it (lab 45231419187). In journald's executor `SystemCallFilter=@system-service` takes 3.7-4.0 ms of 6.7-7.2, its `seccomp_load()` 1.1-1.2 of that, every other seccomp setting ~0.6 together (labs 45238003981, 45239372741, 2 vCPUs): one filter per unit would reach the 0.6. Building the allow-list once is #686. Prior art: systemd#17451 (one program per feature; Lennart wants each filter's application checked), libseccomp#499 (one context drops a conditional rule beside an unconditional one with another action, so merging settings is unsafe) | spin | labs 45228294512, 45231419187 | 11-23 | + +### The login + +| Idea | Result | Shape | Source | Date | +|---|---|---|---|---| +| sntrup761 (OpenSSH's default kex) | 104 vs 40 ms a login | ladder | #245, lab 43479854381 | 11-13 | +| The vsock socket and sshd@ without default dependencies | no sooner; dropped 7 of 22 first connections. Carried since with the lane's other drop-ins (`sshd-vsock.socket.d`, `sshd@.service.d`), which the lane kept together (lab 43518915618) | laptop | `c3c0fd1` | 11-13 | +| CPUWeight/IOWeight/Nice on the first login's lane | −2 ms over the filtered coldplug; second login 63 vs 45 | lane | lab 43518915618 | 11-13 | +| One sshd for every connection (vsock `Accept=no`, `sshd -D` early) | first login 382 vs 381; second 40 vs 48 | lane | lab 43524721490 | 11-13 | +| A login without pam_systemd (a bound) | 380 vs 436, but no session and no XDG_RUNTIME_DIR | lane | lab 43518044150 | 11-13 | +| logind's Varlink socket without default dependencies | accept to login 131 → 120, first login inside the noise; kept with the lane's other drop-ins | ladder | labs 44558035927, 44558053261 | 11-19 | +| Sessions of class `user-early` with the manager started inside the login (#462). Kept since with root lingering (#467, "What the machine carries") | first login +36.2 [+32.0, +45.7], accept to login +39.5; restored +0.5 [−3.0, +3.8] | spin | lab 44987167474, 44987167549 | 11-22 | +| Every login's user manager started beside it, not waited for (`user-runtime-dir@`'s `20-manager.conf`, #462): a command that needs the user bus at once in the first login came before the manager | correctness: the first login's own `systemctl --user` failed 10 of 10. Replaced by class `user-early` (#467) | spin | lab 45032247920 | 11-22 | +| The user manager without the XDG autostart generator, on top of class `user-early` (#467) | first login −4.8 [−11.2, +1.3], accept to login −3.7 [−7.5, −0.5] at 20 boots. Carried since #527, with root's manager in the boot: −3.8 [−6.2, −0.7] at 100 ("What the machine carries") | spin | lab 45030778365 | 11-22 | +| Both user generators masked, a bound: the environment.d one also brings `/etc/environment` to user services | first login −8.4 [−15.8, −1.0] against class `user-early` | spin | lab 45030778365 | 11-22 | +| The user manager's PAM stack down to `pam_permit` and `pam_systemd`, a bound | first login −3.5 [−11.4, +2.5] against class `user-early` | spin | lab 45030778365 | 11-22 | +| `user@`'s `After=systemd-user-sessions.service` (Ubuntu's `10-login-barrier.conf`) shadowed, for a login as spin | lane +30.6 against +29.7 without it: the barrier is not what the lane waits for | lane | lab 45031687433 | 11-22 | +| Root's manager cut to what a workspace could do without, a bound: both user generators, the PAM stack down to `pam_permit` and `pam_systemd`, `ssh-agent.socket` and `systemd-ask-password.socket` masked. Without the environment.d generator user services lose the bus's address (`10-user-sockets.conf`) and `/etc/environment`; without `pam_unix`, `pam_limits` and `pam_loginuid` the manager skips the account check, the limits and the audit login uid | first login −9.6 [−13.3, −6.7] against v20261122.06, the ledger's ~10 ms of CPU for the same cuts. The XDG generator alone was carried; the rest is function | spin | labs 45070150688, 45070208762 | 11-22 | +| No user manager for root, a bound: sessions of class `user-early-light` and root not lingering, as before #467 | first login −17.3 [−19.2, −12.4], console prompt −26.6: the manager's 17.5 ms of CPU, 1:1, on a vCPU with no idle from ~155 ms to the login. The first login's `systemctl --user` fails without it (#467) | spin | lab 45070150688 | 11-22 | +| spin's forwarder (spin's supervisor) without default dependencies, after `ssh.service` only (`--edit forwarder-early`), on v20261122.06 | cold +4.2 [+0.0, +11.0], restored −0.0 [−2.3, +2.3], restored into prestarted −4.3 [−7.7, −0.4]: not a gain on either goal number, though the forwarder was active 116-141 ms after PID 1 against 154-176 (bootchart, 3 a side). The login then waits for systemd-logind, active at 162-186 ms in both arms, before `user-runtime-dir@0` (#553). On earlier releases it read cold −60.4 (lab 44987584707); what changed since is not measured | spin | labs 45071102677 (`prestart`, 20 a side), 45071549627 | 11-22 | + +### The restore and checkpoints + +| Idea | Result | Shape | Source | Date | +|---|---|---|---|---| +| mapped-ram with multifd ×4, 11-13 | not comparable by its own run's log; channels were measured again on 11-20 and kept | ladder | #246, lab 43483852339 | 11-13 | +| Fast snapshot load (mapped-ram and postcopy-ram on a `file:` URI) as the restore | running at 38 ms, but the login at 293/325 instead of 152/161: every page touched is a fault served by one read. `LoadOptions.Fast` stays for large states | ladder | lab 44585840498 | 11-19 | +| Fast snapshot load for every state, the caller's choice (`LoadOptions.Fast`, spin's `fast_load`) | login +394 [+388, +420] at 179 MiB of data, +103 at 1.2 GiB, −129 at 1.7 GiB, −2615 at 7.3 GiB. Replaced by the machine's choice above 1.5 GiB (#470) | spin, touched | labs 45034868686, 45035462478, 45034881876, 45034881366 | 11-22 | +| The state read ahead during a fast load | at 179 MiB the login −168 ms, still +234 over a full load; at 3.7 GiB within noise, p95 713 against 490 | spin, touched | labs 45035029887, 45035048486 | 11-22 | +| Base memory in a shared file, left out of the checkpoint (`x-ignore-shared`) | state 0.3 MiB, save 15 ms, but neither goal number improves: cold 1089 ms on disk, 709-719 on tmpfs | ladder | labs 44663272360, 44664989139, #306 | 11-20 | +| 16 multifd channels as the default | −10.1 alone, but +3.2 [+1.1, +5.8] against 8 when 4 restore at once | spin | lab 44792429636 | 11-20 | +| `direct-io` (O_DIRECT) on the channels | within the noise evicted, +45 ms cached | laptop | log.md, 11-21 | 11-21 | +| `direct-io` on the channels of a save, against dirty-page throttling in the stop | never converged beside a busy disk: each pass ~2.5 s, the save cancelled after 10 min | spin, plugged 2 GiB | lab 44973775066, docs/memory-and-disk.md | 11-22 | +| `downtime-limit` 15 instead of 30 | the guest's stop −2.5 [−7.5, +3.0] short of memory beside a busy disk, −1.5 [−6.0, +2.8] with a writer | spin, plugged 2 GiB | lab 44975130836 | 11-22 | +| The guest's clean page cache dropped right before its save (`sync; echo 1 > /proc/sys/vm/drop_caches`), #276's last idea | the state did not shrink: 183 MiB with the drop, saved at once −0.1 [−0.4, +0.3] and 3 s later −0.0 [−0.3, +0.4]. The restored login was worse, +4.7 [+3.5, +7.3] evicted at once and +5.6 [+4.6, +7.6] 3 s later, as the login read again from the guest's disk what the drop took from its cache | spin | lab 45110967817 | 11-23 | + +### QMP and vsock + +Both transports were measured in spin's shape on the bench, 20 boots, with the `transport` probe +(lab 44912471522, v20261121.01, 2026-11-21). Each ceiling is what the goal number would gain if the +part cost nothing. None is above the noise (±7-9 ms cold, ±13 restored at 20 boots), so none was +built. + +| Idea | Result | Shape | Source | Date | +|---|---|---|---|---| +| Faster QMP in general | the cold boot waits on 14 commands, 6.2 ms from QEMU's main loop being free to `cont` answered (1.3% of 470). A restore waits on 17 before `migrate-incoming`, 6.7 ms, and 2.7 after the guest runs. The commands' own run is ~1.2 ms of each path. The rest is round trips: query-status alone is 131 µs from the client, 18 µs in QEMU. spin-machine's start and dial are off the path: its first command waits 17 ms (cold) and 19.5 (restored) for QEMU | spin | lab 44912471522 | 11-21 | +| Pipelining the bind (every command sent before the first answer) | ceiling: QEMU's wait on the client, 4.5 ms cold and 5.2 restored, under the noise. The read-ahead overlaps the restore's half, so its share is smaller | spin | the same | 11-21 | +| The held start's bind sent ahead of its answers: the run state with the places, every place's serial at once, each image's two nodes together, the reopen with the placeholder's delete; 13 round trips to 9, add-fd still waiting for its answer and `cont` for the bind's last (#649) | first login −1.7 [−5.6, +2.6], sshd accepting −2.4 [−5.5, +2.8] at 60 a side (lab 45230790902); restored −0.3 [−3.8, +3.7] evicted, +0.9 [−10.6, +7.5] cached (lab 45231358105). The split: QEMU waited 4.5 ms p50 for the client in 24 boots, 0.9 of it QEMU busy with the probe's plug monitor, so ~3.6 ms is spin-machine's own, ~0.28 ms a round trip (lab 45177818419). The four round trips removed are ~1.1 ms (inferred), and the whole of spin-machine's share is under what 60 boots resolve. Code on tag `archive/exp-649-held-start` | spin | labs 45230790902, 45231358105 | 11-23 | +| Fewer round trips (no `query-status` before the bind, places read from the Spec instead of `query-block` and `qom-get`, `Last(RESUME)` for the `query-status` after a load) | ceiling ~1.3 ms cold, ~1.9 restored | spin | the same, the detail by command | 11-21 | +| Smaller answers | nothing large is on either path: `query-block` runs in 0.12 ms. The record's 125 KB answers left the restore's clock with `Resume(here)` | spin | the same | 11-21 | +| QMP over vsock, SEQPACKET, ivshmem, virtio-serial, gRPC or protobuf framing | QMP does not ride vsock: it is a Unix socket between the host and QEMU. vsock carries the login, and a login is 10 round trips of 47.8 µs (57.5 through the forwarder), 0.6 ms of a 32.8 ms warm login. Every vsock change shares that ceiling | spin | the same | 11-21 | +| `kvm.halt_poll_ns`, CPU pinning, for vsock | bounded by the same 0.6 ms a login. What they do to the boot's other wake-ups is a different question, not measured here | spin | the same | 11-21 | +| An `iothread=` for the disks, against QMP stalls beside a guest's synced writes on a busy host disk (#391) | no stall to take off the monitor: 2,400 query-status round trips beside 4 KiB `oflag=dsync` writes, with the scratch NVMe idle, 99-100% busy with O_DIRECT writes and 100% busy through the page cache, never took more than 1.2 ms (p50 0.24-0.56 ms), while the guest's writes fell from ~115,000 to 1,500-3,100 in the row. The laptop's 175-950 ms was QEMU's main thread blocked in the host, by #402 in reclaim, the mmap lock or a cgroup throttle, which an iothread does not move | spin | labs 45111443524, 45112573850, `stall` probe archived as `archive/qmp-stall-391` | 11-23 | + +### Memory and the host + +| Idea | Result | Shape | Source | Date | +|---|---|---|---|---| +| Lower `memhp_default_state` (unplug policies) | kept `online` | runner | `2903d8c`, #48 | 09-30 | +| DAMON_RECLAIM, MGLRU eviction | slower, or not selective | runner | docs/memory-and-disk.md | 10-01 | +| `page_reporting_order` 0 or 3 | ~100 MB transient vs ~180 MB of huge pages lost | runner | docs/memory-and-disk.md, #83 | 10-01 | +| Prefetch the boot's files | 47 ms to win 24 | runner | run 36803912357 | 10-01 | +| A second limit (`memory.high`) | `memory.max` suffices | - | docs/memory-and-disk.md | 10-01 | +| KSM, free page hinting, virtio-fs DAX | security, correctness, unsupported | - | docs/memory-and-disk.md | 10-01 | +| QEMU at a higher host priority (cgroup `cpu.weight`, nice, a real-time class) on an idle host | ceiling: QEMU's threads wait 0.2/1.1 ms for a CPU from its exec to the cold first login and 0.1/0.2 to the restored one, the guest's steal 0. Priority can win back only that wait. On a busy host it is a lead for spin ("Open experiments") | spin | lab 44925573288, `run-delay` | 11-21 | +| A burst of restores bound by host CPU0 | no: busy time, interrupts and QEMU's threads spread over all 16 CPUs, and irqbalance runs | spin | lab 44817486118 | 11-21 | + +## Open experiments + +The rows are ranked by ceiling. A row stays here until it is decided, and then moves. + +| Experiment | Number | Phase, p50, ceiling | Decided by | State | +|---|---|---|---|---| +| A burst of restores: 8 at once read ~190-240 ms each under `defer`, against ~100 alone | restore, as a host sees it; spin restores concurrently with no host-wide limit | the burst's ~100-140 ms over one restore alone | `restore-together`, `together=1 8`, evicted, with the change against without it | open. The host's CPUs are 72-78% busy in the burst, and direct reclaim runs as the states fill the page cache (lab 44817486118). Next candidates: `vm.watermark_scale_factor`, and the CPU one restore costs | +| A login without OpenSSH's exec per connection and PAM | both | a warm login, ~25-43 ms, is in both numbers | a bound first: `prestart` with the login replaced | lead (log.md, 11-20, "spin's login, spin's memory"). spin's path already runs one sshd, and PAM and pam_systemd are what spin's sessions are made of | +| Carried items never measured alone: kernel patches 0005, 0007, 0008 and 0010 each (group A is +67.5 together); `pci=lastbus=0` (2026-09, before patches 0004 and 0010); logind's early varlink socket (measured on 2 vCPUs); QEMU 0001 and qboot's `pam.patch` apart; `no_timer_check`, `tsc=reliable`; `hpet=off`; systemd's static tools; `-O ^orphan_file`; `rootfstype=ext4`; the lane's drop-ins on spin's path | cold | each ≤ a few ms; B together +11.5 | rule 5, an arm each, 40 boots | open. The static tools and `orphan_file` need an image build (`--systemd` builds only an experiment patch) | +| What functional items cost, last measured on another machine: BPF JIT and BTF (+21.4 ms to "Freeing", 09-07, a vmlinux through PVH, before the ftrace patches), lockdown at confidentiality (nothing told from noise, 10-01, a host at load 6-10) | cold | a few ms each, unknown in spin's shape | `ssh-first` with a `--kernel` built without each, 20 boots | open. They stay for function, so a number says what they cost and decides nothing | +| The no-systemd floor, each release | a bound | how much of the cold number is systemd's to give back: 445 → 240 in spin's shape | `ssh-first` on the release with `--edit floor --append init=/usr/local/sbin/spin-floor` and `login=lane`; `releases measure` does it beside every release, and report.yml records it (docs/releases.md, "Bounds") | last measured 11-22 on v20261122.02: the lane's first login 407 → 241, −166.3 [−174.7, −160.3] (report.yml run 45018301368, 20 boots). On v20261122.01: 404 → 250, −153.9 [−162.5, −151.2], sshd accepting 242 → 197 (lab 44978079694, 20 boots). 11-20: 445 → 240 (lab 44750322384) | +| A workspace's cgroup at a higher `cpu.weight` while it boots or restores, on a busy host (spin's runner owns the cgroup) | restore, as a busy host sees it | with 16 workspaces keeping the 16 CPUs busy, the restored first login is 306 ms against 115 idle, and QEMU's threads wait 282 ms for a CPU (lab 44925573288). The same weight ratio as QEMU at nice −10, set as the crowd at nice 10: restored −79.3 [−93.5, −71.0], cold −104.7 [−258.3, +150.9], within noise (lab 44927312303) | spin's `restore-together` or a crowd on its runner, with the weight raised through the workspace's cgroup and set back after the login, against without it | a proposal for spin. Measured in one cgroup, where each thread competes alone. In spin each workspace is a cgroup, and the weight is shared by its threads. The idle host has nothing to win (Measured and rejected, "Memory and the host") | +| The restore with more than 2 GiB of RAM | restore | unmeasured (#242's checklist) | `restore-first` with `plugged` above 2048 | open | +| A workspace's 2048 MiB at boot (`memory=2048 plugged=0`) instead of 128 plugged to 2048 through virtio-mem during the boot (#561) | cold | the plug and the onlining of 2048 MiB on the one vCPU while the boot runs; separate runs read −15 nested and −8 metal (v20261122.06, labs 45074465204, 45074579100, 45074680619, 45078339515), so the ceiling is ~15 ms. Prior art: the kernel onlines hotplugged memory strictly in sequence, one memory block after another, and deferred struct page init, which spreads the boot's own memory over threads, does not apply to it (David Hildenbrand on linux-mm, [lore](https://lore.kernel.org/linux-mm/87v9disj2s.fsf@oracle.com/T/)). Squeezy (arXiv 2411.12893, 2024) measured virtio-mem's operations in seconds at GiB sizes and found init_on_free slows a plug. Neither measured a boot. The kernel has init_on_alloc and init_on_free off | `ssh-first`, the two shapes as two trees of one run (`--opt` on a tree), 40 a side on bench and on bench-metal, `restore-first` beside them; 3 ledgers of each shape for the onlining's CPU | a proposal for spin, spin-stack/spin#1660. Measured as two trees of one run (v20261123.04, spin's login): cold first login −5.5 [−10.9, −0.7] nested at 80 a side (lab 45111507862; −2.5 [−7.3, +2.0] at 40, lab 45110554589), −7.0 [−11.4, −3.4] on metal at 40 (lab 45110570912); restored login −2.5 [−3.7, −1.0], the state −17.6 MiB, QEMU's RSS −26 MiB (labs 45110562994, 45111507862). The ledger (lab 45110580480, 3 boots each) shows `kworker/0:1` on the vCPU ~8 ms before PID 1 when plugged and not at all when the memory is at boot, which costs the kernel's own setup ~4.5 ms more: PID 1 −4.0 ms on the kernel's clock (−3.4 on CLOCK_MONOTONIC, before #644). The probes keep spin's shape until spin changes it | + +The floor is a bound and never a candidate: systemd stays (AGENTS.md, "What must not break"). + +## Open questions + +No lab run answers these questions. + +- **Does the image keep a vsock login of its own?** spin does not use the lane (see "What the + machine carries"). This is the maintainer's decision. +- **Is `10-seats.conf` still needed?** The control that should fail passes on systemd 259 (#240). +- **What seeds the guest's RNG without virtio-rng?** It has to be answered before the removal is + measured. +- **musl under long-running load.** No run has measured it (`31a57e7`). +- **`page_reporting_order`.** Revisit only if memory per host becomes the limit + (`docs/memory-and-disk.md`). +- **`machine.Type` off pc-q35-11.1.** QEMU is 11.2 and the machine is still pc-q35-11.1 + (`machine/shape.go`, `internal/build/machinetype.go`). It is a change of its own. +- **The kernel CVE judge.** 9 CVEs apply with a fix later in 7.3, and 1 has no fix (`0ce27ad`, + against 7.3.1; the kernel is 7.3.5 on 2026-11-20). +- **The min_ttl_ms evidence disagrees.** `47aa681` and the LRU_GEN comment in `kernel/Dockerfile` + say different things (docs/log.md, 09-28). +- **The guest clock on 09-30.** `1d5e7f5` blames chrony, which had left the image on 09-10 + (`c7af4d3`). The fix (time by `/proc/uptime`) stands either way. diff --git a/internal/docsrec/testdata/split/kinds.txt b/internal/docsrec/testdata/split/kinds.txt new file mode 100644 index 00000000..97729ddf --- /dev/null +++ b/internal/docsrec/testdata/split/kinds.txt @@ -0,0 +1,711 @@ +1 pr +2 pr +3 pr +4 pr +5 pr +6 pr +7 pr +8 pr +9 pr +10 pr +11 pr +12 pr +13 pr +14 pr +15 pr +16 pr +17 pr +18 pr +19 pr +20 pr +21 pr +22 pr +23 pr +24 pr +25 pr +26 pr +27 pr +28 pr +29 pr +30 pr +31 pr +32 pr +33 pr +34 pr +35 pr +36 pr +37 pr +38 pr +39 pr +40 pr +41 pr +42 pr +43 pr +44 pr +45 pr +46 pr +47 pr +48 pr +49 pr +50 pr +51 pr +52 pr +53 pr +54 pr +55 pr +56 pr +57 pr +58 pr +59 pr +60 pr +61 pr +62 pr +63 pr +64 pr +65 pr +66 pr +67 pr +68 pr +69 pr +70 pr +71 pr +72 pr +73 pr +74 pr +75 pr +76 pr +77 pr +78 pr +79 pr +80 pr +81 pr +82 pr +83 pr +84 pr +85 pr +86 pr +87 pr +88 pr +89 pr +90 pr +91 pr +92 pr +93 pr +94 pr +95 pr +96 pr +97 pr +98 pr +99 pr +100 pr +101 pr +102 pr +103 pr +104 pr +105 pr +106 pr +107 pr +108 pr +109 pr +110 pr +111 pr +112 pr +113 issue +114 pr +115 pr +116 pr +117 issue +118 issue +119 issue +120 issue +121 issue +122 issue +123 issue +124 issue +125 issue +126 issue +127 issue +128 issue +129 issue +130 issue +131 issue +132 issue +133 issue +134 issue +135 issue +136 issue +137 issue +138 issue +139 issue +140 issue +141 issue +142 issue +143 issue +144 issue +145 issue +146 issue +147 issue +148 issue +149 issue +150 issue +151 issue +152 issue +153 issue +154 issue +155 issue +156 issue +157 issue +158 issue +159 issue +160 issue +161 issue +162 issue +163 issue +164 issue +165 issue +166 issue +167 issue +168 issue +169 issue +170 issue +171 issue +172 issue +173 issue +174 issue +175 pr +176 issue +177 issue +178 issue +179 issue +180 issue +181 issue +182 issue +183 issue +184 issue +185 issue +186 issue +187 issue +188 issue +189 issue +190 issue +191 issue +192 issue +193 issue +194 issue +195 pr +196 pr +197 pr +198 issue +199 issue +200 issue +201 issue +202 issue +203 issue +204 issue +205 issue +206 issue +207 issue +208 issue +209 issue +210 pr +211 issue +212 issue +213 pr +214 pr +215 pr +216 pr +217 pr +218 pr +219 pr +220 issue +221 issue +222 issue +223 pr +224 pr +225 pr +226 pr +227 pr +228 pr +229 pr +230 issue +231 issue +232 pr +233 pr +234 pr +235 pr +236 pr +237 pr +238 pr +239 pr +240 pr +241 pr +242 pr +243 issue +244 issue +245 pr +246 pr +247 pr +248 pr +249 pr +250 pr +251 pr +252 pr +253 pr +254 pr +255 pr +256 pr +257 pr +258 pr +259 issue +260 pr +261 issue +262 pr +263 pr +264 issue +265 issue +266 pr +267 pr +268 pr +269 pr +270 pr +271 pr +272 pr +273 issue +274 issue +275 pr +276 issue +277 pr +278 pr +279 pr +280 pr +281 pr +282 pr +283 pr +284 pr +285 pr +286 pr +287 pr +288 pr +289 pr +290 pr +291 pr +292 pr +293 pr +294 pr +295 pr +296 pr +297 issue +298 pr +299 pr +300 pr +301 pr +302 pr +303 pr +304 pr +305 pr +306 pr +307 pr +308 pr +309 pr +310 pr +311 pr +312 pr +313 pr +314 pr +315 pr +316 pr +317 pr +318 pr +319 pr +320 pr +321 pr +322 pr +323 pr +324 pr +325 pr +326 pr +327 pr +328 pr +329 pr +330 pr +331 pr +332 pr +333 pr +334 pr +335 pr +336 pr +337 pr +338 pr +339 pr +340 pr +341 pr +342 pr +343 pr +344 pr +345 pr +346 pr +347 pr +348 pr +349 pr +350 pr +351 pr +352 pr +353 pr +354 pr +355 pr +356 pr +357 pr +358 pr +359 pr +360 pr +361 pr +362 issue +363 issue +364 pr +365 pr +366 pr +367 pr +368 pr +369 pr +370 pr +371 pr +372 pr +373 pr +374 pr +375 pr +376 pr +377 pr +378 pr +379 pr +380 pr +381 pr +382 pr +383 pr +384 pr +385 pr +386 pr +387 pr +388 pr +389 pr +390 pr +391 issue +392 issue +393 issue +394 issue +395 issue +396 issue +397 pr +398 pr +399 issue +400 pr +401 issue +402 issue +403 issue +404 pr +405 pr +406 pr +407 issue +408 issue +409 issue +410 issue +411 pr +412 issue +413 issue +414 pr +415 issue +416 issue +417 pr +418 pr +419 issue +420 pr +421 issue +422 pr +423 issue +424 pr +425 issue +426 issue +427 pr +428 issue +429 issue +430 pr +431 pr +432 pr +433 issue +434 pr +435 pr +436 pr +437 issue +438 issue +439 pr +440 pr +441 pr +442 issue +443 pr +444 issue +445 pr +446 pr +447 pr +448 pr +449 pr +450 issue +451 pr +452 issue +453 pr +454 pr +455 issue +456 issue +457 issue +458 pr +459 issue +460 issue +461 pr +462 issue +463 issue +464 pr +465 issue +466 pr +467 issue +468 pr +469 pr +470 issue +471 pr +472 issue +473 pr +474 pr +475 pr +476 pr +477 pr +478 pr +479 pr +480 pr +481 pr +482 pr +483 pr +484 pr +485 issue +486 issue +487 issue +488 issue +489 issue +490 pr +491 pr +492 pr +493 pr +494 pr +495 issue +496 issue +497 issue +498 pr +499 pr +500 pr +501 issue +502 pr +503 pr +504 pr +505 pr +506 pr +507 issue +508 pr +509 issue +510 issue +511 issue +512 issue +513 issue +514 issue +515 issue +516 issue +517 pr +518 issue +519 issue +520 issue +521 issue +522 pr +523 pr +524 pr +525 pr +526 pr +527 issue +528 issue +529 pr +530 pr +531 pr +532 pr +533 issue +534 issue +535 pr +536 issue +537 issue +538 issue +539 pr +540 pr +541 pr +542 pr +543 issue +544 pr +545 pr +546 issue +547 pr +548 pr +549 issue +550 pr +551 pr +552 pr +553 issue +554 issue +555 pr +556 pr +557 pr +558 issue +559 issue +560 pr +561 issue +562 pr +563 issue +564 pr +565 issue +566 issue +567 issue +568 issue +569 issue +570 pr +571 pr +572 pr +573 pr +574 issue +575 issue +576 pr +577 pr +578 issue +579 pr +580 issue +581 pr +582 issue +583 pr +584 pr +585 pr +586 issue +587 issue +588 issue +589 pr +590 issue +591 issue +592 issue +593 pr +594 pr +595 issue +596 pr +597 pr +598 pr +599 pr +600 pr +601 pr +602 pr +603 pr +604 pr +605 pr +606 pr +607 pr +608 pr +609 pr +610 pr +611 issue +612 pr +613 pr +614 pr +615 pr +616 pr +617 pr +618 pr +619 pr +620 pr +621 issue +622 issue +623 pr +624 pr +625 pr +626 pr +627 issue +628 pr +629 pr +630 pr +631 pr +632 pr +633 pr +634 issue +635 pr +636 pr +637 issue +638 issue +639 pr +640 pr +641 pr +642 pr +643 pr +644 issue +645 issue +646 issue +647 issue +648 issue +649 issue +650 pr +651 pr +652 pr +653 issue +654 pr +655 pr +656 pr +657 pr +658 issue +659 pr +660 issue +661 pr +662 issue +663 pr +664 pr +665 issue +666 issue +667 pr +668 pr +669 issue +670 pr +671 pr +672 pr +673 pr +674 pr +675 pr +676 pr +677 issue +678 pr +679 issue +680 issue +681 pr +682 pr +683 pr +684 pr +685 issue +686 issue +687 pr +688 pr +689 pr +690 pr +691 pr +692 pr +693 pr +694 issue +695 pr +696 pr +697 issue +698 issue +699 pr +700 pr +701 pr +702 pr +703 issue +704 pr +705 issue +706 pr +707 issue +708 pr +709 issue +710 pr +711 pr diff --git a/internal/docsrec/testdata/split/log.md b/internal/docsrec/testdata/split/log.md new file mode 100644 index 00000000..4299085c --- /dev/null +++ b/internal/docsrec/testdata/split/log.md @@ -0,0 +1,815 @@ +# Log: what was done, why, and what it measured + +First built on 2026-11-13 from `git log origin/main` (327 commits, to `3e8075f`), the 150 pull requests of that day (merged, closed and open), the 44 releases' notes, the tree at `origin/main` (comments, `docs/`, `boot/*_test.go` row comments), and spin-stack/spin#1206 and spin-stack/open-remote-ssh#8. Hashes are short commit ids on `origin/main`; `#N` is a pull request here; "lab N" is a `lab.yml` run id as the tree or a PR quotes it. Dates are UTC, as the bench fleet and spin keep them. A commit made in UTC−3 can carry the day before. Nothing here was re-measured. Every change that decides something since adds its entry. + +Where boot time stands, what each phase costs, how a number is measured, and the tables of what was kept, measured and rejected, and is next are `docs/boot-time.md`. This log is the chronology. + +--- + +## 1. Chronological log + +Format: **date · area · refs**, then what was done, why, the result and its status. + +### Week 1: 2026-09-07 to 09-13 + +**09-07 · all · `2afac47`, `219b98a`.** The repository is created from spinbox's and storage's QEMU, kernel and image (image ported to mkosi, ext4 in a read-only qcow2). qemu-nbd dropped, Taskfile split per part, `task shell` added. *Why:* they were one machine, duplicated across repositories. *Result:* "boots as one machine … in 151 ms" (`2afac47`, consumer's initrd). *Status:* in place. + +**09-07 · machine/fingerprint · `5e7d60e`, `b476f6d`, `57e827a`, `b882171`, `17d844f`, `02709d7`.** `machine/` defines the slot map, the shape and the cmdline. `Fingerprint` hashes QEMU, the kernel and the initrd by content, plus the shape. Same day: +- the device topology goes into the hash (`b476f6d`); +- the host CPU goes back in under `-cpu host` (`57e827a`); +- the topology is corrected to leave out disks and NICs (`b882171`: templates have neither); +- the encoding is made length-prefixed (`17d844f`); +- an identity split is added for memoising (`02709d7`). + +*Status:* superseded. See the fingerprint cycle in §2. + +**09-07 · machine · `656d55b` → `b882171`.** `spin-machine save` and `boot --incoming file:` are added, then reverted the same day as "lifecycle" that belongs to the consumer. Kept: `Spec.CPU` with `enforce=on`. Measured: a state saved with Broadwell-v4 resumes on Broadwell-v4 and Skylake-Client-v4, and Nehalem refuses (`656d55b`, now in `docs/migration.md`). *Status:* save/restore came back as checkpoint commands (`c202568`, 09-28; kept after #51). + +**09-07 · tooling · `5e7d60e`, `8aee03a`, `24c8a06`.** `cmd/spin-machine-init` is a debug initramfs, and `spin-machine-console.service` is shipped but not enabled. *Why:* systemd gave no serial login, because the image masked udev, so `dev-ttyS0.device` never appeared. *Status:* the init was deleted `8eeb01c` (09-10) and the console unit deleted `3a7864d` (11-12). See §2. + +**09-07 · qemu · `31a57e7`.** QEMU is linked statically against musl. *Measured:* process start to QMP quit, 44 ms glibc vs 43 ms musl over 5 runs. Not measured: a long-running guest under load (musl allocator, thread stack). *Status:* in place; the load question is still open. + +**09-07 · image/kernel · `2df3dbf`.** Changes: +- root password removed; +- SSH host keys generated per boot (unit hung off ssh.service); +- chrony via `/dev/ptp0`; +- BPF_JIT and BTF on, at +21.4 ms of kernel boot and 5.0 MB (5 runs each way; also `kernel/README.md`); +- `-no-reboot`. + +BPF_LSM was left off. *Status:* BPF on and in place; chrony removed 09-10; BPF_LSM turned on 10-01 (`1400f6a`); the keys moved 3 more times (§2). + +**09-07 · qemu/machine · `8b7391a`.** aio=io_uring, discard=unmap, vhost=on requested, qom_cast_debug off. *Rejected:* +- `cache=none`: the shared base must stay in the host page cache, and O_DIRECT fails on tmpfs; +- `--enable-virtfs`; +- four configure flags that do not exist in 11.1.1. + +*Status:* in place. + +**09-07 · machine/kernel · `b476f6d`, `ee34d31`.** virtio-balloon with free-page-reporting. *Measured:* "costs nothing measurable", 158.9-162.5 ms with vs 157.9-171.6 without, noise ~14 ms. virtio-mem replaces DIMM slots, with `memhp_default_state=online` required: without it a request for 2048 then 3072 MiB plugged 1024 and stopped. Measured 0→2048→3072→512→2 MiB. *Status:* in place. + +**09-07 · machine · `58d404e`.** `tsc=reliable` restored; it had been lost in the move from spinbox. Not measured. In place. + +**09-08 · machine · `fa1803f`.** ICH9 `sata=off`, `smbus=off`. *Measured:* 400 boots per variant, kernel to init: 62.3 baseline, 61.3 sata=off, 61.7 smbus=off, 60.6 both; an earlier 150-boot series agrees. *Measured and rejected:* `usb=off` 63.0 vs 62.9; `vmport=off` 62.6; `smm=off` 62.3; `i8042=off` 62.5. *Status:* in place. + +**09-08 · CI · `fe332b4` (#4).** `task verify:args` starts 9 Specs under the TCG binary with `-S` and requires a QMP answer. *Why:* nothing checked that QEMU accepts the command line. In place (it became `TestQEMUAcceptsEveryArgument`). + +**09-09 · kernel cmdline · `9ca453a`.** `nohz=off` removed. *Measured:* a forced tick is 1.7% of a core per idle vCPU. Boot 821-853 ms vs 843-846; restore 113-221 vs 124-216 (template era). In place. + +**09-09 · machine · `76aacf9`, `7cafdf6`, `6599829`, `2b46d78`, `354c8a6`.** Changes: +- PCIe root ports for hotplug: no measured change to boot or restore; +- a NIC through a root port via `netdev_add fd=`; +- NIC count and `host_mtu` go into the fingerprint, while MAC and fd stay out; +- a second QMP monitor. + +*Status:* root ports were replaced by virtio-scsi on 09-29 (`2b19096`); NIC hotplug was dropped then; MTU and NIC in the fingerprint were superseded by `Spec.Contract` (`fa3041c`). + +**09-10 · boot probes/image · `4cbd229`, `bab6f16`, `c2c4c6a`, `722d468`, `b5f361f`.** `task boot:matrix` (shell). *Found:* masking udev buys nothing (826 vs 829 ms), and masking it costs a 10 s `dev-ttyS0.device` timeout with no login. udev was unmasked (`722d468`) and `40-spin-hotadd.rules` added for CPU and memory. Two stalls of 334 ms waiting on the console (XTGETTCAP and a terminal reset) are fixed by `TERM=dumb` on the kernel cmdline: 687→19 ms, and the whole boot 855→163-207 ms (`b5f361f`). The harness itself was contaminated: `unmask_udev` had become a no-op, so the first udev rows (826/829) were wrong (`b5f361f`). *Status:* udev on and TERM=dumb in place. The memory half of the hot-add rule was removed 11-12 (`3c8da99`). + +**09-10 · tooling · `8eeb01c`.** Debug initramfs deleted. "this repository does not ship an init". With udev on, the serial getty works: 204 ms to a login prompt. In place. + +**09-10 · boot probes · `80f984b`.** The boot bench is ported to Go and the shell harness deleted. *Found:* +- `systemd.mask=` on the cmdline does nothing (debug-generator masked), so every earlier row that used it measured nothing; +- agetty has an unconditional `sleep(1)`; +- the shell harness throttled the console (it read 1424 ms where the guest said 190); +- a Percentile bug. + +*Measured (15 boots, laptop):* as shipped 1256/1276; without agetty 253/320; 512 MiB 1241/1261; 1 vCPU 1309/1326; udev masked: 15 of 15 boots never reached a login. Superseded by `boot:bench`; `boot:bench` was deleted in #250. + +**09-10 · kernel · `c03ed89`, `1a8e25c`, `a31d7b2`, `f32d527`, `64d2901`, `e285dec`.** A kernel-phase investigation. Results, each recorded in `kernel/Dockerfile`: +- initcall_debug with a console attached measures the console (103.9 vs 42.8 ms); +- the 8250 trim is worth 154 µs; +- a modular kernel buys 0.57 ms and was rejected; +- acpi_bus_scan scales with the vCPU ceiling: maxcpus=16 +5 ms and maxcpus=64 +9 ms of kernel (63.0/68.1/72.1 ms), recorded at `Spec.MaxCPUs`; +- four ACPI cmdline parameters are worth 0 (69.9 vs 68.6); +- ksm_init and kcompactd_init are worth 0; +- `event_trace_enable_again`'s 6 ms is the profiler; +- inet_init's 9 ms is BTF's first parse, not XFRM. + +*Status:* rejected (docs/boot-time.md, "Measured and rejected"). + +**09-10 · image · `6aba37b`, `064c4f4`, `c7bab94`, `c7af4d3`, `08c56e1`.** Changes and measurements: +- logind 63 ms on the chain, worth 24 ms; chrony worth 10 (15 boots, laptop); +- Type=idle on the getty measured at 25 ms (291/344 vs 266/283); +- `disable-udev-settle.rules` deleted as wrong; +- chrony deleted: 248/322 vs 261/288; "a restore is invisible from the inside", and correcting the clock belongs to whoever restores; +- blame figures that summed to ~380 ms out of a 175 ms userspace are kept only as history. + +*Status:* chrony removed and in place. + +**09-10 · qemu · `b151186`.** The device list is turned into an allowlist (`--without-default-devices`): 363→225 instantiable types and a 23.7→8.7 MB binary. MICROVM rejected ("no ACPI CPU hotplug"). Boot unchanged (240/274 vs 245/265, laptop). In place. + +**09-10 · boot probes · `c049a21`, `8eef89d`, `a0efd65`.** QEMU's startup split: 1.4 ms launcher, ~27 ms exec to first instruction, ~7 ms guest to first console byte. The QMP greeting is not a checkpoint: it comes before the board is built, so the real QMP reply is at 18-20 ms, not 8. Cold-start cost is the host zeroing pages (18.8%) plus rom_reset; a restore pays neither (09-26). Not acted on. + +**09-11 · machine · `21a830c`.** `Disk.DirectOverBacking`, with a cache-modes bench of 16 VMs. Writes were inconclusive: the disk was 94% full and times moved tenfold. `mincore` reports every page resident for a file the caller does not own. *Status:* the field is now in `machine/vm.go`; the bench was deleted in #48; `Disk.Cache` was removed in #94. + +**09-11 · image · `ec008b0`.** sshd `TrustedUserCAKeys` (the CA file is written by the consumer). #101 (10-03): without the CA nothing logs in. In place. + +**09-12 · machine · `9177475`.** `Spec.Accel` (tcg). TCG guest to PID 1 in 6.5 s vs 33 ms under KVM. In place. + +**09-12 · image · `bb6bb89` (#5).** logind out of the boot transaction. The first login starts it through the varlink socket and a `/run/systemd/seats` drop-in (`10-seats.conf`). *Measured:* 249/287 vs 273/297, 25 boots, two runs (laptop). `boot:logind` holds sessions. *Status:* **reversed 11-12** (#240). See §2. + +### Week 2: 2026-09-14 to 09-20 + +**09-14 · image · `9335335`, `fe7d4ab`, `891e2f7`, `b5908ee`.** Changes: +- the image is sized in two passes: 974 MiB with 132 free, was 1163 with 317; +- e2fsprogs 1.47.4 is built static and pinned; +- `-m 0` for reserved blocks; +- a 64 MiB journal. + +Bug: `891e2f7` (shipped in v20260914.01) made a 4.08 GiB filesystem, because `-b` read the size as a block count. Fixed in `b5908ee`. In place. + +**09-14 · kernel · `b9d1985`.** A trixie toolchain and a reproducible vmlinux. *Why:* v20260914.01 and .02 had different kernels from the same source. bookworm's pahole 1.24 encoded `.BTF` in parallel, in a non-deterministic order, and the banner carried the build date. Two `--no-cache` builds now give the same vmlinux. Usable 503/575 vs 509/547 with gcc 12 (laptop, 20 boots). In place. + +**09-15 · CI · `c767cd5`.** The BuildKit `type=gha` cache had never stored anything: the runtime token does not reach `run:` steps, and every build shared one scope. Fixed with named scopes. Superseded by the registry cache (`1666cb5`, 11-12). + +**09-18 · machine · `da17b34`, `f023b56`, `5d4a01c`, `4947281`.** A restore opens its template read-only. Disks can be given as a chain of descriptors (`-add-fd`), and so can the console, `/dev/kvm`, vhost-vsock and vhost-net. In place, apart from the template parts. + +**09-20 · CI · `f63aa38` (#10).** Workflows move to Blacksmith. Superseded 10-24 (`f29e59d`). + +### Week 3: 2026-09-21 to 09-27 + +**09-21 · machine · `3d10256`, `56f6fea`.** `FingerprintCache` added. *Status:* removed `2d9b7e3` (09-29), with no caller; the identity split went in `c5baaa7` (10-01). + +**09-24 · machine · `35df9cf`.** No VMX/SVM in the guest. Measured with 3 hot-added cores: vmx=1,0,0,0 plus a warning before, vmx=0 on all after. Fingerprint moved. In place. + +**09-24 · image · `a01c847`.** Host keys made without RSA. RSA was 309 ms in blame in a guest, and on the host 141 ms vs 6 (ECDSA) and 5 (Ed25519). In place. + +**09-26 · image · `f36ae13`.** `/tmp` is a tmpfs again and tmpfiles-setup is unmasked. The imported optimizer had masked both. 223/230 vs 220/232, within noise. In place; `/tmp` was capped at a quarter of memory in `47aa681`. + +**09-26 · machine · `8063bcd`.** discard=unmap on the format node of a chain. Before this, fstrim freed nothing and deleted data stayed readable. Not measured. In place. + +**09-26 · firmware/qboot · `e4f456f` (#12).** The qboot experiment: `write-pointer.patch` (vmgenid needs WRITE_POINTER), built in a pinned container. The compiler moves the number: 6.32 ms saved with GCC 15.2 vs 3.86 with GCC 14.2 (`qemu/qboot/README.md`). Not adopted yet, because firmware was not in the fingerprint. *Status:* adopted 09-29 (`f2f4da0`). + +**09-26 · boot probes · `5221690`, `c6e48de`, `adc52cd`, `e2f6b8f`, `b9707e3`, `7b08e5a`.** Probes added: `boot:initcalls`, `boot:userspace`, `boot:systemd`. Findings: +- p50 98.2 ms kernel to "Freeing", of which 54.5 ms is 680 initcalls; +- udev coldplugs 266 devices, 64 of them `ttyN`; +- `CONFIG_VT=n` was predicted at 5-12 ms and measured at 0 (228/237 vs 228/246); +- 19 udev rule files masked: 0; +- device-count boot parameters: 0; +- the console-unit swap measured 340 ms worse, and the cause was finally found to be a 334 ms XTGETTCAP timeout, fixed with `TERM=dumb` on that unit (221/233 vs 558/572). + +*Status:* findings recorded. The rows were deleted in `3f669ef` and #90. `boot:userspace` and `boot:systemd` were deleted in #250. + +**09-26 · kernel · `dae6a14`, `5a3d509`, `cda04b1`, `9b5f0dd`.** A floor kernel (tinyconfig + PVH): release 97.95 vs floor 52.33 ms, so the config costs 45.6 ms (BTF, ACPI, ftrace). lz4 instead of gzip for an initrd: 6.4 ms. erofs removed (100.46 vs 102.22, noise). KSM and THP off: -0.50 ms, rejected. `CONFIG_VT` off as dead config. The 2.09 ms quoted for it was withdrawn (0.31 ms over 40 boots on an idle host). *Status:* erofs and VT off are in place. The floor probe and `kernel/minimal` were deleted in #48 (09-30). + +**09-26 · image · `9fab3f1`, `ad05544`, `9b5f0dd`.** Unit-file count does not matter: 300 extra units gave 236 vs 246. Unit loading costs 26 ms per `systemd --test`, not the 212 the debug log suggested. Masking the tpm2 and factory-reset generators is worth 1.0 ms of that 26. An empty `/etc/machine-id` skips the preset pass. *Status:* the masks are in place, except the tpm2 generator's, deleted 11-20 (#352). `boot:unitload` was deleted in #88. + +**09-26 · machine · `ab4844c`.** `drop-cache=off` on chain images: a restore had been issuing `POSIX_FADV_DONTNEED` on the shared base. Restore exec-to-running 29 ms with an overlay vs 24 without disks; `cont` 8.9→2.8 ms; a cold cache has been measured at 251 ms. In place. + +**09-26 · CI · `aa157cf`, `1ef95d1`.** The Blacksmith builder v2 required a `cache-key` and silently fell back to a local builder without it. Fixed with `nofallback`. Superseded 10-24. + +**09-27 · machine · `7ec3601`, `2f5a7b0`.** ACPI PCI hotplug is turned off and the guest's pciehp used instead. *Why:* device_del never completed, and spin's lane waited 30 s. Fingerprint moved. *Status:* superseded by virtio-scsi (09-29). + +**09-27 · tooling · `0b1f470`, `51c1fe9`, `2f03d09`, `e7e52db`.** `boot` with no disk uses `-snapshot`. Added: attach/detach, and the rule that checks go through the CLI. boot now execs QEMU, and the QMP handshake has a 5 s deadline. Validation was hardened, and the fingerprint moved again (`-accel` became its own argument). In place. + +### Week 4: 2026-09-28 to 10-04 + +**09-28 · machine/CLI · `c202568`.** `save --template` and `restore` added, plus `boot:restore`: restore ~20 ms; first request 14 ms warm, 33 cold, 31 after a reclaim. *Status:* the template parts were removed 09-30 (#51); restore was not measured again until 11-13. + +**09-28 · tooling · `30b717b`, `a8e2737`.** Every pin goes into `versions.yaml` with a gate test; the versions tool moved to go-tools. In place. + +**09-28 · kernel · `2fd0fff`, `430d2b3`.** 7.2.8 with PSI; then MGLRU, PARAVIRT_SPINLOCKS, PARAVIRT_TIME_ACCOUNTING, fq_codel and hung-task detectors. 322 vs 333 ms usable (15 boots). ZRAM rejected. In place. + +**09-28 · boot probes/image · `f7cd1ab`, `47aa681`, `337c08d`.** `boot:ssh-load`: CPU load does not slow a login, and 16 MiB available doubles one to ~210-310 ms. CPUWeight/IOWeight/MemoryLow on ssh.service changed nothing and are not shipped. MGLRU `min_ttl_ms=1000` and `/tmp` at a quarter of memory. **The sources disagree** on min_ttl_ms: `47aa681` says worst login 1369-7106 ms without vs 94-128 with; `kernel/Dockerfile:192-194` says 611-1785 vs 105-106. *Status:* in place; `boot:memory-policy` was deleted in #88, and `boot:ssh-load` was deleted in #250. + +**09-28 · CI · `5332e97`, `3bef421`, `e6a0a1b`, `6b0f338`.** Actions pinned by commit, actionlint, the race detector, `task mutate`, a coverage floor. The floor was set at 85% against a local 85.7%. CI measures 84.7%, so it broke main and was lowered to 80% (`e6a0a1b`). In place. + +**09-29 · machine/qemu · `43fb03b` (#24), `2b19096` (#25).** Hotplugged disks go on virtio-scsi instead of PCIe root ports. *Measured 2026-09-29, 4 ports vs 1 controller:* boot -31 ms; attach 135 → 1.5 ms; detach 6.1 s → 0.7 ms. NIC hotplug dropped. In place. + +**09-29 · boot probes/CI · `a503db7` (#23), `e9e0c8e`, `de9b7db` (#29).** A report feature matrix (96 rows) published with every release, and `lab.yml` on the self-hosted KVM runner. *Why:* a laptop read 61 vs 105 ms minutes apart. Fixed along the way: +- the lab went green having measured nothing (a skip) (`8d8e97b`); +- a concurrency group cancelled queued experiments (`a3ba5a6`); +- two runners both took nbd0 (`b21e100`); +- an NBD device was mounted before it had a size (`8946f67`). + +In place, with the lab on the bench fleet since 10-24. + +**09-29/30 · kernel · `349dacb` (#33), `20fd702`, `3e26963` (#40).** Four local patches: 0001 objtool writes NOPs, -7.0 ms; 0002 skips the weak-function scan, 11.9 ms; 0003 rewrites the eval maps on first use, -9.0 ms; 0004 PCI config through ECAM, -4.5 ms. Kernel boot 109.4 → 73.7 ms (lab runner, workspace shape, 15-20 boots). The whole report boots on it (run 36651858261). Fingerprint moved. In place. + +**09-29 · firmware · `ae6ab48` (#37), `f2f4da0` (#39).** qboot becomes the default BIOS and the firmware goes into the fingerprint. SeaBIOS 121.89 vs qboot 114.76 ms p50, 7.14 ms saved (lab runner, run 36650049960); 106 rows boot (run 36650559189). In place; the firmware *contents* were later dropped from the fingerprint and only its size kept (`fa3041c`). + +**09-30 · qemu/firmware · `6f65249` (#42), `f10383b` (#43).** qboot writes the PAM registers in 3 writes instead of 7, at ~0.5 ms each. QEMU patch 0001 wraps device creation in one memory transaction (438 flat-view rebuilds). The first version also wrapped board init and the guest printed nothing (lab run 36662499370). In place. + +**09-30 · kernel · `98c3589` (#47).** 7.3-rc5, 1.2 ms slower than 7.2.8 (30 boots). Superseded by 7.3 (10-26) and then 7.3.x. + +**09-30 · boot probes · `f2c47f7` (#48).** Probes deleted with their conclusions kept: `boot:floor` and `kernel/minimal`, `boot:kernel-pages` (#44, added the same day), `boot:memory-unplug` (#46, same day), `cache_bench`, the report's disk axis (96 → 32 rows), the console-swap rows, and the SeaBIOS timing. See §2. + +**09-30 · machine · `a9d6083` (#51).** **Templates removed** (spin #194). `Memory.File`, `x-ignore-shared`, `save/restore --template`, `boot:restore` and `docs/templates.md` all go. The fingerprint now means "a checkpoint resumes only onto a machine with the same fingerprint". Fingerprint moved. In place. + +**09-30/10-01 · boot probes (memory/disk) · #57-#62, #64, #67-#74, #77, #78, #83, #84, #89.** The page-cache lab on construct (AMD Ryzen 9 5900X, Spin OS metal), recorded in `docs/memory-and-disk.md`. Kept as defaults: writeback overlay; hourly fstrim; discard accounting; qboot MTRRs; `page_reporting_order` stays 9. Rejected: docs/boot-time.md, "Measured and rejected". Sub-probes deleted in #89. `caches` and `reclaim` remained until c3c0fd1 (11-19). + +**10-01 · firmware · `4511798` (#75).** qboot programs the MTRRs. virtio-pmem read at 8.3 MB/s uncached-minus vs 1.1 GB/s with SeaBIOS (runs 36818224412, 36818721809). No boot cost: 103.5 vs 103.1 ms. Fingerprint moved. In place. + +**10-01 · image · `5b7b1dc` (#76).** fstrim hourly: 657 → 21 MB on disk, 657 → 20 MB in the host's cache (run 36815822140). In place. + +**10-01 · qemu · `aaf2d86` (#79).** Upstream's virtio-blk discard accounting is carried as a patch: before it, `query-blockstats` showed 0 unmaps for 1.1 GiB trimmed (run 36815822140); with it, 10-12 operations and 1123 MB (run 36884702758). "to delete in the bump that brings it". In place. Deleted 11-19 with QEMU 11.2.0-rc0, which has it upstream (#289). + +**10-01 · kernel · `1400f6a` (#80).** Lockdown at confidentiality plus the BPF LSM; no `/dev/mem` or `/proc/kcore`. "No cost that can be told from noise." *Side effect, found later:* SPIN_GRAPH and SPIN_CPU_SHARE silently traced nothing until #240 (11-13). In place. + +**10-01 · CI/release · `2cd98f0` (#81).** Release notes say what changed, and the report boots each row 20 times, KVM only. *Why:* at 3 boots a row every KVM row read 5-11% slower between two releases that 20 alternated boots put within 5 ms. Also: `v20261001.01` shipped a `qboot.bin` without `mtrr.patch` in the tarball, because hack/release named the patches one by one. In place. The report's 20 boots a row went with the feature matrix 11-19 (#303). + +**10-01 · boot probes · #88, #90.** `unitload` deleted (it compared the image with itself) and `memory-policy` deleted. Bench rows reduced to "as shipped" and "baseline", with findings left as notes. In place. The bench rows went with `boot:bench` 11-13 (#250). + +**10-01 · machine · `c5baaa7` (#97), `ca7b54f` (#98), #94.** The fingerprint becomes one hash, and `Incoming` one field. The release verdict was blind to `machine/` changes, so `fingerprint_sha256` is now recorded. `Disk.Cache` removed. In place. + +### Week 5: 2026-10-05 to 10-11 + +**10-09 · qemu · `f0ec1e0` (#103).** QEMU 11.1.2. "A new machine: every checkpoint taken on 11.1.1 stops resuming." That stranded v20261002.01's checkpoints (v20261013.01). Led to the next entry. + +### Week 6: 2026-10-12 to 10-18 + +**10-13 · CI/release · `d692a7c`, `03aeb28`, `96a39d2`, `845fb5d`, `f033995` (#109), `b207bee` (#110), `302ced2` (#111), `99e31f9`.** Supply chain: +- signing and attestation, an SBOM, release from main only, apk locks; +- a reusable builder (#109, #110), reverted the same day (#111): it never achieved SLSA L3 and needed guards; +- an OSV scan, kept; +- attestations checked by digest, because the 338 MB tarball was over cosign's 128 MiB limit. + +In place, apart from the reusable builder. The apk locks gave way to pinned builder images 11-20 (#309). + +**10-13 · machine/fingerprint · `fa3041c` (#114).** **The fingerprint is the machine's contract.** `MachineType=pc-q35-11.1`. It hashes: the shape; `Spec.Contract` (every device as Args writes it); the BIOS's size; and the host CPU under `-cpu host`. It no longer hashes the QEMU, kernel, initrd or pvh.bin bytes. Added `boot:roms`, `boot:compat` (a v20261002.01 checkpoint resumes on 11.1.2), and `hack/machinetype`. One break by design. In place; `fingerprint_sha256=2bd7da6b…` from v20261013.02 onward. + +**10-13/14 · CI · `7628981`, `4f7d55e`, `8c6d1c7`.** compat runs on main and before a release, not on PRs, because the KVM runner refuses pull_request jobs. cosign is built from its pin. Docker Hub images come from mirror.gcr.io after a 429. In place. + +### Week 7: 2026-10-19 to 10-25 + +**10-19 · image · `fb39fd5` (#210).** GNU coreutils instead of uutils: 21 OSV findings against rust-coreutils 0.10.0; image 855M vs 877M. In place. + +**10-19 · CI · `7bf5429` (#197).** One OSV issue per package; there had been 77 open. In place. + +**10-24 · CI · `c75f144` (#214), `f29e59d` (#215), `d67afc4`, `97a6de1`.** Every workflow step is one task. Builds move to GitHub's runners. **Report and lab move to the bench fleet** (one instance type) and compat to the kvm fleet. A fix: vhost-vsock permissions were reset by udev after `modprobe` (`97a6de1`). In place. The first report on the fleet (v20261026.01) compared a Ryzen 9 5900X with a Xeon 6975P-C, and its notes say so (docs/measuring.md, "Avoid the pitfalls"). + +### Week 8: 2026-10-26 to 11-01 + +**10-26/29 · kernel · `1c12413`, `0bb00ce`, `fc1079c`.** Kernel 7.3; the apk locks moved; the kernel now tracks mainline. Superseded: refresh.yml now proposes the newest stable release of the 7.3 series (`spin-machine-dev refresh kernel`). + +### Week 9: 2026-11-02 to 11-08 + +**11-03 · qemu/kernel · `7c37270`, `b4b67c3`, `6e7ba47`.** QEMU 11.1.3, kernel 7.3.1. The apk lock broke because Alpine's mirror dropped python3 3.14.8. In place. Superseded by QEMU 11.2.0-rc0 11-19 (#289) and kernel 7.3.5 11-17 (#266). + +### Week 10: 2026-11-09 to 11-13 + +**11-09 · kernel/CI · `00db122` (#223), `0ce27ad` (#224), `8d495c5` (#225).** Kernel 7.3.3, with the config named by series and a daily proposal job. A kernel CVE judge: of 18221 CVEs against 7.3.1, 9 apply with a fix later in 7.3 and 1 has no fix. The apk lock broke again (zlib 1.4). In place; the kernel is 7.3.5 since 11-17 (#266). + +**11-09 · tooling · `ed4ad86`, `e1d40ad`, `6e25bb3`.** Retries and tokens for GitHub downloads after 504s. Task and go-tools as released binaries (455 → 81 modules). In place. + +**11-11 · kernel · `cce320f` (#229).** 7.3.4. In place. Superseded by 7.3.5 11-17 (#266). + +**11-12 · docs/image · `e452afc` (#232), `3a7864d`.** A comment sweep: several comments still said a QEMU or kernel bump strands checkpoints, which has been false since `fa3041c`. Dead code deleted: `spin-machine-console.service`, the modprobe blacklist, and the getty@tty2-6 masks. In place. + +**11-12 · image · `02c58b9` (#235).** bubblewrap, socat and ripgrep for agent sandboxes. In place. + +**11-12 · CI · `c6c29b5` (#236), `ec2c7fb` (#237), `1666cb5` (#239).** A daily apk-lock refresh PR. *Why:* the lock broke three times (`6e7ba47`, `8d495c5`, release run 43157106109). The BuildKit cache moved to ghcr: on the fleet the gha cache read a store nobody wrote, so compat compiled cold on every run and failed on main 4 times from 11-09; both release attempts on 11-12 failed. In place. The daily apk-lock refresh was replaced by pinned builder images 11-20 (#309). + +**11-12 · image · `3c8da99` (#238).** The hot-add rule onlines CPUs only. udev's memory "online" write raced the kernel's `memhp_default_state=online` and logged EINVAL for every block. Closes #230. In place. + +**11-12/13 · image/kernel/boot probes · #240 (`bc41f44`, `a8df865`, `28823fb`, `8fb1dd9`, `e5b8003`).** +- Kernel patch 0005, each PCI capability list walked once: kernel 95.1 → 88.9 ms; ECAM accesses 1,032 → 680 (lab 43327612594). +- **logind back in the boot, and spin lingers:** first SSH login 570/626 → 510/525 (lab 43308825692, 10 boots). +- MOTD and pam_motd off: -7 ms per login, -12 on the first. +- `sshd@` waits for the host keys. Before this, SSH over vsock "worked not at all". +- New probes: `boot:waits`, `boot:jobs` (+ jobwatch, godbus), `boot:ssh-first` (+ vsockproxy), `boot:exits`, `boot:mmio`. + +Measured and not shipped: +- the getty without BindsTo: 342 vs 345 (lab 43303190733); +- keygen in the boot: 518 vs 514 (lab 43312419007); +- virtio-rng removed: -13.6 ms to the prompt (lab 43321809471), not done because it would move the fingerprint; +- `pci=noearly`: the guest does not boot; +- PID 1 spends ~25 ms in the BPF verifier. + +*Side effect:* v20261113.01's console prompt came 21-25% later (release notes). *Status:* patch 0005 and the exits/mmio/jobs probes were deleted in #249 (11-13). 0005 came back the same day (#255) and is in place. + +**11-13 · image · `43de41e` (#241).** serial-getty Type=simple. *Why:* with linger, `user@1000` runs inside the boot transaction, and Type=idle held the getty for 91.8 ms (lab 43361486792). 346/358 vs 423/441 (lab 43362067503); v20261112.01 was 344/353. Released in v20261113.02. *Status:* removed in #249 (11-13): nothing a workspace does waits for the console's prompt. + +**11-13 · boot probes/machine · #242, #246 (both closed).** Restore measured, and a **mapped-ram** checkpoint layout proposed twice: +- #242 (draft): `--channels`; mapped-ram ×4 restore-to-login 394/410 vs stream 877/1888 (lab 43364516874). Those numbers were later declared contaminated by restored VMs leaking between repetitions. +- #246: mapped-ram put in `Spec.Contract`, which would move the fingerprint, plus `boot:score`. On the fleet, with every cold boot run before every restore: restore login 385/400 mapped-ram vs 386/399 stream (lab 43483852339); also lab 43482829958, 373/402 vs 376/416. Closed: "does not earn moving the fingerprint". A laptop lead of 188/358 vs 412/732 was called "a lead, not a finding". + +*Status:* rejected; #242 and #246 closed. + +**11-13 · image · `d895543` (#245), `5e0cc2f`.** sshd offers only `mlkem768x25519-sha256`. ML-KEM costs the same as curve25519: first login 461 for both; a second login 40 vs 39; OpenSSH 9.6 with sntrup761 took 489 first and 104 for a second (lab 43479854381, also 43463472762). `boot:ssh-first` logs in with x/crypto/ssh, and vsockproxy is removed. *Status:* merged 18:30Z. #245's own body said "Do not merge before the clients move": open-remote-ssh#8 merged at 18:57Z, and spin-stack/spin#1206 (the spin CLI refusing OpenSSH < 9.9) merged after its CI and KVM lanes passed. Not yet released. Released in v20261113.03. + +**11-13 · image · `3e8075f` (#247 → #248).** SSH host keys are made from the boot's first dispatch (wanted by sysinit.target, `DefaultDependencies=no`). First login 489/506 → 468/494; accept to login 177 → 154 (lab 43483372488). Rejected in the same run: masking two generators (489), and masking 11 always-failing units (484). Not released. Released in v20261113.03. + +**11-13 · boot probes · #249, #250.** Removed: +- kernel patch 0005 ("6 ms of a ~470 ms first SSH login, for a local patch carried across every kernel bump"); +- the getty Type=simple drop-in ("nothing a workspace does waits for that prompt"); +- `boot:exits`, `boot:mmio`, `boot:jobs`/jobwatch/godbus. + +#250 also removes `boot:bench`, `boot:trace`, `boot:userspace`, `boot:systemd` and `boot:ssh-load`, keeping "a gate …, the release's report, the metric a workspace waits for (ssh-first), and one tool per layer". + +**11-13 · goal · #251, #252, #254.** The goal is written down: a cold boot to the first SSH login in under 100 ms (AGENTS.md), with restore as the second number. The rules that held exploration back are removed (no init in a release, the fingerprint as an event to avoid, one default per experiment, the bench fleet alone deciding); hotplug and dynamic memory become an invariant that is never traded for boot time. + +**11-13 · boot probes · branch `floor-kernel` (experiment).** The floor without systemd: PID 1 a script that mounts what sshd needs, makes an Ed25519 key and has socat hand vsock connections to `sshd -i`. First login 467 → 220 ms (lab 43492686353), 506 → 240 (lab 43493135230); guest uptime puts init at ~90 ms of kernel and the keys 10-20 ms later. What is left at the floor: QEMU and firmware ~44 ms (boot:firmware-stages, lab 43494513791: QEMU's own start 35.9, qboot ~8.5, of QEMU's start 7.9 copying vmlinux), kernel ~80-90, init ~20, the login ~44. `/proc/uptime` starts partway into the kernel, so it hides ~35 ms that an earlier reading charged to QEMU. + +**11-13 · CI · spin-stack/ci#14, #15, spin-machine#253.** A `bench-metal` fleet (c8i.metal-48xl, then r7i.metal-24xl behind it) and lab.yml's `host` input. It has not run: metal spot scored 1-3 of 10 for placement and failed `UnfulfillableCapacity` in every zone; on-demand failed `VcpuLimitExceeded` at a quota of 96 vCPU. An increase to 288 was requested the same day (case open). *Status:* the fleet first ran 11-19 (spin-stack/ci#20; below). + +**11-13 · kernel · #255 (this change).** Where the kernel's ~100 ms goes on the bench fleet (boot:initcalls lab 43495583323): initcalls 52 (acpi_init 12, of which `acpi_pci_root_create`, bus 0's enumeration, 11.2 traced on a kernel without forced lockdown, lab 43499868986; inet_init 7.9, which is vmlinux BTF's first parse; the virtio probes ~17), before the first initcall ~15-20 (SPIN_EARLY, lab 43507472288; ~4 of it the probe's own 18 MB log buffer), SMP ~4, the root mount ~6. Kept: patch 0005 back, 0006 (BTF parsed in the background from a core_initcall), `CONFIG_DEFERRED_STRUCT_PAGE_INIT=y`: kernel 96.3 → 87.1 ms (lab 43505126131), first login 466 → 456 as built and 223 → 214 at the floor (lab 43501992969). `driver_async_probe` for rng, balloon and vsock on the command line: 214 → 209 at the floor (lab 43506390106). *Status:* 0005 in place; `driver_async_probe` deleted 11-20 (#352), 0006 11-20 (#345), `DEFERRED_STRUCT_PAGE_INIT` 11-21 (#356). + +**11-13 · image · the first login's lane (this change).** Where systemd's ~250 ms over the floor went, on the bench fleet: ~60 before sshd accepts (sysinit, udev, journald), ~105 in pam_systemd, and ~65 in a handshake competing for the CPU. logind answers a session of class `user` only once the user's manager has started, and orders its scope after `systemd-user-sessions` (systemd v259.9 source, `logind-session.c`). The vsock socket, `sshd@`, dbus, logind, `user-runtime-dir@` and `user@` without default dependencies, no `/run/nologin` at boot (pam_nologin refused the lane's first login: "Access denied for user spin by PAM account configuration"), sessions of class `user-early-light`, and udev's coldplug filtered to block, net, virtio, misc, input, rtc, ptp and ttyS0: first login 478 → 402 ms (lab 43518915618). Measured and left out: priority (`CPUWeight`, `Nice`) on the lane, −2 ms over the filter and a slower second login (63 vs 45 ms). + +**11-13 · kernel/qemu · branches `kernel-snapshot`, `qemu-snapshot` (rejected).** QEMU publishes bus 0's configuration space over fw_cfg after the firmware (etc/spin/pci-config) and the kernel answers boot-time configuration reads from it until each dword is written. It works (`PCI: configuration space of 5 devices on bus 0`) and is worth -14 ms against the same kernel without it (lab 43514550646), but only 2-3 ms against 0005, which already removes most repeated reads: 209/217 against 211/222 (lab 43514884598). Not worth a QEMU patch and a 250-line kernel patch. + +**11-13 · boot/qemu · branch `first-login-report` (this change).** v20261113.03's report read +11-18% on every row: the report times the serial console's prompt, and the getty drop-in removed in #250 left it Type=idle, waiting for the lane's units. The first login it does not time went from 478/500 (v20261113.02, lab 43524334205) to 381/410 ms (v20261113.03, lab 43524721490), two runs and not interleaved. The report now logs into the release over SSH too (`first_login`), and compare writes it first. The QEMU build asserts static-pie, full RELRO, an NX stack and stack canaries, which come from QEMU's and Alpine's defaults and no flag here. Measured and left out: one sshd for every connection (the vsock socket with Accept=no, an `sshd -D` from the first dispatch), first login 382/393 against 381/410 and a second 40 against 48 ms (lab 43524721490). + +**11-13 · image · udev's coldplug keeps cpu (this change).** The coldplug filtered in `630fa2c` left out cpu, and a core attached before systemd starts is onlined by that replay reaching `40-spin-hotadd.rules` and by nothing else. spin gives a workspace its cores while its own init is PID 1, so with v20261113.03 every workspace came up with one core whatever it was sized to (spin's kvm run 43527839765, four tests "still waiting for the guest to have its floor's two cores"). `task boot:hotadd` attaches a core before systemd and reads `online` after: `0` on v20261113.03's image, `0-1` with cpu in the filter. What cpu costs the first login was not measured; it is one device per core. + +### Week 11: 2026-11-14 to 11-20 + +**11-19 · image · systemd from Ubuntu's source package, stage1 (this change).** The image installs Ubuntu's own systemd 259.9-0ubuntu0.1, rebuilt from its .dsc (versions.yaml `systemd-source`) by `image/systemd/Dockerfile`. The build uses Debian's `stage1` build profile (no BPF framework, audit, AppArmor, SELinux, OpenSSL, TPM2, homed, cryptsetup…) and links systemd-executor, udevd, systemctl and journalctl statically against libsystemd-shared. The packages are versioned `+spin1` and held. *Why:* PID 1 spent ~25 ms in the BPF verifier on socket-bind at every boot (#240, "measured, nothing done"), and restrict-fs failed to load under lockdown on every boot (#261). *Measured:* +- `boot:ssh-first` on the bench fleet, 20 boots of each, interleaved, first login p50 against the archive's systemd: + - stage1: −47 (lab 44531842773), −38 (44537549305) and −47 ms (44538877783); + - static over stage1: −10 and −1 ms, within noise. Accept to login was −7 ms in both runs. +- `boot:waits` on a laptop: PID 1's setup before the generators goes from 25.8 to 5.6 ms. +- `boot:restore-first` (new, below): unchanged. The guest's part, from running to login, is ~50 ms with either systemd (44533227886). + +*Left out:* masking `systemd-udev-load-credentials` (−8, −6 ms) and `-Db_lto=true` (Ubuntu already builds with `-flto=auto`); see docs/boot-time.md, "Measured and rejected". The patch that would make restrict-fs load under lockdown, reading `s_magic` through BTF, loaded in this guest. It is for systemd upstream and is not needed here. *Cost:* a rebuild whenever Ubuntu publishes a systemd. The archive serves only the current source, so the build fails the day it moves, and `refresh:systemd` proposes the move. + +**11-19 · boot · `boot:restore-first` (this change).** The goal's second number had had no probe in the tree since #246 closed. Every row of `boot:ssh-first` is booted cold, logged into and saved, then restored with its state evicted from the page cache (checked with mincore) and logged into again. Every cold boot runs before every restore. On the bench fleet a restore reaches the first login at 841/913 ms, ~790 of it before the guest runs, reading the state from the runner's gp3 volume (44533227886). #246 read 386 ms on 11-13. What moved is not known. On a c8i.metal-48xl it is 905/942 (44535167653), so the restore is the host's disk, not the virtualization. + +**11-19 · lab · nested against metal.** `bench-metal` ran for the first time (spin-stack/ci#20 keeps it to c8i.metal-48xl, on-demand when spot has none; spin-machine#272 caps the job at 60 minutes). The same CPU (Xeon 6975P-C) on both, p50: +- first login: 378-392 ms nested (two runs) against 332 metal (44537498507), so **nesting costs ~50-60 ms**; +- `boot:firmware-stages`: QEMU start 30.5 against 28.1, the PCI walk 5.00 against 2.22 (173 exits, ~29 against 13 µs each), kernel and init 108.7 against 69.5 (44535161371, 44535156851). + +An r7i.metal-24xl (Sapphire Rapids, slower per core) read 296 ms (44534028478), faster than the c8i.metal. Unexplained. Repeat it before quoting it. Every bench-fleet number in this log and in docs/boot-time.md is nested. + +**11-19 · boot/image · where the first login's own time goes, and logind's socket early (this change).** `boot:login-lane` marks the guest's journal through the first login: accept → authenticated 55.5, PAM's session → logind's new session 29.0, → scope 4.3, → command 8.4 ms (v20261119.01, lab 44555905383). Its diagnostic rows (`SPIN_LANE_DIAG`, sshd at DEBUG1 and logind at debug, lab 44557162195) say what they are: +- **Before authentication.** PID 1 starting `sshd@` takes ~11 ms, and OpenSSH 10's three execs (`sshd` → `sshd-session` → `sshd-auth`) ~12. Loading PAM's modules cold takes 8.3 ms, against 0.9 at the second login. ML-KEM is 3.5. +- **The hop to logind** is logind not running yet. Its Varlink socket kept its default dependencies, so logind waited behind `sysinit.target` and udevd, ready ~230 ms into the boot (`boot:waits TARGET=systemd-logind.service`, lab 44557605832). The first login waited ~32 ms for it, the second 1. + +The socket without default dependencies (`systemd-logind-varlink.socket.d/20-lane.conf`), 20 boots of each (labs 44558035927, 44558053261): +- the hop: 24.5/41.8 → 15.8/22.7; +- accept to login: 131/137 → 120/128; +- the first login: 332/355 → 328/337. The p50 moves little because logind starting sooner takes the CPU sshd was starting on. + +Masking `modprobe@drm`, which logind is ordered after, added nothing (327/345). What is left of the login is CPU contention on 2 vCPUs, `user@1000` (38 ms) and the host key generation (21 ms) starting in the same window, rather than waits. + +**11-19 · systemd/boot · where PID 1's gap between the unit load and the first job goes (experiment, tooling kept).** `image/systemd/experiments/pid1-marks.patch` makes PID 1 append its monotonic clock, its own CPU time, the units loaded and the time in `unit_load` after each step of `manager_startup` and `do_queue_default_job` to `/run/spin-pid1-marks`. `boot:waits` reads the file. `lab.yml`'s `systemd_experiment` builds the patched systemd on the runner and puts it into each overlay. Bench fleet, 10 boots (lab 44561762624), p50 ms: +- bus, varlink, coldplug, vacuum, ready: < 0.2 together; +- **loading what `default.target` reaches: 28.4 wall, 20.9 of it PID 1's CPU, 192 units** (~0.11 ms of CPU each; the rest is likely cold reads); +- building the transaction: 0.30; +- the first dispatch: 0.87. + +The gap is unit loading, not the transaction that 11-13's single debug-logged boot named. 96 of the units a boot lists are inactive, loaded because another unit names them in `After=`/`Wants=`: `initrd-*`, `plymouth-*`, `modprobe@*`, hibernate, cryptsetup's targets, `firewalld` and `auditd` named by docker. Masking does not spare a load (a masked unit is still looked up and loaded as masked), which is why masking 11 units moved nothing (docs/boot-time.md, "Measured and rejected"). + +**11-19 · image/machine · the root mount's storage path (branch `ext4-mount`, not yet on the fleet).** The kernel gap `security_initcall_late_sync` → `EXT4-fs (vda): mounted` was 6.8 ms nested and 5.0 metal (`boot:initcalls`). Three changes, from reading Linux 7.3 and the image: +- the image without `orphan_file`, a mke2fs.conf default since 1.47.0: every mount, read-only included, reads it one block at a time (`ext4_init_orphan_info`, ~73 single-block reads with no readahead). Crash correctness is the classic orphan list's; +- `lazy_itable_init=0`: `mke2fs -d` left no group `ITABLE_ZEROED`, so each overlay's first read-write mount had `ext4lazyinit` zero every inode table in the first second of the boot. After one `--init /bin/sh` boot the overlay held 16.06 MiB of zero clusters, and none with the tables zeroed at build. The thread still starts, to prefetch block bitmaps (it does not with `no_prefetch_block_bitmaps`). The image is 256 KiB smaller; +- `rootfstype=ext4`: without it the root mount tries ext3, then ext2 (`EXT4_USE_FOR_EXT2`), on the superblock before ext4. + +Laptop lead only, on a host at load ~30: the gap's p50 over three alternated rounds of `TestKernelInitcalls` (8-10 boots each) was 8.8/2.8/4.3 ms with the release, 4.1/3.2/2.9 with `rootfstype` alone, and under 2.4 (below the rows printed)/1.3/1.2 with all three. Not decided until `boot:ssh-first` and `boot:restore-first` run interleaved on the bench fleet. *Status:* merged 11-19 (#286) and in place; `rootfstype` and `^orphan_file` are still leads, not measured on the bench (docs/boot-time.md, "What the machine carries"). + +**11-19 · kernel/qemu/machine · the kernel is entered as a bzImage (this change, functional: security).** KASLR was inactive under PVH. The PVH entry into `vmlinux` skips `arch/x86/boot/compressed`, where KASLR picks the random base and sets `KASLR_FLAG`, so `CONFIG_RANDOMIZE_BASE` and `RANDOMIZE_MEMORY` did nothing: every PVH boot had `_text` at `ffffffff81000000`. The machine now boots `kernel/bzImage` (LZ4, as the config already had: x86 has no `KERNEL_UNCOMPRESSED`), which qboot loads from fw_cfg itself (`boot_from_fwcfg`); `linuxboot_dma.bin`, the ROM QEMU adds for a bzImage and SeaBIOS runs, ships again. `vmlinux` and `pvh.bin` stay, for `--kernel vmlinux`, debugging and BTF. A tree without a bzImage (every release before this one) still boots its `vmlinux`, which boot:compat needs. Two builds, the second on a fresh BuildKit with no cache, gave the same bzImage (`ff9f0ec6…`) and vmlinux (`ff53d597…`). *Checked:* `boot:lockdown` now requires `_text` present and not `ffffffff81000000`, and no `nokaslr`; it fails on the PVH tree. Three bzImage boots: `_text` `ffffffffb5c00000`, `ffffffffa2a00000`, `ffffffff90800000`, the physical base moving too (`/proc/iomem`); the PVH `vmlinux`, three times `ffffffff81000000`. The fingerprint does not move (`2bd7da6b…` either way) and `boot:roms` passes: on q35 an option ROM is a fw_cfg file, not a RAM block. *Cost on a laptop (i9-13900HK), a lead only that the bench fleet decides:* `boot:firmware-stages` REPS=5, QEMU exec to the diagnostic init 105.6 vs 83.6 ms p50 summed (qboot copying the bzImage 2.3 ms; the rest the decompressor and the kernel after it); kernel start to init over 10 boots 34-92 ms, p50 ~51, against 34-37 for PVH, so the spread is the bzImage's and not yet explained. `boot:ssh-first` alternated A/B/A/B/A/B at REPS=5: first login 500/658/603 vs 504/587/764 ms p50. The laptop's noise is larger than the difference. Kept whatever the bench fleet says: it is a security fix, and what it costs is the next thing to make cheaper. + +Bench, nested (2026-11-19): it costs nothing measurable. `boot:initcalls` in the workspace shape, kernel start to "Freeing" 94.5 → 93.9 ms (lab 44577696958): the laptop's 34-92 ms spread did not reproduce. `boot:ssh-first` against the PVH release, sshd accepts 199 → 198 ms and first login 328 → 317 (lab 44583379559, 20 each); the login gain is in accept-to-login and is main's, not the bzImage's. The LZ4 decompression and the fw_cfg load do not show. + +**11-19 · machine · one surface for spin: `machine.VM`, every machine started held (this change).** spin built a `Spec`, exec'd `Args()` and drove QMP with a client of its own, so what a checkpoint is (the migration capabilities both ends must agree on), how a disk reaches a device, and the `-S` before a CPU plug lived in spin. Now `machine.VM` (QEMU's: `machine.Attach`) is that conversation: `Boot`, `Resume` with `Load{Fast}`, `Loaded`, `Checkpoint` with a seal at pre-switchover, `Continue`, `AttachDisk`/`DetachDisk`, `SetCPUs`, `SetMemory`, `CPU`. An interface on purpose, so another VMM can be put behind it and compared. Every machine starts held, `-S` or `-incoming defer` (`Spec.Restore`): under `-incoming defer`, `cont` leaves QEMU in `inmigrate` (11.2.0-rc0), so one QEMU cannot wait for both. A disk is bound to its place (`Spec.Disks`, a raw node over an empty `null-co`) by serial, `blockdev-reopen` onto the chain handed over `add-fd`: the device's serial and read-only-ness are fixed at realize, and QEMU 11.2 has no `blockdev-replace`, so the raw node stays and a seal targets `machine.TopNode`. The prestart prototype measured it on the bench fleet: cold first login 313→291, restore 170→153 ms (lab 44573266140). Checkpoints are written in mapped-ram (`FormatMappedRAM`, recorded in `Saved`); a stream checkpoint from before still loads, in full (`boot:compat`). The host CPU's model name left the fingerprint: a checkpoint records the CPU its guest was shown and `CanResume` checks it (spin#1348). Fast load needs userfaultfd for QEMU's user and was not run here: an unprivileged QEMU refuses postcopy ("Userfaultfd not available"). *Status:* PR, measured on the bench fleet with `boot:restore-first` (`SPIN_RESTORE_FAST=1`) and `boot:prestart`. Merged 11-19 (#293). + +**11-19 · machine · one rule for where a checkpoint resumes: `CanResume(Saved, Target)` (this change, functional).** After #293 a checkpoint recorded its format and CPU, but the machine it was of was still spin's `machine_identity` string, and nothing recorded the QEMU that wrote it: QEMU loads what an older QEMU of the same machine type wrote and promises nothing the other way, so during a rolling update a checkpoint from an updated host could be placed on one not yet updated with an identical fingerprint (spin-stack/spin#1348). `Saved` now carries `Fingerprint` and `VMM` ("qemu 11.1.90"), a machine says what it resumes (`VM.Target`: formats, fingerprint, VMM, CPU), and `CanResume` is the one rule a placement and `Resume` both ask: the format read, the same fingerprint, the same VMM at the writer's version or newer, the CPU shown again. `Args` names the machine by its fingerprint (`-name guest=spin-machine:`, read back with `query-name`), which the guest does not see and `Contract` does not hash. Records from before a field was kept are not checked on it. + +**11-19 · machine · a place is a filter node (this change, functional).** A place's node was raw over the bound disk's top image. spin's storage compacts a chain by rewriting a bound image's backing file (`change-backing-file`), which QEMU takes only on a root node whose chain, followed by backing and filter links, contains the image: on the root it answered "'slot0' and image file are not in the same chain", on the image "Need a root block node" (QEMU 11.2.0-rc0). A place is now a `throttle` node in a group with no limits: a filter, so the chain is seen through it, and pass-through. copy-on-read, compress and preallocate are filters too, and each changes what is written. Checked on QEMU 11.2.0-rc0: bind by `blockdev-reopen`, then `change-backing-file` through the place, then a seal under an overlay. The fingerprint does not move (`-object` is not in `Contract`). Its cost per I/O is the bench's to say. + +**11-19 · kernel · branch `kernel-floor`, patches 0007-0011 and a config trim (this change).** The kernel was 78.0 ms nested against 45.0 on metal, same CPU (boot:initcalls, labs 44563496308, 44563512999). Five of its gaps, each a patch: +- 0007, ORC's lookup table by one merge pass instead of 59,650 binary searches: 3.5 ms on both hosts. Every block checked against the binary search, 0 differ. +- 0008, init's 1,989 ftrace records freed with one memmove: 2.6 ms on both hosts. +- 0009, the boot CPU polls for an AP by `local_clock()` while booting: 4.1 ms nested, under 1.4 on metal. +- 0010, no early-quirks PCI scan under KVM: 2.1 ms nested. pci=noearly also defers MMCONFIG; this skips only the scan. +- 0011, virtio-pci's `queue_select` written only when the queue changes: 84 → 22 writes. + +Config: `X86_MSR`, `X86_CPUID` off (nothing in the image or spin opens `/dev/cpu`); `BLK_DEV_LOOP_MIN_COUNT=0` and `SERIAL_8250_RUNTIME_UARTS=1` (from `kernel-trim`). *Measured:* only on a laptop, not nested, 10 boots each interleaved, a lead: the ORC gap 4.59 → 0.93 and 4.45 → 0.72, the WAET gap 0.44 → 0.07 and 0.32 → 0.06, the ftrace gap 2.7 → under 1.1 ms. 0009 and 0011 cannot move there: the AP never waits and exits are cheap. The kernel's total read 61.5 → 55.7 in one run and 53.0 → 54.3 in the other on a host building QEMU at the time: noise. Not yet measured on the bench fleet or against the first login. + +Bench, nested, workspace shape (2026-11-19, lab 44587603255, 20 boots each): kernel start to "Freeing" 96.4 → 86.6 ms (−9.8), in initcalls 61.7 → 58.7, outside them 35.1 → 27.8, where ORC and ftrace are. `virtio_pci_driver_init` 8.57 → 8.59: 0011 does not show even nested. *Status:* merged 11-19 (#291); 0009 and 0011 deleted 11-20 (#345); 0007, 0008, 0010 and the config trim in place. + +**11-19 · lab · the probes become `spin-machine-dev lab` (branch `dev-cli-lab`, this change).** Each probe was a Go test behind a `SPIN_*` switch of its own, and took a second kernel, a second QEMU, an edit of the image or a rebuilt systemd each through another environment variable (`SPIN_KERNEL_B`, `SPIN_KERNEL_C`, `SPIN_MACHINE_OUTPUT_B`, `SPIN_APPEND_B`, `SPIN_SYSTEMD_DEBS`), laid out by lab.yml's `variant=beside|instead`. Two failures in one day came from that shape: `boot:restore-first` read no `SPIN_MACHINE_OUTPUT_B` and measured the release's QEMU under the name of 11.2's (lab 44584214362), and a Kernel run from before the bzImage failed `lab:place` with no message (lab 44587254371). Now a tree is a whole machine with a manifest naming every part's source, refused when it is not whole, and a probe is handed trees (`internal/lab`, docs/cli.md). Ported: `ssh-first`, `restore-first` (its `fast` rows an option), `prestart`, `initcalls` (totals, the initcalls of interest per tree, each tree's slowest initcalls and largest gaps). The "as this branch" row is the tree edit `lane`. Not ported, and kept as `boot:` targets `lab check` runs on any tree: `firmware-stages`, `waits`. Deleted, each question answered and its answer in this log or beside it: +- `boot:login-lane` (`boot/login_lane_test.go`): where the first login's own time goes, on the guest's clock. See the 11-19 entry above and docs/boot-time.md's cold-boot budget, lab 44555905383. +- `boot:density` (`boot/density_test.go`): one idle workspace's host memory, ~125 MiB (lab 44546329726). +- `boot:page-cache` (`boot/pagecache_test.go`): the page caches a machine has. See docs/memory-and-disk.md and docs/boot-time.md's "Measured and rejected". +- initcalls' extra passes, not ported: `SPIN_GRAPH` (function_graph under chosen functions, `boot/graph_test.go`), `SPIN_CPU_SHARE` (who had the CPU during one initcall, `boot/cpushare_test.go`), `SPIN_EARLY` (the lines before the first initcall) and `SPIN_FORMAT_CHECK` (an event's format after patch 0003). Each served one question, answered above. When another asks for one, it comes back from git (`boot/initcalls_test.go` and those two files before this change) as an option of the `initcalls` probe. +- `boot:ssh-first`, `boot:restore-first`, `boot:prestart`, `boot:initcalls` are now lab runs over `OUTPUT_DIR`, the same targets. + +Checked against the probe it replaced on the bench fleet, `lab dispatch ssh-first`, the release and the release with the lane, 20 each (lab 44596983249): sshd accepts 215/228 and 216/229, first login 349/366 and 339/353. The old probe's rows read 215/223 and 216/223, 348/360 and 335/345 (lab 44585268429). A release ships no spin-machine. The old targets' `:tools` built this checkout's into the release tree, and a tree does the same, named in its manifest (the first dispatch, 44596065601, failed on it). + +**11-19 · lab · the release report is a ladder (this change).** The report measured each release alone, through the feature matrix (eight combinations of memory, vsock and hotplug, and the image's boot variants, each timed to the serial console's prompt), and compared its report.json with the previous release's, taken on another day on another instance. For v20261119.02 it said sshd accepted 7.3% later than v20261119.01 (202.6 → 217.3 ms); the two interleaved on one host said 199 → 198 (lab 44583379559). And the goal's second number, a restore to the first login, was not in it. Now `spin-machine-dev lab ladder` boots the newest five releases on one bench host, each with the spin-machine of its own commit, interleaved: a cold boot and a restore to the first login, both into a QEMU started ahead, and save, state, the kernel and QEMU's RSS as diagnostics. report.yml runs it after each release (ladder.json beside it, the table in its notes) and weekly. A release whose spin-machine cannot run a probe is a dash with the reason. boot:compat is now `lab compat`: every release since the fingerprint last moved, fetched against its sha256 and signature, and CanResume held to QEMU's one-way promise against each one's QEMU. The feature matrix is deleted: its last answer is v20261119.02's report.json asset and the "Feature matrix" section of its notes (no row moved beyond 5%, every row 344-389 ms usable), and git has the code (boot/report.go, boot/report_test.go). *Status:* the report measures each release alone since 11-20 (#314); `lab ladder` and `lab compat` in place. + +**11-20 · machine · a named CPU model, what it costs (#222).** spin-machine can show the guest a named model the fleet shares (`CanResume`, `Models`, `Baseline`, #293). The question left was its cost. The bench host is nested, and its L0 hides features the Xeon 6 has (la57, TSX, fsrm): QEMU refuses GraniteRapids-v1, SapphireRapids-v1 and Icelake-Server-v2 there ("Host doesn't support requested features", lab 44657973748, cancelled after 50 minutes of boots each waiting out its login; `lab` now refuses such a tree at its first boot). The newest model it runs, chosen on the runner (`lab tree --cpu baseline`), is Cascadelake-Server-v5. Against `-cpu host`, 20 boots each, interleaved: the cold boot's first login 327/342 → 343/353 ms (+16.4, sshd accepts +12.6; lab 44664362024); the restore's 160/170 → 161/170 evicted and 167/188 → 165/203 cached (lab 44664603720). A fleet that takes a baseline model pays ~16 ms on every cold boot for checkpoints that cross host generations. On one generation `-cpu host` with `CanResume`'s feature check is free. + +**11-20 · lab · density, the latency half (#273).** #278 answered the memory half (an idle workspace costs its host ~165-170 MiB). `lab` probe `density` boots the row's number of workspaces, logs into each, lets them settle 10 s, times one more's first login, and ends them all before the next measurement. On the bench (c8id.4xlarge, 16 vCPUs, 32 GiB, nested), 2 vCPU / 2 GiB workspaces, idle, 10 of each interleaved: with 0, 4, 8 and 16 already running the first login is 332/343, 328/340, 328/345 and 326/338 ms (lab 44667235868). Each of the crowd took ~625 ms to boot and log into. Idle workspaces do not move the first number up to 16 on this host. The 25% point is past that. Not measured yet: a CPU-bound crowd (`load=cpu`), more than 16, and metal. A first run left every crowd up until the experiment ended (m.Cleanup runs then) and measured a host carrying a growing pile of machines (lab 44665519945); the probe ends its crowd itself. + +**11-20 · lab/machine · multifd channels on the checkpoint, the no-systemd floor, and spin's shape (#320, lab 44750713447, lab 44750322384).** The two experiments of the methodology review, and the first runs in spin's shape (#319). *multifd:* `spin-machine save` and `restore` move a checkpoint's memory over `--channels` threads (QEMU's multifd on mapped-ram); with QEMU started ahead, in the ladder's shape, the restore's first login reads 140.9/152.0 at one channel, 140.5/178.0 at two (inside the noise), 101.5/117.4 at eight and 93.5/114.9 at sixteen, Δp50 −47.4 [−54.4, −39.4]: the first goal number under 100 ms. In spin's shape the p50 falls 149 → 114 but ~20% of restores with channels (56 of 280) stall ~400 ms between running and the login, against 5% at one, and the p95 goes 254 → 435. *Floor:* `lab tree --edit floor` boots sshd with no systemd before it, a bound only: the ladder's shape 322 → 219 (Δ −103.5 [−108.6, −100.5]), spin's 445 → 240 (Δ −204.8); sshd accepts at 173 and 189 ms with nothing before it. *Spin's shape:* the cold first login is 445 ms against 322, Δ +122.9 [+116.6, +129.8]; accept to login 214 against 114. *Later the same day:* the stall was a guest left at 128 MiB. At 128 MiB MGLRU's `min_ttl_ms` (armed by tmpfiles at boot) forbids eviction for the first second, so the guest OOM-kills sshd-session, logind and systemd units, and the client retries (lab 44784196287: kills up to 27, failed logins up to 14 a login); a second, idle ~400 ms stall in states saved with 8 channels sat inside sshd's key authentication. spin sizes every workspace to 2048 MiB right after its start (spin's `vmm.resize`), and sized so (`plugged=2048`) neither appears: no kills, every row's gap p95 under 69 ms (lab 44788801555). Restored into a QEMU started ahead, spin's shape and login: 150/156 at one channel, 103/108 at 8, 92.7/111 at 16, Δp50 −57.4 [−59.4, −54.3], and 16 against 8 −11.0 [−13.0, −7.9] (lab 44789688221). *Status:* channels kept. Restores run side by side decide the default count: 8 since 11-20 (#332). The floor edit is kept as the bound's instrument. + +**11-20 · qemu/machine · the hotplug controller scans the places it has (#324, lab 44788216590).** In spin's shape the 4 hotplug disks' virtio-scsi controller made the guest scan 256 targets at boot: `virtio_scsi_init` 12.1 ms (lab 44587603255), ~460 of the boot's exits (QEMU's trace, laptop). `qemu/patches/0002` gives virtio-scsi a `max_target` property (default 255, a disk plugged above it is refused, the build asserts the property), and the machine sets it to the hotplug disks less one, so the guest scans the places a disk can be attached to and no more. Every place is still scanned, unlike `scsi_mod.scan=manual` (rejected: it loses disks); 4 disks attached to a running guest all appear. On the bench, spin's shape (`plugged=2048`, `login=spin`), 20 each against the same QEMU without the property: first login 512/531 → 503/514, Δp50 −8.9 [−15.5, −0.9], sshd accepts −10.3 [−18.8, −0.2], the console prompt −12.5 [−19.0, −5.3]. The fingerprint moves for machines with hotplug disks, so their older checkpoints boot cold. In the same run `CONFIG_SCSI_SCAN_ASYNC` (#325) read −2.6 [−8.9, +6.8]: rejected. The decompressor without its VGA cursor (#328) and an uncompressed payload (#326) are in "Measured and rejected" (docs/boot-time.md). *Status:* kept. + +**11-20 · machine/lab · a checkpoint's memory moves on 8 channels by default (this change, lab 44792429636).** One restore at a time, 16 channels were best in spin's shape (92.7 against 103 at 8, lab 44789688221), but each channel is a thread of QEMU's and restores share a host. `lab` probe `restore-together` lets 1, 4 and 8 restores go at once, each from its own checkpoint into its own QEMU started ahead, evicted from the page cache. On the bench (spin's shape and login, 30 bursts, first logins pooled; the pooled interval is narrower than the truth, since restores in one burst are not independent): alone 152 / 100 / 90.2 ms at 1 / 8 / 16 channels; 4 at once 184 / 140 / 143; 8 at once 400 / 329 / 337. Against 8, 16 gains −10.1 [−12.2, −7.6] alone and loses +3.2 [+1.1, +5.8] at 4 at once (+10.9 [−4.7, +30.4] at 8). The rule set before the run picked 8: it gains on 1 at every count. `machine.DefaultChannels` is 8. A Save or Load that names a count, and `spin-machine save/restore --channels`, still choose any. A fast load or a stream state stays at one thread. The release record's restore numbers measure each release at its own default, so this release's Δ against the one before it is the change. Eight restores at once take ~330-400 ms whatever the count: what a host does with a burst is its own question. *Status:* kept. + +**11-20 · CI · the builders are images, and the apk locks are gone (this change).** The daily apk-lock refresh (`c6c29b5`) kept the locks buildable, at a price: Alpine's mirror serves only the newest build of each package, so a lock moved every two or three days (11-09, two on 11-12, 11-19, #308 on 11-20), and the lock is the first layer of QEMU's build, so each move compiled QEMU cold on its pull request (17-21 min) and again on main (12 min), since only main exports the cache. #308 was libxml2 r2 → r3, which nothing links. QEMU's and e2fsprogs' builders are now images, Alpine with the part's apk.list installed (`builder/Dockerfile`), published to ghcr and pinned by digest (`qemu-builder`, `e2fsprogs-builder`). An image keeps its packages after the mirror drops them, so nothing forces a move: refresh.yml makes them again weekly and proposes the ones whose packages moved, with the list of what did. The tag is a hash of the Alpine, the list and every package installed, so it never names two images. A part's build stops at its first step when the tree's apk.list is not the builder's. In place. + +**11-20 · CI · qemu.yml, kernel.yml and image.yml are parts.yml (this change).** Three workflows of the same shape, each a path-filtered `changed` job and build, and none of them a required check, since a path-filtered workflow does not report on a change outside its paths: a pull request could merge with its QEMU build red (#309's was not blocking). One workflow now, with no path filter: `changed` decides for each part, the builds run when it says so, and `parts` (`spin-machine-dev needs`) fails when one that ran did not pass, which gives a ruleset one check to require. A change that reaches all three runs one `changed` where it ran three (each a billed minute). Over the 200 runs before it (gha-optimize, 2026-11-20): build p50 1m01s cached, cold 10-22 min; `changed` 20 s. In place. + +**11-20 · lab · each release's numbers in the repository, measured alone (this change).** The ladder (11-19) made every release re-measure the newest five on the bench (~13 min of the `report` job), uploaded a 31 MB ladder.json as a release asset and ended the release's notes with a table: numbers no one could share or read back but by downloading the asset, and the same five releases booted again with every release. Now the `report` job measures the release alone (`spin-machine-dev releases measure`, a ladder of one), keeps its p50/p95s as `docs/releases/RELEASE.json` with its host, date and run (whose artifact keeps every sample, 90 days), writes `docs/releases.md` from every record (a Mermaid chart of each goal number release by release, the tables, where each was measured), and proposes both as a pull request as the release app. It boots one release where it booted five, and nothing goes on the release. *Why alone, not beside the release before:* every record is then read the same way, one run each, and the page says plainly what that costs: the 11-19 report said v20261119.02 accepted SSH 7.3% later than v20261119.01, and the two interleaved said they did not (labs 44583379559, 44600043625), so a Δ on the page is a lead and a decision is `lab ladder` over the two, interleaved. `releases compare A B` prints two records with each one's host and date, and that command. Past releases are `releases missing`, measured by `report.yml` dispatched with `versions` (each alone, one after another, proposed together). Seeded from the two ladder.json assets there were, taking only each one's newest release, the one that run was for: v20261120.01 (cold 327/337, restore 159/164, run 44641240861) and v20261120.02 (cold 323/329, restore 168/180, run 44727451080); the older releases inside them were measured interleaved, and are left for `releases measure`. `lab publish` and the release-notes section are deleted. + +**11-20 · lab · the records' chart is an SVG, and the records a web page (this change).** The page's two Mermaid `xychart-beta` blocks drew one p50 line each and could not draw a gap: a release without a number was left off that chart's axis, so the cold and the restore charts had different x axes, and neither showed the p95. `spin-machine-dev releases doc` now writes `docs/releases.svg` beside the page, from the same code (`lab.Chart`, hand-written, no dependency): both goal numbers on one axis, each a p50 line over a band to its p95, broken where a release has not the number, the 100 ms goal dashed, a tooltip on every point. One SVG is shown on GitHub's light page and its dark one, and an image cannot follow the theme, so its two colours were chosen to clear 3:1 on both (#2a78d6, #d95926; dataviz's palette checks against #ffffff and #0d1117) with text in a mid grey (3.9:1 and 4.8:1). `releases site` writes the same page as one HTML file with the chart inline, so its tooltips show, and each record beside it. `pages.yml` publishes it at https://spin-stack.github.io/spin-machine/ from every merge that changes a record. The tables are one list of rows that the Markdown and the HTML both write, so the two cannot say different things. Each release in "Where each was measured" now links its record. + +**11-20 · lab/docs · the methodology review, and docs/boot-time.md (this change).** Two adversarial reviews of how boot time is measured, each finding re-run on the ladders of runs 44641240861 and 44727451080 (five releases interleaved, 20 boots each). *Found:* +- No per-phase budget existed, so nothing said whether 100 ms is reachable. Split by phase, the cold boot spends ~125-135 ms in QEMU, qboot and the kernel before PID 1 runs. The no-systemd floor (209 ms) was measured once, on 11-13, on an 87 ms kernel. +- The goal probes boot a shape and a login path spin does not: no CPU or memory ceilings, where spin boots 1 CPU and 128 MiB with ceilings of 16 and 8 GiB (the kernel 86.6 ms against 62, lab 44587603255), and an `sshd-vsock.socket` that spin turns off. +- Effects inside the noise were accepted. Two releases booting the same guest read Δp50 of the first login in [−8.7, +4.8] ms (bootstrap, n=20), yet the logind socket's −4 and `driver_async_probe`'s −5 were kept while −8 and −6 were rejected as noise. +- `docs/releases.md`'s Δ is drift between runs: v20261120.01's restore login read 158.9 and 167.0 in the two runs. +- The bzImage's cost was recorded as zero by a clock that starts after decompression: sshd accepted ~10-13 ms later from v20261119.01 to .02 while "Freeing" went 76 → 62.5. +- `restore-first`'s `read` reads the mapped-ram file's holes (2 GiB for 155 MiB of data), and its `up` times the monitor socket. + +*Decided by the maintainer:* the kernel, systemd, QEMU and qboot may all be patched without limit. systemd is a must, so a no-systemd init is only ever a bound. *Done:* `docs/boot-time.md` holds where both numbers stand, the per-phase budget, the method with one acceptance rule (a gain when the 95% interval of Δp50 excludes 0), the kept and rejected tables, the measurement pitfalls, and what is next. This log's former "Where we stand", "Measured and rejected", "Measurement pitfalls found" and "Open questions" moved there. *Next:* the probes in spin's shape (branch `lab-measure`); multifd channels on the restore and the no-systemd floor on today's kernel, both on the bench. + +**11-20 · lab/image · spin's login, spin's memory, and spin no longer lingers (this change).** What spin expects of the guest's SSH server, read in spin-stack/spin at 1bd3414: sshd on 127.0.0.1:22 reached through its supervisor's vsock forwarder (a Go dialer, so TCP_NODELAY), ssh.service started by the supervisor's `systemctl reload-or-restart` when it installs the user CA and before it lets SSH through, a certificate for **root** (the CLI, the exec server and the terminal agent all log in as root), sessions in `user.slice` (spin writes its memory limits there, internal/guest/sessionmem), and a workspace sized to 2048 MiB through virtio-mem right after its start, before the guest's handoff (vmm.go, resize). The goal probes did none of it: they logged in as spin through systemd's vsock socket, an `sshd@` a connection, and left spin's shape at 128 MiB. *Found, on a laptop (leads, not nested):* +- At 128 MiB the guest's OOM killer runs through the boot and the logins: user@1000, logind, `sshd@`, `ssh.service` and session scopes killed, ssh.service hitting its start limit, logins lost and retried, in every boot of spin's shape. Sized to 2048 MiB right after its start (67-79 ms to plug) nothing is killed. Every number in spin's shape so far measured a guest spin never runs. The ~400 ms stalls between running and the login in ~20% of multifd restores (lab 44750713447) look like it. +- spin's path costs less than the lane's: accept to the first login 67-70 against 142-155 ms, a warm login 27-30 against 33-37 (6 boots each, 2048 MiB). socat as the forwarder without `nodelay` read 69 ms warm against 26 with it: Nagle against the delayed ACK, which spin's Go forwarder does not have. +- On spin's path, sessions of class `user-early-light` and nobody logged in as spin, the lingering user@1000 is a systemd --user started in every boot for nobody: without it accept to login 40 against 70 ms and the first login 294 against 316 (6 each); through `lab run`, 8 each, first login −13.1 [−33.3, +5.6], accept to login −7.1 [−28.5, −2.4], the console prompt −37.8 [−63.2, −22.4]. The lane's login as spin did not move (283 against 281). +- Measured and not kept, each a lead on spin's path: `UsePAM no` refuses root, whose password is locked, and would take the session and `user.slice` with it; pam_systemd removed, −15 ms on the first login and −5 warm, but no session, no `XDG_RUNTIME_DIR` and no `user.slice`, where spin holds a person's sessions below the machine's memory; the sshd PAM stack cut to pam_nologin, pam_unix, pam_loginuid and pam_systemd, nothing (70 against 67). Exec costs, warm: `sshd-auth` 1.7 ms a start against 0.56 for `true` (16 libraries, 7 of them Kerberos'), `sshd-session` 0.9, `sshd -t` 2.2; a rebuilt OpenSSH without GSSAPI has a ceiling of ~1-2 ms a login, under the bench's noise. + +*Changed:* `lab`'s shape options `plugged=MIB` (the guest sized right after its start, as spin does) and `login=spin` (root, through a socat forwarder to ssh.service, systemd's vsock socket masked), both off by default. The image no longer lingers spin, and `--edit nolinger` puts that into a release's overlay. *Measured on the bench* (spin's shape, `plugged=2048`, `login=spin`, 20 each, interleaved): the first cold login 532/551 → 496/514, Δp50 −36.1 [−45.8, −23.6], accept to login −26.9 [−39.8, −18.9], the console prompt −89.5 [−103.6, −73.9], QEMU's RSS −7.9 MiB (lab 44785179901); `prestart` cold −27.4 [−32.7, −19.9], prestarted −25.8 [−35.2, −15.1], both restore rows within the noise (lab 44785565313). *Status:* kept. + +**11-20 · boot · the time before the kernel's clock gets an instrument (this change).** docs/measuring.md's rule 7 (then docs/boot-time.md's rule 6): the bzImage's decompression ran where no clock looked. QEMU zeroes kvm-clock as the machine goes to "running" (`kvmclock_vm_state_change`, KVM_SET_CLOCK with the 0 a machine never run has), and the kernel prints the kvm-clock it read when it made it the scheduler's clock ("kvm-clock: using sched offset of N cycles", in ns). The probe init prints that line and "Freeing" with their kmsg times, and `boot:firmware-stages` places them on QEMU's trace: after the firmware's last select, "to the kernel's clock" (the initrd's copy, the jump, the decompression and the kernel's setup until kvmclock_init), "kernel to Freeing", and "Freeing to SPIN-READY", what is left, which a wrong anchor would push below zero and the probe refuses. Its default shape is spin's (1 CPU, 128 MiB, ceilings 16 and 8 GiB, 4 hotplug disks), and `lab check` hands a second tree to it as SPIN_MACHINE_OUTPUT_B. *Checked, laptop, a lead (8 boots each interleaved):* v20261120.02 (bzImage) against v20261119.01 (PVH, no decompressor): to the kernel's clock 24.3 against 7.9 ms, kernel to Freeing 28.4 against 34.3, and Freeing to SPIN-READY 9.5 against 9.7: what moved is the phase the bzImage added, and the residual on the other side of the anchor did not. The bench reading is next. + +**11-20 · lab · initcalls and density size their guests (this change).** v20261120.03's release report failed on a diagnostic: `initcalls` lost 3 of 40 boots, and the report of 63049ff 4 of 40, each `never saw "SPIN-DMESG-END" in 1m30s` with an empty console tail (report runs 44800662338, 44805222647). ssh-first and the restores lost none in either, and initcalls lost none in the 2-vCPU, 2 GiB shape (44735598126). `plugged=2048` became every probe's default, but only ssh-first, restore-first, prestart and restore-together called `Plug`: initcalls and density booted spin's shape and left it at 128 MiB, while the record said "sized to 2048 MiB". Such a guest had 6 MiB of its 72 free, and had already stalled on memory, when the dump ran (laptop, 3 boots; sized, 1.9 GiB free and no stall), so the bench's loss reads as a guest at the edge of its memory. That is a lead: the laptop lost none of 20 at 128 MiB, and the tail that would say so was empty because `readUntil` returned nothing on a timeout, which it now does not. Both probes now plug as the others do, and a test holds that every probe taking `plugged` needs `memory --to`. initcalls' numbers are now of the kernel booting while virtio-mem plugs, which is what spin's kernel does, so its record moves with this: "Freeing" read 43.1/50.2 sized against 33.6/212 unsized (laptop, 20 each, two runs apart: a lead, not a Δ). *Decided by:* 0 lost in 40+ bench boots (the dispatch on the PR). + +### Week 12: 2026-11-21 to 11-27 + +**11-21 · lab · the probes boot, size and log in as spin does, unless asked (this change).** #319 made spin's shape the probes' default, but left the guest at 128 MiB and logged in by the lane, and both made numbers spin never sees: at 128 MiB the guest OOM-kills its way through the boot (lab 44784196287), and on spin's path the cold first login read 532 ms where the lane's read 445 (labs 44785179901, 44750322384). `plugged` is now 2048 and `login` spin unless a run says otherwise; `plugged=0 login=lane` with the old shape options is the shape before. The release records measure what the probes measure, so the first record after this one is the first in spin's shape, and its pair's Δ (`against`) is measured in the same shape. The `floor` edit's sshd serves the lane, so a floor run passes `login=lane`. + +**11-21 · image/lab · where one vCPU's time goes before the first login, and what the CPU weights do (laptop leads, PR #329 closed).** With the guest sized to 2048 MiB (`plugged=2048`) one vCPU adds ~85 ms to the first login against two, on the lane and on spin's path alike (4 boots each). The guest spends ~225 ms of CPU to the login either way, with 0 ms idle at one vCPU: the second CPU used to run beside the login what one CPU runs before it, and no unit waits longer of its own. Up to the login, in ms of CPU at one vCPU on spin's path: PID 1 ~49, udevd with its workers, trigger and credentials ~41, the kernel and its threads ~31, the lingering user@1000 ~20 (gone since #327), `ssh.service` with its `sshd -t` ~20, journald ~13, logind ~13, the session ~9-12, dbus-broker ~7, the host-key generation ~5, getty ~3. `StartupCPUWeight=1` on udevd and its coldplug trigger took the lane's first login 285 → 240 ms (Δp50 −45.7 [−49.3, −35.8], 12 boots each) and did nothing on spin's path (308 against 307): there `ssh.service` and the forwarder wait for `basic.target`, which waits for udev, so its CPU is on the login's path whatever its weight. `children_max=2` and journald's `ReadKMsg=no` gained nothing. On spin's path the host keys `spin-machine-sshd-keygen` makes are not loaded (spin's own key comes first), ~5 ms of CPU `ssh.service` waits for: spin could mask the unit at its handoff. Not benched. The lever is the order spin starts the login in (docs/boot-time.md, "Open experiments"). + +**11-21 · lab · restores in a burst (lab 44792429636).** Beside picking 8 channels (above), `restore-together` showed that 8 restores let go at once take ~330-400 ms each to the first login at any channel count, against ~100 alone and ~140 four at once. Not explained (docs/boot-time.md, "Open experiments"). + +**11-21 · image · spin's login path starts from the boot's first dispatch, beside udev at the lowest weight (lab 44805051310, PR #338's edits).** docs/boot-time.md's "Open experiments" row, a bound on spin's path. ssh.service alone without default dependencies had still started right after basic.target: it is after Ubuntu's `sshd-keygen.service`, wanted by it and with default dependencies, whose `ConditionFirstBoot` never holds here: a job waits for its ordering before PID 1 checks its condition. logind and dbus-broker had none, but `PrivateTmp=` orders a unit after `systemd-tmpfiles-setup.service`. `lab` edits `login-early` (ssh.socket, ssh.service, sshd-keygen and the probe's forwarder without default dependencies, shutdown conflicts kept; logind and the broker with `PrivateTmp=no`) and `udev-startup` (udevd and its trigger at `StartupCPUWeight=1`). On the bench, spin's shape and login, v20261120.03, 20 boots each interleaved: `login-early` first login −10.8 [−16.3, −5.2], sshd accepts −33.6, accept to login +23.0, console prompt +18, because with the login early it ran beside udev's coldplug on the one vCPU. Both edits −59.4 [−65.9, −56.2], accepts −56.0, accept to login −4.6, second login +6.1 [+3.7, +7.9], console prompt +51.4 (the serial getty waits for dev-ttyS0, which the coldplug announces). On a laptop, sessions had their `XDG_RUNTIME_DIR`, no unit failed and poweroff stopped QEMU in ~123 ms as the release does. *Side effects:* logind and the bus share the machine's /tmp (read-only to logind under ProtectSystem=strict); the console prompt later; udev's coldplug finishes later. *Status:* the image's half kept (`image/`: the three `10-lane.conf`, `30-privatetmp.conf`, `20-startup.conf`, asserted by build.sh). spin's supervisor forwarder is spin's to order, proposed in docs/boot-time.md's "Open experiments". parts.yml keeps no image artifact, so the image is measured as the release with `--edit lane`, which now carries these drop-ins, and `--edit forwarder-early` orders the probe's forwarder as spin's supervisor would be. A laptop lead, 8 boots each: the image with the forwarder as spin orders its supervisor today (after basic.target) +21.3 [-46.1, +261.0], with it early -56.0 [-116.5, +169.8]: with udev at the lowest weight, basic.target can come later, and the image alone may cost spin until its supervisor moves. The bench decides. + +**11-21 · lab/machine · the restore into a QEMU started ahead, taken apart (laptop leads; the `split` probe, branch `restore-split-lab`, not for main).** 106/112 ms on the bench (lab 44798669409): running at 59, the login ~47 after. `lab` probe `split` runs the prestarted QEMU under its trace with host timestamps and reads the guest's journal and per-task CPU. *To running* (laptop, spin's shape, 8 channels, state evicted, 24 restores): spin-machine's exec and dial 2.1 ms, ~20 QMP round trips to migrate-incoming 6.0 (query-cpu-model-expansion 0.5 of it, each round trip ~0.25), the header 1.5-9 (the first read of a cold file), the RAM load 50.4, the device state 3.4 (~0.4 a virtio device), to running 1.1, the reply 1.5. The state is 181 MiB of data: the guest's ~117 MiB in use, the memmap of 2 GiB plugged, the kernel; settling 10 s before the save took off 3 MiB, so free page reporting has little to give. Read from the page cache the load is ~10 ms instead of 50 (running 29.6 against 78, 6 each), so the load evicted is the disk. `direct-io` (O_DIRECT for the channels) was within the noise evicted and +45 ms cached. *Running to the login* (laptop ~33 ms, guest clock from vmgenid's "crng reseeded due to virtual machine fork"): the accept probe's connection ~5 ms (socat's child, sshd forking an sshd-session that reads EOF), the connection to "Accepted publickey" ~22, the session and `true` ~4. A second login right after reads 25-29, so the restore costs the first login ~5 ms over a warm one here. The probes' logins were never closed (`Key.Run` gave Go a blocking socket, closed only once nothing read it): the checkpoint held the cold login's session, and the restore's vsock transport reset tore it down beside the login timed. Closing it: 37.1 → 34.8 ms after running, dropping the accept probe as well 31.5 (8 each). *On the bench* (spin's shape, v20261120.03, 20 each): `split` (lab 44809015139) read to running 58.7 ms, of it the RAM load 38.8, the QMP round trips 8.3, the dial 2.3, the device state 4.5; the login left open cost the first login ~5 ms (104 → 99.1), the accept probe ~4 more (95.3). `prestart` (lab 44809512339), the read-ahead against the release: restored into a QEMU started ahead 95.0/100 → 82.1/87.4, Δp50 −12.9 [−14.7, −9.8], running −11.9; restored −12.1 [−15.3, −8.9]; the cold boots within the noise. *Changed:* the probes close their logins; `machine.Resume` reads the state's data ahead from its first line. spin resumes through `machine.VM.Resume` (`internal/runner/qemu/checkpoint.go`), so it takes the read-ahead with the pin. *Status:* kept. + +**11-21 · lab · where a burst of restores waits (laptop leads; this change).** Lab 44792429636's samples, read again: the eight-at-once rows read ~210 ms to the first login (running 165-177) in their first three bursts, at 1, 8 and 16 channels alike, and 285-480 in every burst after; the extra is before running (1 channel: running max 168 → 369 p50, the median login 44 ms after it both times; 8 channels 166 → 272, 46 → 67 after), one and four at once at 8 and 16 channels do not move over the run, four at once at 1 channel creeps 165 → ~190, and no restore is slower for its place in the order (each index's mean rank 2.8-4.1 of 0-7). A host whose state changed during the run, which only a burst feels. `restore-together` now records what the host counted during each burst (PSI stall time of CPU, I/O and memory; `/proc/vmstat`'s direct reclaim, compaction stalls and huge-page fallbacks, MiB read; CPU busy; memory free and cached going in) and every restore's `running`, and takes `states=cached` (the disk out of the burst) and `defrag` (the host's THP defrag policy for the burst). *Laptop, i9-13900HK, not nested, 5-6 bursts a row, leads only:* 8 at once from the disk read 590-740 ms against 107-110 alone, the disk the bound (1.4 GiB at ~2.7 GB/s, I/O PSI full ~120-260 ms a burst) with or without huge pages. From the page cache: 440-445 ms under the default `madvise`, with ~3000 compaction stalls that all failed, ~2.4 GiB scanned by direct reclaim and memory PSI full ~250 ms a burst, and 85% of 20 CPUs busy; 133 ms with huge pages off for QEMU (PR_SET_THP_DISABLE, a wrapper, Δ −307 [−437, −156]); 150 under `defrag=defer` with no compaction and memory PSI 3 ms. Alone, huge pages off cost +16.0 [+8.9, +22.6] after running (the guest on 4 KiB pages), and `defer` 74.5 → 80.3 (5 each). QEMU marks guest RAM MADV_HUGEPAGE, so under `madvise` every fault of a load that finds no free 2 MiB block compacts and reclaims before it returns: one restore finds the ~90 blocks it needs, eight need ~700 at once and fight over them, and a host that has run a while (a page cache full of states, the bench after its first ~20 GiB) has none to spare. spin restores workspaces concurrently (spin-stack/spin at 1bd3414: an actor goroutine per workspace in `internal/runner/reconcile`, a per-workspace lock in `workspace.Manager.Resume`, up to 10 commands at once in `handler`), and leaves the host's THP policy as the distribution sets it. *On the bench* (lab 44810128678, v20261120.03, spin's shape, 8 channels, 30 bursts a row, every restore one sample): under `defer` against `madvise`, 1 at once 99.6 → 99.5, Δ −0.1 [−2.0, +1.6]; 8 at once from the disk 283/384 → 239/281, Δ −44.1 [−53.2, −35.2]; from the page cache 1 at once 72.3 → 72.0, 8 at once 268/317 → 193/241, Δ −74.9 [−83.2, −64.9]. *Decided:* THP defrag `defer` is a requirement of spin's host (`/sys/kernel/mm/transparent_hugepage/defrag`; `docs/memory-and-disk.md`): it gains in a burst and costs one restore alone nothing, spin never sets the policy and Ubuntu's default is `madvise`. *Not explained:* 8 at once under `defer` still read ~190-240 against ~100 alone, and from the cache barely less than from the disk. `restore-together` now records where a burst ran on the host's CPUs: each CPU's busy time (/proc/stat) and interrupts by line (/proc/interrupts), the CPUs QEMU's running threads were on, sampled every 5 ms, and the QEMUs', the job's CPU lists and irqbalance. It records them because nothing pins QEMU (spin-machine runs it with `-sandbox resourcecontrol=deny`, spin sets only a cgroup `cpu.weight`) and one CPU taking the disk's interrupts or the threads would look like this. *Where on the host's CPUs* (lab 44817486118, v20261120.04, 20 bursts): not one CPU. In the 8-at-once rows the busiest CPU held 6-7% of the busy time (16 CPUs evenly would be 6%), CPU 0 was busy 212-270 ms a burst against the others' 221-276, the interrupts were spread (the busiest CPU 7%, an NVMe queue on top), irqbalance runs, and the job and every QEMU may run on 0-15; QEMU's threads ran on every CPU about alike. What the burst is instead: the host's CPUs 72-78% busy (CPU PSI some 84-190 ms a burst), so 8 restores of ~1 CPU-burst each on 16 CPUs are near the host's capacity, and direct reclaim of the page cache that the states fill (MemFree ~2 GiB of 32 against 28 GiB cached; pgscan_direct 408k pages under `madvise`, 48k under `defer`, with 743 allocation stalls). Here `defer` read 379/445 → 302/388 at 8 at once and 83.2 → 84.0 alone. *Next:* the host keeping memory free ahead of a burst (kswapd's watermarks, `vm.watermark_scale_factor`), and the CPU a restore costs. + +--- + +**11-21 · CI · a release is measured at its tag and recorded by main (this change).** report.yml checked out the release's tag and ran `releases measure`, which wrote the record and the page with the tag's code, and `releases propose` put them on main (#337). v20261120.04's proposal (#350) failed main's TestTheCommittedPageIsTheRecords: #342 had changed `lab.Chart` after the tag, so the tag's page was not the one main writes from the same records, and it was fixed by hand with main's `releases doc` (75a3b24). Measuring stays at the tag, which boots each release with its own spin-machine and the tag's probes, and `releases measure` now only keeps the ladders. A second checkout of main builds its own spin-machine-dev, `releases record` (now taking every ladder.json) writes the records and the page, and `propose` runs there. Functional: no boot number moves. + +**11-21 · lab · what we carry, and what it earns (this change, lab 44818953987).** The reverse of a kept change: every boot-time modification the tree carries, with the shape and host it was kept on, in docs/boot-time.md's section of that name, grouped for removal one arm a group. Found before the bench: 15 masks and 1 disabled generator name units the image does not have (deleted, #352). The 5 masks of `ConditionNeedsUpdate` units are load-bearing, because the image has no `/etc/.updated`, and unmasked they rebuild hwdb.bin and the linker cache at every boot (first login +260 ms, QEMU's RSS +90 MiB, laptop). *Measured* (prestart, spin's shape, 20 each against v20261120.04, the removal's Δp50 of the cold first login): every kernel patch +67.5 [+62.5, +72.4]; SeaBIOS for qboot +68.5; the 16 other masks +57.5; the generators +16.7; the coldplug filter +14.9, and without it a restore +464 (a guest saved with its coldplug still running, a guess); QEMU 0001 with qboot's PAM patch +11.5 [+6.7, +20.2]; `driver_async_probe` with `rcu_expedited` −1.4 [−4.9, +3.1]; kernel 0006, 0009, 0011 and the in-doubt options +1.2 [−4.5, +8.3]; PID 1's quiet logging +2.4 [−2.3, +7.8]. In one vCPU what runs before the login is on its path, so most of what was kept on two still earns. *Status:* the command-line pair deleted (#352); A1 and the logging measured again at 40 boots, cold; the rest kept, with what it earns in the table. A1 deleted 11-20 (#345), the logging 11-20 (#354). + +**11-21 · machine/image · what earned nothing in spin's shape, deleted (lab 44818953987).** The first decisions of the carry ablation (docs/boot-time.md, "What the machine carries"; #349). `driver_async_probe=` for rng, balloon and vsock (11-13, 2 vCPUs, inside the noise at the floor) and `rcupdate.rcu_expedited=1` (09-07, never measured) leave the command line: taken out together, on the bench in spin's shape, 20 boots each against v20261120.04, the first login read −1.4 [−4.9, +3.1] ms cold, +1.4 restored and +1.7 into a QEMU started ahead. With one vCPU an asynchronous probe has no second CPU to run beside. The command line is not in `Spec.Contract`, so the fingerprint does not move. And 16 masks in optimize-systemd.sh named units no package installs (timesyncd, pcrmachine, both tpm2-setups and the tpm2 generator of a systemd built without TPM2, boot-system-token, avahi, cups, bluetooth, smartd, both e2scrubs, both multipathds, lvm2-monitor, run-lock.mount): deleted without a run, and image/build.sh now fails a mask that shadows nothing. *Status:* in place. + +**11-21 · kernel · 0006, 0009 and 0011 deleted (labs 44818953987, 44822157367, #345).** The kernel's half of the carry ablation that read nothing in spin's shape (docs/boot-time.md, "What the machine carries"): 0006 parses vmlinux BTF on another CPU and 0009 polls for a booting AP, and spin boots one vCPU. 0011 had never shown a time, even nested. Taken out together, against v20261120.04, the cold first login read +1.2 [−4.5, +8.3] ms at 20 boots and −2.5 [−8.4, +1.8] at 40 (sshd accepts −1.9, the console +4.2, both within noise). The arm was meant to carry `DEFERRED_STRUCT_PAGE_INIT=n` and the loop and 8250 counts back as well, and did not: the branch's commit staged the patches' removal and not the config, so the parts run (44812044088) built the three patches' removal alone and those options were measured only inside the whole stack's arm, which is kept. *Status:* the three patches deleted; the options open. `DEFERRED_STRUCT_PAGE_INIT` deleted 11-21 (#356); the loop and 8250 counts kept, #357 closed. + +**11-21 · image · PID 1's quiet logging and the printk sysctl deleted (labs 44818953987, 44822157367, #354).** optimize-systemd.sh set the manager's `LogLevel=err`, `LogTarget=journal`, `ShowStatus=no` and `StatusUnitFormat=name`, and wrote `kernel.printk = 3 3 3 3`, for a quiet, fast boot, never measured. Taken back together (`lab` edit `carry-logging`) against v20261120.04 in spin's shape, the cold first login read +2.4 [−2.3, +7.8] ms at 20 boots and −1.8 [−7.7, +3.2] at 40; accept to login +1.7 [+0.2, +3.2], the second login +1.8 within noise. The console is quiet through the command line's `quiet loglevel=3` either way. The timeouts in fast-boot.conf stay. The `carry-*` edits stay too, as the tool to run the ablation again (docs/boot-time.md). *Status:* deleted. + +**11-21 · kernel · `DEFERRED_STRUCT_PAGE_INIT` deleted, the loop and 8250 counts kept (lab 44839538785, #356, #357).** The three options #345's arm meant to measure and did not, one arm each against main's kernel (d255113), prestart in spin's shape, 40 boots a side, v20261120.04's QEMU and image. `DEFERRED_STRUCT_PAGE_INIT` off, upstream's default: cold first login −2.5 [−9.3, +3.8] ms, restored +1.1 [−6.4, +7.9], into a QEMU started ahead −4.0 [−13.0, +13.3]. It was kept on 11-13 for a memmap of 5.2 ms at 2 GiB at boot (lab 43495583323). spin boots 128 MiB, which the kernel does not defer, and plugs the rest through virtio-mem, which it never defers. A boot option does not run in a restored guest, so the restored row's upper bound over +5 says the run's noise, not the option. Upstream's 8 loop devices and 4 runtime ports: cold +5.3 [−3.2, +15.0], restored +1.7 [−6.7, +12.7]: within noise, but the cold bound does not rule out the 2-4 ms the initcalls and udev's coldplug of 8 more block devices would cost, so the counts stay. *Status:* the deferred page init deleted; the counts kept. + +**11-21 · docs · the cold budget in spin's shape, and docs/boot-time.md (lab 44841266997, this change).** `ssh-first` on v20261120.04 as published, spin's shape and login, 20 boots: sshd accepts 396/406, first login 465/479, accept to login 68.4, a second login 35.9. With the release's report (QEMU's exec to a guest ready ~28 by difference, "Freeing" 79.9) and `firmware-stages` (33.6 to the kernel's clock), PID 1 to sshd accepting is ~255 ms, more than half the cold boot. The budget measured before was in the ladder's shape and showed ~75-85. A QEMU started ahead removes the first ~28 ms only: firmware and the kernel run after `cont`. docs/lab.md is renamed docs/boot-time.md and reordered for the next investigation: the numbers, both budgets in spin's shape, the method with the deletion rule, one ledger of what the machine carries, the rejected ideas by part with the shape each was measured in, the open experiments with their budget entries, and the questions no run answers. *Status:* in place. + +**11-21 · machine/kernel/qemu · the PVH boot path deleted (this change).** Since v20261119.02 the machine boots a bzImage through qboot and fw_cfg, and PVH stayed only as a fallback: `machine.OpenRelease` booted a release's vmlinux through `pvh.bin` when it had no bzImage, `--kernel` took a vmlinux, and machine's QEMU tests loaded an ELF stub through `pvh.bin`. Nothing called any of it. `OpenRelease` now requires `kernel/bzImage` and `linuxboot_dma.bin` and names the missing file. `--kernel` refuses a file without the bzImage's `HdrS` header. `pvh.bin` no longer ships, and machine.env loses `pvh_sha256`. The machine's QEMU tests load a bzImage stub instead. The kernel config changes: `CONFIG_PVH` is off, so the kernel and its checksum change, and the vmlinux still ships for what reads its symbols. *What it costs:* `lab compat` stops at the first release without a bzImage, which is v20261119.01 and every release before it, so v20261119.02 is the oldest it checks. spin's Taskfile.yml:250 checks for `_output/qemu/pvh.bin` and must drop that line. The fingerprint does not move: it hashes neither the kernel nor the option ROM. *Status:* in place. + +**11-21 · lab · the probes boot spin's 16 controller targets (lab 44847364468, this change).** spin's c0ffbc0 (2026-11-20) gave the hotplug controller 16 targets, 4 for disks attached at run time and the rest for the extensions a workspace boots with, where the probes booted 4. `ssh-first` on v20261120.04, 20 boots each, interleaved: first login −3.8 [−11.1, +4.5], sshd accepting −2.3 [−6.3, +2.4], within noise. *Why:* the probes measure spin's shape. *Result:* `hotplug-disks` defaults to 16, and the budget's rows taken with 4 stand. *Status:* in place. + +**11-21 · docs · every doc checked against the tree and spin's main (this change).** A pass over every document for claims the code no longer bears out: names, defaults, files, spin's policy (read at spin's d4f62bd), and *Status* lines. Numbers that only a run can settle are listed in docs/boot-time.md's open experiments, not changed. Two were measured: TCG reaches the first login in 7604 ms against KVM's 455, ~17 times, where the docs said fifty (`ssh-first`, lab 44848049631, 5 boots each). QEMU's mapped files are 6.6 MiB resident on v20261120.04 against the ~42 MB of 11-14, because the bzImage is read into QEMU's memory where the vmlinux was mapped (`ssh-first`'s new `qemu_rss_anon`, `qemu_rss_file` and `qemu_rss_shmem`, lab 44847770977). *Status:* in place. + +**11-21 · machine/lab · a named CPU model costs the cold login 27 ms on the bench (lab 44855890737).** For memories that resume on any host of a pool, `ssh-first` compared `host` with `lab tree --cpu baseline`, which is `machine.Models` plus `machine.Baseline` on the runner. The nested c8id's newest runnable model is Cascadelake-Server-v5: Nitro's L1 does not expose enough for SapphireRapids or GraniteRapids. Against `host`: first login +27.2 [+13.0, +30.8], sshd accepting +23.1 [+9.7, +28.5], warm login −0.4 within noise, QEMU's RSS unmoved. *Why:* spin runs `-cpu host`, so a memory resumes only on a host showing every saved feature (spin-stack/spin#1417). *Result:* a fleet-wide named model is rejected for now. `Baseline` stays public for spin. *Status:* open. Next is `host` minus the features a pool's hosts do not share, measured the same way. + +**11-21 · machine · a record read from QEMU replaces the fingerprint (this change).** The fingerprint was a sha256 over a prediction of the machine (`Spec.Contract`, the shape, the BIOS file's size), passed to QEMU as `-name` and read back. A refusal could not say what differed. spin overwrote its probe's fingerprint with one computed from a Spec of placeholders. And the release's `fingerprint_sha256` hashed the CLI's default machine, not spin's, so v20261120.03's notes said checkpoints still resume when spin's shape had moved (`max_target`). *Measured* (laptop KVM, QEMU 11.2.0-rc0, v20261120.04, mapped-ram, the fingerprint taken out so that QEMU decides): QEMU refuses by itself fewer or more boot vCPUs, another vCPU ceiling, another virtio-mem size, a missing device, a smaller RAM or BIOS block and another machine type. It loads silently an extra device (a vsock the guest never finds), a larger BIOS block and more base RAM, because mapped-ram's `parse_ramblock` refuses only a smaller block, and a larger `max_target`, whose extra targets the guest used. A QMP dump of spin's shape: between a machine held and the same machine after a boot, a memory plug, the balloon polled, a vCPU and a disk added, only the balloon's statistics, virtio-mem's sizes, ICH9-LPC's `pm_io_base` and `gpe0_blk` and the RTC's date moved; between two machines, the MAC, the vsock's context id and vmgenid's GUID. *Result:* `QEMU.Target` reads the machine from the running QEMU (every device it was started with and every property but those, its options, its RAM blocks, the features its vCPU has on), and `CanResume` compares two records and returns a `*Refusal` naming every difference. `max_target` may grow; the CPU's features compare as one set, so a richer host is refused too. At spin's shape the record is 25.6 KB of JSON and 126 features, read in 8 round trips, 8.4 ms (boot:record). boot:record holds a machine to its own checkpoint and the silent cases to a refusal by name. boot:compat checkpoints the release before with this tree's `spin-machine save` and compares records; its local run on v20261120.04 resumed. *What it costs:* read inside `Resume`, the destination's record put its 8 round trips on the second goal number: restore-first's first login +4.3 ms [+0.2, +7.5] evicted and +8.2 [+6.2, +10.8] cached against v20261120.04 (bench, lab 44868324811). None of it could leave the clock: QEMU answers no monitor while it loads a state, and a read on a second monitor from QEMU's greeting stayed on it (laptop, +29 ms against +16 read in `Resume`), because QEMU's main loop is busy from its exec to the end of the load. The source's record is read while QEMU writes the state, where QEMU does answer, which brought `spin-machine save` from +7.0 and +10.6 ms (lab 44866054104) to within the noise (lab 44868324811). *Decided* (the maintainer, option C): the destination's record is a constant of a host, its QEMU binary, its CPU and the shape it resumes into, so `Resume` takes it from the caller (`here`), runs `CanResume` before it sends QEMU anything, and never asks QEMU. spin computes it once at runner start and holds each pool machine to it once (spin-stack/spin#1416). `spin-machine restore --target FILE` takes one as given, `spin-machine target` prints one, and the restore probes read each tree's record once before measuring, from a machine held for a checkpoint in the probe's shape. With it, against v20261120.04, whose restore reads its fingerprint record (name, version and CPU, five round trips) inside the restore (bench, spin's shape, 20 each): restore-first's first login +1.0 ms [-2.3, +4.1] evicted and -3.0 [-6.2, +0.0] cached, running +0.1 [-1.7, +1.3] and -1.4 [-2.9, -0.7] (lab 44871809382); prestart within the noise in every row, its restored login -2.5 [-4.3, +0.3] and restored into a QEMU started ahead -1.6 [-3.1, +2.1] (lab 44872699993). A checkpoint or a stored identity from before is refused, as a `vmm` difference, and boots from disk once. A newer QEMU that adds a property to a device is a refusal, which boot:compat reports at the bump. `Spec.CPUWithout` and `Unshared` are there for spin#1417's pools, not yet measured. *Status:* in place; spin follows (spin-stack/spin#1416). + +**11-21 · machine/qmp · the machine sends QMP through the public client, each command defined once (this change).** `machine.QEMU` runs on `*qmp.Client`, and machine/qmp.go, the third QMP client after spin's two, is deleted. Every command the machine sends is a `qmpdef.Define`d value beside the code that sends it, and the block and descriptor commands spin's storage agent also sends are public in qmp/block.go. `spin-machine-dev verify qemu` holds all of them to the binary's query-qmp-schema, which refused the record's `query-kvm`: QEMU 11.2.0-rc0 deprecates it. The accelerator is read from `query-accelerators`, whose `enabled` is the accelerator's name, `kvm` or `tcg` for every machine `Spec.Args` starts, so the record's part stays `{"accel", "kvm"}` or `{"accel", "tcg"}`. The version comes from the monitor's greeting, which is query-version's answer, so a record is 7 round trips. *Measured* (laptop, v20261120.04 with QEMU 11.2.0-rc0, spin's shape, `spin-machine` built before and after): the record of a running machine and of one held for a checkpoint are byte-identical under KVM and under TCG, a checkpoint saved by the old `spin-machine` restores with the new one (`restore --target`), and boot:record passes. A round trip costs more through the client: query-memory-size-summary's p50 went from 216 to 263 µs, +47 [+44, +49], and in a second run from 136 to 159, +23 [+21, +27] (laptop under load, one held machine of spin's shape, the old and new client in turn, 6000 and 4500 each). What it pays for is the reader waking the waiting call on another thread: the same client under GOMAXPROCS=1 read 106 µs, below the old client. The record's read moved −0.4 ms [−2.6, +1.7] with one round trip fewer. A restore sends ~20 commands before QEMU loads its state, so 0.5-1 ms more on restore-first is expected (inferred, under the bench's noise at 20 boots). The query-migrate polls stay; events replace them in a change of their own, interleaved against the release on the bench, which decides both. *Status:* in place; no checkpoint is stranded. + +**11-21 · machine · a checkpoint's waits are its MIGRATION events (this change, labs 44898418357, 44898581478, 44898910862).** Checkpoint, Resume and Loaded asked `query-migrate` every millisecond until the migration reached the state they waited for. They now turn on the `events` capability with the others they set, arm a `qmp.Expect` for `MIGRATION` before the command that moves the migration, and wait on it. `query-migrate` is asked only after a save that failed, for its reason. *What QEMU 11.2.0-rc0 sends* (`TestACheckpointIsWaitedOnByItsEvents`, in `boot:record`, laptop and bench): a save sends setup, active, `STOP`, pre-switchover, device, completed. A full load sends setup, active, `RESUME`, completed, so the guest runs before the event. A fast load sends setup, active, postcopy-device, postcopy-active, `RESUME`, completed (bench only, where the runner turns userfaultfd on), so `Resume` returns before the guest runs, as it did when it polled. Half a state sends setup, active, failed, and QEMU exits (migrate-incoming's exit-on-error) with the reason on its stderr. A `query-migrate` after that event found the connection reset, so a failed load asks nothing and says where the reason is. *Measured* on the bench, spin's shape and login, 20 each interleaved, v20261120.04 with its own spin-machine against the same tree with this branch's (which also carries the record, the module rename and the public QMP client): restore-first's first login −0.4 [−2.9, +0.8] evicted and −1.4 [−3.2, +0.8] cached, running −0.3 [−1.8, +0.7] and −0.7 [−1.7, +0.3], all within noise (lab 44898581478). ssh-first's first login +0.9 [−5.4, +5.3], sshd accepts −0.2 [−5.1, +5.2], within noise; the console prompt read +6.1 [+0.3, +9.0], a diagnostic on a path this change does not touch (a cold boot waits on no migration), left for the next release's record to confirm or not (lab 44898910862). The 23-47 µs a round trip costs more through the client (the entry above) does not show at 20 boots. *Status:* in place; nothing a checkpoint records changes. + +**11-21 · machine · the verbs spin's runner drives a QEMU by (this change).** `machine.QEMU` gains `CPUs`, `Status`, `Hold`, `Shutdown`, `Done`, `End` and `GuestMemory`. `Memory` returns `MemorySize{Now, Base, Ceiling, Block}`, and `Checkpoint` returns the save's `Cost{Paused, Total, RAM}` from one `query-migrate` after it completes. `VM` gains `CPUs` and the two new returns. The balloon gets an id, `balloon0`, so that `GuestMemory` reads it at a fixed path. It turns the guest's reports on at its first call, so no timer runs in a boot that never asks. *The record:* a held machine of spin's shape read the same 34170 bytes of record with and without the id (laptop, v20261120.04, `spin-machine target` from each build), because the record leaves every id out and names the balloon by its slot. *Shutdown, decided by observation:* spin's runner pressed ctrl-alt-del and pressed the power button only if QEMU refused the keys. QEMU takes them, and the guest never sees them: its kernel has no i8042 or AT keyboard driver. Booted to systemd, a machine sent the keys ran until it was killed (SHUTDOWN host-signal), and one whose power button was pressed powered off 0.64 s later (SHUTDOWN guest-shutdown). So `Shutdown` presses the button alone. *What `End` says* (`TestTheMachineSaysHowItEnded`, in `boot:record`): `poweroff -f` ends as {guest, guest-shutdown}, `Shutdown` under systemd as {guest, guest-shutdown}, and a panic as {guest, guest-reset}, since `panic=1` reboots and `-no-reboot` ends the reboot. No panic device exists, so `GUEST_PANICKED` is never sent. A checkpoint of a 128 MiB guest at the `/bin/sh` prompt cost a 5 ms pause, 56 ms in all and 86 MiB of RAM written. No goal path changes timing: `Boot` and `Resume` send what they sent, and the cost's round trip is on the save, before either clock. *Status:* in place; no checkpoint is refused. + +**11-21 · lab · what QMP and vsock cost the goal's paths: the `transport` probe (lab 44912471522, this change).** The question was how to make QMP faster, posed as if QMP ran over vsock, with vsock RTT tuning, CPU pinning, `halt_poll_ns`, SEQPACKET, ivshmem, virtio-serial and gRPC framing as candidates. QMP is a Unix socket between the host and QEMU. vsock is between the host and the guest, and carries spin's SSH login. So two questions: how much of each goal number is QMP, and how much is the login's vsock. `transport` boots and restores spin's shape with QEMU traced (`qmp_enter_*`, the monitor's queue and answers, the run state, host time). After the cold login it times query-status, a one-byte echo over vsock and through a forwarder hop, and a warm login's round trips. *Measured* (bench, spin's shape and login, v20261121.01, 20 boots, 0 lost): the cold boot waits on 14 commands, 6.2/6.6 ms from QEMU's main loop being free to `cont` answered, 1.3% of the traced first login's 470. Of that, 4.5 ms is QEMU waiting for spin-machine's next command, and the commands' own run is ~1.2. A restore waits on 17 commands before `migrate-incoming`, 6.7/7.6 ms (5.2 of it waiting on the client), and 2.7 ms from the guest running to the restore's last answer, of a 114 ms first login. spin-machine's start and dial are off both paths: its first command waits 17.1 ms (cold) and 19.5 (restored) for QEMU to finish making the machine. query-status takes 131/142 µs from a Go client and 18 µs inside QEMU. A vsock round trip is 47.8 µs, 57.5 through a forwarder like spin's, and a login is 10 of them: 0.6 ms of a 32.8 ms warm login. *Why not double:* each QMP round trip on the path is ~0.25-0.9 ms where the command runs in ~0.02-0.35. The rest is the client's turn in a process that has just started, on a nested host. *Decided:* no change. If QMP cost nothing, the cold number would gain at most 6.2 ms and the restore at most ~9.4. Pipelining the bind gains at most 4.5 cold and 5.2 restored, and the read-ahead overlaps the restore's half. Dropping the round trips that can go gains ~1.3 cold and ~1.9 restored. Every vsock idea is bounded by 0.6 ms a login. All of these are under the noise at 20 boots (±7-9 ms cold, ±13 restored), so none was built (docs/boot-time.md, "QMP and vsock"). The laptop agreed (i9-13900HK, under load): 14 and 17 commands, vsock 13-16 µs, 10 turns a login. *Status:* the probe is kept so the split can be taken again. + +**11-21 · machine · the package starts and ends the QEMU it defines (labs 44912292706, 44912896763, 44914490616, 44914952228, this change).** Every caller assembled one QEMU's life itself: exec it, wait for the monitor's socket, dial, `qmp.New`, `Attach`, keep its output, kill and reap. In this tree there were ~7 such wrappers and ~8 dial loops, with poll intervals of 1, 5 and 20 ms, socket waits from 5 s to unbounded and handshake timeouts from 5 s to 2 min, and spin's runner had its own. `machine.Start(ctx, Spec, StartOptions)` now returns a `*machine.Process`: the `*machine.QEMU` its own monitor drives, with the process under it. Start opens and hands QEMU every descriptor the Spec implies (each monitor's socket, bound by Start, `/dev/kvm`, `/dev/vhost-vsock`, `/dev/vhost-net` per NIC, a `file:` console), so QEMU opens no path. The caller keeps its TAPs and disks, and shapes the process (uid, chroot, namespaces, cgroup) through `StartOptions.Cmd`, which runs after the opens. Readiness is Start's own monitor, bound and connected before QEMU exists and answered by QEMU's main loop once the machine is made. Nothing is polled. `Exit` holds the wait status, the last `SHUTDOWN`, the console's panic line when Start reads the console, and stderr's last 4 KiB. `Stop` presses the power button of a running guest, then quits, then sends SIGKILL, each step bounded. A monitor silent for 1 s (a QEMU loading a state) is killed. `machine.Dial` replaces the dial loops for a second monitor. `spin-machine boot` starts QEMU through Start and waits beside it, with Pdeathsig, instead of exec'ing it with a `_bind` helper. *Observed on real QEMU* (laptop, KVM and TCG, v20261121.01's QEMU): a held machine stopped is quit, `exit status 0` with SHUTDOWN host-qmp-quit. Killed, it reads `signal: killed` with no SHUTDOWN. A refused device fails the start at once with QEMU's line (`Property 'virtio-balloon-pci.no-such-property' not found`). `poweroff -f`, `Shutdown` under systemd and a panic end as guest-shutdown, guest-shutdown and guest-reset, exit status 0 (boot:record). *Measured* on the bench, spin's shape and login, v20261121.01 with its own spin-machine against the same tree with this branch's: ssh-first's first login +0.5 [−5.2, +8.3] at 20 boots (lab 44912292706) and −2.9 [−7.0, +5.0] at 40 (lab 44914952228), sshd accepting −3.5 [−6.8, +3.1], within noise. restore-first at 20 read the cached login +3.6 [+1.5, +4.5] (lab 44912896763), and at 40 +0.4 [−1.7, +3.1] evicted and +0.7 [−2.1, +3.1] cached, running +2.2 [−0.1, +5.2] and +0.4 [−1.1, +2.9], within noise (lab 44914490616). The cached cold login inside that run read +4.9 [+1.8, +9.5], where ssh-first's 40 cold logins read −2.9, so it is read as the probe's noise and left for the next release to confirm or not. *Why no gain:* the dial polls were never on the clock. A client polling the socket found it long before QEMU could answer, because QEMU makes the socket early in its start and answers only once the machine is made (the `transport` entry above: spin-machine's first command waits 17 ms on QEMU). *Status:* in place. spin follows, in place of its runner's own start, handover and shutdown. + +**11-21 · machine · the package opens a disk's chain, and the base only to read (this change).** A `machine.Disk` took open files, and each caller read the chain itself: `cmd/spin-machine/chain.go` from the qcow2 headers, the boot tests by hand, and spin's runner through `qemu-img info --backing-chain` under Landlock, refusing an image outside the disk's own. `machine.OpenDisk(DiskPath)` now opens the top read-write unless the disk is read-only and every image below it read-only. It reads the chain from the headers and refuses a backing file that is not a regular file under the caller's `Under` (files or directories), symbolic links resolved. A writable top that is one of `Under`'s images, the shared base, is refused (rule 1). Each backing file is opened `O_PATH`, checked through its descriptor and reopened through it, so no rename falls between the check and what QEMU is handed. A FIFO is never opened to find out what it is. A chain that comes back on itself, a missing backing format, an encrypted image, an external data file, a backing name over QEMU's 1023 bytes and a header that claims more than its first cluster are refused, each naming the file. `Image.Size` carries the size the guest sees, which spin bounds QEMU's writes by. `spin-machine --disk` takes the release's base as `Under` unless `--disk-under` names others, and `lab compat` names the previous release's. *Header parser vs qemu-img, measured* (laptop under load, one chain of overlay, overlay and the release's base): `qemu-img info -U --backing-chain` 3.4 ms p50 over 50 runs, `OpenDisk` 0.045-0.050 ms, the reader it replaces 0.015 ms. *Landlock:* not needed in process. It confined qemu-img's C parser to the images it was given. This reader executes nothing, opens nothing before checking it, and bounds every read by the first cluster (at most 2 MiB). *Goal numbers:* not run on the bench. The 0.03 ms the checks add to a boot's or a restore's disk open is under the ±7-9 ms a 20-boot interval resolves. boot:record passes on a tree of v20261121.01 with this spin-machine, its root disk now opened by `OpenDisk`. *Status:* in place. spin adopts it in place of `backingChain`, passing its disk's images other than the top as `Under`. + +**11-21 · machine · a host's record in one call, and where a checkpoint's state is synced (this change).** spin's runner started a held machine only to read `QEMU.Target` and kept the answer (spin-stack/spin#1416). spin also synced the state file every 100 ms while QEMU wrote it, synced it again inside the seal, and bounded a resume by the state's written blocks. *Built:* `machine.ReadTarget(ctx, Spec, StartOptions)` starts a machine of the Spec held, reads its `Target` and stops it. The caller's monitors are dropped. Each NIC is put on a hub port, so no TAP and no `/dev/vhost-net` is needed. The console writes to nothing, but the serial port is kept. *Measured* (laptop, v20261121.01, spin's shape, 2026-11-21): a machine whose NIC was on a real TAP with vhost read a record byte-identical to `ReadTarget`'s, and 25 589 bytes. One call took 72-76 ms p50 over 20 (QEMU's start 28, the record 11, its quit 37). It runs at a runner's start, off both goal clocks. boot:record now holds a machine's own checkpoint to `ReadTarget`'s record of its shape held for a checkpoint. Its first run failed with `device isa-serial: checkpoint isa-serial, here none`, because the test's Spec had no console. The record names the serial port, so the caller's Spec has to carry the console its machines have. The lab still reads a tree's record through that tree's `spin-machine target`, because the lab can drive a binary that predates `ReadTarget`. `restore` and the probes that resume into a machine they just started still ask that machine, which is the right call when there is no host constant. *Checkpoint sync, decided by measurement* (laptop ext4 NVMe, 99% full and shared; spin's shape plugged to 2 GiB, 1.5 GiB touched, 1.6 GiB written per save, mapped-ram with 8 channels; a seal that creates and syncs a file; 16 interleaved saves an arm, medians over the saves that did not stall on the disk): with the sync inside the seal, the pause's sync was 275 ms and the guest stopped 683 ms from seal to `cont`. Every 100 ms and then inside the seal gave 167 ms and 566. After `cont` gave 0 and 506. Over every save, the sync after `cont` beat the periodic arm in the pause by 183 ms [−1676, −160] and in QEMU's total by 232 [−2027, −124]. The guest's whole pause does not resolve over every save, because the stalls were seconds long and hit every arm. The sync after `cont` took 2-3 ms. QEMU syncs nothing itself (strace). The seal's file took 2-7 ms with ~830 MiB dirty, so spin's reason for the periodic sync did not reproduce on ext4. *Decided:* `Checkpoint` syncs nothing, and the caller fdatasyncs after `Continue`. The resume bound stays with the caller, because it rests on the host's slowest disk. `Resume` is unchanged, so restore-first was not re-run. Both decisions are written down in docs/memory-and-disk.md. `Cost.Paused`, QEMU's downtime, reads 200-250 ms under the caller's clock from the seal to `cont`. That gap is not yet traced. *Status:* in place. spin replaces `qemu.Target` with `ReadTarget` and moves its `fdatasync` after `Continue`/`Hold`. + +**11-21 · machine/image · the pressure probe (labs 44921602512, 44921841077, 44923048262, 44924252325, 44924755505, 44926664003, 44926917170, this change).** A runner hosts ~20 workspaces. The platform has to say which of them is short of CPU, memory or IO, which one causes it, and when QMP is slow, so that an agent can later act on one machine at a time. The machine now owns both ends of a probe. In every guest, `spin-machine-pressure.timer` starts a static sender 10 s after the boot. It runs at Nice 19, on the idle scheduler and IO class, as root, out of the OOM killer's way. It arms PSI triggers (150 ms in 1 s) on the guest's CPU, memory and IO, watches its OOM kills, and writes a line to host vsock port 1032 each time one fires. On the host, `machine.ListenPressure` routes each connection by the CID the kernel names. `StartOptions.Pressure` adds the same triggers on QEMU's cgroup, and times every QMP command against what that command took before. `Process.Usage` reads the counters that say who causes a stall: the cgroup, `query-blockstats`, and the balloon's OOM kills and allocation stalls. A prototype settled the shape first. Guest PSI is blind to the host taking a vCPU, and a fast OOM killed before any trigger fired. Host cgroup PSI tells the two apart, but a trigger with a window under 2 s is root's alone. No QMP event carries pressure, and a QEMU loading a state answers no command, so the timing follows the migration's events. *Observed on real QEMU* (task boot:pressure, laptop, v20261121.01, one vCPU, 1 GiB, QEMU pinned to one core, several runs). Three loops brought guest CPU stalls each second and no host ones. One loop with two host hogs on its core brought host CPU stalls each second, and `query-blockstats` took 536 ms against a 14 ms baseline, a `SlowCommand`. Two readers of the disk, 4 KiB at a time, brought guest IO stalls; 1 MiB reads from one reader stalled the guest only now and then. A working set reread through what a 700 MiB tmpfs left brought guest memory stalls. A stream read once did not, because clean cache is reclaimed without a stall. A 3000 MiB allocation brought `OOMKill{1}`. The lane found two bugs. The sender spun at ~0.8 s of the guest's CPU a second, because a kernfs file polls as changed until it is read again. And the OOM killer took the sender in the very OOM it was there to report. *Measured* on the bench, spin's shape and login, v20261121.01 against the same release with the sender put into its overlays (`--edit pressure`), interleaved. Ordered after multi-user.target, the sender started beside the first login. The first login read +0.5 [−2.6, +6.7] at 20 boots (lab 44921602512) and +2.5 [−2.1, +7.6] at 40 (lab 44924252325). With `Type=idle` it read +6.1 [+2.3, +10.0] (lab 44924755505), because the boot's jobs are done just before the login arrives. sshd accepting to the login read +2.6, +3.3 and +2.9 in those three runs, each excluding 0. Started by the timer, the first login read −0.5 [−3.6, +2.9] and accept-to-login −0.5 [−1.8, +0.9] (lab 44926664003, 40 boots). The restored login read +0.2 [−3.0, +2.7] evicted and +1.4 [−3.8, +4.7] cached at 20 (lab 44921841077), and +0.3 [−2.5, +3.2] and +1.1 [−3.6, +4.7] at 40 (lab 44923048262), with the sender running in the checkpoint. With the timer it read +1.8 [−2.0, +5.2] evicted and +0.9 [−2.5, +3.4] cached at 40 boots, the sender not yet started when the state was saved (lab 44926917170). *Status:* in place. A guest's first 10 s go unreported. spin follows with one listener and a watch per Start. Its guest supervisor's `POST /v2/memory-pressure` on port 1027 is then deleted in favour of `Stall{Guest, MemoryPressure}`. The actuators are #395 and #396, and the open questions #391-#394. + +**11-21 · lab · would a higher host priority for QEMU cut either goal number: the `run-delay` probe (labs 44925573288, 44927312303, this change).** A weight, a nice value or a real-time class changes only who runs when two threads want one CPU. So the most any of them can win is the time QEMU's threads spend runnable and not running, and that was measured before anything was built. `run-delay` samples every QEMU thread's `/proc/PID/task/TID/schedstat` every 5 ms, from before the exec to the first login, cold and restored (evicted). It keeps an exited thread's last sample and splits the wait at the guest's first run, from QEMU's trace. Its rows are crowds of workspaces already running, as `density` boots them. *The instrument sees what it claims:* the guest's steal time, which KVM takes from the vCPU thread's run_delay, read 330-340 ms cold on the busy host against the vCPU thread's 304-331. *Idle host* (bench, spin's shape and login, v20261121.01, 20 boots, 0 lost; lab 44925573288): QEMU's threads wait 0.2/1.1 ms in all to the cold first login (467/479) and 0.1/0.2 to the restored one (115). That is the ceiling of any priority change on the host the goal is measured on, and it is under the noise by ~40×. *Busy host,* 16 workspaces each keeping its vCPU busy on the bench's 16 CPUs: the cold first login reads 1184/1490 and the restored 306/321. QEMU's threads wait 824 ms cold, summed over threads that wait at the same time (331 of it the vCPU's, 248 the main thread's, the rest vhost and io_uring workers), and 282 restored, 224 of it before the guest runs. The host's own steal read 0 in every row, so the bench's hypervisor (L0) took nothing visible at 10 ms ticks. Only the host's (L1's) wait is in reach of a priority, and that is what was measured. *The arm* (lab 44927312303, 20 boots a row, interleaved): the crowd at nice 10 against the crowd at 0. The lab runs unprivileged, and 10 steps either way is the same ratio of weights (110:1024 against 1024:9548), so this is QEMU at −10 as the scheduler sees it. The restored first login fell −79.3 [−93.5, −71.0] (316 → 238) and its wait 290 → 116 ms. The cold first login moved −104.7 [−258.3, +150.9], within noise: the vCPU's wait fell 304 → 119 ms, but the main thread's rose 208 → 289 and the vhost workers' 90 → 122. QEMU's own CPU time grows from 503 ms idle to ~605 busy, which no priority wins back. *Decided:* nothing changes in the machine. On the idle host there is nothing to win. On a busy host, restores gain clearly, and the lever, a workspace's cgroup `cpu.weight`, is spin's runner's (machine.Start's `Cmd` places QEMU in it). That is a proposal for spin ("Open experiments"), to be measured there. The lab put every QEMU in one cgroup, where each thread competes on its own. In spin each workspace is a cgroup whose weight its threads share, which may give less. SCHED_FIFO was not tried, because a weight already shows the gain and a FIFO QEMU could starve the host. *Status:* the probe is kept, so the wait can be read again on a host whose load is spin's. + +**11-21 · machine · a machine held at its cgroup's limits (#403, this change).** spin sets `cpu.max`, `memory.high` or `memory.max`, and `io.max` on a workspace's cgroup, and the limit applied silently. A host CPU Stall could be the host squeezing the machine or spin's own `cpu.max`. *Built:* the host side of the probe reads QEMU's cgroup each second, beside its PSI triggers, and tells the watch a `Limited` each second a limit held: `cpu.max` when `nr_throttled` moved, `memory.high`, `memory.max` and its OOM kill when `memory.events` moved, and a key of `io.max` when a device's rate reached 90% of it. Each carries the limit, its device, the limit's value, what was used, how many times the kernel held the machine, and since when. The last reading is taken at QEMU's exit. `Usage` gains `CPU.Throttles` and `memory.events`' four counters. *Checked first:* cgroup v2 has no counter of what `io.max` throttled. `io.stat` gained no field on Linux 7.0 with `CONFIG_BLK_DEV_THROTTLING=y`, under an `io.max` that held `dd` for 6.4 s. *Observed on real QEMU* (task boot:pressure, laptop, v20261120.04 with this checkout's sender, one vCPU, 1 GiB). Under `cpu.max` of 0.2 CPU, one loop brought a `Limited` each second at 199,500-200,200 µs a second and 10 throttles, and a host CPU Stall each second with it. With `memory.high` 32 MiB above QEMU's memory, rereading a second disk brought 2,200-4,300 `high` events a second, `memory.current` within 0.1% of the limit. Under an `rbps` of 4 MiB/s, QEMU read at 4,188,788-4,189,940 B/s. Its cgroup's `io.pressure` total did not move in those 5 s, because io_uring leaves no QEMU thread waiting, so the rate is the one sign. No phase before the limits brought a `Limited`. *Not measured:* boot and restore. The limits are read in a watch's own goroutine, and neither goal measurement starts a watch. *Status:* in place. + +**11-21 · machine · a checkpoint and a resume tell their phases, and a checkpoint's guest no longer waits on ext4 (labs 44932635041, 44932944601, this change).** A checkpoint reported only at its end, with `Cost`. spin's snapshot showed nothing until then, and the guest stayed stopped 200-250 ms past `Cost.Paused` for no traced reason (#399). *Built* (#407): `SaveOptions.Phases` and `LoadOptions.Phases` take a func told each typed `machine.Phase` of one call. A save is `SaveStarted`, `RAMWritten` (a `query-migrate` every 100 ms while the guest runs), `GuestStopped`, `Sealed{Took}` and `SaveCompleted{Cost}`, then `GuestRunning` from `Continue` or `GuestHeld` from `Hold`. A load is `LoadStarted`, `StateLoaded{Bytes}` and `GuestRunning`, and after a fast load `Loaded` tells `StateLoaded`. The hook is per call and not per machine, because spin's timeline is per snapshot (spin-stack/spin#1481). Without `Phases`, a save and a load send the same commands as before. `spin-machine save` and `restore` print the timeline. *Observed on real QEMU* (boot:record, laptop, v20261121.01, a 128 MiB guest): a save told SaveStarted at 0, GuestStopped and Sealed at 45.4 ms, SaveCompleted at 50.2 and GuestHeld at 51.0. A load told LoadStarted at 0, StateLoaded at 35.3 and GuestRunning at 35.8. *#399 traced* (laptop ext4, spin's shape with 2 GiB plugged and 1.5 GiB of tmpfs filled, 1.6 GiB a save, 8 channels, every command and event timed): the gap fell between `remove-fd`'s answer and the next command. Each command took under a millisecond, and `cont` 2-3 ms. QEMU `ftruncate`s the state it writes, and ext4's `auto_da_alloc` writes a truncated file's dirty pages back on its last close. That last close was Checkpoint's copy of the file, closed before Checkpoint returned. Closed on a goroutine, with 16 saves an arm interleaved on one guest: `completed` to `cont`'s return fell from 238 ms p50 to 6, and the guest's stop to `cont` from 451 to 198, −252 [−4354, −33]. The caller's `fdatasync` after `Continue` rose from 3 ms to 259, so the time to a durable state did not change (−19 [−4088, +3963]). The phases also showed that the last `RAMWritten` before the stop was 0.3-0.9 GiB short of `Cost.RAM`. QEMU writes that RAM after the seal, with the guest stopped (#415). *Measured* (bench, spin's shape and login, v20261121.01's spin-machine against this branch's at cd966d5, which also carries main since the release; 20 each, interleaved): restore-first's login +2.5 [−0.2, +6.1] evicted and −2.3 [−5.0, +1.7] cached, within noise; `running` +2.3 [+1.7, +3.5] evicted and −0.1 [−1.2, +1.3] cached (#416). ssh-first's first login +0.3 [−4.9, +7.1], within noise. `StateLoaded.Bytes`, one `fstat`, came after these runs. *Status:* in place. spin takes `Phases` into its snapshot timeline, and syncs the state after `Continue` as before. + +**11-21 · boot · what a snapshot keeps: `boot:rollback` (#408, lab 44937567816, this change).** Nothing checked that a rollback brings back the same memory and disk, byte for byte. boot:record checked that a counter goes on after a restore, and boot:compat that a release's checkpoint resumes. *Built:* `TestARollbackBringsBackTheSameMemoryAndDisk` (`task boot:rollback`, lab.yml's `check:rollback`). It boots spin's shape plugged to 2 GiB to systemd, logs in as root over SSH through vsock, and runs the maintainer's terminal loop `while true; do date +%T.%N; sleep 0.1; done` detached, beside a Perl process that holds 4 MiB of random bytes and a counter and stamps each line with both of the guest's clocks on the serial console. Then it takes four steps. A checkpoint with memory is sealed as spin's storage seals a disk and continued in place. A rollback with memory goes onto the sealed disk after the guest changed the file and the bytes. A disk-only snapshot is `stop`, `blockdev-snapshot` and `cont`. A cold boot comes from the sealed disk. Left at 128 MiB, the guest's OOM killer took the SSH session, as the lab's Plug says. *Observed* (v20261121.01, 3 runs on the laptop and 1 on the bench, which agreed). The checkpoint stopped the guest 11-17 ms (`Cost.Paused` 11-14), inside one of the loop's sleeps, so the loop's largest step stayed at 101-105 ms. After the rollback the process had the same PID and the same bytes. The file matched from memory and again from the disk. The loop and the counter went on from their lines at the checkpoint, and the kernel reseeded its RNG (vmgenid). The cold boot had the synced file and not the later one. The loop's log, written 3 s and never synced, was not on the disk at all, because the seal is crash-consistent. The disk-only snapshot stopped the guest 7-14 ms. The guest's clocks stop with it. A stop held 1.00 s left the guest's wall clock 1.001 s further behind, and both clocks stepped 101 ms across it. The resumed guest read the checkpoint's time, 6.34 s behind 48 ms after the resume, and nothing in the machine corrected it, by the 09-10 decision. spin steps it at the supervisor's next registration, and after a snapshot continued in place nothing steps it (spin-stack/spin#1498). An SSH session open at the checkpoint did not survive the rollback. The restored sshd read `Transport endpoint is not connected` within 3 ms, its pty shell was gone at the first look, and the guest's kernel logged nothing of vhost-vsock's reset (spin-stack/spin#1483). *Status:* in place. `lab dispatch` takes no `check:TARGET` yet (#419). + +**11-21 · machine · a checkpoint plans a 30 ms pause, not QEMU's 300 (#415, lab 44940051596, this change).** The phases showed a 1.6 GiB checkpoint's guest stopping with 0.3-0.9 GiB still to write, and that remainder was most of `Cost.Paused`. *Explained:* QEMU stops the guest once what is left fits in `downtime-limit` times the rate it measured over the last 100 ms. The machine never set the limit, so it was the default 300 ms. Into the page cache the rate read 30-34 Gbit/s, so the guest stopped with up to ~1.2 GB to go. An idle guest stopped part-way through QEMU's first pass, and what was written after the stop was memory QEMU had not reached yet, not memory the guest had dirtied. Mapped-ram, multifd and pause-before-switchover leave that test as it is (QEMU 11.2's `migration/migration.c`). *Measured* (bench, nested KVM, v20261121.01, spin's shape plugged to 2 GiB, 20 saves an arm interleaved on one guest, branch `exp/415-downtime`): at 30 ms QEMU's downtime fell from 192 ms to 6 for an idle guest with 1.5 GiB of tmpfs filled, −186 [−189, −184], and the save's total did not move, +4 [−2, +6]. With a writer rewriting 64 MiB of a 512 MiB set every ~100 ms it fell from 221 ms to 8, −213 [−218, −208]. The total rose 39 ms [+33, +45] for one more pass and 195 MiB more written while the guest ran. The laptop agreed, at 238 to 12 and 209 to 11. A writer rewriting 256 MiB of a 1 GiB set with no pause converged at 30 ms in all 10 saves (laptop). *Rejected:* 100 ms (60 ms of downtime with the writer, laptop); auto-converge, whose throttle never engaged in any save; `avail-switchover-bandwidth`, not run, since it only stands in for the rate in the same test. *Found on the way:* `cont` right after `Checkpoint` once failed with "Migration is not finalized yet", because QEMU sends `completed` before it moves the run state to `postmigrate`. That is #421. *Status:* in place. A checkpoint is on neither goal clock, and `Resume` reads the same file, so restore-first was not re-run. boot:record resumed a checkpoint saved at 30 ms. + +**11-21 · machine · a checkpoint returns once QEMU has left finish-migrate (#421, this change).** `Continue` right after `Checkpoint` failed once in about 235 checkpoints with `cont: GenericError: Migration is not finalized yet`, and the guest stayed stopped. *Explained* (QEMU 11.2.0-rc0's `migration/migration.c`): the migration thread sets `completed`, sends `MIGRATION{completed}` and lets the BQL go in `migration_completion_end`, and moves the run state from `finish-migrate` to `postmigrate` only once it holds the BQL again, in `migration_iteration_finish`. `qmp_cont` refuses `finish-migrate` (`monitor/qmp-cmds.c`), and `runstate_set` sends no event. `blockdev-set-active` is not refused there, so a `Hold` in the window succeeded and left the machine in `finish-migrate`. *Reproduced* (laptop, real KVM, v20261121.01 with this checkout's spin-machine, spin's shape plugged to 2 GiB, a guest rewriting 600 MiB of tmpfs, Checkpoint then Continue in a loop): 0 refusals in 2000 checkpoints on an idle host. With QEMU and the test pinned to two host CPUs kept busy by two spin loops, 102 of 300 `cont`s were refused, `query-status` reading `finish-migrate` at the refusal, and with `Hold` first, 88 of 300 Holds left the machine in `finish-migrate` and 79 `cont`s were refused. *Built:* `Checkpoint` asks `query-status` after the cost's `query-migrate`, and again every millisecond while it reads `finish-migrate`, bounded by its context. Making `Continue` retry `cont` was rejected: `Hold` and `Status` would still see `finish-migrate`. *Measured:* under the same contention, 0 of 300 refused, and 0 of 300 with `Hold` first. The guest's stop to `GuestRunning`, 8 runs of 60 checkpoints an arm interleaved on the idle laptop, moved from 6.62 ms p50 to 6.82, +0.20 [+0.08, +0.33], one QMP round trip. *Status:* in place. A checkpoint is on neither goal clock. + +**11-21 · boot, lab · a checkpoint's pause is held under 50 ms: `boot:checkpoint-pause` (#423, #419, lab 44944984313, this change).** What re-measured `checkpointDowntime` lived only on `exp/415-downtime`, and `lab dispatch` took no `check:TARGET`, so that run was dispatched with `gh workflow run`. *Built:* `TestACheckpointPausesTheGuestBriefly` (`task boot:checkpoint-pause`, lab.yml's `check:checkpoint-pause`), from the experiment with its arms gone. It uses the two guests that decided 30 ms, saves each 10 times at the machine's own setting, continues and syncs after each, and logs the guest's stop to `GuestRunning`, QEMU's downtime, what was left at the stop and the total. The median of the larger of the stop and QEMU's downtime must stay under 50 ms. That is the 30 ms QEMU plans plus 20 for what it writes past the plan and for `cont`. QEMU's default read 199 and 231 ms. compat.yml runs it on every change to QEMU on main and before every release. `lab dispatch check:TARGET` now sends the check, waits, prints the last 60 lines of the `lab:ci` step from the job's log through the API, and exits 1 unless the run succeeded. *Measured* (bench, nested KVM, c8id.4xlarge, v20261121.01, spin's shape plugged to 2 GiB, 10 saves a guest, dispatched with `lab dispatch check:checkpoint-pause`): idle 13.3 ms p50 from the stop to `cont` returned, the slowest 14.8, QEMU's downtime 6 ms, nothing left at the stop, total 465 ms. Writer 18.9 ms p50, the slowest 25.8, downtime 7 ms, total 531 ms. Both agree with the experiment's 14 and 18 ms. *Found on the way:* on the laptop, with its disk busy and its swap full, the writer's pause reached 0.1-8.7 s in 4 and 6 of two runs' 10 saves, with at most 85 MiB left at the stop. QEMU's downtime was longer than the stop to `GuestRunning` (8.68 s against 5.81 s), so QEMU stopped the guest long before the host heard of it at `pre-switchover`. That is #426, and it is why the bound holds the larger of the two. *Status:* in place. + +**11-21 · machine · a per-disk IO limit, the first actuator (#395, this change).** A runner hosts about 20 workspaces, and spin has to hold back the one that saturates the shared disk, per disk and while it runs, without the guest learning of it. The prototype said every disk place sits behind a throttle node, so a limit would be one `qom-set` on its group. *Checked* in `machine/spec.go`: every place's node is a throttle filter, but all of them are in one group, `places`, and a group shares its limit among its members, so a limit there would hold all of a machine's disks together. A disk attached while the machine runs has no filter at all. A group per place would have changed the command line every machine boots with. *Built:* `QEMU.SetDiskLimit(serial, DiskLimit)` and `QEMU.DiskLimit(serial)`, where `DiskLimit` is bytes and requests a second, read and write, and its zero value is no limit. The command is `block_set_io_throttle`, sent to the backend of the disk's device, whose group is the device's alone and which a bind never replaces. It reaches a place and a hot-plugged disk alike, and is read back from `query-block`. `verify qemu`'s schema check covers both, and refused a misnamed field in each when one was tried. Bursts are left out: QEMU already lets a tenth of a second's worth through at once. The probe reports a held disk as `Limited{DiskReadBytes…}`, its serial in `Device`, from one `query-blockstats` a second, and only while a disk is held through Start's monitor. *Measured* (task boot:disk-limit, laptop KVM, v20261121.01 with this checkout's spin-machine, spin's shape with two disks beside the root, 3 runs): 8 MiB/s held 32 MiB of the guest's direct reads to 3.776-3.777 s, 50 writes a second held 150 direct 4 KiB writes to 2.881 s, and a disk attached at run time read at 8 MiB/s in 3.900-3.901 s. The other disk did the same in 2-6 ms beside each, and the held one read in 2-5 ms once cleared. `SetDiskLimit` took 1.8-5.5 ms. In task boot:pressure a 4 MiB/s limit brought a `Limited` each second with `Used` at 4.19-4.25 MB/s. *Decided:* a checkpoint carries no limit. A resumed machine reads `DiskLimit{}` and runs free until spin sets the limit again, which then holds (same lane). The limit is spin's policy for a neighbour, and a resumed machine may have other neighbours. No bench run: neither goal path sends a command it did not send before. *Status:* in place. That lane's `memlimit` phase fails on this laptop on main as well (#429). + +**11-21 · machine · what a host gives a machine: `Spec.Files`, `Spec.Overhead`, `Disk.Overhead` (this change).** spin hard-coded two facts that depend on the machine and its release. It linked a release's whole firmware directory into each QEMU's root, and it bounded each QEMU's cgroup at the guest's ceiling plus 768 MiB and at its vCPU ceiling plus 256 tasks. *Traced* (strace of a KVM and a TCG boot): QEMU opens by name its binary, the kernel, the initrd, and from the firmware directory the BIOS, `linuxboot_dma.bin` and `kvmvapic.bin`. It also opens `/dev/null` for its OFD lock probe. It reads `/proc`, `/sys`, `/dev/urandom` and `qemu.conf` only when they are there. `efi-virtio.rom` is never opened, since every NIC has `romfile=`. *Built:* `Spec.Files`, `Spec.Overhead() (Overhead{Memory, Tasks}, error)`, which reads the kernel's and the initrd's sizes, and `Disk.Overhead`, each qcow2 image's L2 cache (its whole L2 table up to 32 MiB) and four clusters of refcounts, from `read_cache_sizes`. Tasks are counted up to their most: one thread a vCPU slot, QEMU's four, a vhost worker for each device, a checkpoint's channels and their driver, QEMU's thread pool (64, and a thread it cannot start aborts QEMU) and io_uring's workers (the ring's 128 entries). Memory is 64 MiB of QEMU's own, the kernel and the initrd, 1 MiB a vCPU, 64 KiB a thread, and 1/256 of the ceiling for page tables. *Verified* (task boot:overhead, laptop, real KVM, v20261121.01): spin's shape with a NIC and a vsock started as nobody in a root holding only `Files` and `/dev/null`, in a cgroup of its own, and was taken to its ceiling. That is 16 vCPUs, 8192 MiB filled from `/dev/urandom`, and four disks attached beside its two, one of them a 64 GiB overlay the guest wrote a block of every 512 MiB, while the guest read, wrote and trimmed every disk. It was then checkpointed. Beyond the guest it held 31 MiB and 9 tasks at boot, 73 MiB and 27 tasks at the ceiling, and 79 MiB and 34 tasks (pids.peak) through the checkpoint. Of the 73 MiB, 27 were page tables, 16 the bzImage and 8 the big disk's L2 cache. `Overhead` for it, disks included, is 153 MiB and 223 tasks. *Found on the way:* the cgroup's `anon` is not QEMU's memory beyond the guest. A huge page the guest gave back in part stays charged until the kernel splits it, and it read 160 MiB above `smaps` just after the guest freed 1.4 GiB. The lane counts QEMU's own from `smaps`. In 2 of 5 runs, vCPUs plugged right after a checkpoint's `Continue` never reached the guest (#433). The lane plugs before it checkpoints. The checkpoint at the ceiling also got this laptop's QEMU OOM-killed once, by the host, with its swap full. *Not measured:* a restore and a QEMU that has run for days. spin adopts the root and the bounds through spin-stack/spin issues. *Status:* in place. + +**11-21 · boot · a contended checkpoint loop, how a qemu bump is checked for #421: `boot:finish-migrate` (#425, this change).** #424's wait for QEMU to leave `finish-migrate` was held in the tree only by a fake QEMU, and an idle host does not reach the window, so boot:record passed with the fix and without it. *Built:* `TestACheckpointIsContinuedAtOnceOnABusyHost` (`task boot:finish-migrate`), the scratch loop of #421: spin's shape plugged to 2 GiB with a guest rewriting 600 MiB of tmpfs, 300 checkpoints each continued at once, any refusal a failure. The target runs the test and QEMU under `taskset` on the host's last two CPUs, and the test keeps each of the CPUs it is given busy with a spin loop and refuses to run on more than four. It is not in CI. The qemu entry's note in versions.yaml names it beside boot:record and boot:compat, so a QEMU that reorders `migration_completion_end` and `migration_iteration_finish`, or adds a run state after `completed`, is caught at the bump. *Measured* (laptop, real KVM, v20261121.01 with this checkout's spin-machine): with `finished` made to return at once, 39 of 300 continues were refused, and 0 of 300 with it. QEMU alone pinned to the busy CPUs, the test free, refused 0 of 300 without the fix, which is why the test runs on them too. *Status:* in place. + +**11-21 · qemu, machine · a checkpoint's stop does not wait on the host's disk: `x-defer-disk-flush` (#426, lab 44958247487, 44962720682, this change).** On a busy disk, a checkpoint stopped the guest for 0.1-8.7 s on the laptop, and QEMU's downtime ran past the stop to `GuestRunning`. *Traced* (QEMU `-trace` on `runstate_set`, `vm_stop_flush_all`, `migrate_set_state` and `luring_co_submit`): from `finish-migrate` to `pre-switchover`, the time was `do_vm_stop`'s flush after the drain, one io_uring fsync of the overlay. It took 527 ms in one laptop save. On the bench, beside one host writer on `/tmp`, which is an overlayfs there, and with a guest that synced its own writes, nothing reproduced: Δ +0.9 [−2.6, +5.5] (lab 44957455283). Four writers on the instance store's ext4, with the guest writing its disk with `oflag=direct`, gave the fsync 13-79 ms and the guest's stop 42 ms p50 (lab 44958247487). *Built:* `qemu/patches/0003` adds the migration capability `x-defer-disk-flush`, and `Checkpoint` sets it. After the stop's drain, QEMU's own flushes write to the page cache only, and the guest's next flush forces them. The first version ended the deferral when the switchover ended, and the fsync came back in `cont`, since activating a qcow2 node closes and reopens it. The guest's stop to `GuestRunning` went from 19.6 to 50.3 ms p50 (lab 44958247487). The deferral now lasts until the VM runs (`vm_prepare_start`) or QEMU closes the disks (`bdrv_close_all`). *Measured* (bench, nested KVM, v20261121.01 with QEMU from parts run 44961949665, spin's shape plugged to 2 GiB, the busy-disk guest, 20 pairs interleaved on one guest, branch `exp-defer-ab`): the guest stopped at least 40.0 ms p50 (93.0 slowest) without the capability and 18.0 (28.8) with it, −22.0 [−29.2, −15.8]. QEMU's downtime went from 40 to 7 ms, −33 [−40, −27]. On QEMU's clock, `finish-migrate` to `running` read 8-20 ms against 20-95. `boot:checkpoint-pause` gains the busy-disk guest on the scratch disk, and read idle 13.9, writer 17.3 and busy disk 19.1 ms p50 (lab 44962720691). record and rollback pass on the patched QEMU (lab 44962720561, 44962720776). restore-first, with the spin-machine held at the release's and the QEMU binary as the only change: login −0.1 [−2.3, +2.4] evicted, −3.2 [−4.7, −0.5] cached (lab 44963610565). Main's spin-machine against the release's read +2.2 [+0.5, +4.0] evicted with the release's QEMU (lab 44963610916). That is #438, and it is why the run with both changes read +2.8 (lab 44962720850). *Contract:* a checkpoint's disk is in the page cache when `Checkpoint` returns, as its state is. A caller that keeps the sealed layer syncs it with the state after `Continue` (spin-stack/spin#1514). *Not fixed:* the laptop's other waits, 1.6-1.9 s in the drain with nothing to flush and 0.7-1.6 s for the last RAM, with its swap full (#437). *Status:* in place. + +**11-21 · machine · a QEMU without `x-defer-disk-flush` checkpoints as before (compat 44964906186, this change).** Compat on main 607797b failed for every release from v20261119.02 to v20261121.01 with `migrate-set-capabilities: GenericError: Parameter 'capability' does not accept value 'x-defer-disk-flush'`. #435 set the capability on every checkpoint, and only the QEMU `qemu/patches` builds has it. Compat checkpoints each release's QEMU with this checkout's spin-machine. spin does the same when a runner's machine library is upgraded while machines from an earlier release run, and none of those could have been checkpointed. *Fixed:* `Checkpoint` asks `query-migrate-capabilities` first and sets `x-defer-disk-flush` only when the QEMU lists it. That costs one round trip before the migration starts, with the guest running, and is on neither goal number's clock. A QEMU without it checkpoints as before #435, with the stop's flush on the host's disk. `qmpdef.Enum` still names the capability, so `verify qemu` fails a pinned QEMU that lost the patch. *Reproduced* (laptop, a tree of v20261121.01 with this checkout's spin-machine, boot:record's tests): main's `Checkpoint` failed `TestACheckpointedMachineIsHeldThenContinued` with compat's error, and this change passed all four of boot:record's tests. *Status:* in place. + +**11-21 · boot, machine · a workspace checkpointed and continued grows: `boot:cpu-plug` (#433, this change).** The overhead lane had seen vCPUs plugged right after a checkpoint's `Continue` never reach the guest in 2 of 5 runs, and plugged before its checkpoint since. *Traced* (a miss of the lane in #433's order, its states under `/var/tmp` on ext4, the laptop's disk busy and its swap full, QEMU `-trace` on `cpuhp_acpi_*`, `acpi_gpe_*` and `monitor_qmp_cmd_in_band`): QEMU received no command for 73 s after `cont`. The guest gave up after its 60 s, with `gpe02` at 0 events and no status bit and `sci` at 0, so QEMU had raised nothing. The `device_add`s came after, and the guest took all 15 insert events within 0.4 s. What held the plug was the lane's own helper, which closed the state between `Continue` and the plug. ext4 writes back a file QEMU truncated on its first close, and that close took 0.6 ms to 75 s across 9 checkpoints in the same lane. Nothing was lost in QEMU's hotplug or in the guest's GPE handling. *Ruled out* (laptop, real KVM, v20261121.01 with this checkout's spin-machine, states on tmpfs, so every close is free): 0 misses in 200 guests each way after a checkpoint, after a plain stop and cont, and with no pause. Also 0 in 100 each way after a checkpoint and a stop on two CPUs a spin loop keeps busy, 30 checkpoints with 1400 MiB of the guest filled there, 10 each way at 30% and at 5% of one CPU, 100 checkpoints with #417's close in the save's path again, and 100 each way in a guest whose PID 1 is a shell. The lane in #433's order missed 0 of 50. *Built:* `TestAWorkspaceCheckpointedAndContinuedGrows` (`task boot:cpu-plug`). spin's shape is booted to systemd at 2048 MiB and checkpointed and continued, then given 16 vCPUs, 8192 MiB and four disks at once. The guest must have all of them within 20 s, in 10 guests, and the state is closed once it has. compat.yml runs it, since a QEMU or kernel that lost a hotplug after a migration would leave a workspace at its size, and lab.yml's `check:cpu-plug` runs it on the bench. *Measured:* 10 guests grew in 0.31-0.71 s with the state on tmpfs. With it on ext4 written back at 10 MB/s while the guest grew (a scope's `IOWriteBandwidthMax`), 5 grew in 0.31-1.18 s. `Checkpoint`'s comment now says that the close or sync after `Continue` can take as long as the disk needs, and that a caller must not hold the next command behind it. The lane's comment that blamed the checkpoint is gone. *Status:* in place. + +**11-21 · qemu, machine, lab · a disk's counters without its backing chain: `x-flat` and the `usage` probe (#402, labs 44973302743, 44973302685, 44973726633, this change).** The question was whether a runner polling `Process.Usage` across ~20 machines, and the watch's read of a held disk each second, slow the machines. #402 said `query-blockstats` cost ~6 ms p50 "because every reply carries all 16 hotplug slots", and that one took 536 ms under host steal. *Explained* (laptop, spin's shape, the command timed beside query-status with QEMU's main thread's `schedstat` across each call). The hotplug targets are not in the reply, since an empty SCSI target has no block backend. What is in it is every image of each disk's backing chain, twice under a place's throttle filter (`bdrv_query_bds_stats` recurses into `parent` and `backing`). The reply was 12.6 KiB for a root of an overlay over the base plus a raw home. Each image added ~3.6 KiB and ~70 µs of the main loop, which also runs the disks' I/O: 0.37 ms of main loop at depth 1, 0.73 at 8 and 2.5 ms (124 KiB) at 32. Every seal of a workspace's disk adds an image. The 6 ms is a deep chain or a loaded host, not the slots. *The 536 ms is not the command.* Each call over 50 ms in the pressure probe's lane, sampled every 0.5 ms, had QEMU stalled in the host. At `memory.high` the main thread was in D state in its cgroup's reclaim (`reclaim_high` → swap writeout → `wbt_wait`) or a swap-in, for 170-195 ms, and query-status was as slow. In the memory and OOM phases it was in `mmap` waiting for the mmap lock while the vCPU faulted, 52-284 ms. Under `cpu.max` the monitor's thread was throttled for 80 ms. Two busy loops on QEMU's core cost a call 4-6 ms at most. A first run that traced QEMU to a file on ext4 caught its threads in the trace's own `writev`, so a stall measured with tracing to a busy disk can be the trace. *Built:* `qemu/patches/0004` adds `query-blockstats`' member `x-flat`, which leaves out `parent` and `backing`. `QEMU.DiskUsage`, Usage's QMP half and what the watch reads, asks with it. A QEMU without it (every release up to v20261121.01) refuses the member, so it is asked once and then only without it. The `usage` probe times DiskUsage on a running machine, quiet and pinned to one host CPU beside two busy loops, at a `depth`. *Measured* (bench, nested, spin's shape, v20261122.01 with QEMU from parts run 44972755256, 20 machines each × 200 calls): DiskUsage's main-loop time went from 293 to 96 µs p50, −197 [−202, −181], and its round trip from 573 to 390, −183 [−190, −158] (lab 44973302743). At depth 32 it went from 2991 to 94 µs, −2898 [−2917, −2895], and the round trip from 3377 to 391 (lab 44973302685). Against main's own parts build without 0004, depth 1 read −183 [−203, −176] µs, with query-status +8.1 [−55.5, +39.1] µs, within noise (lab 44973726633). So the +43 µs query-status read against the release is the build, not the patch. *Not explained:* pinned beside two busy loops, DiskUsage's p50 sat at 3.07 ms in every flat run against 2.2 at depth 1 and 4.3 at depth 32 without x-flat, and the slowest call did not change at depth 1. The 3 ms is about one scheduler slice on these hosts (#442). *Not built:* asking only for the held disks. With x-flat, each device costs ~20 µs of main loop (laptop, 2 against 11 places), so the ceiling is ~20 µs a second at spin's shape with one disk held. *Goal numbers:* untouched. DiskUsage has two callers, `Usage`, which spin calls when it chooses, and the watch, which asks only while a disk is held. Neither runs on a boot or a restore. 0004 changes only that command's handler and its HMP caller. boot:record passes on the patched QEMU (lab 44973302762, and on the laptop), and so does boot:pressure on the laptop. *Status:* in place. + +**11-21 · machine, spin-machine · a restore reads its state ahead before QEMU answers (lab 44976494418, this change).** restore-first's evicted login read 16 ms more than the cached one (111 against 95.2, main's spin-machine on v20261122.01's parts, 30 restores each). That gap is the disk. `Resume` started the read-ahead (lab 44809512339), but `spin-machine restore` calls Resume only after its dial, and the dial waits for QEMU's first answer, ~19.5 ms after its exec (`transport`, lab 44912471522). So the read began when QEMU was ready to load and never overlapped QEMU's start. `machine.ReadAhead` is the read-ahead with Resume's rule (a full load of a mapped-ram state), and `restore` calls it once the state is open, before the dial. Resume still calls it for callers that do not, and the kernel skips the pages a first call already asked for. *Measured* (bench, nested, spin's shape and login, 30 a side interleaved, lab 44976494418): evicted login 111 → 101, −9.3 [−12.2, −7.3], and `running` −8.1 [−9.4, −6.5]. The cached row read −0.2 [−2.2, +1.5], as it should with nothing left to read. The cold login read −7.5 [−12.8, +0.0], within noise, and no cold boot runs this code. *What limits it now:* the evicted row is 6 ms over the cached one. The read starts ~5 ms after QEMU's exec, once boot has bound the socket and `restore` has started, and a sequential reader takes ~60 ms for the state's 179 MiB (`read`, the same run). *Status:* in place. spin's runner, once it resumes through `machine.QEMU.Resume`, calls ReadAhead before `machine.Start`. + +**11-22 · boot · a checkpoint's stop on a host short of memory (#437, lab 44971162018, 44971787197, 44972838681, 44973775066, 44975130836, this change).** #437 guessed that the laptop's slowest saves, 1.6-1.9 s in the drain and 0.7-1.6 s for the last RAM, were QEMU's memory read back from a full swap. *Traced on the laptop* (QEMU `-trace` with wall-clock timestamps, each thread's `/proc` state, `wchan` and major faults every 2 ms): QEMU had nothing in swap and the host swapped in 167 pages in 11 minutes. The waits were a disk 60-80% full in `/proc/pressure/io`: guest writes in flight in `jbd2_log_wait_commit` and `rq_qos_wait`, which the drain waited for, and major faults on QEMU's own binary, evicted by reclaim (1.9 M file refaults) and read back from the disk that held the state, the overlay, the swap and the busy writers. A run without the busy writers, the disk still saturated by other work, waited 1.5 s once in the caller before `cont`. *Runners* have no swap (only spin's control plane gets a swap file, and it is never a runner) and give each machine's group `memory.swap.max` 0. *On the bench*, no swap and QEMU's binary on a disk apart from the state: with the host's memory taken but 1 GiB, the busy disk's dirty pages got the test killed. With 4 GiB left, the writer read 23.0 ms p50 (43.5 slowest) and with the busy disk 26.1 (44.4), against 18.5 beside the busy disk alone. QEMU took no major fault while the host reclaimed 26 M pages. `bpftrace` on `sched_switch` named the two slowest of 40 saves (139 and 188 ms): `balance_dirty_pages`, on a guest write in the drain and on one multifd channel's write of the last RAM, the other seven channels behind that file's `i_rwsem`. *Tried:* `direct-io` on the save's channels, with an `O_DIRECT` descriptor added to the state's set. Beside the busy disk it never converged, each pass ~2.5 s and ~520 MiB left, and was cancelled after 10 min. Rejected. `downtime-limit` 15: −6.0 [−11.9, −1.1] in 20 pairs short of memory, then −2.5 [−7.5, +3.0] in 25, −1.5 [−6.0, +2.8] with the writer, −0.2 [−0.5, +0.3] idle. Rejected. *Built:* `boot:checkpoint-pause`'s fourth guest is the busy-disk guest on a host whose available memory is taken but 4 GiB (`shortOfMemory`), measured and not held to the bound: on compat's kvm host, 118 GiB of it taken, the stop read 56.2 ms p50 against 25.2 on the bench (compat 44976542939, lab 44976542360). *Status:* the test is in place. A runner does not reach #437's seconds. Its stop on a host short of memory is the dirty limit's (#444). + +**11-22 · lab · a tree's spin-machine from any commit, and #438 bisected (lab 44976271054, this change).** #438 read restore-first's evicted login +2.2 ms [+0.5, +4.0] with main's spin-machine against v20261121.01's, and asked which commit moved it. A tree could hold only this checkout's spin-machine or a release's, so `--spin-machine commit:SHA` now builds one from any commit, fetched alone from origin as a release's is. *Measured* (bench, nested, spin's shape and login, v20261122.01's parts, 30 restores each, eight spin-machines interleaved): against v20261121.01's, main's read evicted login −0.1 [−2.7, +4.6] and `running` +0.6 [−2.3, +3.5]. Of the five commits between, only 8d04bd4's `running` excluded 0, +4.5 [+0.1, +7.9], and main contains it. `listening` read −4.2 from eb70cb8 on, because `machine.Start` binds the monitor's socket before QEMU exists, so `listening` no longer marks QEMU's start. That instance was noisy: its cached restores were as slow as its evicted ones. *Not reproduced.* The difference was on the evicted row only, the disk's, and the read-ahead before the dial, asked for from four goroutines, leaves the evicted row nothing to wait on (#446, #447). *Status:* the lever in place. #438 and #416 answered in their comments. + +**11-22 · lab · a probe's login is not preceded by a connection spin does not make (labs 44977850524, 44978246896, this change).** `Key.LoggedIn` polled `VsockAccepts(cid, 22)` until something accepted, then logged in. On spin's path (`login=spin`), that connection reached the forwarder, which opened one to 127.0.0.1:22, and sshd forked and exec'd `sshd-session` for it. The probe then closed it and logged in at once, so the guest's one vCPU ran that session beside the login being timed. spin's runner opens the user's connection once, through its supervisor, and asks nothing first (spin-stack/spin's `internal/runner/forward/forward.go`). LoggedIn now logs in until a login is done, with VsockAccepts' 50 ms connect timeout on the login's own connect, because a connect to a context id that does not exist yet waits 2 s. *Measured* as two rows of one tree, so one run compares the two probes (bench, nested, spin's shape and login, v20261122.01 with main's spin-machine, 40 each, lab 44978246896): restored login −4.1 [−6.0, −2.2], `running` −0.0 [−1.0, +0.9], the cold login before the save −3.6 [−7.2, +0.8], within noise. Only the restored login changed, in lab 44977850524 too: −3.6 [−7.3, −1.7] at 30. The number moves because the probe stops adding work, not because the machine changed, as with #341. LoggedIn is restore-first's, prestart's, restore-together's and density's. `ssh-first` keeps its own poll, because it times `accepts` with it, so its first login still carries the session (#450). *Status:* in place. + +**11-22 · image · ssh.service starts without `sshd -t` (lab 44977044826, this change).** Where PID 1 to sshd accepting goes, read from the guest after the first login (a `chain` probe on branch `exp/chain`, lab 44976328180, 10 boots, v20261122.01, spin's shape): PID 1 starts at 84.6 ms on the guest's clock, the first jobs dispatch at 139.3, sysinit.target at 280.5, basic.target 285.6 and the forwarder 286.6. The CPU used to the first login: the kernel's own 106 ms, PID 1 66, udevd 46, ssh.service 45 (both logins' sessions in it), journald 20, logind 16, the bus 11. One vCPU and no idle time, so the login waits for every exec before it. Ubuntu's ssh.service runs `sshd -t` as ExecStartPre: without it, the cold first login −3.2 [−7.2, −0.8] and sshd accepting −2.4 [−6.4, −1.1], 60 boots each interleaved, spin's shape and login. The same run took four other execs and settings out, one arm each, and none moved the login: systemd-udev-load-credentials masked −2.1 [−6.3, +0.3]; systemd-user-sessions' ExecStart emptied, its ExecStop kept, −0.6 [−5.2, +1.5]; sshd-socket-generator masked +0.8 [−4.0, +4.7]; and `DefaultMemoryAccounting=no` +4.1 [+0.8, +7.1], worse, with sshd accepting +6.2 [+2.2, +8.0], not explained. So an exec pair costs the login ~3 ms here, not the ~6 a getty's echo's 10 ms of CPU suggested. *Status:* `sshd -t` dropped at start (`ssh.service.d/20-no-config-test.conf`, asserted by build.sh, in the lab's lane edit); the restore unchanged (restore-first in the description). + +**11-22 · image · what a restored login waits on, and sshd's sleeps bounded (lab 44980029214, #457).** With the disk gone from the evicted restore, the login after `running` is restore-first's largest phase (~35 ms). A connection that timed each write and read of the login (laptop, v20261122.01, one restore at a time) split a 32 ms restored login into 4.6 ms to the server's banner, ~5 ms of key exchange, 14.5 ms from the signed `userauth` request to `USERAUTH_SUCCESS`, and ~4.7 ms for the channel, `exec` and exit. sshd at `LogLevel DEBUG3` said where the 14.5 ms went: "elapsed 0.903ms, delaying 6.180ms" after the key query and "elapsed 1.468ms, delaying 5.615ms" after the signed request. Both are `ensure_minimum_time_since` in OpenSSH 10.2's `auth2.c`, which waits until 5 ms plus 0-4.2 ms have passed since a userauth request arrived. It runs while `authctxt->authenticated` is 0, and `userauth_finish` sets that flag only after it, so the request that succeeds sleeps too. The query sleeps after sshd has already answered `PK_OK`, before it reads the signed request. spin's users meet the query from both clients: `golang.org/x/crypto/ssh` always asks first, and OpenSSH's `ssh` does for a key whose public half it holds. *Bound* (an `LD_PRELOAD` shim in ssh.service whose `nanosleep` returns at once, `--edit nosleep` on branch `exp-nosleep`, not for merge; bench, nested, spin's shape and login, #447's spin-machine on v20261122.01, 30 each, interleaved): restored login −13.4 [−15.2, −10.5] evicted and −13.5 [−15.6, −12.4] cached, `running` +0.7 [−0.8, +1.5], the cold login before the save −3.2 [−13.7, +2.7], within noise. The cold login hides the sleep behind the boot work its vCPU still has. A laptop check that the shim took: sshd and `sshd-session` mapped it, and the signed request's turn fell from ~14 to 2.9 ms. The shim first went in through the edit's `Files`, which the manifest keeps as JSON, and arrived 136 bytes longer and was ignored; it goes in by `Setup` in base64. *Status:* open (#457). The candidate is a patch that skips the sleep for a request answered with `PK_OK` or that succeeds, which tells the client nothing it does not know, and keeps it for failures. It needs openssh rebuilt from Ubuntu's source, as image/systemd does for systemd. + +**11-22 · ci, qmpdef, machine · compat in minutes, and its QMP half in go test (compat 44978948650, 44979352669, lab 44978556859, this change).** A compat run on #443's branch took ~10 minutes (run 44974499826): `boot:checkpoint-pause` 311 s, building QEMU and the kernel 239 s (QEMU's cache missed), the releases' checkpoints resumed 109 s, the rest ~40 s. It ran only on main after a merge, so #435, which sent `x-defer-disk-flush` to every QEMU, was found after it merged. *Moved:* `boot:checkpoint-pause` is a bound, not compatibility. It runs in release.yml's `pause` job on a bench host once a release is published, and the qemu entry's bump note names it. Its run there (lab 44978556859, v20261122.01) held idle 23.0, writing 16.8 and beside a busy disk 17.9 ms p50. *Built:* compat runs on every pull request beside CI. A `changed` job decides whether the change reaches the machine, QEMU or the kernel. A part it does not reach is not built: QEMU is main's published one (`fetch qemu`, 10 s) and the kernel the release's. A `compat` job at the end reports on every change, so a ruleset can require it as it requires `parts`. `changed` now compares from the merge base, so a dispatched branch is not charged with what main gained after it forked. *Built:* `go test` holds the machine package to every supported release's `query-qmp-schema` (`internal/qmpdef/testdata/released`, recorded from each tarball's `qemu-system-x86_64` by `spin-machine-dev releases schema`, which report.yml runs on each release). `CheckSupported` holds what the package sends unconditionally to every release. A value or member only newer QEMUs have is `qmpdef.Probed` or tagged `qmpdef:"probed"`. `TestTheMachineDrivesEverySupportedQEMU` drives `Checkpoint` and `DiskUsage` against a fake QEMU that refuses what each release's schema refuses, in QEMU's words. *Proved:* with #439's fix reverted, that test failed for v20261119.02 to v20261121.01 with `Parameter 'capability' does not accept value 'x-defer-disk-flush'`, compat 44964906186's error, in ~2 s. v20261122.01 and the pinned QEMU have the capability and passed. With DiskUsage's fallback removed it failed on all seven releases, since only the pinned QEMU has `x-flat`. *Measured:* compat dispatched on a change that reaches neither part took 4m02s wall, its KVM job 3m03s, of which resuming the seven releases' checkpoints was 103 s and fetching QEMU 10 s (44979352669). On this branch, which touches `internal/build` and so builds both parts from a warm cache, it took 3m57s (44978948650). *Status:* in place. + +**11-22 · machine · the read-ahead asks from four goroutines (lab 44976924478, this change).** With the read-ahead before the dial, restore-first's evicted login was still 6 ms over the cached one. The read-ahead was one goroutine making a `posix_fadvise(WILLNEED)` per 128 KiB piece, 1432 of them for the state's 179 MiB. Each call allocates its pages and submits their read before it returns, on a nested host. Four goroutines now ask, each for every fourth piece of each extent. *Measured* (bench, nested, spin's shape and login, 30 a side interleaved, against the read-ahead before the dial, lab 44976924478): evicted login 102 → 96.2, −6.2 [−9.1, −4.3], `running` −6.1 [−7.2, −4.8]. The cached row read −0.5 [−1.6, +1.9]. The evicted row is now level with the cached one (96.2 against 96.3), so the one goroutine asking was the limit and not the disk, and the restore has nothing left to win from reading. A test now holds a 64 KiB hole between two extents: a goroutine's last stride can end past it, inside the next extent, and without the reset to the extent's end over a third of that extent went unread. *Status:* in place. + +**11-22 · image/lab · udev after basic.target, and the no-systemd floor again (labs 44977226981, 44977605109, 44978034052, 44978079694, 44978927041).** In the `chain` probe's timeline sysinit.target waited for udevd's READY, at 280 ms against ssh.service's 237: udevd runs at the lowest weight while the boot runs, so its start came after every early unit, and basic.target and spin's forwarder after it. Copies of systemd-udevd.service and systemd-udev-trigger.service without `Before=sysinit.target`: cold first login −46.3 [−49.4, −39.8] (60 boots each), basic.target 286 → 242 ms on the guest's clock, udevd ready after the login at 342. Restored, ~30% of restores take ~530 instead of ~112 ms (p95 539-547), and one run read restored into prestarted +317. A journal dumped from the slow ones (branch `exp/restore-diag`): the guest resumes at 0.430 s, and the next login is accepted at 0.889 with nothing logged between, 0.04 s idle in the guest's whole uptime. It is the forwarder-early arm's tail and likely the coldplug arm's +463.7: a guest saved before the boot's deferred work is done (#452). The same change at udev's normal weight gains nothing (+0.7 [−5.0, +6.5]), so the gain is the weight and the order together. The serial getty at the lowest weight +2.7 [−4.3, +7.9], four unused varlink sockets masked −0.8 [−4.8, +4.3]. *The floor:* on v20261122.01, no systemd before sshd, the lane's first login 404 → 250 ms, −153.9 [−162.5, −151.2], sshd accepting 242 → 197 (20 boots). *Status:* udev after basic.target open, blocked by #452; the getty and sockets rejected. + +**11-22 · kernel · vmlinux BTF parsed on first use moves the parse, not the login (labs 44982285400, 44982285406).** kernel/Dockerfile says the first kfunc registration of the boot parses the 4.6 MB of vmlinux BTF, today xfrm's, and that only `DEBUG_INFO_BTF=n` removes it. A patch (branch `exp/btf-first-use`) keeps vmlinux's kfunc sets, destructors and struct_ops registered before the parse on a list, and the first `bpf_get_btf_vmlinux()` parses and registers them, in order, before any other caller gets the BTF; a struct_ops init that registers a kfunc set in turn (io_uring's) registers it at once. A program calling kfuncs of the common set loaded and ran on it. The kernel to "Freeing" −7.2 [−8.6, −6.2], inet_init 6.85 → 0.14 ms (10 boots), but the cold first login −1.5 [−3.1, +1.6] (60 boots): journald's `DeviceAllow=` and `IPAddressDeny=` load cgroup BPF programs at its start, and `bpf_check()` asks for vmlinux BTF for every program, so the parse lands in journald's start, before the login, on the same vCPU. *Status:* not carried. A verifier that asks for BTF only when a program needs it would let the parse leave the boot. + +**11-22 · image · the host key is Ed25519 alone (lab 44979726719, this change).** spin-machine-sshd-keygen made an Ed25519 and an ECDSA key, each with its own ssh-keygen, before ssh.service starts, on the one vCPU. Ed25519 alone: the cold first login −5.0 [−8.3, −1.8], sshd accepting −4.4 [−6.9, −1.9], 60 boots each interleaved, spin's shape and login. Every client since OpenSSH 6.5 takes Ed25519; one that accepts only ECDSA host keys no longer gets in. The same run took `pam_selinux` and `pam_mail` out of sshd's PAM stack, −1.9 [−4.9, +2.8], not separable. *Status:* Ed25519 alone; the restore unchanged (in the description). + +**11-22 · machine, boot · a resume takes its disks before the load (labs 44984233276, 44984233299, 44984162863, #459, this change).** A fast load in compat completed with no RESUME, and its guest never ran. QEMU's stderr said `Failed to get "write" lock` on the overlay. QEMU 11.2.0-rc0 adds a held machine's nodes inactive. Both run BHs, the full load's and the fast one's, activate them with `migration_block_activate(NULL)`. When that fails they skip `vm_start` and tell the monitor nothing, and the run state stays `inmigrate`. `Resume` returned nil for that, in a full load too. The lock came from the boot tests: `rootDisk` never closed its files, and QEMU's lock lives on the description the test's `*os.File` shares. So the lock outlived the killed "in full" machine until a garbage collection closed the file. `Resume` now sends `blockdev-set-active` before `migrate-incoming`, so QEMU's refusal is its error, before a byte of the state is read. `rootDisk` closes its files when the test ends. *Measured.* With `GOGC=off` on a laptop (KVM, userfaultfd on), main missed 10 of 10 fresh-process runs of the events test and the fix passed 50 of 50. On the bench (nested, v20261122.01, 100 fresh-process runs each), main missed 3 with #459's events and stderr, and the fix missed 0. restore-first, fix against main (bench, spin's shape and login, 30 a side interleaved, `fast=true`, lab 44984162863): evicted login −0.3 [−2.4, +4.8], `running` +0.2 [−1.6, +4.9], cached login −0.6 [−4.8, +1.7], all within noise. *Status:* in place. `boot:record`'s "a disk another machine holds" holds it on real KVM. + +**11-22 · image · sshd delays a failed userauth and not a login (labs 44983986606, 44983986575, #457, this change).** The image installs Ubuntu's openssh 1:10.2p1-2ubuntu3.8 rebuilt from its source package (`image/openssh`, versions.yaml `openssh-source`) with `userauth-delay-failures.patch`: `input_userauth_request` skips `ensure_minimum_time_since` for a request that authenticated, or for a public key query sshd answered with `PK_OK`, and keeps it for every other request but `none`. Ubuntu's package changes nothing on that path. It carries d43ba60 (CVE-2026-60001), whose keyboard-interactive and GSSAPI follow-ups delay only a failure, so the patch tests the method (`m == &method_pubkey`) and not `postponed` alone: those methods' first requests set `postponed` and keep their delay. The packages are `+spin1` and held, as systemd's. *Measured* (bench, nested, spin's shape and login, 30 a side interleaved, v20261122.01 against itself with this checkout's OpenSSH, `lab tree --openssh`): restored login 93.2 → 79.6, −13.6 [−14.9, −9.8] evicted and −13.6 [−16.2, −11.4] cached, `running` −0.3 [−1.9, +3.1] (lab 44983986606); the cold first login 467 → 457, −9.4 [−15.8, −2.6], sshd accepting −3.4 [−8.2, +0.6], accept to login −6.0 [−10.1, −4.8], the second login −10.9 [−12.3, −9.0] (lab 44983986575). The restore matches the `LD_PRELOAD` bound (−13.4). The cold login, which the bound read as within noise at −3.2 [−13.7, +2.7], moved too. *Checked* (`boot:sshd-delay`, laptop, 10 logins): the signed request of a login took 16.8 ms on the release's sshd and 1.9 ms on this image's; every refused key and unknown user still took 5.8-9.1 ms. The query's own turn shows no delay on either, because `PK_OK` goes out before it: the query's delay holds up the signed request. *Found on the way:* `debugfs cat | grep -q` on a binary fails under `pipefail` (debugfs takes SIGPIPE when grep stops at the match), so build.sh dumps sshd-auth to a file before it asks. *Status:* in place. The success half is upstream's intent and should be offered to OpenSSH (#457). + +**11-22 · machine · GuestRunning is QEMU running the resumed guest (labs 44987275584, 44987275543, #465, this change).** A fast load says `postcopy-active` in `qemu_loadvm_run_fast_snapshot_load` right after it schedules the run BH, and the BH starts the guest later, on QEMU's main loop (QEMU 11.2.0-rc0). `Resume` returned and told `GuestRunning` at `postcopy-active`, so #459's guest, which never ran, was told running at 6.80 ms. `Resume` now arms a wait on `RESUME` before `migrate-incoming` and returns, telling `GuestRunning`, once it arrives, in a full load too. A full load that leaves the machine neither running nor paused is now an error, where `Resume` returned nil. *Checked* (`boot:record` on the bench, lab 44987275584): the events test now asks QEMU's run state from inside the `GuestRunning` callback and finds it running, in full and fast. The fast load told `GuestRunning` at 8.77 ms and `StateLoaded` at 672 ms. *Measured* (bench, nested, spin's shape and login, v20261122.01, `fast=true`, 30 a side interleaved, against main's spin-machine, lab 44987275543): fast `running` −0.4 [−1.5, +1.3] and fast login −0.6 [−13.8, +22.0], both within noise. The cached row's login read −0.5 [−4.4, +4.3]. The evicted row's login read −2.7 [−5.1, −0.8] with its `running` −0.0 [−3.1, +2.7]. A full load's path changed only by a wait that has already matched, so that row is taken as noise until another run repeats it. *Status:* in place. `Resume` now returns when QEMU runs the guest, not when the load is merely handed over. + +**11-22 · lab · ssh-first logs in over the connection it timed (lab 44987441326, #450, this change).** `ssh-first` polled `VsockAccepts(cid, 22)` to time `accepts`, closed that connection, and logged in on a new one. On spin's path (`login=spin`) the closed connection had reached the forwarder, which opened one to 127.0.0.1:22, so sshd forked and exec'd `sshd-session` for it on the guest's one vCPU beside the first login timed. spin's runner opens the user's connection once. The probe now keeps the first connection accepted and runs the first login over it (`Key.LoginOn`); `accepts` is still that connect's return. If that login fails, the probe logs it and logs in again as before. `VsockAccepts` had no caller left and is gone. *Measured* as two rows of one tree, so one run compares the two probes (bench, nested, spin's shape and login, v20261122.01 with main's spin-machine, 40 each interleaved, lab 44987441326, branch `exp-ssh-first-rows`, not for merge): accept to login 69.6 → 65.3, −4.3 [−5.4, −3.0]; first login 463 → 458, −4.4 [−9.1, +0.3], within noise at 40, because `accepts` itself spreads ±4 ms; sshd accepting +1.8 [−3.7, +4.4]; the second login −0.6 [−2.0, +1.3]. The console prompt read −6.2 [−12.3, −2.2]: the echo getty runs after sshd accepts, on the same vCPU as the extra session. The size matches #451's −4.1 on the restored login. The number moves because the probe stops adding work, not because the machine changed. *Status:* in place. Compare a release measured before it only within one run, as the ladder does. + +**11-22 · CI · refresh.yml proposes the openssh source when Ubuntu moves it (#463, this change).** The archive serves only the openssh source resolute publishes now, so image/openssh stopped building the day Ubuntu moved it, and nothing moved the pin. `spin-machine-dev refresh openssh` is `versions refresh -propose -label openssh openssh-source`, and refresh.yml's `systemd` job is now `sources`, one matrix job each for systemd and openssh. The patches are checked where the build already checks them: the proposing pull request changes `openssh-source`, so parts.yml's `changed` builds the image, and `image/openssh/Dockerfile` applies every patch with `--fuzz=0`. *Checked.* With the pin set back to 10.2p1-2ubuntu3.7, `versions refresh openssh-source` committed 10.2p1-2ubuntu3.8 with the repository's pin, 5f83862e…. A moved `openssh-source` makes `changed` answer `build=true` for the image. The patch applies with `--fuzz=0` to the pinned source as `dpkg-source -x` lays it out. With one of its context lines in auth2.c changed, `--fuzz=0` refuses it (`Hunk #1 FAILED at 360`), where patch's default fuzz would have applied it. *Status:* in place. + +**11-22 · image · every login gets its user manager again (labs 44987167474, 44987167549, #462, this change).** `boot:logind` failed from v20261120.03 on: `systemctl --user` found no manager. Sessions have been of class `user-early-light` since 11-13, and logind starts no manager for one (`SESSION_CLASS_WANTS_SERVICE_MANAGER`, systemd v259.9). spin's linger had been the only thing that started `user@1000`, and e807038 (11-20, "spin does not linger") took it away. Root, the user spin logs in as, never had a manager on that path (inferred from the same code; not checked on a release). *Bisected* on the laptop, KVM, `boot:logind` against each release: v20261120.02 passes; v20261120.03, .04, v20261121.01 and v20261122.01 fail. e807038 is the only image commit between .02 and .03. v20261122.01 passes with `/var/lib/systemd/linger/spin` written back into the test's root. `lab tree --edit nolinger` did not reproduce it, because `boot:logind` boots its own raw copy of the base and never applies a tree's edits. *The fix.* `user-runtime-dir@`'s `20-manager.conf` wants `user@%i`. logind starts that unit for every session and waits for it alone, and the manager starts after it, so the login does not wait for the manager. *Measured* (bench, nested, spin's shape and login, 20 a side interleaved against v20261122.01, the drop-in and the class put into the overlay by experiment edits on branch exp/user-manager-462, 5ba7507): the drop-in first login +2.6 [−4.0, +8.7], restored login +0.8 [−1.5, +4.5] evicted and +1.0 [−1.1, +5.8] cached, cold login in the restore run +3.7 [−1.7, +10.5], all within noise. Accept to login +5.1 [+2.8, +6.5] and the second login +15.8 [+14.2, +16.6]: the manager runs while the second login does. Class `user-early`, which holds the login for its manager, cost the first login +36.2 [+32.0, +45.7], so it was rejected. *Checked:* `boot:logind` passes with the drop-in. With the console `su` login taken out of the check, the first SSH login's own `systemctl --user` still fails 3 of 3 with the drop-in, and passes 2 of 2 with class `user-early`. A command that needs the user bus at once in the first login can arrive before the manager. *Status:* in place. The manager's own cost is what would let a login wait for it (#467). + +**11-22 · qemu, image · a restored guest's TSC, and udev after basic.target (labs 44983495254, 44983967863, 44984395014, 44986512574, 44987412184, 44987412171, 44987412210, 44987584707, #452, this change).** The ~450 ms that blocked udev after basic.target and spin's forwarder early was not guest work. Sampled on the bench (branch `exp/452-diag`), a slow restore's vCPU thread ran ~17 ms after the resume and then sat in `kvm_vcpu_halt` for 281-450 ms, neither running nor waiting, and the guest's /proc/stat was missing that time. Traced with the host's kvm and vsock events, the guest answered the login's packets until it halted, and woke on its first local timer interrupt, with no TSC-deadline write before it: the slow login ended 528-555 ms after QEMU's exec however long the load took. kprobes on `kvm_synchronize_tsc` showed why. QEMU writes each vCPU's TSC before the load, zero after the vCPU is made and one at the reset, and KVM, having had a TSC from userspace, takes the migration's TSC within a second of it for a sync and keeps the offset (kernel bf328e22e472's case, undone). The guest's TSC counts from the new vCPU's creation, so its saved TSC deadline is met only after the saved uptime, ~0.5 s. A guest saved with its tick running (udev still at work) had that deadline a tick ahead and reprogrammed none of its later timers. One saved idle armed far ahead and reprogrammed, so the release's restores never showed it. The coldplug arm's restored +463.7 (lab 44818953987) was the same. QEMU 0005 writes an incoming machine's TSC only from the migration: the writes became the creation's and the checkpoint's, unmatched, and 16 of 16 restores read 84-94 ms (lab 44987412184). *Measured,* spin's shape, 30 a side against the release: udev after basic.target with 0005 cold −48.6 [−51.7, −42.6], restored −2.0 [−8.0, +4.7] with p95 114 against 114 evicted and 126 against 128 cached; without 0005 the same edit's restored p95 is 539-546 (lab 44987412171). In `prestart`, cold −44.7 [−53.4, −39.4], restored into prestarted −1.3 [−4.1, +3.6] with p95 98.8 against 101, and without 0005 413 (lab 44987412210). 0005 alone moves neither number (cold −3.0 [−5.8, +0.1], restored −1.9 [−7.6, +2.0]). spin's forwarder early with 0005: cold −60.4 [−63.3, −52.9], restored +3.3 [+1.0, +7.4], p95 104 against 101 (lab 44987584707), so it is spin's to take. The image now carries copies of systemd-udevd.service and systemd-udev-trigger.service without `Before=sysinit.target`, and image/build.sh checks them. *A first 0005 skipped only the zero:* the reset's one still set KVM's flag, and the tails stayed (labs 44986055383, 44986006042). + +**11-22 · qemu, qboot, kernel · every carried patch has a test that fails without it, and three are measured alone (labs 44993254745, 44993790452, 44993011539, 44993011448, #472, #481, #478).** A patch dropped at a bump, or rebased into applying and doing nothing, built and booted, and nothing said so: `patch --fuzz=0` refuses only a patch that no longer applies. *Built:* `verify args` asks the TCG QEMU what 0001-0004 do with no guest (`TestEachQEMUPatchDoesItsJob`): 163 flat views from QEMU's start to its first answer at spin's shape, a disk beyond `max_target` refused, a save's stop submitting one io_uring flush without `x-defer-disk-flush` and none with it, and `query-blockstats` without `parent` or `backing` under `x-flat`. `boot:patches`, which compat runs beside boot:record, asks a guest of spin's shape what only it sees: its SCSI host refuses a scan of target 16 (0002), the firmware enabled the MTRRs (qboot's `mtrr.patch`), and a guest restored 650 ms ahead of its new vCPU's TSC goes no more than 200 ms without a line (0005). On v20261122.01, before 0005, it went 625 ms (lab 44993011539); on v20261122.02, 12 ms (lab 44993011448). `kernel/Dockerfile` reads each kernel patch's effect in the vmlinux it built (#478). *Measured alone* (bench, spin's shape, `prestart`, against main's QEMU from parts run 44989641652): taking 0001 back read restored +11.7 [+0.9, +19.3] and cold +0.2 [−8.7, +7.1] (20 a side, lab 44993254745), so it earns on the restore. `pam.patch` read cold +3.9 [−3.4, +8.0] and `no-pci-walk.patch` +5.2 [−1.7, +9.2] (40 a side, lab 44993790452). Both are inside the noise with upper bounds over +5 ms, which rule 5 keeps. *Status:* every patch kept. + +**11-22 · kernel, boot · the host counts the port I/O exits 0004 and 0010 save (labs 45017602084, 45018204750, 45018204645, 45018410483, 45018410313, 45018410890, #486, this change).** The vmlinux check (#478) sees 0004 and 0010 compiled in, not earning. 0004 needs `raw_pci_ext_ops`, set from the ACPI MCFG table, and 0010 needs KVM's CPUID leaf, so a kernel that set up MMCONFIG after enumeration, or a machine without MCFG, would pass it. `boot:patches` now cold-boots spin's shape to `/bin/sh`, reads KVM's `io_exits` and `mmio_exits` for every vCPU through QEMU's `query-stats`, and holds the median of 3 boots' `io_exits` at or under 1,025 (`TestPCIConfigurationCostsNoPortExits`). *Calibrated* on the bench, 20 boots each, v20261122.02 with its own kernel and with kernels built without each patch (parts runs 45017420814, 45017423344, branches `exp/486-no0004` and `exp/486-no0010`, not for merge): the release 955-974, median 958, mmio 2,142; without 0010 1,075-1,097, median 1,094; without 0004 3,477-3,499, median 3,496, mmio 881. 0004 saves 2,520 port exits, not the issue's estimated 1,300: 1,261 configuration accesses move to ECAM, and mmio_exits falls by the same 1,261. 0010 saves ~120, clear of a spread of ~25, so both are guarded. *Checked:* the release passes (974/974/980). The guard fails without 0004 (median 3,481) and without 0010 (median 1,097). *Status:* in place, run by compat.yml with every change's kernel. + +**11-22 · qemu · 0003 says the same in fewer lines (#488, this change).** `x-defer-disk-flush`'s patch was 369 lines, most of them a `defer_flush` argument carried through `migration_stop_vm`, a second `vm_stop_force_state` and the stop's helpers. Now `do_vm_stop` and `vm_stop_force_state`'s stopped branch start the deferral themselves, after the drain, when the run state is `finish-migrate` and `migrate_defer_disk_flush()` (public in `include/migration/misc.h`) holds: 249 lines, 71 added and 3 removed in QEMU against 107 and 22 before. Postcopy's and CPR's stops are `finish-migrate` too, so the accessor is false with `postcopy-ram` or a CPR mode; the machine sets neither on a save, so what it does is unchanged. *Checked* on the rebuilt QEMU (parts run 45017732016): `verify args`' 0003 subtest, one flush without the capability and none with it; compat (run 45017731970); `boot:checkpoint-pause` on the bench, busy-disk guest p50 stopped 20.6 ms, 22.1 short of memory (lab 45018667678). *Status:* in place. + +**11-22 · CI · the coverage floor counts what CI can run (#410, this change).** `task test`'s floor counted every statement, and a function marked `mutate-lane:` runs only in a lane with root and KVM. Each probe the lab gained pulled the total down however well its testable half was tested: #406 passed at 79.96%, which `go tool cover -func` rounded to 80.0 before the comparison. `internal/coverfloor` reads coverage.out, leaves out each function whose doc comment carries the marker, as go-tools' mutate does, and compares the exact percentage. *Measured* locally on `140ebbb` with CI's conditions (no release tree, no root): 80.48% before it, 80.65% of 9298 statements with internal/coverfloor's own, and 93.36% of the 7697 left without the lane's 1601. The floor moves from 80 to 93, just under it, so it ratchets. *Status:* in place. + +**11-22 · lab · every release's record carries its no-systemd floor (this change).** AGENTS.md and docs/measuring.md (rule 8) ask for the bounds each release, the no-systemd floor first, and report.yml measured only the goal's numbers and the diagnostics: the floor was last measured by hand, on v20261122.01 (lab 44978079694). `releases measure` now boots the release beside its floor after the ladder, `ssh-first` with `login=lane` over the release and the release with `--edit floor --append init=/usr/local/sbin/spin-floor`, 20 boots each, interleaved, as the hand-made runs did. The record keeps both first logins as `floor-lane` and `floor`, and docs/releases.md tables them under "Bounds" once a record has them. Only the release a record is made for is measured beside its floor: the one it is against has none, and no Δ is read of a bound. It is the one bound docs/boot-time.md lists as each release's. *Checked* by report.yml on this branch against v20261122.02 (run 45018301368, record not proposed): first login by the lane 406.8 / 420.2, no systemd before sshd 240.5 / 245.5 (p50 / p95, 20 boots each, bench, spin's shape), beside the ladder's cold 420.0. *Status:* in place. + +**11-22 · kernel, qemu · every carried patch is git format-patch output (#487, this change).** Three hygiene items found while writing #478, none of which changes what a patch does. Kernel 0003 left `eval_map_work` and its `INIT_WORK` behind after `trace_eval_init()` came to call the copy directly, and its allocation-failure branch did what the success path did: the copy (now `trace_eval_defer()`) runs once, first, and `trace_init_wq` stays for `tracerfs_init_work`. Subjects said `[PATCH 7/11]` and the like after 0006, 0009 and 0011 were deleted; they say `[PATCH]`. Kernel 0007, 0008, 0010 and QEMU 0002, 0004 and 0005 had no `diff --git` lines (#488 had just remade QEMU 0003); all thirteen were remade with `git format-patch -N` from git trees of the pinned tarballs. *Checked* on the laptop, no build: each set, applied with `patch -p1 --forward --fuzz=0` as the builds do, gives the tree the series' commits do; the old and new kernel sets differ only in 0003's trace.c; every changelog is unchanged; checkpatch --strict reads the kernel patches clean but for 0002's citation of a commit the tarball has no history for. `gates/patches_test.go` holds both directories to the format. CI rebuilt the kernel and QEMU, and the vmlinux check still finds each patch. *Status:* in place. + +**11-22 · lab · the floor's gap is a Δ with its interval (#495, this change).** The record kept the floor as two p50/p95 pairs, and the gap a reader wants, what systemd costs at most, was their difference with no interval, so it could not be read by the one acceptance rule. A record now keeps `bounds.floor`, the floor's Δp50 against the release's lane login from the same run, drawn by `DeltaP50`, the bootstrap every release's Δ uses, and docs/releases.md shows it in "Bounds" beside the two pairs. A bound is still never read against the release before it. *Checked* on the floor's samples from report.yml run 45018301368 (v20261122.02, bench, spin's shape, 20 boots each), kept as `internal/lab/testdata/floor-45018301368.json`: −166.3 [−174.7, −160.3]. The floor keeps its own lane-login arm. Its sshd does not serve spin's path, which is spin's forwarder before sshd, and the floor has no systemd to run it. *Status:* in place. + +**11-22 · CI · the coverage floor is go-tools' coverfloor (go-tools #131, v20261122.02, #496, this change).** `internal/coverfloor` (#490) copied go-tools mutate's rule for lane code, which every spin-stack repository's `task test` should read the same way. go-tools' `coverfloor` reads it through mutate's own `LaneFunctions`, and it refuses a marker that names no test, as mutate does. `task test` runs it by name from go-tools' release, and the copy is deleted. *Checked:* both tools printed the same line on main's profile (93.38% of what CI runs, 80.66% with the 1606 lane statements). The same release copies no ignored directory into mutate's copies (go-tools #132, #129) and stops a run whose importer test fails unmutated (go-tools #133, #130): the `_output` guard in `task test` stays, for a plain `go test`, with its comment saying so. *Status:* in place. + +**11-22 · qemu · 0003 has no postcopy clause (#501, this change).** `migrate_defer_disk_flush()` was false with `postcopy-ram`, and no test could ask it: a save to a file cannot run with `postcopy-ram`, because the source opens a return path at connect and waits for the destination's SHUT at completion (11.2.0-rc0), so holding it needed a second QEMU as a destination. No caller can reach it either. The machine turns on `x-defer-disk-flush` only in `Checkpoint`, which also turns `postcopy-ram` off and migrates to `file:`. `postcopy-ram` is turned on only by `Resume`, on a destination, for a fast load, and a destination's stop is not a switchover's. spin moves a workspace by checkpoint, upload and resume (`moveFor`, spin#1487), with no live migration. The clause also guarded nothing that precopy's stop doesn't share. A deferred flush is safe when the migration's reader shares this host's page cache, which is what the capability says, and that holds or fails the same way whichever phase stops the VM. So the clause is gone, and postcopy's stop defers as precopy's does. CPR's exclusion stays, because cpr-reboot's stop can precede a host reboot that loses the page cache, and #499's subtest holds it. The patch adds 70 lines where it added 71, and every branch it carries is asked by `verify args`. *Checked:* the series applies with `patch --fuzz=0` to the pinned tarball, and `migration/options.c` and `qapi/migration.json` match the edited files, which `scripts/qapi-gen.py` reads without error. On the rebuilt QEMU (parts run 45030863541), `verify args`' 0003 subtest passes, and so does compat (run 45030863623). `boot:checkpoint-pause` passes on the bench with the busy-disk guest's p50 stopped at 19.7 ms, 29.5 when short of memory (lab 45031602785). What a checkpoint does is unchanged, since it never sets `postcopy-ram`. *Status:* in place. + +**11-22 · image · the first login waits for its user manager, which root starts in the boot (labs 45030778365, 45031248191, 45031644179, 45031644114, 45031687433, 45032247920, 45032247623, #467, this change).** Since #462 a login's manager started beside it, and the first login's own `systemctl --user` could arrive before it. On spin's login (root, bench, v20261122.03) it failed 10 of 10 (lab 45032247920, `ssh-first` with the first login's command `systemctl --user list-units`, archive tag archive/exp-user-manager-467). *Where the manager's time goes:* a diagnostic read root's manager's timestamps after the logins (`systemctl show` of `user@0` and the manager's own Generators/UnitsLoad timestamps). With class `user-early` the manager took ~48 ms from `user@0` starting to ready: ~11 PAM and exec, ~2.6 the manager's start, ~9 the XDG autostart and environment.d generators, ~2 unit load, ~8 building the first transaction (its lazy unit loads, a debug log showed), and ~15 sockets.target, which waits for dbus.socket's and ssh-agent.socket's `ExecStartPost=systemctl --user set-environment`. The user units are default.target, basic.target, sockets.target (dbus.socket, ssh-agent.socket, systemd-ask-password.socket), timers.target and paths.target with nothing in them, and app.slice. *Cuts* (bench, nested, spin's shape and login, 20 a side, against class `user-early`, lab 45030778365): the sockets' environment from `/etc/environment.d` and their ExecStartPost taken away −17.1 [−27.0, −10.7]; the XDG generator masked −4.8 [−11.2, +1.3]; both generators, a bound, −8.4 [−15.8, −1.0]; the PAM stack down to `pam_permit` and `pam_systemd`, a bound, −3.5 [−11.4, +2.5]. With the environment cut and the XDG mask, `user-early` still cost +29.8 [+17.2, +42.2] (lab 45031248191): what is left is systemd --user's own start. *Root lingering* moves that start into the boot, where the first login finds it done or nearly. Decided at 40 a side (lab 45031644179): `user-early`, the environment cut and root lingering, first login +4.7 [−0.2, +12.2], within noise; sshd accepting +5.6 [+1.1, +10.1]; the second login −16.7 [−17.7, −16.3]. Without the environment cut, +19.6 [+15.9, +25.6]. Restored login −10.8 [−15.9, −6.6] evicted and −12.3 [−15.1, −5.5] cached, 20 a side (lab 45031644114). The likely reason is that root's manager no longer stops 10 s after the cold login's session ends (`UserStopDelaySec`) and starts again beside the restored login (inferred, not measured). *Left out:* the XDG mask, which moved neither goal number. *The lane's login as spin* waits for spin's own manager: first login +29.7 [+22.8, +42.1], and shadowing Ubuntu's `user@` barrier on `systemd-user-sessions` changed nothing (+30.6, lab 45031687433). The lane is no goal number, and the no-systemd floor's Δ in the next release's record is read against it. *Changed:* class `user-early`, root's linger file, `environment.d/10-user-sockets.conf` and the two sockets' `10-env.conf`; `20-manager.conf` deleted, since logind starts the manager of every session of class `user-early` itself. `boot:logind` runs its SSH logins before the console `su`, so the first SSH login's `systemctl --user` is the first login's. `lab`'s lane edit carries the same. *Checked:* the first login's `systemctl --user` passed 10 of 10 on spin's login and on the lane's with these edits, the manager-wants drop-in removed (labs 45032247920, 45032247623). *Status:* in place. + +**11-22 · lab, report · a boot chart of every release and of any tree (labs 45035203882, 45036503632, 45037354657, this change).** A number said how long a boot took, and nothing showed what ran in it. The `bootchart` edit puts systemd-bootchart (Ubuntu's 235-2build1, pinned in versions.yaml) into a tree's overlays as PID 1, sampling at 200 Hz. The `bootchart` probe stops it with the first login and keeps its chart and `systemd-analyze plot` beside `result.json`. `releases measure` draws each release once, and its record links both charts from docs/releases.md. *Cost* (bench, spin's shape, 20 a side, v20261122.03, lab 45036503632): first login +10.4 [+4.5, +16.8], console prompt +15.7 [+12.3, +19.7], QEMU RSS +4.0 MiB. It is a diagnostic and never in the image. *Fixed on the way:* the sampler is named `init`, not systemd-bootchart (lab 45035203425 found none); the stop command's sudo and its forks drew themselves ~0.1 s past the login (labs 45036002014, 45036494125); 235 names processes from `/proc/PID/sched` as "9" on this kernel and reads cgroup v1, so it names them by command line and draws no cgroup. *What v20261122.03's chart shows* (lab 45037354657, 3 boots): PID 1 at 82 ms of the kernel's clock and the login at 320. From about 100 to 140 ms the vCPU is nearly idle while the disk reads ~230 MB/s, so systemd's first 40 ms wait on the image. From about 190 ms to the login the one vCPU is busy and every process waits to run. udevd (21.5 ms), journald (18.6) and logind (14.8) use the most CPU. In the plot, systemd-udevd.service activates for 189 ms and systemd-udev-trigger.service for 127. These are leads, and the log's 2.1 is why a chart's bar is not a saving. *Status:* in place. + +**11-22 · machine, lab · the machine loads a state fast above 1.5 GiB of data, and no caller chooses (labs 45034868686, 45035462371, 45035462478, 45034881876, 45034881433, 45034881366, 45035029887, 45035048486, #470, this change).** `LoadOptions.Fast` was the caller's choice, and spin offered it as a host policy, `fast_load`, off by default, whose comment cited 293 against 152 ms from before mapped-ram and multifd (lab 44585840498). A fast load reached the first login at ~400 ms against ~95 for a full one at today's state (lab 44987275543). *The crossover:* `restore-first` gained `touched=MIB`, which writes that many MiB of non-zero bytes into a tmpfs in the guest after its cold login and before its save. Bench, nested, spin's shape and login, plugged to 2048 MiB up to 1.5 GiB touched, then to 4096 and 8192, the state evicted, 20 a side interleaved, first login p50/p95 in full against fast: 179 MiB of data 95/105 against 489/563, +394 [+388, +420]; 825 MiB 258/310 against 431/446, +173 [+149, +195]; 1.2 GiB 374/510 against 476/534, +103 [+88, +120]; 1.7 GiB 570/763 against 441/498, −129 [−167, −76]; 3.7 GiB 1410/1804 against 451/518, −959 [−1008, −911]; 7.3 GiB 3152/3658 against 538/581, −2615 [−2642, −2589]. A full load costs the disk's read of the data, ~0.4 ms a MiB; a fast load's login barely moves. *Where a fast load's time goes* (branch `exp-470-blocktime`, `postcopy-blocktime` on, lab 45035029887): at 179 MiB ~2,500 faults, mean 69 µs, most 64-128 µs, blocked the vCPU 45 ms of the ~400 the login adds. With the state read ahead each fault took 5.5 µs and blocktime 3 ms, and the login was still 325 ms (−168 against no read-ahead, +234 over a full load). The postcopy lasted 0.8 s at 179 MiB and 2.4 s at 3.7 GiB: QEMU's eager thread places every 4 KiB page of the RAM blocks at their ceilings, 8 GiB, one ioctl each. That this is what slows the guest is inferred, not measured (#519). Postcopy's preempt channel is a second socket from a source, for pages queued behind the precopy stream, and a file load has neither. *Read-ahead during a fast load* (lab 45035048486, 10 a side, 3.7 GiB): faults 78 against 85 µs, login 436 against 458, p95 713 against 490, so it is not carried. *Changed:* `LoadOptions.Fast` and `spin-machine restore --fast` are gone. `Resume` loads fast a mapped-ram state with more than `machine.fastAbove` (1536 MiB) of data on a host that grants QEMU a userfaultfd (`/dev/userfaultfd` open to every user, spin's grant, or `vm.unprivileged_userfaultfd=1`), and in full otherwise. The read-ahead and the channels follow the same choice. `restore-first` lost its `fast` row; a bench runner grants the userfaultfd, so `touched` over 1.5 GiB measures the fast load. `boot:record`'s events test fills 1.6 GiB of a 2 GiB guest for the fast load's events. spin's `fast_load` is spin-stack/spin#1570. *Status:* in place. + +**11-22 · image · six unmeasured deviations measured, two reverted, and boot:workspace (labs 45034963004, 45036254377, #508, #517, this change).** The inventory (#508) and docs/image.md (#517) left six deviations with no measurement in spin's shape on spin's login. Each was taken back to what Ubuntu ships by a `lab` edit, one arm each, interleaved against v20261122.03 with `--edit lane`, 20 a side, 1 of 16 vCPUs, 128 MiB, `prestart` (lab 45034963004). Taking back, Δp50 cold: `nsswitch.conf` +0.8 [−8.4, +5.2]; the volatile journal +6.1 [+2.3, +15.8]; docker and containerd by socket +13.9 [+11.4, +18.2], restored +55.7 [+12.0, +73.9]; the manager's timeouts +0.3 [−5.2, +3.3]; logind, the bus and the user units early +16.5 [+9.8, +20.4]; the host keys from the first dispatch −0.8 [−10.5, +3.5]. *Kept:* the journal, docker (a deferred row, which says the first `docker` command waits for the daemons), and the lane's logind units, now measured in spin's shape. *Reverted:* `nsswitch.conf` and `fast-boot.conf`, which earned nothing; their edits went with them, and so did `carry-logging`, which edited `fast-boot.conf`. The host keys stay pending #515. `boot:workspace` checks what a workspace expects and asserts what the image gives up; on v20261122.03 (lab 45036254377) it found tracefs empty under `lockdown=confidentiality`, where docs/image.md said it mounted by hand, and the first `docker` command waiting 0.47 s on two vCPUs. It runs in release.yml's bench job on the release's own image, beside `boot:logind`. *Opened:* #509-#515. *Status:* in place. + +**11-22 · lab · the boot chart from spin-stack's systemd-bootchart (labs 45042034749, 45042509602, 45043434713, #525).** Ubuntu's 235 named processes "9", read cgroup v1 and so labelled none with its unit, and filtered out 62 of the processes that ran. The `bootchart` edit now compiles spin-stack/systemd-bootchart at the commit versions.yaml pins, in a container on the runner that makes the tree (`internal/lab/bootchart.Dockerfile`), with `ControlGroup=yes` and `Cmdline=no`, and the probe keeps the fork's JSON beside the chart. *What v20261122.03's chart shows at 78dc08c* (lab 45043434713, bench, spin's shape, 3 boots): CPU by unit p50 init.scope 134 ms (PID 1 118 to 123 ms, and the sampler, named `bootchart`, ~10 ms), systemd-udevd.service 25, systemd-journald.service 19, systemd-logind.service 15, the root cgroup's kernel threads 15, session-1.scope 13, ssh.service 11, dbus-broker.service 10. systemd-udevd waits ~120 ms to run and systemd-udev-trigger ~110. The sampler says it used ~10 ms of CPU, ~0.2 ms a sample. `first_login` 433 ms p50, `chart_end` 330. Leads, not savings. *Status:* in place. + +**11-22 · lab · the boot chart without the things a reader had to guess at (lab 45060814905, spin-stack/systemd-bootchart#9, #528).** The charts at 78dc08c (lab 45043434713) named one executor "9", gave idle kernel threads no cgroup in one boot of three (so "/" counted 15 processes there and ~50 in the others), showed "systemd-user-sessions.service (deleted)" as a unit of its own, and drew the header and top tables overlapping on a page ~340 px taller than its chart. The fork at 096d61a names a process whose comm is digits by its exe link's basename, says "/" for a process the kernel lists in no cgroup (before systemd mounts one), cuts " (deleted)", gives its font sizes a unit (CSS ignored them, so browsers drew every label at 16px), and sizes the page from what it draws. *What lab 45060814905 shows* (bench, spin's shape, v20261122.05, 3 boots): no process without a cgroup, "/" at 51 processes in each boot, no name of digits and no " (deleted)", and each page 40 px below its last row. The executor and the removed cgroup did not recur in these boots, so the fork's `--proc` tests are what show those two fixed. A name in parentheses such as "(systemd-user-)" is a child systemd forked, seen once before it exec'd: that is what it was then. *Status:* in place. + +**11-22 · lab · the boot chart's first sample, wait graph and legend (lab 45064083873, spin-stack/systemd-bootchart#10, #534).** The write graph in lab 45060814905 had the read graph's shape from 85 to 215 ms, in a boot whose tables said it wrote 0.0-0.1 MB. It read the right counter, `pgpgout`. As PID 1 the sampler starts before /proc is mounted, and its first samples held zeros. The first sample that read /proc then differed from zero by everything since the kernel started: 21 MB read, 124 KB written and 79 ms of CPU in one 5 ms interval. The IO graphs' 250 ms average spread that jump into a ramp, and the CPU and pressure graphs began with a full bar. The fork at 3125dea gives the samples before /proc the first counters it reads. It also drops the "CPU wait" graph, which summed every task's run delay, so on one vCPU it sat at its ceiling and read like a boot bound by IO (upstream #13). CPU pressure now sits under CPU utilization. The process graph's title says what its colours and dashed lines are (upstream #39), and the header's "Graph data" and "Sampler" lines are drawn at 12px instead of 8px. `--proc` tests hold three upstream reports that the fork already got right: a "(systemctl)" name kept whole (#44), no nameless process without /proc/PID/sched (#34), and a short-lived `@`/`:` template instance drawn (#40). Upstream #38's leaks are cppcheck not modelling `_cleanup_fclose_`. *What lab 45064083873 shows* (bench, spin's shape, v20261122.05, 3 boots, the fork's branch at 1f00a0f, whose tree 3125dea merged unchanged): `pgpgout` is 124 KB in every sample of every boot, and each write graph is empty. No chart has a wait graph, and each carries the legend and the 12px header lines. The read graph still starts ~20 ms before the first read, from its 250 ms average (#538). *Status:* in place. + +**11-22 · lab · a ledger of the boot to the first login, from a scheduler trace (labs 45062548343, 45062836688, 45062836494, 45063070048, #533, this change).** The boot chart samples every 5 ms, sees only processes and draws nothing of the login's ~65 ms after sshd's accept. The `ledger` probe records the scheduler's tracepoints from the kernel's start and cuts the kernel's clock into windows where the boot and the login change hands, each with its CPU by unit and its idle. The host's clock meets the kernel's through markers the guest writes on request, to ±0.15 ms. *The premise that broke:* the release kernel forces lockdown at confidentiality, which takes tracefs away (lab 45061089609), so the ledger runs on a kernel built from branch `ledger-533-kernel` with lockdown forced to none (parts run 45061289985), and no release gets a ledger until #536 decides how. *Cost* in spin's shape, 20 a side (lab 45063070048): first login +3.0 [−2.4, +15.9], within noise; console prompt +12.1 [+7.1, +17.6]; the kernel alone −1.0 [−9.5, +4.9]. *What six boots of v20261122.05 show* (labs 45062548343, 45062836688, bench, spin's shape): the kernel to PID 1's exec 83 ms, 72 of it in PID 1 before its exec, which is why the boot chart's init.scope (118-123 ms) is twice the ledger's 59 from PID 1's exec on. From PID 1 to the login's sshd-session, 171 ms: PID 1 55, idle 18, journald 18, unattributed (generators and executors) 17, logind 15. Between 110 and 151 ms, the stretch #521 read as the vCPU nearly idle on the disk, PID 1 runs 26 to 30 ms and the vCPU idles 7 to 13 while tasks wait on the disk. The login's 65 ms from sshd-session's exec to true's exit has no idle in it: sshd 20 ms, user@0.service 17, udevd 9, PID 1 4, journald 3. Root's manager (linger) starts as the connection arrives, and its 17 ms of CPU land inside the login's windows (#527). *Opened:* #536, #537. *Status:* in place. + +**11-22 · machine · a failed resume says whether the checkpoint is to blame, and a failed load does not (#516, this change).** spin decides from `Resume`'s error whether to drop a suspended workspace's memory, and only `*Refusal` was typed. *Read in QEMU 11.2.0-rc0's source:* `MIGRATION` carries the status alone, and every failure of a load ends at `process_incoming_migration_co`'s `fail:` label, its reason on stderr before QEMU exits: a section QEMU rejects, a file that ends early and a failed read on the host (both `-EIO` from `qemu_fill_buffer`), and userfaultfd refused to a fast load. So no new type was made for a failed load, and the cases `Resume` can pin on the checkpoint fold into `*Refusal`: a format QEMU does not read (part `format`) and a `Saved.Added` that does not parse (part `added`). A stream checkpoint asked to load on several channels is the caller's options, not the checkpoint, so it stays a plain error. `boot:record`'s truncated state asserts that it is not a `Refusal`. *Opened:* #546. *Status:* in place. + +**11-22 · image · root's manager without the XDG autostart generator (labs 45062836688, 45070208762, 45070150688, 45070973943, 45071003631, 45071003608, #527, this change).** v20261122.04's first login was +6.8 [+0.1, +13.6] over .03, and the cause is root's manager, which #467 starts in the boot and the first login waits for. That is correctness and stays. *What the manager does* (the ledger, lab 45062836688, v20261122.05, 3 boots, CPU before the login's end, p50): `user@0` 17.5 ms in all; systemd-executor and the PAM stack of `systemd-user` 4.6-5.0, of it `unix_chkpwd` 1.1; the manager from its exec to its generators 2.6; the environment.d generator 2.0; the XDG autostart generator 1.6; loading units 4.4; the first transaction to `Startup finished` 1.4. The rest of its 17-18 ms in the ledger runs after the login. The vCPU has no idle from ~155 ms to the login's end, so a millisecond of CPU cut there is a millisecond of the login's. A workspace needs the environment.d generator (it reads `10-user-sockets.conf`, the bus's address for user services, and `/etc/environment`), the sockets, and the PAM stack's account check, limits and audit uid. It does not need the XDG generator: a workspace has no graphical session. *Arms* (bench, spin's shape and login, against v20261122.06, 100 a side, interleaved, lab 45070150688): the XDG generator masked, first login −3.8 [−6.2, −0.7], accept to login −6.1 [−9.0, −0.3]; every cut above together, a bound, −9.6 [−13.3, −6.7]; no manager for root (`user-early-light`, no linger), a bound, −17.3 [−19.2, −12.4]. The two bounds match the ledger's CPU for what they remove, ~10 and ~17.5 ms, so the ledger's CPU is the login's time here. The ledger of the arms (lab 45070208762, 3 boots each) shows `user@0`'s CPU at 17.0-18.1 on the release, 15.5-15.7 with the XDG mask and 9.4-10.9 for the floor's cuts, so each edit removed what it named. The XDG arm's −3.8 is about twice the generator's 1.6 ms of CPU. Its disk wait went too: `user@0`'s disk time 11.9-16.2 against 8.8-10.6. The login waits for the manager to finish, so that wait is on its path (inferred from the two ledgers). The same mask measured −4.8 [−11.2, +1.3] at 20 a side in #467 (lab 45030778365), when the manager started inside the login, and was left out. Restored login −1.7 [−4.4, +2.2] evicted and −2.5 [−5.1, +1.9] cached, in noise (lab 45070973943, 20 a side). `boot:logind` and `boot:workspace` passed on the arm (labs 45071003631, 45071003608). *Changed:* optimize-systemd.sh masks `/etc/systemd/user-generators/systemd-xdg-autostart-generator`, and image/build.sh refuses a user generator's mask that masks nothing, as it does a system generator's. *Left:* what remains of #527 is function, and the cost of the correctness #467 bought. *Status:* in place. + +**11-22 · docs · spin's early login, each number against its own run's release (labs 44805051310, 44807457606, #363).** docs/boot-time.md set −59.4 from one run beside "the image's half alone −17.4" from another in one cell, and gave "−51 more" in a second cell, a difference between two arms rather than either against its release. They are two runs on two hosts, both against v20261120.03, 20 boots a side, spin's shape and login. Lab 44805051310 (spin-machine at 90a6543): `login-early` (ssh.socket, ssh.service, sshd-keygen and the probe's forwarder without default dependencies, logind and the broker without PrivateTmp) −10.8 [−16.3, −5.2], with `udev-startup` as well −59.4 [−65.9, −56.2]. Lab 44807457606 (at fbc7517): `--edit lane`, the image's half without the forwarder, −17.4 [−25.0, −8.5]; with `forwarder-early` as well −68.5 [−78.0, −61.8]. *Changed:* each cell names its run's arms beside their numbers, and no delta is taken between runs. + +**11-22 · lab · the boot's dependency view, and what fills the stretch before the first job (labs 45070438471, 45070718529, 45071125219, 45071549627, 45071102677, #521, #553, #554).** The bootchart probe now keeps `systemd-analyze critical-chain` of the login's units, the login user's manager's chain, and `systemd-analyze dot --order` among the chain's units, drawn by graphviz (docs/measuring.md, "Boot charts"). *The stretch from ~109 to ~146 ms* (debug boots with `systemd.log_level=debug systemd.log_target=kmsg systemd.log_ratelimit_kmsg=0`; without the last, systemd's own kmsg rate limit cut PID 1's lines at 118 ms): PID 1 loads every unit `multi-user.target` reaches, ~36 ms in those slowed boots, with 56 lookups of mount units that do not exist, and then computes a transaction of 79 jobs in ~0.4 ms. `UnitsLoadFinishTimestamp` is taken before that loading, so the plot's empty stretch is the loading. *dev-vda.device:* no unit queues a job for it, and nothing depends on it. It is `tentative` from PID 1's catchup (root is mounted from it) until udevd announces it, and the plot draws tentative as activating. *The chain to the login* on v20261122.06: the forwarder that stands for spin's supervisor waits for `basic.target`, 28-38 ms after `ssh.service` is active. Taken off it (`--edit forwarder-early`), it was active ~33 ms sooner, and the goal numbers did not move: cold +4.2 [+0.0, +11.0], restored −0.0 [−2.3, +2.3] (`prestart`, 20 a side). The login waits for systemd-logind next (#553). *Status:* the view in place. The forwarder row moved to "Measured and rejected". The release copy is open (#554). + +**11-22 · release/lab · each release's ledger, on a traceable kernel published beside it (parts run 45071066129, lab 45073394754, #536, #558, this change).** The ledger (#533) needs tracefs, which the release kernel's lockdown at confidentiality takes away, so it ran only on demand, on a kernel from a scratch branch kept as a run artifact that expires (`run:45061289985`). *Decided:* option 1 of #536 at release cadence. release.yml's `traceable` job builds the release's kernel source and config with `KERNEL_LOCKDOWN=none`. `release traceable-kernel` holds its config to the release kernel's, lockdown swapped and every other option equal. The job signs the bzImage and publishes it on the release as `…lab-only-traceable.bzImage`: in no tarball, in no SOURCES, in nothing spin boots. Options 2 (a `lockdown=` parameter) and 3 (on demand only) were not taken: 2 trades spin's compile-time guarantee for a command-line one, and 3 left no ledger per release. `lab tree --kernel traceable:TAG` checks the signature, `releases measure` takes one ledger of each release on that kernel beside its boot chart, and the record keeps it as `docs/releases/TAG-ledger.txt`. *Measured:* built as the `traceable` job builds it, the kernel passed the config check against the release kernel of the same job (parts run 45071066129). The ledger on it, with v20261122.06 and drawRelease's tree, gave 3 of 3 ledgers: 0 breaks, 0 events dropped, residue 0.6 ms p50 and first login 427 ms p50, in spin's shape (lab 45073394754). That release's record read 414.4 cold in the same shape, so the +13 is within the ledger's own ~16 ms. *Cost:* one cold kernel compile per release, 10 min after the release kernel's, in a job of its own so that pause and wake do not wait for it. report waits for it. A change that breaks the traceable build is first seen at release time (#558). *Status:* in place. The first release built with it is the first with a ledger. + +**11-22 · lab · the CPU weight while the boot runs, on user@0's chain and on two units off the login's chain (labs 45082870346, 45083184310, 45083106264, 45083184131, #553).** The cold login does not wait for logind on v20261122.07. In its ledger (lab 45082187351, 3 boots), logind is active within 1-13 ms of `basic.target`, before or after it. The login's session opens 2-4 ms after it is authenticated, and the session waits 0-5.6 ms for root's manager (`user-early`). The login waits for the forwarder's chain (journald → tmpfiles → `sysinit.target` → `basic.target`) and for the key exchange on a vCPU that idled 14 ms of the 185 from PID 1 to the connection (boot 2). The two arms were lab edits (`logind-weight`, `offpath-weight`), on the bench, spin's shape and login, interleaved against v20261122.07. *logind, `user-runtime-dir@` and `user@` at `StartupCPUWeight=1000`:* first login −9.2 [−16.1, −0.3] at 30 a side in a screening run of three arms (lab 45082870346). The run fixed in advance to decide it, the arm alone at 40 a side, read −3.6 [−10.3, +0.6] (lab 45083184310). Accept to login was −7.7 [−14.0, −4.0] and sshd accepting +8.8 [−1.1, +13.3]. In its ledgers (lab 45083106264), logind is active ~9 ms sooner and `sysinit.target` ~18 ms later (p50 of 3). The weight moves the vCPU from the forwarder's chain to the manager's, and the login needs both. Restored, in noise: −1.2 to +0.1 (lab 45083184131, 20 a side). *`spin-machine-sshd-keygen` and `systemd-udev-load-credentials` at `StartupCPUWeight=1`:* sshd accepting +22.6 [+15.9, +33.5], first login +3.4 [−3.2, +14.6]. ssh.service waits for the keygen, which finished 45-70 ms later (lab 45083106264), and the forwarder waits for ssh.service. The keygen is on spin's path, not off it. Both together +6.0 [+0.5, +15.1]. Under cgroup v2, a weight is shared with the unit's siblings: `user@0` competes in `user-0.slice`, and `user.slice` competes with `system.slice` and `init.scope`. `StartupCPUWeight=` holds until the boot's jobs are done, and on spin's path the getty's wait for `dev-ttyS0` keeps them running past the login. *Decided:* neither is kept, and both rows are in "Measured and rejected". On one busy vCPU, a weight only changes which chain waits. What the login needs before it is the CPU it takes. *Status:* the edits are removed. + +**11-22 · machine · what a guest sends on the pressure port is bounded in time (#559, spin-stack/spin#1597, this change).** spin's security review, adopting the probe, found the guest's bytes bounded in size (128-byte lines) and count (one connection per CID) but not in time, which spin's I7 asks for: a guest's root writing `stall memory 1 1 1` in a loop kept a host goroutine busy on the runner's CPU, a dial-and-drop loop left one goroutine and timer per connection waiting `answerWait` with one `GuestLost` each, and `hello oom=0` then `oom 18446744073709551615`, again on each connection, reset the base and wrapped the reported kills. *Changed:* each watch paces its guest's lines (64 at once, 16 a second) and connections (4 at once, 1 a second) with a token bucket, sized from the sender: a Stall at most once a 1 s window for each of three resources, an OOM line only in an OOM storm, and a dial 1 s after an end. A guest over the line pace is cut off with `ErrGuestTooFast` rather than having lines dropped and counted: the counters are totals, so its next hello and Stall lose nothing, and the end needs no new field to say what happened. A connection over the accept pace is closed and the one held stays. One `GuestLost` waits per watch, and later ends give it their error. A count or `Total` below the last heard is ignored, and `internal/pressure` saturates microseconds past a `time.Duration`. *Measured:* nothing; no guest's path changes, since the sender starts 10 s after boot. *Status:* in place. + +**11-22 · machine · CPUID leaf 2 with QEMU's cache descriptors (#565, labs 45082640147, 45082640186, 45083473855, 45083473790, 45083754801, this change).** *Why:* nesting costs ~50 ms of the cold first login, and #565 profiles a boot's exits by reason on both hosts with the new `exits` probe. Both hosts make the same ~10,400 exits, and nested ones cost more. CPUID was the most frequent: 3805 exits, 3549 of them below the guest kernel's half. Every process glibc starts asks for its cache sizes 12 times (glibc 2.42, `dl-cacheinfo.h`, `handle_intel`), and QEMU's leaf 2 answered 0xFF ("see leaf 4"), so each query walked leaf 4's subleaves, 1797 exits. *Changed:* `-cpu` carries `x-consistent-cache=off`, so leaf 2 holds QEMU's descriptors for the same caches leaf 4 describes (`env->cache_info`), and glibc reads them there. (Not under `host`: leaf 2 described `legacy_intel_cpuid2_cache_info`, a 2 MiB 8-way L2 against leaf 4's 4 MiB 16-way, corrected 11-23, #586.) *Measured* (bench, nested, spin's shape, against v20261122.06 with spin-machine `exp/cpuid2-descriptors` at ee005ce): CPUID exits 3727 → 2176, every exit −1541 [−1695, −1380] (3 a side). First login −10.3 [−14.2, −4.0] at 40 a side, a second login −1.1 [−1.6, −0.7]. The restored login +1.0 [−3.9, +4.4] evicted and −0.4 [−4.6, +1.6] cached, both within noise, at 30 a side. That is ~6.7 µs an exit removed, against 1.94 µs in the nested L1, so the two L0 trips around an exit cost ~4.7 µs (inferred). *The record:* `machine.CPU` reads feature bits, and `x-consistent-cache` is a switch, so the record does not move. A guest moved across the change reads the same cache sizes from either leaf. *Opened:* #566 (the MMIO accesses), #567 (HZ), #568 (memory's first touch). *Status:* in place. + +**11-22 · image/lab · no host key made when spin hands over its own (labs 45086250796, 45085877480, 45085877238, 45085886063, 45086216266, #515, spin-stack/spin#1650, #573).** spin already makes, pins and hands over the workspace's host key. vminitd makes an Ed25519 key, the launch claim carries its public half, the control plane connects with it fixed, and before it execs systemd vminitd writes it to `/run/spin/ssh/ssh_host_ed25519_key` with a drop-in naming it sshd's only `HostKey`. The image's `spin-machine-sshd-keygen` still ran on ssh.service's path, 6.2 ms of CPU (ledger, v20261122.07), for a key nothing loads. So the brief's plan (a systemd credential through fw_cfg, a Spec field and a kernel option to read it, spin making the key on the host) was not needed. *Changed:* the unit carries `ConditionPathExists=!/run/spin/ssh/ssh_host_ed25519_key`, read back by build.sh. `ssh.service.wants/spin-machine-sshd-keygen.service`, a symlink checked in since `2df3dbf` that #515 could not trace, wanted the unit a second time and is gone. The sysinit want stays for the lane. The lab's `--edit spin-handoff` stands in for vminitd's handoff: a fresh key per boot, made on the host, and a shell as PID 1 that places it and execs systemd. *Measured:* on the bench, spin's shape and login, against v20261122.07, both arms with the handoff. At 60 a side the first login read −6.8 [−11.8, +0.2] (lab 45085877480), under the ~6 ms ceiling's noise, so the run that decided it took 120 a side: first login −6.9 [−9.6, −2.4], sshd accepting −6.8 [−10.4, −1.8]. In the same run, the ssh.service want taken away read −1.6 [−3.7, +4.3], which rule 5 deletes (lab 45086250796). Restored, 20 a side: restored login −0.6 [−3.1, +4.7], cold −9.0 [−16.3, +2.8], within noise (lab 45085877238). `boot:logind` and `boot:workspace` passed on the arm (labs 45085886063, 45086216266). *Opened:* #575, because `login=spin` does not hand over a key, so its probes still pay the keygen. spin-stack/spin#1650 records `HostKeyPath` as the image's contract. *Status:* in place. The arms' edits (`keygen`, `keygen-unwanted`) are removed. + +**11-23 · lab · `login=spin` hands over spin's host key (labs 45088516505, 45088516571, 45088516492, #575, this change).** Since #573 the image's host-key generation steps aside when spin's handoff has placed spin's key, and spin's vminitd always does. `login=spin` did not, so every probe on spin's path paid the keygen spin's own path skips, ~7 ms (#515's −6.9). *Decided* (the maintainer, #575's first option): the handoff is part of `login=spin`. Its overlay carries the drop-in naming `/run/spin/ssh/ssh_host_ed25519_key` sshd's only `HostKey` and a fresh key per boot, made on the host, and every boot on spin's path runs a shell as PID 1 that places the key and execs systemd (`Key.Init`). The `spin-handoff` edit is gone, and a tree's own `--append init=` still comes after the handoff's. *The stand-in's cost:* the shell runs three execs (two mounts and a `mkdir`) and writes the key with builtins. The ledger gives it a window of its own, `handoff`: 6.3, 7.3 and 7.9 ms from its exec to systemd's in three boots (lab 45088516505, bench, spin's shape, v20261123.01 on its traceable kernel). Of the 7.3, 3.3 ms was idle on cold reads of the shell, `mount` and their libraries, 2.7 the mounts and the `mkdir`, and 1.1 the shell. systemd mounts `/proc` and `/run` itself when no one has, so part of that is work moved, not added. vminitd does more before systemd on spin's path, and the lab measures none of it. *What moves:* a release that skips the keygen now reads it on spin's path. v20261123.01 does not carry #573 yet, so the first release that does will read ~7 ms against the one before it, from the image, not from the probe. Every probe ran with the handoff: ssh-first on v20261122.07 and v20261123.01, 20 a side, first login 430 and 416 (lab 45088516571), restore-first on v20261123.01, restored 82.3 evicted (lab 45088516492). *Status:* in place. + +**11-23 · image · systemd's first patch: drop-in candidate names derived once (labs 45090299768, 45090326943, 45091690423, #574, this change).** #574's second experiment. PID 1 spends most of its loading in `unit_file_find_dirs()`, once for every unit name or alias, lookup directory (~12) and drop-in suffix (4), and each call worked out the unit's candidate names again: the name, its template, its "-" prefixes. Upstream's #42858 (Eric Curtin, merged 2026-07-25, in v262) works them out once per name, `manager_enumerate()` 45.35 → 38.81 ms in its author's container (50 runs, ~270 units). Yocto backported it to 259.5, with an unrelated `CONF_FILES_WARN` change beside it, so the backport here is upstream's commit with one removed line's context moved to 259's `set_get()`. *Measured* (bench, spin's shape and login, v20261123.01, each arm systemd rebuilt on the runner, against a control rebuilt with a comment and no code changed, so both install their packages the same way): first login −6.5 [−9.9, −1.3] at 100 a side, sshd accepting −6.1 [−10.0, −1.1] (lab 45090299768). PID 1's CPU from its exec to the login's sshd-session, 55.1-57.8 ms on the control and 48.1-53.4 with the patch, 5 ledgers each (lab 45090326943). Restored, 20 a side: −0.9 [−4.3, +3.0] evicted, −1.4 [−5.0, +2.1] cached, within noise (lab 45091690423). *Changed:* image/systemd carries its first patch, applied without fuzz after Ubuntu's, as image/openssh does; the Dockerfile fails when it does not apply or its function is not in the source; the release ships it under `usr/share/spin-stack/systemd/` and names it in SOURCES, NOTICE and the SBOM's pedigree. A bump to 262 drops it. *In the same run:* #574's third experiment, no unit made for a `RequiresMountsFor=` prefix with no unit file, read −1.0 [−4.3, +3.9], and PID 1's CPU did not move: rejected, in "Measured and rejected", with the patch and an upstream draft kept in #580. *Status:* in place. + +**11-23 · lab · a probe saves once the guest's boot has finished (lab 45095349849, #578, this change).** Every probe that restores took its checkpoint right after the cold login, while the boot's last jobs still ran, and each restore of that state ran them beside the login it timed. *Decided* (the owner, #578): spin checkpoints an empty workspace, a project's workspace or a prebuild long after its boot, never mid-boot, and restore-first measures that. `bootFinished` now waits, over SSH as the probe's user, for `systemctl is-system-running --wait`, then for `multi-user.target` active with no job queued, then for the user manager's own `is-system-running --wait`. The middle step is there because the manager calls its start finished when its queue first empties, which a `Type=idle` unit starting the rest of the boot (#581) finds. docs/measuring.md, "When a checkpoint is taken", is the definition. restore-first, prestart, restore-together, run-delay and transport wait for it. restore-first records it as `finished`. *Measured* as three rows of one tree, so one run compares the probes (bench, nested, spin's shape and login, v20261123.01 with its own spin-machine, 40 each interleaved, lab 45095349849, branch `exp-save-rows`, not for merge): saved finished against saved at the login, restored login 83.8 → 79.0, −4.9 [−7.3, −3.8], `running` +0.3 [−0.6, +1.4], the state +4.5 MiB [+4.3, +4.9], save −13.5 [−15.2, −12.2]. The boot finished 85.6 ms after the login it used to be saved at. A further 3 s settle moved neither the state (−0.0 [−0.4, +0.3]) nor the restored login (+0.4 [−0.6, +1.3]), so the probe waits for nothing after finished. *What moves:* the restore rows step down ~5 ms at this change, from the probe and not the machine, as with #451. The ladder boots every release with the probe of the run, so a ladder stays comparable within itself. Compare a restore measured before this change only within one run. *Status:* in place. + +**11-23 · image · the first login's target (labs 45089584735, 45089584596, 45090246240, 45090246267, 45091658603, 45091658388, 45098372930, 45098372897, 45098372904, 45098373025, #574, #578, spin-stack/spin#1653, this change).** #574's first experiment. On one vCPU every unit started before the first login is on its clock, so the boot's default target becomes `spin-machine-login.target`, which wants only the login's units (ssh, its keygen, the vsock socket, journald, logind and its Varlink socket, the bus, `/tmp`, spin's supervisor by name), each without default dependencies, and `spin-machine-boot-rest.service` starts `multi-user.target` once the boot's first jobs are done (`Type=idle`). Every unit still runs. *Bound* (the rest 3 s later, the forwarder off `basic.target`): −55.5 [−63.0, −51.6] at 20 a side (lab 45089584596); in its ledgers PID 1's CPU before the login 55 → 38 ms, and udevd, its trigger, tmpfiles, sysctl and user-sessions gone from before the login (lab 45089584735). *Triggers,* the supervisor early, 20 a side (lab 45090246267): idle −59.2, a 2 s timer −66.5, sshd's PAM stack −52.0 with accept to login +15.3; the same PAM trigger with the supervisor as spin orders it −20.8. Idle is kept: it is systemd's own "after the boot's jobs", and the timer's 2 s is arbitrary. *Found:* logind's Varlink socket has to be in the target, since systemd refuses to start a socket whose service runs; without it `boot:logind` failed (lab 45090950033). `lab check` now boots a tree's edits, made in an image of its own: before, a check booted the tree's base image and ignored them. *Carried form,* against v20261123.01, 40 a side (lab 45091658603): cold −17.7 [−26.2, −11.7], accept to login −11.8; with the supervisor off `basic.target` −42.6 [−50.2, −38.4]. Restored, 20 a side (lab 45091658388): +3.1 [+0.9, +5.4] evicted, +2.2 [−1.6, +5.4] cached; an earlier run read +8.1 and +4.6 (lab 45090776228). `boot:workspace` and `boot:logind` pass (labs 45091658629, 45091658828). *Decided* on v20261123.02, with the probe that saves once the boot has finished (the entry above), bench, nested, spin's shape and login, 40 a side, branch `exp-581-finished` (this change and that probe), tagged `archive/exp-581-finished`. ssh-first (lab 45098372930): first login −21.5 [−26.4, −15.5], sshd accepting −10.0 [−16.2, −3.7], accept to login −10.7 [−12.9, −8.2], second login +0.0 [−0.8, +0.6], QEMU's RSS −1.9 MiB. restore-first (lab 45098372897): restored login +1.1 [−6.0, +5.2] evicted, +2.2 [−10.6, +12.9] cached, both within noise; the state and the save within noise; `finished` +35.2 ms, since the rest of the boot runs after the login. The earlier run's restored +3.1 was the probe saving while the rest of the boot still ran (#578). `boot:workspace` and `boot:logind` pass on it (labs 45098372904, 45098373025). *The console prompt* +15.5 [+11.5, +19.0]: the serial getty is in `multi-user.target` and now follows the login. It does not count against the change: nothing a workspace does waits for the getty, and no goal number moves with it. *spin's supervisor off `basic.target`* (the same run, the probe's forwarder with `forwarder-early`'s drop-in): first login −45.3 [−50.2, −39.4], sshd accepting −66.3, but accept to login +21.0 and the second login +43.7 [+41.1, +46.1]. The first login then comes before the boot's first jobs are done, and `Type=idle` starts the rest exactly when the second login comes, so its cost moves from the first login to the second. Restored within noise (evicted +0.4). That half is spin's to decide (spin-stack/spin#1653); on a release with this target, `--edit forwarder-early` reruns it. *Removed:* the lab's `login-target` and `login-target-spin-early` edits, which put this checkout's target into a release that lacked it; the open row for unit loading at boot, which this answers. *Status:* in place. + +**11-23 · lab · each MMIO exit put on the guest code that made it (labs 45098316459, 45098579511, 45098880914, 45098879979, #566, this change).** `exits` now keys the MMIO and port exits by `guest_rip` and names each one's function through the guest's own kallsyms. A tree booting the traceable kernel with `ftrace=` keeps the guest's trace, so the accessors' callers come with stacks. The trace does not move the counts: 3,104-3,129 EPT_MISCONFIG exits with it and without it. *Found* (bench, nested, spin's shape, v20261123.01): IOAPIC 625, ~576 of them in `apic_intr_mode_init`, where the 24-pin table is read four times and written twice (#590). ECAM 1,078 exits: enumeration 469 accesses, virtio-pci's capability walk 258, `pci_save_state` at add 128, ACPI AML 65, MSI-X enable 64 (#591). virtio's BARs: ~527 emulated at device setup and ~205 MSI-X table writes. About 650 ioeventfd notifications, ~500-650 of them the root disk's requests and ~95 vsock resets to the probe's dials (#592). Port I/O: `rtc_cmos_read` 106, ACPI's ports 137, serial 83, firmware and decompressor 277. *Measured and rejected:* a 1 MiB readahead on the root disk (`opt_io_size=524288`) left the notifications as they were (895 → 927) and the first login at +1.4 [−2.7, +8.0], 40 a side. *Status:* the probe's change is in place. Every lever left is a kernel patch of ~1-3 ms, each in its issue. + +**11-23 · machine · the record holds the vCPU's properties that shape CPUID (#569, CI run 45099128633, this change).** *Why:* #565's `x-consistent-cache=off` changed CPUID leaf 2, and the record did not move: `machine.CPU` read feature bits only, so a checkpoint taken on one side of the change resumed on the other without a refusal. *Read* (QEMU 11.2.0-rc0's `target/i386/cpu.c`, `host-cpu.c`, `kvm/kvm-cpu.c`, 2026-11-22): the vCPU's properties that shape CPUID without being a feature bit, and of those, the ones `-cpu` sets or the host model takes from the host. #565's claim that a guest reads the same caches from either leaf does not hold under `host`. `legacy-cache` is on there, so with the switch off leaf 2 describes `legacy_intel_cpuid2_cache_info` (L2 2 MiB 8-way) while leaf 4 describes `legacy_intel_cache_info` (L2 4 MiB 16-way). glibc reads a 2 MiB L2 since v20261123.01 (#586). *Changed:* `CPU.Properties` holds `cpuidProperties`, read off the vCPU in the qom-list-get `CPU` already made: `x-consistent-cache`, `l3-cache`, `legacy-cache`, `host-cache-info`, `family`, `model`, `stepping`, `model-id`, `level`, `xlevel`, `phys-bits`, `guest-phys-bits` and `pmu`. `CanResume` refuses each difference as `cpu `, and refuses a property only one side has. `TestTheRecordHoldsWhatTheCPUIsGiven` fails a `-cpu` option that is neither a feature, a feature filter (`migratable`, `enforce`) nor held. *Compatibility:* a record written before this change holds no property, and is refused by each, `cpu x-consistent-cache: checkpoint none, here false` among them. The record names no release, and v20261122.07 (switch on) and v20261123.01 (off) run the same QEMU, 11.2.0-rc0, so nothing in an old record says which side of the switch it was taken on. Reading it as either value would let the other side's checkpoints through. Every checkpoint saved by a released spin-machine boots cold once. `boot:compat` saves each release's checkpoint with this tree's spin-machine, so it reads each release's own switch. With this change alone, v20261123.02 and v20261123.01 resumed and v20261122.07 was the first it refused, `cpu x-consistent-cache: checkpoint true, here false` (CI run 45099128633). The entry below rides in the same record change, and moves the first refused release to the newest. *Opened:* #586 (leaves 2 and 4 disagree under host), #587 (`Unshared` ignores the properties), #588 (leaf 0xA is the host's PMU and nothing holds it). *Status:* in place. + +**11-23 · lab · `login=spin`'s forwarder is `spin-supervisor.service` (release run 45100012702, labs 45103075446, 45103442674, 45103464996, #598, this change).** The release run's ladder read v20261123.03, the first release with the login's target (#581), about +50 ms worse cold than v20261123.02: first login ~446 against ~396, sshd accepting ~402 against ~340, the restore unmoved (release run 45100012702, its record in #598). The lab had measured #581 at −21.5 [−26.4, −15.5] (lab 45098372930). *Found:* the edit that measured #581 linked the probe's forwarder into the new target, "as spin's would", and was removed with #581's merge. The target wants spin's supervisor by its name, `spin-supervisor.service`, which spin's vminitd links into `/run/systemd/system` before systemd starts (spin-stack/spin's `internal/guest/vminit/handoff`). `login=spin`'s stand-in was `spin-lab-forward.service`, wanted by `multi-user.target` alone, so on .03 it started only once `spin-machine-boot-rest.service` queued the rest of the boot. Bootchart of .03 on main's probe (lab 45103075446, bench, spin's shape, 1 boot): the forwarder active at 221 ms of PID 1's clock, `ssh.service` at 78, nothing on its chain between them. The ladder measured the stand-in's wiring, not the machine. *Changed:* the stand-in is installed as `spin-supervisor.service`, with spin's unit's default dependencies and `WantedBy=multi-user.target`, and `TestTheImageStartsLoginSpinsSupervisorWithTheLogin` fails when the image's login target does not want the unit `login=spin` installs. With it, the forwarder was active at 160 ms, behind `sysinit.target` as spin's unit is (lab 45103464996, 1 boot). *Measured again* through `releases measure v20261123.03` on this change (report run 45103442674, bench, nested, spin's shape and login, 20 a side): first login −17.8 [−27.9, −8.1], sshd accepting −9.5, accept to login −10.0, second login −0.7 within noise, restored login +0.4 [−1.4, +2.6] within noise; the console prompt +20.4, the serial getty following the login as #581 says. *The record:* #598 carries the stand-in's reading. `releases propose` does not propose a release twice, so once this is on main #598 is closed, its branch deleted, and report.yml dispatched on main with `versions=v20261123.03 record=true`. *Status:* in place. + +**11-23 · machine, qemu · leaf 2 describes the caches leaf 4 does (#586, labs 45100482399, 45101932202, 45101932224, 45101932173, 45101932449, 45101932412, 45101932286, #594, this change).** *Why:* #565 claimed that with `x-consistent-cache=off` leaves 2 and 4 describe the same caches. *Seen in a guest* (bench, nested, spin's shape, v20261123.02, lab 45100482399): leaf 2 EDX 0x2c307d, ECX 0x4d, so glibc read a 2 MiB 8-way L2 (descriptor 0x7D) while leaf 4 and the guest's kernel said 4 MiB 16-way. L1 and L3 agreed, and so did every threshold glibc derives (`shared_cache_size` 16 MiB, `non_temporal_threshold` 8 MiB, the same before #570), because QEMU's legacy L3 is inclusive and glibc adds the L2 to the shared size only for a non-inclusive one. What moved is `sysconf(_SC_LEVEL2_CACHE_*)`. The host's caches (Xeon 6975P-C, read on the runner) are L2 2 MiB 16-way, L3 480 MiB: neither leaf is the host's, and neither was before #570. *Options read and run:* `legacy-cache=off` is refused under `host` (`CPU model 'host' doesn't support legacy-cache=off`), since only a named model has a cache model of its own. `host-cache-info=on` passes the host's leaf 2 through, 0x00feff01, whose 0xFF sends glibc round leaf 4 again: CPUID exits 2371 → 4087, every exit +1693 [+1657, +1825] (lab 45101932224). No option keeps the descriptors and makes them agree. *Changed:* `qemu/patches/0006` (#594) adds `x-legacy-cpuid2-cache`, default on as QEMU is; off, leaf 2 encodes `env->cache_info` (0x2C, 0x30, 0x49, 0x4D). `-cpu` sets it off and `cpuidProperties` holds it, in the same record change as #569. *Measured* (bench, nested, spin's shape, against v20261123.03, whose leaves disagree, with ctl = #569's spin-machine on the patched QEMU): leaf 2 EDX 0x2c3049, ECX 0x4d, and glibc's L2 4194304/16, the kernel's 4194304/16, its thresholds unchanged (labs 45101932202, 45101932412). CPUID exits 2371 → 2406-2449, leaf 2 and leaf 4 still 12 and 4 a process: two more processes in the fix's boots, not a dearer one (inferred); every exit +13 [−143, +96] (3 a side). First login +0.6 [−6.1, +5.5] against the release, +0.4 [−7.5, +5.8] for ctl, 40 a side (lab 45101932173). Restored login evicted −2.1 [−6.1, +5.2], cached −1.7 [−4.3, +1.7], 30 a side (lab 45101932449). *Compatibility:* no release's QEMU has the switch, so the record refuses every release's checkpoints by it; #569 already refused every checkpoint a released spin-machine wrote, so spin's checkpoints boot cold once. `boot:compat` refuses v20261123.03, the newest release, first: `cpu x-legacy-cpuid2-cache: checkpoint none, here false (same)` (CI run 45104443218). *Status:* in place. + +**11-23 · release · a regressed release is withdrawn, never deleted (#595, spin-stack/go-tools#139, spin-stack/ship-it#45, this change).** Releases come several times a day, and report.yml measures each one once it is published. Until now nothing stopped a consumer from adopting one that measured slower. *Decided:* a withdrawal marks the release and deletes nothing. The release becomes a GitHub prerelease titled "(withdrawn)", with the reason and the issue at the top of its notes. Its record gets `withdrawn`, the page names it, and the newest release not withdrawn becomes GitHub's latest (`releases withdraw`/`restore`, `withdraw.yml`, run only by a person). Assets, `SOURCES`, signatures, provenance, the record and its charts stay, and compat goes on resuming the release's checkpoints, because a withdrawal says nobody should adopt it, not that it does not resume. The next release is measured against the newest release not withdrawn, and its `against` says which. *The rule* (docs/releasing.md, "Withdrawing a release"): either goal number's Δp50 against the release before it, with its interval wholly above 0, or a failed functional check, unless docs/log.md accepts the cost, as #505 did for v20261122.04's +6.8. At 20 boots a side about 1 in 40 flags of each number is noise, so report.yml's `releases flag` opens an issue with the Δs and the commits between the two releases, and a person decides. A prerelease is what the consumers already skip, read 2026-11-23. go-tools' `github-release` track reads GitHub's `/releases/latest`, which is never a prerelease. ship-it's release list leaves prereleases out. Here, `LatestRelease` and the notes' "what changed since" leave them out too. go-tools#139 is the pin already on a release that was then withdrawn, which `versions check` reads as behind an older release. ship-it#45 is spin's proposal, opened at publish, before the withdrawal. #595 is the `pause` job's functional checks, which open no issue yet. + +**11-23 · image · the inventory's blind spot was mkosi (#518, image build on #517, this change).** #518 asked the inventory to tell a path a package ships from one it only lists, because `/etc/systemd/system-generators/systemd-gpt-auto-generator` is in `systemd.list` and an image built without `optimize-systemd.sh`'s link to it had none. *Read* (2026-11-23): Ubuntu's `debian/rules` makes that link with `dh_link`, and `systemd_259.9-0ubuntu0.1_amd64.deb` carries it (`dpkg-deb -c`), so the package ships it and a `.list` holds only what the package's data does. mkosi 27.1's `installer/apt.py` unlinks it after every install, to turn gpt-auto on in mkosi's own images. The image's link puts back Ubuntu's mask, so the inventory is right not to list it, and it did see the deletion, as `deleted /etc/systemd/system-generators/`. Comparing against md5sums would have done harm: md5sums lists no symlinks, so every link a package ships would read as added. *Changed:* docs/image.md's inventory note and generator row say so; nothing in `image/`. *Status:* #518 closed without a change to the inventory. + +**11-23 · kernel · `CONFIG_HZ_250` removes 587 exits and no time from the login (#567, parts run 45110306519, labs 45111418504, 45111452844, this change).** *Why:* #565's profile counted 1043 TSC-deadline writes and 827 preemption-timer exits at HZ=1000, and #567 inferred ~3.5 ms from ~500 of them at ~7 µs a nested exit. Firecracker's x86_64 guest configs and Cloud Hypervisor's `ch_defconfig` build at 250, with no number published for it. *Measured* (bench, nested, spin's shape and login, v20261123.04 against the same release with a kernel built at `HZ_250`, branch `exp/567-hz250`): every exit −587 [−608, −445] at 3 a side, of them MSR writes 1018 → 755, preemption-timer exits 691 → 482, HLT 332 → 298 and external interrupts 396 → 360; the host's KVM handled them in −0.6 [−8.1, +7.3] ms less. The first login −0.6 [−5.9, +3.1], sshd accepting −1.4 [−7.7, +3.2] and the console prompt +4.7 [+0.4, +7.8] at 60 a side. *Why the inference missed:* a tick's MSR write and its preemption-timer exit take 1.0-1.5 µs each in the L1, against ~10 µs for an MMIO exit and ~18 for a port exit in the same profile, so ~7 µs an exit is the price of an exit handed to QEMU, not of every exit. *Status:* rejected; `HZ_1000` stays. Archived as tag `archive/exp-567-hz250`. + +**11-23 · image · Docker's packages pinned (#511, #609, Parts run 45111218531).** `install-dev-tools.sh` installed Docker's packages at whatever Docker's repository served that day and fetched its signing key with no hash. *Changed:* each `.deb` in Docker's resolute pool is a `download` in `versions.yaml`, by version and SHA-256, handed in as build arguments with no default and checked before apt installs it. There are six, not the five #511 named, because `docker-ce-rootless-extras` came in unpinned as docker-ce's recommend. The pins are v20261123.04's versions, and each SHA-256 is the one in Docker's `Packages` index, whose `InRelease` verifies against Docker's key. The build no longer reads Docker's repository. The key and the apt source a workspace's `apt upgrade` uses are files in `rootfs/`, the key unchanged from what Docker serves (fingerprint `9DC858229FC7DD38854AE2D88D81803C0EBFCD88`, no expiry). It is not a `versions.yaml` entry, because a `download` needs a version in its URL and the key's has none. *Proved:* one changed character in docker-compose-plugin's pin stops the image build at `sha256sum: WARNING: 1 computed checksum did NOT match` (Parts run 45111218531, branch archived as `archive/511-wrong-pin`). *Status:* in place. + +**11-23 · image · containerd's config is containerd.io's own (#510, labs 45111391250, 45111705358, 45112037022, this change).** The image replaced containerd.io's `/etc/containerd/config.toml`, which disables CRI, with one that enabled it, a v3 schema with the v2 plugin name, with no consumer named since `2afac47`. dockerd does not use CRI. *Decided* by the owner (#510, option b): containerd.io's file. *Measured* with an overlay edit that wrote the package's setting over the image's (bench, nested, spin's shape and login, against v20261123.04, 20 a side): first login −4.9 [−12.2, +1.6], sshd accepting −5.0 [−12.1, +1.2], both within noise (lab 45111391250). Restored login: evicted −0.6 [−2.1, +1.5], cached −0.5 [−2.1, +0.9], both within noise (lab 45112037022). Neither number can see the file, because containerd starts at a workspace's first docker command (inferred). `boot:workspace` passed on that tree, with docker running a container (lab 45111705358). *Changed:* the image's file is deleted. A workspace that wants CRI, for crictl or a kubelet, writes its own config. *Status:* in place; the experiment branch is archived as `archive/510-containerd`. + +**11-23 · image · docker.socket is Docker's own, 0660 and group docker (#509, labs 45111147182, 45111147449, 45111146715, 45111146865, 45111146854, 45111146735, 45111708456, this change).** *Why:* the image carried its own `docker.socket` since the first commit (`2afac47`), with no recorded reason, at `SocketMode=0666`, `SocketGroup=root`. Any local uid reached dockerd, which is root on the guest: a service's DynamicUser, `nobody`, a sandboxed command running as another uid. Docker's own unit is 0660, group docker, and `spin` is in docker. *Changed:* the image's unit and `optimize-systemd.sh`'s link to it are deleted, so the link docker-ce's postinst made to its own unit stands. `boot:workspace` asserts the socket is `660 root:docker`, that `spin` runs a container through the group, and that uid 65534 with no groups is refused. On v20261123.04 as released the two new checks fail (`666 root:root`, the refusal not refused; lab 45111708456) and with the change they pass (lab 45111146854). *Measured* (bench, nested, spin's shape and login, against v20261123.04, the change as an overlay edit, 20 a side): first login +1.7 [−5.3, +10.0], sshd accepting +1.5 (lab 45111147182); restored login +0.4 [−0.6, +1.3] evicted, +0.3 [−0.3, +0.8] cached (lab 45111147449). Both within noise, so it goes in on function. *Second arm, rejected:* the image's `containerd.socket` out of the boot transaction, against Docker's socket alone: first login +7.4 [−4.7, +15.3] (lab 45111146715), prestart within noise in every row (lab 45111146865). Both sockets start in `sockets.target`, after the first login since #581, so there was nothing on the clock to take. `boot:workspace` passed on that arm too (lab 45111146735). Prior art: upstream containerd binds its own socket and its unit has none; SUSE carried a `containerd.socket` from a 2016 socket-activation patchset never merged upstream. In "Measured and rejected". The experiment edits lived on `exp-509`, tagged `archive/exp-509`. *Status:* in place. + +**11-23 · lab · the ledger splits the span before the kernel's clock (lab 45110630795, #537, #611, this change).** The ledger had one span from the moment before QEMU is exec'd to the kernel's 0, ~20 ms longer than `boot:firmware-stages`' 73.7 ms, and docs/measuring.md read the 20 ms as spin-machine's start and the held start, inferred. Now the host watches spin-machine's children for QEMU's exec (a bracket of ±0.11 to 0.14 ms), and the kernel's "kvm-clock: using sched offset" line puts the guest's first instruction at the kernel's 0 less it. *Six boots of v20261123.04 on its traceable kernel* (bench, spin's shape): spin-machine to QEMU's exec 2.1 ms, QEMU's exec to the guest's first instruction 49.4, the guest's first instruction to the kernel's clock 47.4 (63.2 on the run's first boot: its ~15 ms more are all in that part). *The premise that broke:* the 20 ms are not before QEMU. They are after its exec, on a machine that firmware-stages does not boot (#611). *Status:* in place. + +**11-23 · lab · the boot chart's IO graphs draw each 5 ms on one scale (spin-stack/systemd-bootchart#11, labs 45110751133, 45113479570, #538, this change).** The fork averaged 250 ms around each IO bar and scaled each graph to its own peak. A 5 ms read burst came out as a plateau over the whole chart, and the boot's one 164 KB write filled the write graph for 150 ms. The three boots of lab 45110751133 were replayed through `--proc` and drawn both ways. Unsmoothed on one scale, the ~8 MB burst at the chart's start, the later read bursts and the write each appear where they happened and at their sizes against one another. The other drawing shows none of that, so the fork now draws this one. Lab 45113479570 is the pinned fork's chart of v20261123.04, three boots. *Status:* in place. + +**11-23 · kernel · the IOAPIC's table read once takes 384 exits and no time the login can show (#590, parts run 45111505269, labs 45113437048, 45114405201, 45115330128, #627, this change).** *Why:* #565's profile put 576 IOAPIC MMIO exits in `apic_intr_mode_init`: the 24 redirection entries read four times and written twice (the x2APIC path's save and restore, the ExtINT search, `clear_IO_APIC`'s read, mask and verify). *Built:* a patch (branch `exp/590-ioapic-once`) that reads each entry once for the ExtINT search and the clear, skips the clear's write and verify for an entry already masked and clear, and has `enable_IR_x2apic` restore only when `mask_ioapic_entries` masked something. Every entry is still read, so a kexec'd kernel or other firmware is handled as before. The last 96 reads, reusing the save's copy, were left: the copy goes stale when remapping masks entries. *Measured* (bench, nested, spin's shape and login, against v20261123.04): IOAPIC accesses 589 → 205 (`native_io_apic_read` 397 → 205, `__ioapic_write_entry` and `ioapic_mask_entry` 96 → 0), every exit −322 [−394, −222], the host's KVM handled them in −3.1 [−6.2, −1.1] ms less (3 a side). The first login −4.5 [−7.8, +0.4] at 60 a side and −2.0 [−4.3, +0.6] at 120, both within noise. They are KVM's in-kernel IOAPIC, ~11 µs each in the L1, so ~384 of them are 4-6 ms at most (inferred), and the 120-boot interval reaches −4.3. The five exit patches of #590-#592 together, a bound, read −7.4 [−12.1, −2.8] at 60 a side; #627 asks whether they are one change. *Status:* rejected. Archived as tag `archive/exp-590-ioapic-once`. + +**11-23 · kernel · two levers on the boot's ECAM reads remove what they claim and no time the login shows (#591, parts runs 45111902862, 45111905648, labs 45113437048, 45114405201, 45115330128, #627, this change).** *Why:* since 0004 every configuration read is an MMIO exit, and #591 counted the reads by caller. *(a)* `pci_bus_add_device()` saves every device's state at its add (upstream a2f1e22390ac, v6.19, for error recovery), 16 reads for each of 8 functions. A patch (branch `exp/591a-no-save-state`) keeps the save only where something can restore it without the driver's own save: AER (and DPC and EDR, which need it), EEH, s390, Xen's pcifront, and a root-bus device whose host bridge sets `reset_root_port`. CONFIG_PCIEAER alone was not a safe gate, because the same commit took out `pci_restore_state()`'s refusal of a state never saved, and those mechanisms call drivers' error handlers without AER. *(b)* `vp_modern_probe()` walked the vendor capabilities once for each of four types; a patch (branch `exp/591b-virtio-caps-once`) walks them once and keeps the first usable one of each type, as before. *Measured* (bench, nested, spin's shape and login, against v20261123.04): (a) MMIO exits −128 exactly, the host's handling −3.3 [−6.2, −2.1] ms; (b) −114 exactly, both at 3 a side and both the counts the source gave. The first login at 60 a side: (a) −4.3 [−6.8, +0.5], within noise; (b) −5.8 [−8.2, −0.6], outside it, but 114 exits at ~15 µs each (10 in the L1 and ~4.7 for the L0's trips) are ~1.7 ms, a third of that. A run of 120 a side, made because both arms straddled the noise, read (a) −1.3 [−3.5, +1.3] and (b) +0.9 [−1.8, +2.7]. The larger run decides, and it was chosen after the first was read, which this entry says. *Status:* both rejected. With #590 and #592's patches, as a bound, −7.4 [−12.1, −2.8] (#627). Lever 3, BAR sizing from the firmware, was not tried: it needs a new reason over the rejected configuration-space snapshot (11-13). Archived as tags `archive/exp-591a-no-save-state` and `archive/exp-591b-virtio-caps-once`. + +**11-23 · kernel · virtio-pci's queue selection and MSI-X rewrites: exits removed, no time on the login, and spin's dialer filed (#592, parts runs 45111690155, 45111693255, 45113393915, labs 45113437048, 45114428660, 45114405201, 45115330128, spin-stack/spin#1661, #627, this change).** *Lever 1:* every `vp_modern_*` queue accessor writes `queue_select` first, so setting up 13 queues wrote it 91 times. The same patch as 0011 (deleted with two others in a group arm, #345), here alone (branch `exp/592-l1-queue-select`), writes it 23 times. The MSI-X vector read-back after writing a queue's vector stays: virtio 1.2 §4.1.5.1.2 says a device refuses a vector by reading back NO_VECTOR and the driver must check, and `vp_find_vqs` falls back to shared vectors on it. *Lever 2:* each MSI-X message was written at activation and again by x86's `msi_set_affinity` before startup (`IRQCHIP_AFFINITY_PRE_STARTUP`, ff363f480e59), with the same vector and destination. A patch (branch `exp/592-l2-msix-once`) returns without the write when neither changed; a skip in `__pci_write_msi_msg` would have broken the restore of MSI state after resume. *Measured* (bench, nested, spin's shape and login, against v20261123.04, 3 a side for exits): lever 1 MMIO exits −68, lever 2 −56 (14 messages of 4 accesses, not the 19 inferred). The first login: lever 1 −2.8 [−6.6, +3.4] at 60 a side and +0.6 [−1.8, +2.3] at 120; lever 2 −0.1 [−3.1, +4.5] at 60. *The bound:* #590's, #591's and these patches in one kernel (branch `exp/batch2-bound`, 0017 refreshed to apply after 0016): every exit −838, MMIO −366, the host's handling −5.2 [−11.2, +1.2] ms (lab 45114428660); first login −7.4 [−12.1, −2.8] and sshd accepting −10.5 [−14.9, −4.1] at 60 a side (lab 45114405201); the restored login +0.0 [−5.4, +4.9] evicted (lab 45115341056). A bound is not a candidate; #627 asks whether the five are one change. *Lever 3:* spin's runner redials vminitd's RPC port every ≤2 ms until it listens (spin-stack/spin `internal/runner/qemu/guest_rpc.go`, `connectVsockRPC`), so spin's path pays refused-dial resets as the probe's dial did; how many is spin's to count (spin-stack/spin#1661). *Status:* levers 1 and 2 rejected. Archived as tags `archive/exp-592-l1-queue-select`, `archive/exp-592-l2-msix-once` and `archive/exp-batch2-bound`. + +**11-23 · machine · what SetMemory down and one vCPU cost (labs 45113957566, 45117940800, #549, this change).** `boot:actuators` boots spin's shape to systemd at 2048 MiB and times each actuator until the guest shows it, 10 times each. Its first reading counted the 128 MiB memory blocks online, and 19 of 20 unplugs to 1024 MiB stood at 1536 MiB for the whole 2 minutes. virtio-mem's own log said QEMU had all 1024 MiB back. The driver takes back its smaller blocks from inside a memory block, and the block stays online until all of it is gone. So the check now reads MemTotal. *Bench, spin's shape:* SetMemory 2048 → 1024 MiB 21.2 ms idle and 53.7 with 1180 MiB of page cache; back up 9.1; a vCPU added 13.2 and removed 14.8. docs/machine.md's actuators table has them. *Status:* in place. + +**11-23 · image · tzdata, e2fsprogs and fuse3 are installed (#512, labs 45112622373, 45112622091, 45112622071, 45113946185, image jobs on #616 and #625, this change).** *Decided* (the owner, #512, option b): the three a workspace cannot work around from inside, a zone loaded by name, a disk attached to a running workspace formatted and checked, and FUSE, which the kernel has. python3, lsb-release and the smaller tools stay out. *Changed:* `image/mkosi.conf` names them; `deviations.py` counts `/etc/localtime`, tzdata's postinst link to `Etc/UTC`, as a file a maintainer script writes on every Ubuntu, so the inventory is unchanged at 118 lines. `boot:workspace` loads `Europe/Madrid` by name, asserts the default zone is still UTC, finds `fusermount3` and `/dev/fuse`, and formats, mounts, writes and fscks an empty disk the host attaches while the guest runs; all pass with the packages in an overlay of v20261123.04 (lab 45112622373). *Measured* (bench, nested, spin's shape and login, the packages installed into the release's overlay by its own apt, branch `exp-512`, tagged `archive/exp-512`): first login −2.9 [−9.7, +3.6], sshd accepting −3.4 [−8.6, +4.0], 20 a side (lab 45112622091). Restored, 20 a side: evicted −0.3 [−1.8, +1.1], cached +1.8 [+0.3, +2.9], all of it in `running`, before any guest code (lab 45112622071); at 60 a side evicted −0.9 [−3.9, +2.0], cached +0.3 [−10.4, +12.5], within noise (lab 45113946185). The boot finishes +9.8 ms later and the state is +0.8 MiB, from `e2scrub_reap.service` in `multi-user.target` after the login; the console prompt +8.5. None is a goal number. *Size:* 217 → 224 packages, the tree +5.1 MiB (987408 → 992672 KiB), the qcow2 1013587968 → 1019158528 bytes (+5.3 MiB). *Status:* in place. + +**11-23 · kernel · vmlinux BTF is parsed when a program first needs it, not before the login (#460, parts runs 45112032746, 45116894547, labs 45113437048, 45114405201, 45115330128, 45115341056, 45118194310, this change).** *Why:* 0012, parsing vmlinux BTF on first use instead of at the first kfunc registration (11-22, archived as `archive/exp-btf-first-use`), took 7 ms out of the kernel and put it into journald's start, because `bpf_check()` asked for the BTF for every program, journald's cgroup device and skb programs (`DeviceAllow=`, `IPAddressDeny=`) among them. *Changed:* 0012 as measured, and 0013, which has the verifier ask for the BTF only where a kernel type first enters a program: a program with its own BTF or a BTF-typed attach point, the first kfunc call, a vmlinux BTF id in ld_imm64, a map pointer access, a helper argument or return typed by vmlinux BTF, `bpf_find_vma()`'s callback, and `bpf_snprintf_btf()` / `bpf_seq_printf_btf()`. Prior art: Jay Wang's bpf-next series of 2026-09-23 (LWN 1096093, not merged) chose the same points; the eager fetch came with 8580ac9404f6 (2019). *Reviewed* (an independent read of both patches, every `btf_vmlinux` reader in kernel/bpf): two bugs found and fixed before the patch was carried. The printf-BTF helpers read the BTF as the program runs, in atomic or NMI context, and with no trigger at load they could have started the parse there; they now ask for it at load. A parse that failed for memory in whichever task asked first (an unprivileged bpffs mount's `delegate_*` options can choose that task) latched the error for the whole boot; it is now tried again by the next user, and only a malformed BTF is final. vmlinux BTF now has no object id until it is parsed. *Measured* (bench, nested, spin's shape and login, against v20261123.04): no exit moves (3 a side, lab 45113437048). The first login −10.0 [−12.7, −3.3] at 60 a side and −6.3 [−9.1, −4.6] at 120 before the fixes; the kernel carried −6.4 [−9.4, −1.0] at 60, sshd accepting −6.7 [−9.5, −2.2]. Restored −1.0 [−6.0, +4.2] evicted and +1.7 [−9.1, +10.2] cached, 30 a side, the state 1.3 MiB smaller (the BTF is not in it). The build asserts both (kernel/README.md). *Status:* in place; reaches the goal number with the next release. + +**11-23 · image · the update stamps written at build, the five units of `ConditionNeedsUpdate` unmasked (#513, labs 45120950183, 45120950314, 45120950141, this change).** The image had no `/etc/.updated` or `/var/.updated`, so `ldconfig`, `systemd-sysusers`, `systemd-hwdb-update`, `systemd-journal-catalog-update` and `systemd-update-done` were masked: without the stamps they rebuild the caches in every boot (+260 ms, laptop, 11-21). *Changed:* `image/build.sh` writes both stamps last, with `/usr`'s mtime and `TIMESTAMP_NSEC=`, as `systemd-update-done` does, and fails an image whose stamps' mtime is not `/usr`'s; the five masks are gone from optimize-systemd.sh; `boot:workspace` asserts each unit checked its condition and skipped. `/usr`'s mtime in the release is 0 (`SOURCE_DATE_EPOCH`), which first failed the arm's setup through `expr`'s exit status on a result of 0. *Measured* (bench, nested, spin's shape and login, against v20261123.04 with the stamps and the unmasks in its overlay, branch `exp-batch3`): first login −0.3 [−6.8, +4.5], sshd accepting −1.3 [−7.7, +1.1], 20 a side (lab 45120950183); restored +0.2 [−2.1, +0.9] evicted, −1.3 [−4.5, −0.4] cached, cold login +1.2 [−2.6, +7.3] (lab 45120950314); `boot:workspace` on the overlay: the five units' conditions false and no unit failed (lab 45120950141, whose other failures are #509's and #512's checks, which v20261123.04 predates). The overlay measures the stamps and unmasks as files of the overlay, not of the base, which only changes where their few blocks are read from. *Status:* in place, a functional change: a `/usr` change made later is applied at the next boot. + +**11-23 · image · the pressure sender started by the boot's rest, its timer deleted (#401, labs 45120950183, 45120950314, 45120692382, 45120950141, this change).** The sender waited for a timer 10 s after the boot because, ordered after `multi-user.target` alone, it started beside the first login and cost it 2.6-3.3 ms (11-21). Since #581, `multi-user.target` is started by `spin-machine-boot-rest.service` once the first login's units are up, the first of #401's arms. *Changed:* `spin-machine-pressure.service` is `WantedBy=multi-user.target`, enabled by optimize-systemd.sh; `spin-machine-pressure.timer` is deleted; build.sh checks the want and refuses the timer; the lab's `pressure` edit makes the same want; `boot:workspace` asserts the sender runs. *Measured* (bench, nested, spin's shape and login, against v20261123.04 with the change in its overlay, branch `exp-batch3`): first login −0.8 [−7.8, +4.8], sshd accepting −0.2 [−9.1, +3.6], 20 a side (lab 45120950183); restored −0.8 [−2.9, +2.1] evicted, −0.4 [−3.6, +0.8] cached, the state +2.1 MiB because the sender is running at the save (lab 45120950314). In 5 ledgers it started at 0.37-0.38 s on the kernel's clock, after the login's end at ~0.29 s (lab 45120692382); in `boot:workspace` on two vCPUs at 0.29 s (lab 45120950141). *Status:* in place. A guest's first ~0.4 s go unreported, not its first 10 s. + +**11-23 · machine · `Unshared` refuses a pool whose CPUs differ in what taking features away leaves as it is (#587, this change).** *Why:* `Unshared` compared only the vendor and the model, so a pool whose hosts differ in stepping or physical address bits got a `CPUWithout` as if it made them share one CPU, and every cross-host resume was then refused by `CanResume`. *Read* (QEMU 11.2.0-rc0's `target/i386/cpu.c`, `host-cpu.c`, `kvm/kvm-cpu.c`, 2026-11-23): under `host`, `family`, `model`, `stepping` and `model-id` are the host's (`host_cpu_instance_init`), `phys-bits` and `guest-phys-bits` the host's and KVM's whenever `lm` is on, `pmu` is set by `kvm_cpu_max_instance_init`, and the cache switches by the machine type and `-cpu`. No feature taken away moves any of them. `level` and `xlevel` can move: `kvm_cpu_max_instance_init` starts the minimum leaves at KVM's, and `x86_cpu_expand_features` raises them for each feature word that is on (AVX10 to 0x24, APX to 0x29, SVM to 0x8000000A). Two hosts' levels can then agree or differ either way once `CPUWithout` is applied, and the record does not hold KVM's own leaf to say which. *Changed:* `Unshared` refuses, naming each, a pool whose hosts differ in any property but `level` and `xlevel`, and leaves those two to the records of the machines started with `CPUWithout`. *Status:* in place; spin-stack/spin#1417 told. + +**11-23 · machine · a state of another length than its checkpoint wrote is refused before QEMU reads it (#546, CI run 45111149822, this change).** *Why:* a failed load says only that it failed. QEMU 11.2.0-rc0 ends every failure at `process_incoming_migration_co`'s `fail:` label, and `qemu_fill_buffer` reports a file that ends early and a host's failed read both as `-EIO` (read 2026-11-22). So spin kept a truncated state's memory and retried it forever. *Changed:* `Checkpoint` records the state file's length in `Saved.Length`. `Resume` fstats the file it is handed after `CanResume` and returns a `*Refusal` (part `state length`) before QEMU is asked anything. It costs one `fstat`. It does not catch bytes changed in place, which stay a plain error. `boot:record`'s "a truncated state" now wants that refusal and the state never read. *Compatibility:* the field is new and optional. A `Saved` without it, every checkpoint a released spin-machine wrote, resumes without the check, and the machine's record (`Saved.From`) does not move. In CI run 45111149822, `boot:record` refused a real state cut to half its length, `state length: checkpoint 8597660207, here 4298830103 (same)`, with the state never read. `boot:compat` resumed v20261123.04 and refused v20261123.03 first, by `cpu x-legacy-cpuid2-cache` as before (#586), so this change refuses no release main did not. *Status:* in place. + +**11-23 · lab · a workspace's memory at boot beats the same memory plugged during it (#561, labs 45110554589, 45111507862, 45110570912, 45110562994, 45110580480, spin-stack/spin#1660, this change).** spin boots 128 MiB and plugs 2048 through virtio-mem right after the start. #561's lead (−15 nested, −8 metal) came from separate runs, so a tree now takes probe options of its own (`--opt` in a tree spec), and the two shapes ran as two trees of one interleaved run: `plug` (the release, `memory=128 plugged=2048`) and `start` (`memory=2048 plugged=0`), v20261123.04, 1 of 16 vCPUs, ceilings kept, spin's login. *Cold first login:* nested −2.5 [−7.3, +2.0] at 40 a side (lab 45110554589), within noise, then −5.5 [−10.9, −0.7] at 80 a side (lab 45111507862); metal −7.0 [−11.4, −3.4] at 40 (lab 45110570912). sshd accepting −8.3 nested and −7.6 metal, accept to login and the second login unmoved. *Restore* (nested, 20 a side, lab 45110562994): the state −17.6 MiB [−17.8, −17.3], `running` −2.4 [−3.5, −0.8], the restored login −2.5 [−3.7, −1.0] evicted and −2.2 cached. QEMU's RSS at the cold login −26 MiB. *Where it goes* (ledger, traceable kernel, 3 boots each, lab 45110580480): plugged, `kworker/0:1` runs ~7.8-8.0 ms of the vCPU in the kernel's window before PID 1, inferred to be the onlining of the plugged blocks; at boot it runs 0.3 ms, the kernel's own setup (`swapper/0`) takes ~4.5 ms more for the larger memory map, and PID 1 comes 3.4 [−5.9, −2.1] ms sooner. The rest of the cold gain is after PID 1 and the ledger does not pin it at 3 boots. *Decided:* a gain on both goal numbers, and the boot shape is spin's: spin-stack/spin#1660 proposes `canonicalMemory` at the workspace's least, 2048 MiB, with virtio-mem kept for growth to 8 GiB (invariant 3). Base RAM is in the machine's record, so checkpoints from before the change boot cold once. The probes keep spin's shape until spin changes it. *Status:* the tree option is in place; #561 closes here and the decision is spin's. + +**11-23 · lab · where a cold boot's EPT violations land (#568, lab 45111606645, this change).** #565 counted 172 EPT violations in a cold boot at ~115 µs each nested and asked whether prefaulting the base memory in a QEMU started ahead would take them off the path. `exits` now keeps a histogram of `kvm_page_fault` by guest-physical address in 128 MiB buckets. *Found* (bench, nested, spin's shape and login, v20261123.04, 3 boots, the same in each): 171 violations, 18.9 ms of the L1's time. 52 in the base (0-128 MiB) and 6 in the bucket above it, 48-51 in the memory virtio-mem plugs (QEMU puts its device memory at 4 GiB when there is no RAM above 4 GiB), 39 in the PCIe ECAM at 0xB0000000, 9 in 0xF8000000-0xFFFFFFFF (IOAPIC, local APIC, flash) and 17 in the 64-bit BARs at 12 GiB. The MMIO ones are inferred from the addresses: KVM's first fault on an MMIO page installs the misconfigured entry that every later access exits through. *Decided:* closed as off the goal's clock. Prefaulting the base could win only the base's ~58 faults, ~6 ms at most, and only in `prestart`, because `ssh-first` starts before QEMU's exec and a prefault there is on its path. The plugged faults cannot be prefaulted without zeroing all that is plugged. With the memory at boot (#561) they become base faults, and the split is the same question. *Status:* the histogram is kept in `exits`. + +**11-23 · lab · a guest that drops its page cache before its save does not make a smaller state (#276, lab 45110967817, branch archived as `archive/drop-caches-276`).** #276's last idea: most of a restored state might be the guest's clean page cache, so a guest asked to drop it right before spin's save would leave less for the restore to load. *Measured* with a `restore-first` option on the experiment's branch, a tree each: `drop=0` ran `sync; echo 1 > /proc/sys/vm/drop_caches` as root after the boot had finished and saved at once, `drop=3` waited 3 s first, which leaves free page reporting its 2 s delay (bench, nested, spin's shape and login, v20261123.04, 20 a side). The state read 183 MiB on all three trees: −0.1 [−0.4, +0.3] at once, −0.0 [−0.3, +0.4] after 3 s. `running` did not move, −0.9 [−2.0, +0.9]. The restored login was worse, +4.7 [+3.5, +7.3] evicted at once, +5.6 [+4.6, +7.6] after 3 s, +6.5 and +6.4 cached. *The instrument saw the drop:* the restored login is the side that moved, as a guest whose cache was emptied must read the login's files from its disk again (inferred: the probe does not read the guest's cache). *Why the state does not shrink* (inferred, not measured): a save writes every page that is not zeros, and a freed page keeps its bytes until something gives it back to the host. Free page reporting gives back only free blocks of `page_reporting_order` (2 MiB here), and a page cache freed 4 KiB at a time beside the boot's live pages leaves few whole ones, even after 3 s. Waiting 3 s with no drop had moved nothing either (docs/measuring.md, "When a checkpoint is taken"). *Decided:* rejected, with its row in docs/boot-time.md. Nothing is asked of spin before a checkpoint. #276's three ideas are answered, and the restore stands at 78-80 ms, under the goal. + +**11-23 · lab · a guest's synced writes on a saturated host disk do not stall QMP on the bench (#391, labs 45111443524, 45112573850, probe archived as `archive/qmp-stall-391`).** On a laptop with a 97% full disk, query-status reached 175-950 ms beside small synced writes, and #402 did not reproduce that case. A `stall` probe on the experiment's branch booted spin's shape, logged in, started a row's load, and timed 200 query-status round trips 100 ms apart, sampling QEMU's main thread and its monitor's I/O thread (`stat` and `wchan`) every 0.5 ms across each, with both kernel stacks taken past 20 ms. The rows: the guest's 4 KiB `dd oflag=dsync` writes (fio's `--bs=4k --fsync=1`; the image has no fio); four host streams of 1 MiB O_DIRECT writes on the scratch NVMe the overlay is on; both; and the guest's writes beside four buffered host streams flushed each GiB, so that dirty-page throttling and writeback are in play. *Measured* (bench, nested, spin's shape and login, v20261123.04, 3 boots a row, two runs): the slowest round trip of all 2,400 was 1.2 ms, and none passed 20 ms. p50 0.24-0.37 ms with the guest writing alone, 0.41-0.56 with the host disk busy. *The load was real:* the disk read 99-100% busy from its io_ticks in every busy row, and the guest's writes fell from 113,700-118,400 a row to 2,700-3,100 beside O_DIRECT and 1,500-2,100 beside buffered writes. QEMU's disks are `aio=io_uring` on the main loop's ring, so a slow write waits in the kernel and not in the main thread. *Decided:* the case does not stall QMP on the host kind the goal is measured on, so no `iothread=` arm was measured and the probe was removed with its question. The laptop's stalls stand as #402 explained them: the main thread blocked in the host, in cgroup reclaim at `memory.high`, waiting for the mmap lock under reclaim, or with QEMU's cgroup throttled by `cpu.max`. + +**11-23 · lab · density on metal, and a CPU-bound crowd on the bench (#563 section 2, labs 45110655407, 45110663095, 45110670764, 45110678888, 45110688511, this change).** #273 measured an idle crowd on the bench up to 16. #563 asks what a metal host carries, for spin's metal-or-nested cost model, and needs no new code: `density` as it stands, spin's shape and login, v20261123.04. *Bench, nested, 16 CPUs, `load=cpu`, 10 a row:* the first login read 387/417 empty, 378/431 beside 4 busy workspaces, 441/450 beside 8, 1015/1215 beside 16, 941/1196 beside 24. *Metal, c8i.metal-48xl, 192 CPUs:* `load=cpu`, 337/447 empty, 331/488 at 16, 335/344 at 32, 336/341 at 48 (10 a row), and in a second run 342/363 empty, 327/366 at 64, 466/486 at 96 (8 a row; a crowd of 96 took 83 s to boot, past what 10 rows fit in bench-metal's 60 minutes). `load=idle`: 345/368, 336/343, 329/341, 334/352 at 0-48, and 342/356, 328/350, 331/340 at 0, 64 and 96. *Read* by #563's line, a p95 within 25% of the empty host's in the same run: nested, up to 8 busy workspaces of 16 CPUs; metal, up to 64 busy of 192, not 96, and every idle crowd measured. The rows of one host are two runs, so a row compares only with the empty row of its own run. The empty metal row's 447 p95 in the first run is one slow boot of ten. *Not measured:* busy crowds between 64 and 96, and workspaces of more than one vCPU. *Status:* rows in docs/boot-time.md ("The bench fleet is nested, not metal"). Section 1 of #563 (the I/O tax) needs new probes and equal storage on both hosts, and stays open in #563. + +**11-23 · systemd · the executors' sandbox, a bound: −14 ms (#574 experiment 4, labs 45120692382, 45121038332, #637, #638, this change).** Read first, a release ledger (v20261123.04, spin's shape and login, 5 boots): before the first login the executors spend journald 6.0 ms, logind 10.3 and `user@0` 2.8, p50, beside the units' own binaries. *The bound:* one drop-in each for journald, logind and `user@` emptying `SystemCallFilter=`, `SystemCallArchitectures=`, `SystemCallErrorNumber=`, `RestrictAddressFamilies=`, `RestrictNamespaces=`, `RestrictRealtime=`, `RestrictSUIDSGID=`, `MemoryDenyWriteExecute=`, `LockPersonality=` and every `Protect*=`; `PrivateTmp=`, `IPAddressDeny=` and `DeviceAllow=` kept. udevd was left out: it starts after the first login since #581. *Measured* (bench, nested, 60 a side, branch `exp-batch3`): first login 374 → 360, −14.1 [−18.5, −11.5]; sshd accepting −13.2 [−16.0, −10.9]; accept to login −2.1 [−3.1, −0.1]. *Status:* a bound, not carried. #637 splits it into the seccomp and namespace halves and proposes one seccomp filter per unit in systemd. #574 closed with its five experiments: #579 in (−6.5), #580 rejected, #581 in (−21.5), #460 in (the kernel's), this bound to #637. The runner-up, the dynamic linker's share, is #638. + +**11-23 · image · the volatile journal holds 8 MB, not 4 (#514, labs 45121159504, 45121159741, 45121159883, 45120692139, this change).** *Found:* `/run` is a tmpfs of 20% of the RAM at its mount, and the guest mounts it at 128 MiB, before spin sizes it to 2 GiB: 19 MiB in spin's shape, whatever the guest grows to. Ubuntu's default cap, 10% of `/run`, would be ~2 MB there. *Measured* (bench, nested, spin's shape: 1 vCPU, 128 MiB sized to 2048 right after the start, a guest running `docker build --no-cache` of 20 `RUN` steps for 10 minutes, branch `exp-batch3`'s `boot:exp-journal`): the journal grows ~0.4 MB a minute, mostly systemd's and dockerd's lines for each build step. At 4 MB the oldest entry was the kernel's first line for 8 minutes, then the boot's first 90 s were gone by the end (lab 45121159741). At 8 MB the whole journal was kept, 3.6 MB used (lab 45121159883). A first try at 16 MB was left: it is 84% of `/run`, near journald's 15% keep-free. The first login, 8 MB against 4 MB in v20261123.04's overlay: −2.2 [−12.1, +6.4], 20 a side (lab 45121159504), and 16 MB −0.2 [−5.6, +9.1] (lab 45120950183). *Status:* in place; a busy workspace keeps ~15-20 minutes. + +**11-23 · image · the dynamic linker's share of PID 1, journald, logind and `user@0` is ~1 ms (labs 45180400607, 45180856158, #638, this change).** #574's runner-up: the four map and relocate `libsystemd-shared` (PID 1 and `user@0` also `libsystemd-core`), and nobody had measured ld.so's share before porting to v262's multicall build (#42304) or a static one (#42820). *Instrument* (branch `exp-ldso`, tagged `archive/exp-ldso`, its `ldso` edit): `LD_DEBUG=statistics` for PID 1 from spin's handoff, which execs it (`systemd.setenv=` does not reach PID 1), and for journald, logind and `user@0` from a drop-in each. PID 1 and journald report on `/dev/kmsg` with `printk.devkmsg=on`, logind and `user@0` on their stderr, the journal: the first run had logind's on `/dev/kmsg` too, its `DevicePolicy=` refused the executor the open, and logind failed at STDERR (lab 45180400607, discarded). glibc 2.43 counts in TSC cycles, 2700 MHz in every boot. *Measured* (bench, nested, spin's shape and login, v20261123.05 on its traceable kernel, the ledger with and without the edit, 8 a side, lab 45180856158), ld.so's total start-up, p50 [range]: PID 1 0.48 [0.46, 0.56] ms, of it loading objects 0.32 and relocation 0.08; journald 0.20 [0.14, 0.31]; logind 0.20 [0.11, 0.31]; `user@0` 0.21 [0.15, 0.36]. Relocations: PID 1 and `user@0` 2,522 symbol (911 from cache) and 16,589 relative; journald 1,157 and 10,518; logind 1,238 and 11,297. Objects at start, from the release's image (`ldd`): 7 for PID 1 and `user@0` (the binary, libsystemd-core, libsystemd-shared, libc, libm, libcrypt, ld.so), 6 for journald and logind, all `BIND_NOW`. The four come to ~1.1 ms, under #638's ~5 ms, so no build was made. *The instrument:* against the ledger alone in the same run, first login +3.4 [−23.0, +11.9], PID 1's CPU −1.1 [−5.1, +0.6], unattributed +0.3 [−0.1, +1.1]; each ld.so total is well inside the trace's wall time from the process's exec to its first sleep. It does not see the kernel's execve before ld.so runs, nor the libraries' pages faulted in later by `main`, which a static build would partly pay too (not measured). `user@0`'s environment generator inherits the variable and reports 0.13 ms more. *Inferred:* the multicall build would not reach even that: it keeps libsystemd-core and libsystemd-shared dynamic, leaves journald and logind alone and makes the executor, static here, dynamic. *Status:* measured and rejected; #638 closed. + +**11-23 · qemu · a bzImage mapped, not read into QEMU's heap (#646, labs 45182382388, 45182382864, 45183618987, this change).** `x86_load_linux` read the whole 16.7 MB bzImage into a buffer that only fw_cfg reads, 6.2-6.9 ms of QEMU's init traced (labs 45177818419, 45177817516, #611), and qboot copies the same bytes again by fw_cfg DMA. `qemu/patches/0007` maps the file read-only (`g_mapped_file_new_from_fd`), as upstream has mapped the initrd since 4.2; a kernel with a dtb appended keeps its buffer. The setup header QEMU patches is already a copy of its own, so nothing writes to the mapping. The QEMU build asserts that a held TCG machine's maps name a stub bzImage given to it; the published QEMU fails that check. *Prior art* is in docs/boot-time.md's row: Garzarella's 2019 series mapped the ELF kernel and the initrd but not the bzImage. *Measured* (bench, nested, spin's shape and login, v20261123.05 against the same release with the patched QEMU, parts run 45180746171, 40 a side, interleaved): first login 380 → 367, −13.4 [−16.9, −7.3], sshd accepting −13.3 [−18.7, −7.5], the console prompt −10.6 [−14.2, −6.3]; QEMU's anonymous RSS −15.9 MiB and its file RSS +16.1, total unmoved (lab 45182382388). Restored, 40 a side: login −9.3 [−11.2, −6.1] evicted and −7.7 [−8.9, −5.1] cached, `running` −8.8 and −7.9, the state unmoved (lab 45182382864): a restore starts QEMU, which loads the kernel into fw_cfg there too. The gain is twice the traced read; what else the anonymous buffer cost nested (its page faults, presumably) was not measured. *A lead, not a decision:* an uncompressed payload (#326's kernel patch, renumbered, branch `exp/646-uncompressed`, parts run 45180892535) against LZ4, both on the patched QEMU: first login −4.0 [−7.9, +0.3], within noise at 40, QEMU's RSS +32 MiB (lab 45183618987). The mapping removes the "+6-7 in QEMU's start" half of #326's rejection; whether the rest is a gain needs more boots, which is #645's. *Status:* in place; the record does not move, as the kernel reaches the guest through fw_cfg. + +**11-23 · systemd · the executors' sandbox costs its system call allow-list, not its number of filters (labs 45228294512, 45229454155, 45231419187, 45235103665, 45235485857, 45238003981, 45239372741, #637, #673, #686, this change).** #637 split #574's bound and asked for one seccomp filter per unit. *The split* (bench, nested, spin's shape and login, v20261123.06, 60 a side, branch `exp/637-split`, tag `archive/exp-637`): the seccomp settings emptied in journald, logind and `user@` read first login −12.0 [−21.8, −2.1], sshd accepting −13.8 [−19.4, −4.9]; the namespace ones (`ProtectSystem=`, `ProtectHome=`, `ProtectControlGroups=`, `ProtectKernelTunables=`, `ProtectProc=`) +0.3 [−9.4, +7.2] (lab 45228294512). *Fewer filters:* the executor applies `SystemCallArchitectures=` after seven other settings, so each of those loads a filter for i386 and x32 too, which the architecture filter then kills; the kernel has neither ABI. Applied first, journald carries 8 filters, not 17, and logind 13, not 26. `boot:seccomp` (on the tag) runs a probe as each unit's `ExecStartPost=`, with the unit's sandbox, over 3435 calls: every native number with zero arguments and no capabilities, each x32 number, and the calls the settings decide by argument; the table was the release's (labs 45235103665, 45235485857). First login −0.4 [−6.1, +2.7] against systemd rebuilt with a comment only (lab 45231419187). *Where it goes:* an instrument patch timing the executor's steps (thread CPU, one boot, 2 vCPUs): journald's executor 6.7-7.2 ms, `SystemCallFilter=@system-service` 3.7-4.0 of it, its `seccomp_load()` 1.1-1.2; the other seccomp settings ~0.6 together (labs 45238003981, 45239372741). So one filter per unit would reach about the 0.6 ms (inferred). *Found on the way:* the lab's packages edit gave `/usr` the package's mtime, newer than the image's update stamps (#513), so every `--systemd` tree ran ldconfig, sysusers, the hwdb and the catalog before the login: both arms ~658 ms (lab 45229454155); fixed in #673. *Status:* rejected, #637 closed; building the allow-list once is #686. + +**11-23 · machine, qemu · QEMU's start and the held start's QMP, split and rejected (#647, #649, labs 45177818419, 45230790902, 45231358105, #669, this change).** #611's split left two cold phases without an owner. *#649, the held start's 14 commands, 6.1 ms on bench:* QEMU waited 4.5 ms p50 for the client, 0.9 of it busy with the probe's plug monitor (the memory spin sizes right after the start), so spin-machine's own share is ~3.6 ms, ~0.28 ms a round trip (24 boots, lab 45177818419). The candidate sent the bind ahead of its answers (`qmp.Send`): the run state with the places, every serial at once, each image's two nodes together, the reopen with the placeholder's delete, 13 round trips to 9; add-fd still holds the connection until its answer and `cont` waits for the bind. *Measured* (bench, nested, spin's shape and login, v20261123.06's parts, spin-machine main at f273377 against the candidate at c966407, 60 a side): first login −1.7 [−5.6, +2.6], sshd accepting −2.4 [−5.5, +2.8] (lab 45230790902); restored login −0.3 [−3.8, +3.7] evicted, +0.9 [−10.6, +7.5] cached (lab 45231358105). Rejected: the four round trips it removes are ~1.1 ms (inferred), and even all of spin-machine's 3.6 ms is under what 60 boots a side resolve. The code is on `archive/exp-649-held-start`. *#647, QEMU's exec to its first trace event, 9.7 ms on bench:* the release's QEMU is static-pie on musl, so there is no dynamic loader and `LD_DEBUG` has nothing to report; musl relocates its 59,700 relative relocations itself. The split, on the laptop as a lead (exec to the first `flatview_new`, 40 starts a row, 4.7-5.4 ms p50): a trivial static-pie binary 0.23, QEMU's `-version` 2.0, `-sandbox` −0.7 to −0.9, the rest option parsing, trace and main-loop start and the machine object. perf on an unstripped build of the same Dockerfile: relocation 7% of `-version`, page faults ~15%, nothing else over 2%. No candidate's ceiling is over ~2 ms on bench (inferred at ~2× the laptop): a seccomp filter compiled at build time (Firecracker's seccompiler), a non-PIE binary (which gives up ASLR), DT_RELR. None was built. The allocator, musl's mallocng, is ~2.3 of the 17 ms of CPU QEMU's main thread spends from exec to held, a lead across QEMU's whole start, opened as #669. *Status:* rejected, both. + +**11-23 · kernel, qemu, machine · the kernel entered as its vmlinux through PVH, moving itself to a random base (#645, parts runs 45192017068, 45216245888, labs 45213668842, 45213683698, 45219768990, 45219785493, 45219801969, 45221660056, 45225297602, parts run 45222305257, #660, this change).** *Why:* a bzImage's decompressor spent ~21 ms (bench) on a copy, LZ4 and parse_elf before the kernel's clock, and it was the only thing that randomized the kernel; PVH skipped it and left the kernel at its linked address (11-19). *The bound first*, a vmlinux through PVH with no KASLR at all, against the same build as a bzImage: first login −18.9 [−22.8, −12.4], restored −3.6 [−5.1, −2.1] evicted, at 40 a side. *Two paths with KASLR kept:* QEMU applying the relocations (Holmes et al., EuroSys '22; Firecracker's design) or the kernel applying its own (Hou Wenlong's RFC, 2026-01-26). The kernel's own was chosen: no relocation format for QEMU to parse, nothing on QEMU's command line, the decompressor's entropy code (#645, issuecomment-7106937337). *Carried:* the RFC as kernel 0014-0018, made checkpatch --strict clean with each change noted in its header; 0019, which sets `KASLR_FLAG` once the kernel moved (without it `RANDOMIZE_MEMORY` left the regions where they were: the lowest vmalloc address ffffc90000000000 and the direct map ffff888000000000 at every one of 10 boots, lab 45225297602; with it, 10 distinct bases of each, lab 45221660056); 0020, because the RFC reads RDRAND from CPUID leaf 1's EDX and the TSC from its ECX, the wrong way round, so its virtual base was drawn from the i8254 and a hash of `boot_params` alone, on a guest that has `rdrand` and `tsc` and no `ds_cpl` (lab 45225297602); QEMU 0008, a random physical base from `XEN_ELFNOTE_PHYS32_RELOC`. The relocation table needs 0xc7000 bytes of the 1 MiB reserved: a 512 KiB reserve failed the link naming that size (parts run 45222305257). The machine boots a release's vmlinux when it carries both Xen notes and its bzImage otherwise, so a release from v20261119.02 to v20261123.06 boots as it did. *Measured* (bench, spin's shape and login, against v20261123.06, 60 a side, the kernel without 0020): first login 368 → 352, −16.8 [−20.9, −13.0], sshd accepting −16.7 [−20.2, −12.7], QEMU's RSS −13.8 MiB (lab 45219785493); restored −4.4 [−17.5, −2.0] evicted, −4.3 [−14.0, +10.2] cached, the state −31.9 MiB, the save −14.6 (lab 45219801969). *Status:* kept. What the bzImage, `KERNEL_LZ4` and QEMU 0007 still serve is #660. + +**11-23 · release · v20261123.07 holds #645's cold gain; its record's 20 a side did not see it (labs 45252584128, 45219785493, release run 45241645340, #694).** *Why:* the record read the cold first login at −3.5 [−12.9, +2.9], within noise, against #645's −16.8 [−20.9, −13.0], and spin was about to be told what the bump gains. *Ruled out* (read from the artefacts): the lab arm and the release boot the same machine. QEMU (`f271a946…`), qboot, `pvh.bin` and `linuxboot_dma.bin` are byte-identical, `spin-machine args` prints one command line but for paths, and both vmlinux files are stripped, 40,165,128 bytes, with the same two LOAD segments and the same config; the release's adds 0020. QEMU's RSS moves the same in both (anonymous −34.0 MiB, file +19.9/+20.1). *Measured* (bench, nested, spin's shape and login, both releases as published, each with its own spin-machine, 60 a side, interleaved): first login 378 → 359, −18.6 [−23.6, −14.0], sshd accepting −15.3 [−21.2, −12.6], the console prompt −18.7 [−24.0, −12.8] (lab 45252584128). The record's run disagreed with itself: its `restore-first` cold boot, the same boot at 40 a side, read −14.2 [−19.9, −8.6]; its 20 `.07` boots sat at a p50 of 370 where the lab's sit at 352-359, and 20 a side drawn from lab 45219785493's samples reach −3.5 in 5 of 100,000 draws. *Status:* the gain stands at ~−17 to −19 ms cold. How many boots the record takes is #694. + +**11-23 · lab · the ledger's kernel_zero on the kernel's sched clock (#644, labs 45229897350, 45230233764, this change).** The ledger's `kernel_zero` landed 19.5 ms (bench) and 12.6 ms (metal) after a port write at the sched clock's 0 (#611). *Found:* the ledger took CLOCK_MONOTONIC's 0, the trace's clock, for the kernel's. CLOCK_MONOTONIC runs on jiffies from timekeeping_init until the switch to kvm-clock and loses the ticks it misses. The kernel prints both clocks at one tick at late_initcall ("sched_clock: Marking stable"), and their difference was the whole error in all 24 boots of labs 45177818419 and 45177817516, to within 0.15 ms. *Changed:* the ledger moves the trace and the journal forward by that lag (`monotonic_lag`, 18-25 ms nested, 11-14 metal) and refuses a journal without the line. *Checked:* with the marker kernel, `kernel_zero` lands 0.03 to 0.14 ms before QEMU's trace stamps the marker, 10 boots on bench and 10 on metal (spin's shape, v20261123.04). *What moved*, recomputed from the runs' kept journals: docs/measuring.md's split of lab 45110630795, `kernel_zero` 97-114 → 77-95 and `qemu_start` 49.4 → 29.3 (`before_qemu` and `guest_to_zero` do not move); QEMU's exec to the kernel's clock untraced on the workspace's machine is 73.4 ms on bench and 68.7 on metal (labs 45177818419, 45177817516), against firmware-stages' 73.7; PID 1 in #561's ledgers −3.4 → −4.0 ms; the pressure sender's start 0.37-0.38 → 0.39-0.40 s (docs/image.md). #611's comment is corrected. No cold-budget row used the ledger's anchor. Two of its rows use clocks with errors of their own, now noted beside them: firmware-stages' anchor is ~2.8 ms late on bench (#665), and dmesg's clock reads the kernel 13-15 ms short from late_initcall on (#666). *Status:* in place. + +**11-23 · qemu · the vmlinux copied into guest RAM beside QEMU's main loop (#698, labs 45257214350, 45260098299, 45260694485, parts run 45257975711, this change).** *Why:* since #645 QEMU loads the vmlinux through `load_elf`. #698 asked whether it read the 40 MB file into ROM blobs at start, as `x86_load_linux` read a bzImage before 0007. It does not: `load_elf` has mapped the file since QEMU 4.2 (816b9fe450, Garzarella, 2019), and the blobs point into the mapping. What it does is copy the 37.4 MB of segments into guest RAM at the machine's first reset, on the main thread, before the main loop answers the monitor. *The phase,* a probe that traces QEMU's reset (`romcopy`, branch `exp/698-romcopy`, never merged): 9.1 ms p50, p95 9.3, 20 boots, bench, spin's shape (lab 45257214350); the ledger read the vmlinux's QEMU start +8.4 against a bzImage's (lab 45260129735, #697). On a laptop half the copy is faulting in the destination's huge pages and half the copy, and a `pread` into guest RAM was no faster than the mapping's `memcpy`, so no cheaper copy was built. *Carried:* QEMU 0009 copies the segments 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; a machine made for an incoming migration copies nothing at reset, as before. *Measured* (bench, spin's shape and login, v20261123.07 against the same release with 0009's QEMU, interleaved): first login 351 → 342, −8.6 [−11.0, −4.0], sshd accepting −9.1 [−12.4, −5.9], the console prompt −7.7 [−11.4, −5.5], QEMU's RSS unmoved, 60 a side (lab 45260098299); restored −0.1 [−1.1, +0.7] evicted, −0.3 [−2.1, +0.9] cached, the state unmoved, the same run's cold login −6.9 [−12.9, −0.8], 40 a side (lab 45260694485). The gain is the whole traced copy. The record does not move: the patch adds no device, property or RAM block, and `boot:record` passed on the patched tree (lab 45261567066). A stub ELF whose notes have `p_align` 0 kills QEMU 11.2 with SIGFPE in `load_elf`, found while writing the build check (#705, not affected). *Status:* kept. + +**11-23 · qemu · QEMU 0007 deleted: no release from v20261123.07 boots a bzImage (#660, parts run 45256311661, labs 45258887660, 45258106255, this change).** 0007 mapped a bzImage given to `-kernel` instead of reading it into QEMU's heap (#646, the 11-23 entry above). Since #645 the machine enters a release's vmlinux through PVH (`machine.OpenRelease` picks it by its two Xen notes), and QEMU's ELF loader maps that file without 0007. A release from .06 or before boots its bzImage with the QEMU it shipped, which carries 0007; only a lab tree of a new QEMU with an old release's kernel pays the read again. *Measured* (bench, nested, spin's shape and login, v20261123.07 against the same release with QEMU built without 0007, 40 a side, interleaved): first login +3.6 [−3.3, +7.8], sshd accepting −1.6 [−6.7, +5.6], QEMU's RSS +0.3 [−1.6, +2.1] MiB, its file RSS +0.2 [+0.2, +0.3], a different binary's pages (inferred) (lab 45258887660); restored login −0.4 [−1.5, +0.9] evicted, −0.1 [−0.9, +0.9] cached, the state unmoved (lab 45258106255). Neither number moves, as #660 expected: 0007 touched nothing on the PVH path. The QEMU build's check of the mapping goes with it. *Status:* deleted. The bzImage and `CONFIG_KERNEL_LZ4` stay until spin's `hack/machine/place.go` stops requiring `kernel/bzImage` (spin-stack/spin#1689). + +**11-23 · lab · the traceable kernel is a vmlinux entered through PVH, as the release's (#697, lab 45260129735, this change).** *Why:* since #645 the release boots its vmlinux through PVH, and its traceable kernel was still a bzImage, so v20261123.07's published ledger read firmware, entry and setup at 47.1 ms against .06's 45.0, where the release had dropped its decompressor. *Changed:* `release traceable-kernel` publishes a self-randomizing vmlinux, checked as the release's, and no bzImage; `traceable:TAG` places whichever the release published; the ledger records `pvh` and names the window by it. *Proof* (bench, spin's shape, v20261123.07, 10 boots a tree, interleaved, the old traceable bzImage against the new traceable vmlinux): firmware, entry and setup 44.3 → 19.4, −24.9 [−25.8, −23.4]; QEMU's start and held start 41.9 → 50.3, +8.4, the vmlinux's load (#698); the kernel's 0 −16.8 [−18.2, −15.1]; first login −21.6 [−32.9, −11.0]. *Status:* in place. + +**11-23 · kernel · the boot's device-setup exits as one change: kernel 0021-0025 (#627, parts run 45256426877, labs 45260781177, 45261629539, this change).** *Why:* five patches each removed the VM exits their changelogs counted (#590, #591, #592), and none moved the first login alone; as a bound the five read −7.4 [−12.1, −2.8] at 60 a side (lab 45114405201). #627 asked whether "the boot's MMIO exits in device setup" is one change and, if so, for one arm at 120 a side, the set chosen before the run. *Changed:* the bound's five, from `archive/exp-batch2-bound`, as 0021-0025 after #645's 0014-0020; they apply to 7.3.6 with no fuzz. The build asserts each on its vmlinux (kernel/README.md); checkpatch `--strict` and sparse pass. 0022 keeps the risk #627 named: upstream a2f1e22390ac took out `pci_restore_state()`'s refusal of a state never saved, so its gate (AER, EEH, s390, Xen pcifront, `reset_root_port`) has to grow by hand with whatever calls error handlers next; it stayed in the set because the set was fixed before the run. *Measured* (bench, nested, spin's shape and login, against v20261123.07, interleaved): first login −9.4 [−14.2, −5.7], sshd accepting −9.5 [−14.4, −5.5], console prompt −10.4 [−14.2, −7.8], second login +0.3 [−0.1, +0.6], QEMU RSS −1.7 MiB [−1.8, −0.1], 120 a side (lab 45260781177). `restore-first`, 60 a side (lab 45261629539): restored login −0.4 [−2.0, +1.7] evicted and +0.2 [−6.6, +7.3] cached, the state +0.0 MiB [−0.1, +0.2], all within noise; its cold row −11.8 [−18.5, −3.2] evicted. The same set against v20261123.06 had read −9.2 [−12.2, −6.0] (lab 45231943664), before 7.3.6 and #645. *Status:* in place; reaches the goal number with the next release. + +**11-23 · kernel, release · the release is its vmlinux alone: no bzImage, no `KERNEL_LZ4`, no kernel 0018 (#660, lab 45262046768, spin-stack/spin#1689, this change).** *Why:* since #645 (v20261123.07) the machine boots a release's vmlinux through PVH, and the bzImage beside it was booted by nothing: spin's `hack/machine/place.go` still asked for it, and its runner reads the vmlinux and `pvh.bin`. The maintainer decided not to wait for spin. *Done:* `kernel/Dockerfile` makes `vmlinux` instead of `all`; `CONFIG_KERNEL_LZ4` and the builder's `lz4` go, and the compression mode is Kconfig's default (gzip), which compresses nothing shipped; kernel 0018, the RFC's change to the decompressor, is deleted, as nothing compiles `arch/x86/boot/compressed/` any more, and with it sparse's rebuild of the bzImage to check that file; CodeQL's kernel analysis builds `vmlinux` for the relocs tool where it built the bzImage. The release packs, hashes (SBOM) and describes (SOURCES) `kernel/vmlinux` alone, and `verify kernel` reads no setup header. `machine.OpenRelease` still boots the bzImage of a release from v20261119.02 to v20261123.06: the lab (`--from release:TAG`) and compat open them. Compat stopped at the first release with no bzImage, which every release from this one on is, and now stops at the first `OpenRelease` refuses. *Measured* (bench, nested, spin's shape and login, 20 a side, interleaved): the boot path is unchanged, first login −4.3 [−14.4, +7.4] at 20 a side, within noise, sshd accepting −5.3 [−11.1, +7.0], QEMU's RSS −1.7 MiB (the arm's kernel is also 7.3.6, main's, against .07's 7.3.5). *Left:* spin's place.go must stop requiring `kernel/bzImage` before it takes a release from this one on (spin-stack/spin#1689). + +## 2. Rework cycles + +Each cycle: the sequence, what each step measured, and the lesson. + +### 2.1 udev: masked, unmasked, then argued over for weeks +1. Initial import: udev masked "to save boot time" (`8aee03a`). The serial getty could not start, so a debug init was written to work around it (`5e7d60e`, `8aee03a`, `24c8a06`). +2. 09-10 `4cbd229`: masking buys nothing (826 vs 829). The first harness had left `systemd-udev-trigger` masked and read "udev changes nothing". +3. 09-10 `722d468`: unmasked. `b5f361f`: the harness's udev row was itself a no-op. +4. 09-10 `064c4f4`: unmasking udev quietly enabled the serial getty that the console unit existed to avoid. This was left open as "a decision". +5. 09-26 `adc52cd`/`e2f6b8f`: udev's 46 ms "overlaps" the boot; removing devices, rules or VT gives 0. +6. 11-12 `3c8da99`: the memory half of the hot-add rule, added 09-10, raced the kernel and was removed. + +**Lesson:** an optimisation imported without its measurement survived 3 days and cost a debug init, a console unit and a harness. Measure before inheriting a mask, and make a variant fail when its edit matches nothing (`e2f6b8f` added that check). + +### 2.2 logind: out of the boot, then back in +1. 09-10 `6aba37b`: logind 63 ms on the chain, worth 24 ms to the console prompt (laptop). +2. 09-12 `bb6bb89` (#5): logind is started at the first login through the seats directory, worth 24 ms (249 vs 273). Two dead ends were recorded, and `boot:logind` was written to hold it. +3. 11-12 #240: back in the boot, with spin lingering. First SSH login 570 → 510 (lab 43308825692). The comment says the 09-12 change "moved logind, dbus-broker and user@1000.service into the first login instead, which is what a workspace waits for." +4. 11-13: the side effect, console prompt +77 ms, was fixed with getty Type=simple (#241), and that fix was removed the same day (#249). +5. #240's notes: the `SPIN_LOGIND_NO_SEATS=1` control "was written to fail, and on this image … it passes". `10-seats.conf` may now be unnecessary. Not settled. + +**Lesson:** the 09-12 decision optimised the console prompt, a metric nobody waits for, and paid for it in the first login, which was not measured until 11-12. Name the metric that matters before optimising. The first SSH login probe arrived two months after the change it would have rejected. + +### 2.3 Serial getty Type=idle / Type=simple +1. 09-10 `80f984b`: removing Type=idle was within noise against agetty's `sleep(1)`. +2. 09-10 `064c4f4`: Type=idle worth 25 ms (291/344 vs 266/283), read as "systemd's job queue draining". +3. 09-26 `b9707e3`/`7b08e5a`: Type=idle was eliminated as the cause of the 340 ms console-swap cost. +4. 11-13 #241: Type=simple shipped, 346/358 vs 423/441, after linger made the idle hold 91.8 ms. +5. 11-13 #249: removed, since the console prompt is not a workspace metric. + +**Lesson:** the value of this setting depends on what else is in the boot transaction. It was re-measured each time something upstream changed (linger), and its worth turns on a metric (the console prompt) that does not matter (#249). Decide which metrics count before shipping fixes for the others. + +### 2.4 SSH host key generation (moved 5 times) +1. 09-07 `8aee03a`: ssh fails five times per boot; "SSH keys are identity and belong wherever the rest of a VM's identity comes from" (not fixed). +2. 09-07 `2df3dbf`: generated per boot, hung off ssh.service. Hanging it off ssh.socket made an ordering cycle. +3. 09-24 `a01c847`: RSA dropped (309 ms in blame). +4. 11-12 #240 `28823fb`: `sshd@` must wait for the keys. Before this, SSH over vsock "worked not at all"; nothing had tested vsock SSH since the socket path changed. +5. 11-12 lab 43312419007: keygen wanted by multi-user.target, 518 vs 514. Nothing gained, because default dependencies kept it after basic.target. Not shipped. +6. 11-13 #247 → #248: wanted by sysinit.target with `DefaultDependencies=no`, 489 → 468 (lab 43483372488). Consumer consequence: a checkpoint taken after boot always carries host keys, so the restorer must re-key (`image/README.md`). + +**Lesson:** the per-connection vsock path ran without host keys until a probe logged in over it. A functional probe of the real login path (`boot:ssh-first`) should come before timing work on it. Step 5 failed for a reason (`DefaultDependencies`) that reading the unit's ordering would have shown. + +### 2.5 Save/restore and templates in the CLI; restore measurement; mapped-ram (proposed twice) +1. 09-07 `656d55b`: save/resume added; reverted the same day as lifecycle (`b882171`). +2. 09-26 `20e14d9`/`ab4844c`: TEMPLATES.md, template restore 24 ms, `drop-cache=off`. +3. 09-28 `c202568`: `save --template`/`restore`, plus `boot:restore`. +4. 09-30 #51: templates removed upstream (spin #194). `boot:restore` deleted, two days after it was written. +5. 11-13 #242: restore measured again, and mapped-ram proposed with `--channels`. Its numbers (lab 43364516874) were contaminated by leaked VMs. +6. 11-13 #246: mapped-ram in the contract. The fleet shows no win (385 vs 386); closed. + +**Lesson:** the product's path (template restore, then checkpoint resume) changed outside this repository, and probes were built and deleted around it within days. Restore of a checkpoint was not measured at all between 09-30 and 11-13. The mapped-ram decision had a fleet result and was reopened with a new reason: on 11-19 `machine.VM` writes every checkpoint in mapped-ram (`FormatMappedRAM`), and on 11-20 multifd channels on it took the restore under 100 ms (#320). A restore with more RAM is still unmeasured (#242's checklist). + +### 2.6 Fingerprint: what it hashes (rewritten ~8 times) +1. Binaries plus shape (09-07). +2. Plus device topology, `b476f6d`. +3. Topology corrected to exclude disks and NICs, `b882171`. +4. NIC count and MTU back in, `6599829`/`2b46d78`. +5. Root ports, then virtio-scsi, in. +6. Firmware by content in, `f2f4da0`. +7. Templates removed, `a9d6083`. +8. One hash, `c5baaa7`. +9. **Contract, not binaries**, `fa3041c` (10-13), after the QEMU 11.1.2 bump stranded every checkpoint (`f0ec1e0`). +10. **No hash at all** (11-21): a record read from the running QEMU, compared part by part (`QEMU.Target`, `CanResume`). + +Each step moved every fingerprint. Comments that said "a QEMU or kernel bump strands checkpoints" survived until `e452afc` (11-12). The verdict tool was blind to `machine/` changes until #98. + +**Lesson:** a prediction of the machine has to be kept honest by a test of its own (boot:roms) and still cannot say what differs. Since 11-21 the record is asked of QEMU, and a refusal names each difference. Check claims about which checkpoints resume against `CanResume`, boot:record and boot:compat, not against older comments. + +### 2.7 Console unit (spin-machine-console.service) +Sequence: created 09-07 (`24c8a06`); made redundant by udev 09-10 (`064c4f4`); measured 340 ms worse as a swap; TERM=dumb fixed it, 09-26 (`7b08e5a`); "viable", but the exposure question was left open; deleted 11-12 (`3a7864d`). + +**Lesson:** two months of a unit nothing enabled. Delete as soon as nothing references a unit. + +### 2.8 Debug init and diagnostic initrds +`cmd/spin-machine-init` was created 09-07 and deleted 09-10 (`8eeb01c`). Diagnostic initrds came back as `boot/probeinit` (09-29, `a81b6b5`), now allowed by CLAUDE.md as isolated diagnostics. + +**Lesson:** the rule ("no init in a release") was clarified rather than broken. AGENTS.md no longer carries that rule. Its "Experiments" section keeps diagnostic initrds apart from release outputs. + +### 2.9 Probes added then deleted (short-lived) +- `boot:matrix` (09-10 → 09-10) +- `kernel/minimal` + `boot:floor` (09-26 → 09-30) +- `boot:kernel-pages` (09-30 → 09-30) +- `boot:memory-unplug` (09-30 → 09-30) +- cache bench (09-11 → 09-30) +- `boot:restore` (09-28 → 09-30) +- `boot:unitload` (09-26 → 10-01) +- `boot:memory-policy` (09-28 → 10-01) +- page-cache sub-probes (09-30 → 10-01) +- bench rows (09-10 … → 10-01) +- console-swap variants (09-26 → 09-30) +- `boot:exits`, `boot:mmio`, `boot:jobs` (11-12 → 11-13, #249) +- `boot:bench`, `boot:trace`, `boot:userspace`, `boot:systemd`, `boot:ssh-load` (→ 11-13, #250) + +This is the cycle AGENTS.md asks for ("Remove an experiment once its question is answered"). The cost is that the answers live only in commit messages and comments. + +**Lesson:** this log, or `docs/memory-and-disk.md`-style records, is where an answered probe's result should land. Before writing a probe, check docs/boot-time.md's "Measured and rejected" and the row comments in `internal/lab/sshfirst.go`. + +### 2.10 /tmp and tmpfiles; erofs; BPF_LSM; chrony +- **/tmp:** masked by the imported optimizer; unmasked 09-26 (`f36ae13`, noise); capped at a quarter 09-28. +- **erofs:** removed from the kernel 09-26 (`5a3d509`); the build assertion relaxed 09-30 (#66) for the pmem/DAX experiment, which was rejected (#63, #65). +- **BPF_LSM:** off 09-07 ("a boundary inside the boundary"); on 10-01 (`1400f6a`), and the stale note was fixed 10-05 (`ebe2a6e`). +- **chrony:** added 09-07, removed 09-10. + +**Lesson:** the imported scripts carried decisions without numbers. Each has been re-decided one at a time. + +### 2.11 CI cache and runners (rebuilt ~5 times) +- gha cache that stored nothing (`c767cd5`, 09-15); +- Blacksmith (09-20); +- the builder's silent fallback (`aa157cf`/`1ef95d1`, 09-26); +- export from main only (`bdec6cc`); +- GitHub runners for builds plus the bench/kvm fleets (10-24); +- the gha cache unreadable on the fleet, so a registry cache (`1666cb5`, 11-12). + +Also the reusable builder, added and reverted on 10-13. + +**Lesson:** each move was taken without checking that the cache was actually hit. A cache-hit assertion would have caught `c767cd5` and `1666cb5` on day one. + +### 2.12 apk locks broke three times +`6e7ba47` (11-03), `8d495c5` (11-09), release run 43157106109 / `ec2c7fb` (11-12); fixed by a daily refresh (`c6c29b5`), which then compiled QEMU cold twice every move. It was fixed structurally on 11-20 by pinning builder images instead of packages. + +**Lesson:** a mirror that serves only the newest build cannot be pinned. Pin something that keeps its contents, such as an image, and move it when the move is wanted. From b11f8700d05cffa0d505b49b488c195d86cdb6ff Mon Sep 17 00:00:00 2001 From: Manuel de Brito Fontes Date: Mon, 23 Nov 2026 19:01:34 -0300 Subject: [PATCH 3/3] docs: the log is docs/log and the tables docs/experiments, rendered, not committed (#709) docs split, run once on the previous commit, wrote 248 entries (docs/log/-.md), docs/log/README.md (the page's head), docs/log/rework.md (section 2, unchanged) and 186 records (docs/experiments/[-].json, one row of a table each). The previous commit's test showed they render the log and the nine tables byte for byte; the verb, its test and the frozen copies go with this commit, as does docs/log.md and the rows of boot-time.md's tables, which now point to the records, the verb and the site. An entry's year is the year of the week heading it sat under ("Week 1: 2026-09-07 to 09-13"), a year later had its month come before the heading's; every entry is 2026. A rejected row's MM-DD date is 2026: the tables began with the repository on 2026-09-07. gates/docs_test.go refuses an entry or record that does not parse, lacks a field, names a decision or section that does not exist, has an invalid date, or lists a run, issue or pull request its text does not cite; every run id its text cites must be listed. pages.yml publishes log.html and experiments.html beside the releases' page. AGENTS.md, measuring.md and cli.md say how to add an entry and a record; every docs/log.md citation names the entry's file. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/pages.yml | 12 +- AGENTS.md | 27 +- README.md | 3 +- cmd/spin-machine-dev/docs.go | 64 +- cmd/spin-machine-dev/docs_test.go | 69 ++ cmd/spin-machine-dev/withdraw.go | 2 +- docs/boot-time.md | 225 +---- docs/cli.md | 20 +- .../10-seats-conf-the-gettys-term.json | 9 + docs/experiments/16-more-unit-masks.json | 12 + .../16-multifd-channels-as-the-default.json | 13 + .../19-udev-rules-masked-loop-and.json | 10 + ...391-an-iothread-for-the-disks-against.json | 18 + ...ithout-opensshs-userauth-minimum-time.json | 16 + ...462-sessions-of-class-user-early-with.json | 18 + .../467-no-user-manager-for-root-a.json | 16 + .../467-sessions-of-class-user-early-and.json | 18 + .../467-the-user-manager-without-the-xdg.json | 17 + ...9-the-images-containerd-socket-out-of.json | 20 + ...inerds-cri-enabled-config-replaced-by.json | 17 + .../515-no-host-key-made-when-spins.json | 16 + ...ots-manager-without-the-xdg-autostart.json | 16 + .../553-logind-user-runtime-dir-and-user.json | 17 + ...-spin-machine-sshd-keygen-and-systemd.json | 16 + .../561-a-workspaces-2048-mib-at-boot.json | 24 + .../566-a-1-mib-readahead-on-the.json | 17 + .../567-config-hz-250-for-hz-1000.json | 17 + ...-journalds-loginds-and-user-s-seccomp.json | 23 + .../574-the-rest-of-the-boot-started-2.json | 16 + .../574-the-rest-of-the-boot-started.json | 16 + ...e-ioapics-redirection-table-read-once.json | 21 + .../591-pci-save-state-at-a-devices.json | 18 + ...-pcis-vendor-capabilities-walked-once.json | 18 + ...2-virtio-pci-writes-queue-select-only.json | 18 + .../592-x86s-msi-set-affinity-skips-the.json | 17 + ...627-kernel-0021-0025-the-boots-device.json | 20 + .../638-pid-1-journald-logind-and-user.json | 16 + .../646-qemu-0007-kept-once-no-release.json | 21 + .../646-the-same-on-qemu-0007-which.json | 17 + .../647-qemus-start-from-its-exec-to.json | 17 + .../649-the-held-starts-bind-sent-ahead.json | 18 + ...660-the-kernel-entered-as-its-vmlinux.json | 22 + ...-generators-disabled-3-tmpfiles-rules.json | 12 + .../experiments/a-burst-of-restores-8-at.json | 12 + .../a-burst-of-restores-bound-by.json | 13 + ...-configuration-space-snapshot-over-fw.json | 13 + .../a-console-unit-instead-of-serial.json | 10 + docs/experiments/a-generous-vcpu-ceiling.json | 10 + .../a-login-without-opensshs-exec-per.json | 9 + .../a-login-without-pam-systemd.json | 13 + .../a-named-cpu-model-instead-of.json | 13 + docs/experiments/a-second-limit.json | 10 + .../a-workspaces-cgroup-at-a-higher.json | 13 + docs/experiments/acpi-params.json | 10 + docs/experiments/agetty-tweaks.json | 10 + .../an-ed25519-host-key-only-no.json | 12 + ...compressed-bzimage-payload-kaslr-kept.json | 10 + .../base-memory-in-a-shared-file.json | 14 + .../base-on-virtio-pmem-and-dax.json | 10 + .../experiments/blk-dev-loop-min-count-0.json | 12 + .../board-init-wrapped-in-one-memory.json | 13 + .../both-user-generators-masked-a-bound.json | 13 + docs/experiments/cache-none-on-disks.json | 10 + ...ied-items-never-measured-alone-kernel.json | 9 + .../checkpoints-on-8-multifd-channels.json | 13 + .../chrony-or-another-time-daemon.json | 10 + docs/experiments/compaction-off.json | 10 + docs/experiments/config-scsi-scan-async.json | 13 + docs/experiments/config-vt-n-for-speed.json | 10 + docs/experiments/config-xfrm-n.json | 10 + .../cpuid-leaf-2-with-qemus-cache.json | 15 + ...ght-ioweight-memorylow-on-ssh-service.json | 10 + .../cpuweight-ioweight-nice-on-the-first.json | 13 + .../damon-reclaim-mglru-eviction.json | 10 + ...ccounting-no-for-cheaper-unit-cgroups.json | 10 + .../deferred-struct-page-init.json | 13 + .../direct-io-on-the-channels-of.json | 13 + .../direct-io-on-the-channels.json | 10 + ...ocker-and-containerd-started-by-their.json | 12 + .../downtime-limit-15-instead-of-30.json | 13 + .../driver-async-probe-for-rng-balloon.json | 13 + docs/experiments/erofs-removed-for-speed.json | 10 + ...ry-logins-user-manager-started-beside.json | 16 + .../every-machine-started-held-so-qemu.json | 12 + .../fast-snapshot-load-as-the-restore.json | 13 + .../fast-snapshot-load-for-every-state.json | 19 + docs/experiments/faster-qmp-in-general.json | 13 + .../fewer-round-trips-no-query-status.json | 10 + docs/experiments/fewer-unit-files.json | 10 + .../getty-without-bindsto-dev-ttys0.json | 13 + .../host-keys-made-from-the-boots.json | 16 + .../hotplug-disks-on-virtio-scsi-not.json | 9 + docs/experiments/hpet-off.json | 9 + docs/experiments/ich9-sata-off-smbus-off.json | 9 + .../initcall-blacklist-ksm-kcompactd.json | 10 + .../journald-volatile-8-mb-its-flush.json | 13 + .../kernel-0006-0009-a-booting-ap.json | 14 + docs/experiments/kernel-0012-and-0013.json | 15 + .../kernel-patches-0001-0005-0007-0008.json | 12 + .../keygen-wanted-by-multi-user-target.json | 13 + docs/experiments/ksm-and-thp-off.json | 10 + .../ksm-free-page-hinting-virtio-fs.json | 10 + .../kvm-halt-poll-ns-cpu-pinning.json | 10 + docs/experiments/lazy-itable-init-0.json | 9 + docs/experiments/less-guest-ram.json | 10 + ...ogind-its-varlink-socket-user-runtime.json | 13 + ...k-socket-without-default-dependencies.json | 14 + .../lower-memhp-default-state.json | 10 + .../lower-the-vcpu-ceiling-drop-the.json | 10 + .../mapped-ram-with-multifd-4-11.json | 13 + .../mask-11-always-failing-units.json | 13 + ...ask-four-varlink-sockets-nothing-uses.json | 10 + docs/experiments/mask-modprobe-drm.json | 13 + .../mask-sshd-socket-and-run-generators.json | 13 + .../mask-sshd-socket-generator-again-on.json | 10 + ...k-systemd-udev-load-credentials-again.json | 13 + .../mask-systemd-udev-load-credentials.json | 14 + docs/experiments/mask-udev.json | 10 + docs/experiments/masks-of-15-units-and-a.json | 10 + docs/experiments/microvm.json | 10 + docs/experiments/modular-kernel.json | 10 + .../motd-and-pam-motd-off-mlkem768x25519.json | 12 + .../no-timer-check-tsc-reliable.json | 9 + .../no-unit-made-for-a-requiresmountsfor.json | 17 + .../nsswitch-conf-without-the-db-entries.json | 13 + docs/experiments/o-orphan-file.json | 9 + .../one-sshd-for-every-connection.json | 13 + docs/experiments/overlay-o-direct.json | 10 + .../page-reporting-order-0-or-3.json | 10 + .../pam-selinux-and-pam-mail-out.json | 13 + docs/experiments/pci-lastbus-0.json | 9 + docs/experiments/pci-noearly.json | 10 + ...pid-1s-loglevel-err-logtarget-journal.json | 14 + docs/experiments/pipelining-the-bind.json | 10 + .../experiments/prefetch-the-boots-files.json | 13 + .../experiments/qboot-instead-of-seabios.json | 12 + .../qboot-mtrr-patch-write-pointer-patch.json | 9 + docs/experiments/qboot-no-pci-walk-patch.json | 12 + docs/experiments/qboot-pam-patch.json | 12 + docs/experiments/qemu-0001.json | 13 + .../qemu-0002-virtio-scsi-max-target.json | 12 + .../qemu-0005-a-machine-made-for.json | 15 + docs/experiments/qemu-0009.json | 17 + .../qemu-at-a-higher-host-priority.json | 13 + .../qemu-copies-the-kernels-elf-segments.json | 14 + ...p-over-vsock-seqpacket-ivshmem-virtio.json | 10 + .../quiet-loglevel-3-panic-1-net.json | 9 + docs/experiments/remove-virtio-rng.json | 13 + docs/experiments/rootfstype-ext4.json | 9 + .../roots-manager-cut-to-what-a.json | 14 + docs/experiments/scsi-mod-scan-manual.json | 13 + docs/experiments/selinux-off-pcre2-on.json | 9 + .../sessions-of-class-user-early-light.json | 12 + docs/experiments/smaller-answers.json | 10 + docs/experiments/smaller-tcp-hash-tables.json | 10 + docs/experiments/sntrup761.json | 13 + .../spin-machine-restore-reads-the-state.json | 12 + ...er-without-default-dependencies-after.json | 18 + .../ssh-service-without-ubuntus-sshd-t.json | 12 + .../ssh-socket-ssh-service-and-sshd.json | 13 + ...ystemd-built-from-ubuntus-source-with.json | 14 + docs/experiments/systemd-oomd.json | 10 + docs/experiments/systemd-timesyncd.json | 10 + ...d-user-sessions-without-its-execstart.json | 10 + .../experiments/systemd-with-db-lto-true.json | 10 + ...temds-drop-in-candidate-names-derived.json | 13 + .../systemds-tools-linked-static.json | 9 + docs/experiments/term-dumb.json | 9 + .../the-boots-default-target-holds-only.json | 13 + ...the-bzimage-beside-the-vmlinux-kernel.json | 17 + ...zimages-decompression-made-cheaper-in.json | 13 + ...compressor-without-x86-verbose-bootup.json | 13 + .../the-guests-clean-page-cache-dropped.json | 13 + .../the-managers-timeouts-at-15-s.json | 13 + .../the-no-systemd-floor-each-release.json | 14 + ...e-pressure-probes-sender-started-with.json | 20 + .../the-read-ahead-asked-for-by.json | 12 + .../the-restore-with-more-than-2.json | 12 + .../the-resume-reads-the-state-ahead.json | 12 + ...he-serial-getty-at-startupcpuweight-1.json | 13 + .../the-state-read-ahead-during-a.json | 14 + .../the-user-managers-pam-stack-down.json | 13 + ...ser-managers-sockets-environment-from.json | 13 + .../the-vsock-socket-and-sshd-without.json | 13 + ...ed-firstboot-machine-id-commit-masked.json | 9 + docs/experiments/trim-the-8250-driver.json | 10 + .../udevd-and-its-coldplug-not-before.json | 13 + .../udevs-coldplug-filtered-cpu-kept-for.json | 15 + .../usb-off-vmport-off-smm-off.json | 10 + .../user-s-after-systemd-user-sessions.json | 13 + .../vmlinux-btf-parsed-on-first-use.json | 14 + docs/experiments/vt-n-x86-msr-n-x86.json | 9 + ...t-functional-items-cost-last-measured.json | 9 + docs/experiments/zram.json | 10 + docs/image.md | 2 +- docs/log.md | 815 ------------------ docs/log/2026-09-07-2afac47-219b98a.md | 7 + docs/log/2026-09-07-2df3dbf.md | 14 + docs/log/2026-09-07-31a57e7.md | 7 + docs/log/2026-09-07-58d404e.md | 7 + .../log/2026-09-07-5e7d60e-8aee03a-24c8a06.md | 7 + ...b476f6d-57e827a-b882171-17d844f-02709d7.md | 14 + docs/log/2026-09-07-656d55b-b882171.md | 8 + docs/log/2026-09-07-8b7391a.md | 12 + docs/log/2026-09-07-b476f6d-ee34d31.md | 7 + docs/log/2026-09-08-fa1803f.md | 7 + docs/log/2026-09-08-fe332b4.md | 8 + ...76aacf9-7cafdf6-6599829-2b46d78-354c8a6.md | 13 + docs/log/2026-09-09-9ca453a.md | 7 + ...4cbd229-bab6f16-c2c4c6a-722d468-b5f361f.md | 7 + ...6aba37b-064c4f4-c7bab94-c7af4d3-08c56e1.md | 14 + docs/log/2026-09-10-80f984b.md | 14 + docs/log/2026-09-10-8eeb01c.md | 7 + docs/log/2026-09-10-b151186.md | 7 + ...1a8e25c-a31d7b2-f32d527-64d2901-e285dec.md | 17 + .../log/2026-09-10-c049a21-8eef89d-a0efd65.md | 7 + docs/log/2026-09-11-21a830c.md | 8 + docs/log/2026-09-11-ec008b0.md | 7 + docs/log/2026-09-12-9177475.md | 7 + docs/log/2026-09-12-bb6bb89.md | 8 + ...6-09-14-9335335-fe7d4ab-891e2f7-b5908ee.md | 13 + docs/log/2026-09-14-b9d1985.md | 7 + docs/log/2026-09-15-c767cd5.md | 7 + ...6-09-18-da17b34-f023b56-5d4a01c-4947281.md | 7 + docs/log/2026-09-20-f63aa38.md | 8 + docs/log/2026-09-21-3d10256-56f6fea.md | 7 + docs/log/2026-09-24-35df9cf.md | 7 + docs/log/2026-09-24-a01c847.md | 7 + ...c6e48de-adc52cd-e2f6b8f-b9707e3-7b08e5a.md | 16 + docs/log/2026-09-26-8063bcd.md | 7 + .../log/2026-09-26-9fab3f1-ad05544-9b5f0dd.md | 8 + docs/log/2026-09-26-aa157cf-1ef95d1.md | 7 + docs/log/2026-09-26-ab4844c.md | 7 + ...6-09-26-dae6a14-5a3d509-cda04b1-9b5f0dd.md | 8 + docs/log/2026-09-26-e4f456f.md | 8 + docs/log/2026-09-26-f36ae13.md | 7 + ...6-09-27-0b1f470-51c1fe9-2f03d09-e7e52db.md | 7 + docs/log/2026-09-27-7ec3601-2f5a7b0.md | 7 + docs/log/2026-09-28-2fd0fff-430d2b3.md | 7 + docs/log/2026-09-28-30b717b-a8e2737.md | 7 + ...6-09-28-5332e97-3bef421-e6a0a1b-6b0f338.md | 7 + docs/log/2026-09-28-c202568.md | 8 + .../log/2026-09-28-f7cd1ab-47aa681-337c08d.md | 8 + .../log/2026-09-29-349dacb-20fd702-3e26963.md | 10 + docs/log/2026-09-29-43fb03b-2b19096.md | 8 + .../log/2026-09-29-a503db7-e9e0c8e-de9b7db.md | 14 + docs/log/2026-09-29-ae6ab48-f2f4da0.md | 9 + .../log/2026-09-30-57-62-64-67-74-77-78-83.md | 9 + docs/log/2026-09-30-6f65249-f10383b.md | 9 + docs/log/2026-09-30-98c3589.md | 8 + docs/log/2026-09-30-a9d6083.md | 8 + docs/log/2026-09-30-f2c47f7.md | 8 + docs/log/2026-10-01-1400f6a.md | 8 + docs/log/2026-10-01-2cd98f0.md | 8 + docs/log/2026-10-01-4511798.md | 9 + docs/log/2026-10-01-5b7b1dc.md | 9 + docs/log/2026-10-01-88-90.md | 8 + docs/log/2026-10-01-aaf2d86.md | 9 + docs/log/2026-10-01-c5baaa7-ca7b54f-94.md | 8 + docs/log/2026-10-09-f0ec1e0.md | 8 + .../log/2026-10-13-7628981-4f7d55e-8c6d1c7.md | 8 + ...845fb5d-f033995-b207bee-302ced2-99e31f9.md | 14 + docs/log/2026-10-13-fa3041c.md | 8 + docs/log/2026-10-19-7bf5429.md | 8 + docs/log/2026-10-19-fb39fd5.md | 8 + ...6-10-24-c75f144-f29e59d-d67afc4-97a6de1.md | 8 + .../log/2026-10-26-1c12413-0bb00ce-fc1079c.md | 8 + .../log/2026-11-03-7c37270-b4b67c3-6e7ba47.md | 8 + .../log/2026-11-09-00db122-0ce27ad-8d495c5.md | 8 + .../log/2026-11-09-ed4ad86-e1d40ad-6e25bb3.md | 7 + docs/log/2026-11-11-cce320f.md | 8 + docs/log/2026-11-12-02c58b9.md | 8 + docs/log/2026-11-12-240.md | 24 + docs/log/2026-11-12-3c8da99.md | 9 + .../log/2026-11-12-c6c29b5-ec2c7fb-1666cb5.md | 9 + docs/log/2026-11-12-e452afc-3a7864d.md | 8 + docs/log/2026-11-13-242-246.md | 13 + docs/log/2026-11-13-249-250.md | 13 + docs/log/2026-11-13-251-252-254.md | 8 + docs/log/2026-11-13-255.md | 9 + docs/log/2026-11-13-3e8075f.md | 9 + docs/log/2026-11-13-43de41e.md | 9 + .../2026-11-13-branch-first-login-report.md | 9 + docs/log/2026-11-13-branch-floor-kernel.md | 8 + ...-branches-kernel-snapshot-qemu-snapshot.md | 8 + docs/log/2026-11-13-d895543-5e0cc2f.md | 9 + ...13-spin-stack-ci-14-15-spin-machine-253.md | 7 + docs/log/2026-11-13-the-first-logins-lane.md | 8 + .../2026-11-13-udevs-coldplug-keeps-cpu.md | 8 + .../2026-11-19-a-place-is-a-filter-node.md | 7 + docs/log/2026-11-19-boot-restore-first.md | 9 + ...ch-kernel-floor-patches-0007-0011-and-a.md | 18 + docs/log/2026-11-19-nested-against-metal.md | 12 + ...or-where-a-checkpoint-resumes-canresume.md | 8 + ...rface-for-spin-machine-vm-every-machine.md | 9 + ...temd-from-ubuntus-source-package-stage1.md | 17 + ...1-19-the-kernel-is-entered-as-a-bzimage.md | 10 + ...-the-probes-become-spin-machine-dev-lab.md | 15 + ...26-11-19-the-release-report-is-a-ladder.md | 9 + ...2026-11-19-the-root-mounts-storage-path.md | 13 + ...-where-pid-1s-gap-between-the-unit-load.md | 14 + ...here-the-first-logins-own-time-goes-and.md | 17 + ...eckpoints-memory-moves-on-8-channels-by.md | 8 + ...6-11-20-a-named-cpu-model-what-it-costs.md | 9 + .../2026-11-20-density-the-latency-half.md | 9 + ...umbers-in-the-repository-measured-alone.md | 8 + ...initcalls-and-density-size-their-guests.md | 8 + ...annels-on-the-checkpoint-the-no-systemd.md | 9 + ...0-qemu-yml-kernel-yml-and-image-yml-are.md | 8 + ...s-login-spins-memory-and-spin-no-longer.md | 14 + ...e-builders-are-images-and-the-apk-locks.md | 7 + ...plug-controller-scans-the-places-it-has.md | 9 + ...ethodology-review-and-docs-boot-time-md.md | 16 + ...-20-the-records-chart-is-an-svg-and-the.md | 7 + ...e-time-before-the-kernels-clock-gets-an.md | 7 + .../2026-11-21-0006-0009-and-0011-deleted.md | 9 + ...eckpoint-and-a-resume-tell-their-phases.md | 9 + ...21-a-checkpoint-plans-a-30-ms-pause-not.md | 9 + ...point-returns-once-qemu-has-left-finish.md | 8 + ...a-checkpoints-pause-is-held-under-50-ms.md | 9 + ...a-checkpoints-stop-does-not-wait-on-the.md | 9 + ...ckpoints-waits-are-its-migration-events.md | 8 + ...ntended-checkpoint-loop-how-a-qemu-bump.md | 8 + ...ks-counters-without-its-backing-chain-x.md | 9 + ...21-a-hosts-record-in-one-call-and-where.md | 7 + ...21-a-machine-held-at-its-cgroups-limits.md | 8 + ...-a-named-cpu-model-costs-the-cold-login.md | 8 + ...-a-per-disk-io-limit-the-first-actuator.md | 8 + ...-without-x-defer-disk-flush-checkpoints.md | 9 + ...read-from-qemu-replaces-the-fingerprint.md | 8 + ...21-a-release-is-measured-at-its-tag-and.md | 8 + ...store-reads-its-state-ahead-before-qemu.md | 8 + ...eckpointed-and-continued-grows-boot-cpu.md | 9 + ...d-struct-page-init-deleted-the-loop-and.md | 9 + ...-doc-checked-against-the-tree-and-spins.md | 8 + ...-1s-quiet-logging-and-the-printk-sysctl.md | 8 + docs/log/2026-11-21-restores-in-a-burst.md | 8 + ...-login-path-starts-from-the-boots-first.md | 9 + ...the-cold-budget-in-spins-shape-and-docs.md | 8 + ...ine-sends-qmp-through-the-public-client.md | 7 + ...the-package-opens-a-disks-chain-and-the.md | 7 + ...the-package-starts-and-ends-the-qemu-it.md | 8 + docs/log/2026-11-21-the-pressure-probe.md | 9 + ...1-21-the-probes-boot-size-and-log-in-as.md | 8 + ...probes-boot-spins-16-controller-targets.md | 8 + .../2026-11-21-the-pvh-boot-path-deleted.md | 7 + ...restore-into-a-qemu-started-ahead-taken.md | 8 + ...the-verbs-spins-runner-drives-a-qemu-by.md | 7 + ...-what-a-host-gives-a-machine-spec-files.md | 8 + ...-21-what-a-snapshot-keeps-boot-rollback.md | 9 + ...t-earned-nothing-in-spins-shape-deleted.md | 8 + ...what-qmp-and-vsock-cost-the-goals-paths.md | 8 + ...6-11-21-what-we-carry-and-what-it-earns.md | 9 + ...6-11-21-where-a-burst-of-restores-waits.md | 10 + ...re-one-vcpus-time-goes-before-the-first.md | 8 + ...uld-a-higher-host-priority-for-qemu-cut.md | 8 + .../2026-11-22-0003-has-no-postcopy-clause.md | 10 + ...11-22-0003-says-the-same-in-fewer-lines.md | 9 + ...22-a-boot-chart-of-every-release-and-of.md | 8 + ...2-a-checkpoints-stop-on-a-host-short-of.md | 9 + ...d-resume-says-whether-the-checkpoint-is.md | 8 + ...11-22-a-ledger-of-the-boot-to-the-first.md | 9 + ...-22-a-probes-login-is-not-preceded-by-a.md | 10 + ...estored-guests-tsc-and-udev-after-basic.md | 8 + ...-resume-takes-its-disks-before-the-load.md | 9 + ...-trees-spin-machine-from-any-commit-and.md | 10 + ...2-compat-in-minutes-and-its-qmp-half-in.md | 9 + ...uid-leaf-2-with-qemus-cache-descriptors.md | 9 + ...-ledger-on-a-traceable-kernel-published.md | 9 + ...ery-carried-patch-has-a-test-that-fails.md | 9 + ...arried-patch-is-git-format-patch-output.md | 9 + ...every-login-gets-its-user-manager-again.md | 9 + ...ses-record-carries-its-no-systemd-floor.md | 8 + ...nning-is-qemu-running-the-resumed-guest.md | 9 + ...2-no-host-key-made-when-spin-hands-over.md | 9 + ...proposes-the-openssh-source-when-ubuntu.md | 9 + ...ger-without-the-xdg-autostart-generator.md | 9 + ...viations-measured-two-reverted-and-boot.md | 10 + ...early-login-each-number-against-its-own.md | 8 + ...sh-first-logs-in-over-the-connection-it.md | 9 + ...11-22-ssh-service-starts-without-sshd-t.md | 8 + ...sshd-delays-a-failed-userauth-and-not-a.md | 9 + ...hart-from-spin-stacks-systemd-bootchart.md | 8 + ...-boot-chart-without-the-things-a-reader.md | 8 + ...boot-charts-first-sample-wait-graph-and.md | 10 + ...oots-dependency-view-and-what-fills-the.md | 9 + ...e-coverage-floor-counts-what-ci-can-run.md | 8 + ...e-coverage-floor-is-go-tools-coverfloor.md | 8 + ...2-the-cpu-weight-while-the-boot-runs-on.md | 8 + ...-first-login-waits-for-its-user-manager.md | 9 + ...2-the-floors-gap-is-a-with-its-interval.md | 9 + ...1-22-the-host-counts-the-port-i-o-exits.md | 9 + ...026-11-22-the-host-key-is-ed25519-alone.md | 8 + ...-the-machine-loads-a-state-fast-above-1.md | 9 + ...he-read-ahead-asks-from-four-goroutines.md | 8 + ...v-after-basic-target-and-the-no-systemd.md | 9 + ...linux-btf-parsed-on-first-use-moves-the.md | 8 + ...what-a-guest-sends-on-the-pressure-port.md | 8 + ...hat-a-restored-login-waits-on-and-sshds.md | 9 + ...bzimage-mapped-not-read-into-qemus-heap.md | 10 + ...-guest-that-drops-its-page-cache-before.md | 9 + ...uests-synced-writes-on-a-saturated-host.md | 9 + ...-a-probe-saves-once-the-guests-boot-has.md | 9 + ...ssed-release-is-withdrawn-never-deleted.md | 9 + ...e-of-another-length-than-its-checkpoint.md | 9 + ...orkspaces-memory-at-boot-beats-the-same.md | 9 + ...-config-hz-250-removes-587-exits-and-no.md | 9 + ...ontainerds-config-is-containerd-ios-own.md | 9 + ...-density-on-metal-and-a-cpu-bound-crowd.md | 9 + ...er-socket-is-dockers-own-0660-and-group.md | 10 + .../log/2026-11-23-dockers-packages-pinned.md | 9 + ...23-each-mmio-exit-put-on-the-guest-code.md | 9 + ...leaf-2-describes-the-caches-leaf-4-does.md | 10 + ...23-login-spin-hands-over-spins-host-key.md | 10 + ...-s-forwarder-is-spin-supervisor-service.md | 9 + ...07-deleted-no-release-from-v20261123-07.md | 9 + ...mus-start-and-the-held-starts-qmp-split.md | 9 + ...t-patch-drop-in-candidate-names-derived.md | 9 + ...3-the-boot-charts-io-graphs-draw-each-5.md | 8 + ...-boots-device-setup-exits-as-one-change.md | 9 + ...dynamic-linkers-share-of-pid-1-journald.md | 9 + ...-23-the-executors-sandbox-a-bound-14-ms.md | 10 + ...ors-sandbox-costs-its-system-call-allow.md | 10 + .../log/2026-11-23-the-first-logins-target.md | 9 + ...-23-the-inventorys-blind-spot-was-mkosi.md | 9 + ...ioapics-table-read-once-takes-384-exits.md | 9 + ...rnel-entered-as-its-vmlinux-through-pvh.md | 9 + ...dger-splits-the-span-before-the-kernels.md | 9 + ...edgers-kernel-zero-on-the-kernels-sched.md | 9 + ...essure-sender-started-by-the-boots-rest.md | 10 + ...d-holds-the-vcpus-properties-that-shape.md | 9 + ...release-is-its-vmlinux-alone-no-bzimage.md | 9 + ...ble-kernel-is-a-vmlinux-entered-through.md | 9 + ...update-stamps-written-at-build-the-five.md | 9 + ...inux-copied-into-guest-ram-beside-qemus.md | 9 + ...3-the-volatile-journal-holds-8-mb-not-4.md | 9 + ...o-levers-on-the-boots-ecam-reads-remove.md | 9 + ...zdata-e2fsprogs-and-fuse3-are-installed.md | 10 + ...red-refuses-a-pool-whose-cpus-differ-in.md | 8 + ...123-07-holds-645s-cold-gain-its-records.md | 9 + ...pcis-queue-selection-and-msi-x-rewrites.md | 9 + ...inux-btf-is-parsed-when-a-program-first.md | 9 + ...3-what-setmemory-down-and-one-vcpu-cost.md | 8 + ...-where-a-cold-boots-ept-violations-land.md | 9 + docs/log/README.md | 11 + docs/log/rework.md | 121 +++ docs/machine.md | 2 +- docs/measuring.md | 15 +- docs/memory-and-disk.md | 2 +- docs/releasing.md | 2 +- gates/docs_test.go | 31 + internal/docsrec/docsrec.go | 2 +- internal/docsrec/docsrec_test.go | 203 +++++ internal/docsrec/log.go | 10 +- internal/docsrec/split.go | 238 ----- internal/docsrec/split_test.go | 91 -- internal/docsrec/tables.go | 9 +- .../experiments/7-rejected-earlier.json | 11 + .../testdata/experiments/carried-one.json | 11 + .../testdata/experiments/open-one.json | 9 + .../testdata/experiments/rejected-later.json | 10 + .../log/2026-11-13-the-last-of-week-ten.md | 13 + .../testdata/log/2026-11-14-also-twenty.md | 7 + .../log/2026-11-14-second-of-the-day.md | 7 + .../testdata/log/2026-11-14-spans-two-days.md | 10 + internal/docsrec/testdata/log/README.md | 3 + internal/docsrec/testdata/log/rework.md | 3 + internal/docsrec/testdata/split/boot-time.md | 517 ----------- internal/docsrec/testdata/split/kinds.txt | 711 --------------- internal/docsrec/testdata/split/log.md | 815 ------------------ 470 files changed, 5220 insertions(+), 3495 deletions(-) create mode 100644 cmd/spin-machine-dev/docs_test.go create mode 100644 docs/experiments/10-seats-conf-the-gettys-term.json create mode 100644 docs/experiments/16-more-unit-masks.json create mode 100644 docs/experiments/16-multifd-channels-as-the-default.json create mode 100644 docs/experiments/19-udev-rules-masked-loop-and.json create mode 100644 docs/experiments/391-an-iothread-for-the-disks-against.json create mode 100644 docs/experiments/457-sshd-without-opensshs-userauth-minimum-time.json create mode 100644 docs/experiments/462-sessions-of-class-user-early-with.json create mode 100644 docs/experiments/467-no-user-manager-for-root-a.json create mode 100644 docs/experiments/467-sessions-of-class-user-early-and.json create mode 100644 docs/experiments/467-the-user-manager-without-the-xdg.json create mode 100644 docs/experiments/509-the-images-containerd-socket-out-of.json create mode 100644 docs/experiments/510-containerds-cri-enabled-config-replaced-by.json create mode 100644 docs/experiments/515-no-host-key-made-when-spins.json create mode 100644 docs/experiments/527-roots-manager-without-the-xdg-autostart.json create mode 100644 docs/experiments/553-logind-user-runtime-dir-and-user.json create mode 100644 docs/experiments/553-spin-machine-sshd-keygen-and-systemd.json create mode 100644 docs/experiments/561-a-workspaces-2048-mib-at-boot.json create mode 100644 docs/experiments/566-a-1-mib-readahead-on-the.json create mode 100644 docs/experiments/567-config-hz-250-for-hz-1000.json create mode 100644 docs/experiments/574-journalds-loginds-and-user-s-seccomp.json create mode 100644 docs/experiments/574-the-rest-of-the-boot-started-2.json create mode 100644 docs/experiments/574-the-rest-of-the-boot-started.json create mode 100644 docs/experiments/590-the-ioapics-redirection-table-read-once.json create mode 100644 docs/experiments/591-pci-save-state-at-a-devices.json create mode 100644 docs/experiments/591-virtio-pcis-vendor-capabilities-walked-once.json create mode 100644 docs/experiments/592-virtio-pci-writes-queue-select-only.json create mode 100644 docs/experiments/592-x86s-msi-set-affinity-skips-the.json create mode 100644 docs/experiments/627-kernel-0021-0025-the-boots-device.json create mode 100644 docs/experiments/638-pid-1-journald-logind-and-user.json create mode 100644 docs/experiments/646-qemu-0007-kept-once-no-release.json create mode 100644 docs/experiments/646-the-same-on-qemu-0007-which.json create mode 100644 docs/experiments/647-qemus-start-from-its-exec-to.json create mode 100644 docs/experiments/649-the-held-starts-bind-sent-ahead.json create mode 100644 docs/experiments/660-the-kernel-entered-as-its-vmlinux.json create mode 100644 docs/experiments/8-generators-disabled-3-tmpfiles-rules.json create mode 100644 docs/experiments/a-burst-of-restores-8-at.json create mode 100644 docs/experiments/a-burst-of-restores-bound-by.json create mode 100644 docs/experiments/a-configuration-space-snapshot-over-fw.json create mode 100644 docs/experiments/a-console-unit-instead-of-serial.json create mode 100644 docs/experiments/a-generous-vcpu-ceiling.json create mode 100644 docs/experiments/a-login-without-opensshs-exec-per.json create mode 100644 docs/experiments/a-login-without-pam-systemd.json create mode 100644 docs/experiments/a-named-cpu-model-instead-of.json create mode 100644 docs/experiments/a-second-limit.json create mode 100644 docs/experiments/a-workspaces-cgroup-at-a-higher.json create mode 100644 docs/experiments/acpi-params.json create mode 100644 docs/experiments/agetty-tweaks.json create mode 100644 docs/experiments/an-ed25519-host-key-only-no.json create mode 100644 docs/experiments/an-uncompressed-bzimage-payload-kaslr-kept.json create mode 100644 docs/experiments/base-memory-in-a-shared-file.json create mode 100644 docs/experiments/base-on-virtio-pmem-and-dax.json create mode 100644 docs/experiments/blk-dev-loop-min-count-0.json create mode 100644 docs/experiments/board-init-wrapped-in-one-memory.json create mode 100644 docs/experiments/both-user-generators-masked-a-bound.json create mode 100644 docs/experiments/cache-none-on-disks.json create mode 100644 docs/experiments/carried-items-never-measured-alone-kernel.json create mode 100644 docs/experiments/checkpoints-on-8-multifd-channels.json create mode 100644 docs/experiments/chrony-or-another-time-daemon.json create mode 100644 docs/experiments/compaction-off.json create mode 100644 docs/experiments/config-scsi-scan-async.json create mode 100644 docs/experiments/config-vt-n-for-speed.json create mode 100644 docs/experiments/config-xfrm-n.json create mode 100644 docs/experiments/cpuid-leaf-2-with-qemus-cache.json create mode 100644 docs/experiments/cpuweight-ioweight-memorylow-on-ssh-service.json create mode 100644 docs/experiments/cpuweight-ioweight-nice-on-the-first.json create mode 100644 docs/experiments/damon-reclaim-mglru-eviction.json create mode 100644 docs/experiments/defaultmemoryaccounting-no-for-cheaper-unit-cgroups.json create mode 100644 docs/experiments/deferred-struct-page-init.json create mode 100644 docs/experiments/direct-io-on-the-channels-of.json create mode 100644 docs/experiments/direct-io-on-the-channels.json create mode 100644 docs/experiments/docker-and-containerd-started-by-their.json create mode 100644 docs/experiments/downtime-limit-15-instead-of-30.json create mode 100644 docs/experiments/driver-async-probe-for-rng-balloon.json create mode 100644 docs/experiments/erofs-removed-for-speed.json create mode 100644 docs/experiments/every-logins-user-manager-started-beside.json create mode 100644 docs/experiments/every-machine-started-held-so-qemu.json create mode 100644 docs/experiments/fast-snapshot-load-as-the-restore.json create mode 100644 docs/experiments/fast-snapshot-load-for-every-state.json create mode 100644 docs/experiments/faster-qmp-in-general.json create mode 100644 docs/experiments/fewer-round-trips-no-query-status.json create mode 100644 docs/experiments/fewer-unit-files.json create mode 100644 docs/experiments/getty-without-bindsto-dev-ttys0.json create mode 100644 docs/experiments/host-keys-made-from-the-boots.json create mode 100644 docs/experiments/hotplug-disks-on-virtio-scsi-not.json create mode 100644 docs/experiments/hpet-off.json create mode 100644 docs/experiments/ich9-sata-off-smbus-off.json create mode 100644 docs/experiments/initcall-blacklist-ksm-kcompactd.json create mode 100644 docs/experiments/journald-volatile-8-mb-its-flush.json create mode 100644 docs/experiments/kernel-0006-0009-a-booting-ap.json create mode 100644 docs/experiments/kernel-0012-and-0013.json create mode 100644 docs/experiments/kernel-patches-0001-0005-0007-0008.json create mode 100644 docs/experiments/keygen-wanted-by-multi-user-target.json create mode 100644 docs/experiments/ksm-and-thp-off.json create mode 100644 docs/experiments/ksm-free-page-hinting-virtio-fs.json create mode 100644 docs/experiments/kvm-halt-poll-ns-cpu-pinning.json create mode 100644 docs/experiments/lazy-itable-init-0.json create mode 100644 docs/experiments/less-guest-ram.json create mode 100644 docs/experiments/logind-its-varlink-socket-user-runtime.json create mode 100644 docs/experiments/loginds-varlink-socket-without-default-dependencies.json create mode 100644 docs/experiments/lower-memhp-default-state.json create mode 100644 docs/experiments/lower-the-vcpu-ceiling-drop-the.json create mode 100644 docs/experiments/mapped-ram-with-multifd-4-11.json create mode 100644 docs/experiments/mask-11-always-failing-units.json create mode 100644 docs/experiments/mask-four-varlink-sockets-nothing-uses.json create mode 100644 docs/experiments/mask-modprobe-drm.json create mode 100644 docs/experiments/mask-sshd-socket-and-run-generators.json create mode 100644 docs/experiments/mask-sshd-socket-generator-again-on.json create mode 100644 docs/experiments/mask-systemd-udev-load-credentials-again.json create mode 100644 docs/experiments/mask-systemd-udev-load-credentials.json create mode 100644 docs/experiments/mask-udev.json create mode 100644 docs/experiments/masks-of-15-units-and-a.json create mode 100644 docs/experiments/microvm.json create mode 100644 docs/experiments/modular-kernel.json create mode 100644 docs/experiments/motd-and-pam-motd-off-mlkem768x25519.json create mode 100644 docs/experiments/no-timer-check-tsc-reliable.json create mode 100644 docs/experiments/no-unit-made-for-a-requiresmountsfor.json create mode 100644 docs/experiments/nsswitch-conf-without-the-db-entries.json create mode 100644 docs/experiments/o-orphan-file.json create mode 100644 docs/experiments/one-sshd-for-every-connection.json create mode 100644 docs/experiments/overlay-o-direct.json create mode 100644 docs/experiments/page-reporting-order-0-or-3.json create mode 100644 docs/experiments/pam-selinux-and-pam-mail-out.json create mode 100644 docs/experiments/pci-lastbus-0.json create mode 100644 docs/experiments/pci-noearly.json create mode 100644 docs/experiments/pid-1s-loglevel-err-logtarget-journal.json create mode 100644 docs/experiments/pipelining-the-bind.json create mode 100644 docs/experiments/prefetch-the-boots-files.json create mode 100644 docs/experiments/qboot-instead-of-seabios.json create mode 100644 docs/experiments/qboot-mtrr-patch-write-pointer-patch.json create mode 100644 docs/experiments/qboot-no-pci-walk-patch.json create mode 100644 docs/experiments/qboot-pam-patch.json create mode 100644 docs/experiments/qemu-0001.json create mode 100644 docs/experiments/qemu-0002-virtio-scsi-max-target.json create mode 100644 docs/experiments/qemu-0005-a-machine-made-for.json create mode 100644 docs/experiments/qemu-0009.json create mode 100644 docs/experiments/qemu-at-a-higher-host-priority.json create mode 100644 docs/experiments/qemu-copies-the-kernels-elf-segments.json create mode 100644 docs/experiments/qmp-over-vsock-seqpacket-ivshmem-virtio.json create mode 100644 docs/experiments/quiet-loglevel-3-panic-1-net.json create mode 100644 docs/experiments/remove-virtio-rng.json create mode 100644 docs/experiments/rootfstype-ext4.json create mode 100644 docs/experiments/roots-manager-cut-to-what-a.json create mode 100644 docs/experiments/scsi-mod-scan-manual.json create mode 100644 docs/experiments/selinux-off-pcre2-on.json create mode 100644 docs/experiments/sessions-of-class-user-early-light.json create mode 100644 docs/experiments/smaller-answers.json create mode 100644 docs/experiments/smaller-tcp-hash-tables.json create mode 100644 docs/experiments/sntrup761.json create mode 100644 docs/experiments/spin-machine-restore-reads-the-state.json create mode 100644 docs/experiments/spins-forwarder-without-default-dependencies-after.json create mode 100644 docs/experiments/ssh-service-without-ubuntus-sshd-t.json create mode 100644 docs/experiments/ssh-socket-ssh-service-and-sshd.json create mode 100644 docs/experiments/systemd-built-from-ubuntus-source-with.json create mode 100644 docs/experiments/systemd-oomd.json create mode 100644 docs/experiments/systemd-timesyncd.json create mode 100644 docs/experiments/systemd-user-sessions-without-its-execstart.json create mode 100644 docs/experiments/systemd-with-db-lto-true.json create mode 100644 docs/experiments/systemds-drop-in-candidate-names-derived.json create mode 100644 docs/experiments/systemds-tools-linked-static.json create mode 100644 docs/experiments/term-dumb.json create mode 100644 docs/experiments/the-boots-default-target-holds-only.json create mode 100644 docs/experiments/the-bzimage-beside-the-vmlinux-kernel.json create mode 100644 docs/experiments/the-bzimages-decompression-made-cheaper-in.json create mode 100644 docs/experiments/the-decompressor-without-x86-verbose-bootup.json create mode 100644 docs/experiments/the-guests-clean-page-cache-dropped.json create mode 100644 docs/experiments/the-managers-timeouts-at-15-s.json create mode 100644 docs/experiments/the-no-systemd-floor-each-release.json create mode 100644 docs/experiments/the-pressure-probes-sender-started-with.json create mode 100644 docs/experiments/the-read-ahead-asked-for-by.json create mode 100644 docs/experiments/the-restore-with-more-than-2.json create mode 100644 docs/experiments/the-resume-reads-the-state-ahead.json create mode 100644 docs/experiments/the-serial-getty-at-startupcpuweight-1.json create mode 100644 docs/experiments/the-state-read-ahead-during-a.json create mode 100644 docs/experiments/the-user-managers-pam-stack-down.json create mode 100644 docs/experiments/the-user-managers-sockets-environment-from.json create mode 100644 docs/experiments/the-vsock-socket-and-sshd-without.json create mode 100644 docs/experiments/timedated-firstboot-machine-id-commit-masked.json create mode 100644 docs/experiments/trim-the-8250-driver.json create mode 100644 docs/experiments/udevd-and-its-coldplug-not-before.json create mode 100644 docs/experiments/udevs-coldplug-filtered-cpu-kept-for.json create mode 100644 docs/experiments/usb-off-vmport-off-smm-off.json create mode 100644 docs/experiments/user-s-after-systemd-user-sessions.json create mode 100644 docs/experiments/vmlinux-btf-parsed-on-first-use.json create mode 100644 docs/experiments/vt-n-x86-msr-n-x86.json create mode 100644 docs/experiments/what-functional-items-cost-last-measured.json create mode 100644 docs/experiments/zram.json delete mode 100644 docs/log.md create mode 100644 docs/log/2026-09-07-2afac47-219b98a.md create mode 100644 docs/log/2026-09-07-2df3dbf.md create mode 100644 docs/log/2026-09-07-31a57e7.md create mode 100644 docs/log/2026-09-07-58d404e.md create mode 100644 docs/log/2026-09-07-5e7d60e-8aee03a-24c8a06.md create mode 100644 docs/log/2026-09-07-5e7d60e-b476f6d-57e827a-b882171-17d844f-02709d7.md create mode 100644 docs/log/2026-09-07-656d55b-b882171.md create mode 100644 docs/log/2026-09-07-8b7391a.md create mode 100644 docs/log/2026-09-07-b476f6d-ee34d31.md create mode 100644 docs/log/2026-09-08-fa1803f.md create mode 100644 docs/log/2026-09-08-fe332b4.md create mode 100644 docs/log/2026-09-09-76aacf9-7cafdf6-6599829-2b46d78-354c8a6.md create mode 100644 docs/log/2026-09-09-9ca453a.md create mode 100644 docs/log/2026-09-10-4cbd229-bab6f16-c2c4c6a-722d468-b5f361f.md create mode 100644 docs/log/2026-09-10-6aba37b-064c4f4-c7bab94-c7af4d3-08c56e1.md create mode 100644 docs/log/2026-09-10-80f984b.md create mode 100644 docs/log/2026-09-10-8eeb01c.md create mode 100644 docs/log/2026-09-10-b151186.md create mode 100644 docs/log/2026-09-10-c03ed89-1a8e25c-a31d7b2-f32d527-64d2901-e285dec.md create mode 100644 docs/log/2026-09-10-c049a21-8eef89d-a0efd65.md create mode 100644 docs/log/2026-09-11-21a830c.md create mode 100644 docs/log/2026-09-11-ec008b0.md create mode 100644 docs/log/2026-09-12-9177475.md create mode 100644 docs/log/2026-09-12-bb6bb89.md create mode 100644 docs/log/2026-09-14-9335335-fe7d4ab-891e2f7-b5908ee.md create mode 100644 docs/log/2026-09-14-b9d1985.md create mode 100644 docs/log/2026-09-15-c767cd5.md create mode 100644 docs/log/2026-09-18-da17b34-f023b56-5d4a01c-4947281.md create mode 100644 docs/log/2026-09-20-f63aa38.md create mode 100644 docs/log/2026-09-21-3d10256-56f6fea.md create mode 100644 docs/log/2026-09-24-35df9cf.md create mode 100644 docs/log/2026-09-24-a01c847.md create mode 100644 docs/log/2026-09-26-5221690-c6e48de-adc52cd-e2f6b8f-b9707e3-7b08e5a.md create mode 100644 docs/log/2026-09-26-8063bcd.md create mode 100644 docs/log/2026-09-26-9fab3f1-ad05544-9b5f0dd.md create mode 100644 docs/log/2026-09-26-aa157cf-1ef95d1.md create mode 100644 docs/log/2026-09-26-ab4844c.md create mode 100644 docs/log/2026-09-26-dae6a14-5a3d509-cda04b1-9b5f0dd.md create mode 100644 docs/log/2026-09-26-e4f456f.md create mode 100644 docs/log/2026-09-26-f36ae13.md create mode 100644 docs/log/2026-09-27-0b1f470-51c1fe9-2f03d09-e7e52db.md create mode 100644 docs/log/2026-09-27-7ec3601-2f5a7b0.md create mode 100644 docs/log/2026-09-28-2fd0fff-430d2b3.md create mode 100644 docs/log/2026-09-28-30b717b-a8e2737.md create mode 100644 docs/log/2026-09-28-5332e97-3bef421-e6a0a1b-6b0f338.md create mode 100644 docs/log/2026-09-28-c202568.md create mode 100644 docs/log/2026-09-28-f7cd1ab-47aa681-337c08d.md create mode 100644 docs/log/2026-09-29-349dacb-20fd702-3e26963.md create mode 100644 docs/log/2026-09-29-43fb03b-2b19096.md create mode 100644 docs/log/2026-09-29-a503db7-e9e0c8e-de9b7db.md create mode 100644 docs/log/2026-09-29-ae6ab48-f2f4da0.md create mode 100644 docs/log/2026-09-30-57-62-64-67-74-77-78-83.md create mode 100644 docs/log/2026-09-30-6f65249-f10383b.md create mode 100644 docs/log/2026-09-30-98c3589.md create mode 100644 docs/log/2026-09-30-a9d6083.md create mode 100644 docs/log/2026-09-30-f2c47f7.md create mode 100644 docs/log/2026-10-01-1400f6a.md create mode 100644 docs/log/2026-10-01-2cd98f0.md create mode 100644 docs/log/2026-10-01-4511798.md create mode 100644 docs/log/2026-10-01-5b7b1dc.md create mode 100644 docs/log/2026-10-01-88-90.md create mode 100644 docs/log/2026-10-01-aaf2d86.md create mode 100644 docs/log/2026-10-01-c5baaa7-ca7b54f-94.md create mode 100644 docs/log/2026-10-09-f0ec1e0.md create mode 100644 docs/log/2026-10-13-7628981-4f7d55e-8c6d1c7.md create mode 100644 docs/log/2026-10-13-d692a7c-03aeb28-96a39d2-845fb5d-f033995-b207bee-302ced2-99e31f9.md create mode 100644 docs/log/2026-10-13-fa3041c.md create mode 100644 docs/log/2026-10-19-7bf5429.md create mode 100644 docs/log/2026-10-19-fb39fd5.md create mode 100644 docs/log/2026-10-24-c75f144-f29e59d-d67afc4-97a6de1.md create mode 100644 docs/log/2026-10-26-1c12413-0bb00ce-fc1079c.md create mode 100644 docs/log/2026-11-03-7c37270-b4b67c3-6e7ba47.md create mode 100644 docs/log/2026-11-09-00db122-0ce27ad-8d495c5.md create mode 100644 docs/log/2026-11-09-ed4ad86-e1d40ad-6e25bb3.md create mode 100644 docs/log/2026-11-11-cce320f.md create mode 100644 docs/log/2026-11-12-02c58b9.md create mode 100644 docs/log/2026-11-12-240.md create mode 100644 docs/log/2026-11-12-3c8da99.md create mode 100644 docs/log/2026-11-12-c6c29b5-ec2c7fb-1666cb5.md create mode 100644 docs/log/2026-11-12-e452afc-3a7864d.md create mode 100644 docs/log/2026-11-13-242-246.md create mode 100644 docs/log/2026-11-13-249-250.md create mode 100644 docs/log/2026-11-13-251-252-254.md create mode 100644 docs/log/2026-11-13-255.md create mode 100644 docs/log/2026-11-13-3e8075f.md create mode 100644 docs/log/2026-11-13-43de41e.md create mode 100644 docs/log/2026-11-13-branch-first-login-report.md create mode 100644 docs/log/2026-11-13-branch-floor-kernel.md create mode 100644 docs/log/2026-11-13-branches-kernel-snapshot-qemu-snapshot.md create mode 100644 docs/log/2026-11-13-d895543-5e0cc2f.md create mode 100644 docs/log/2026-11-13-spin-stack-ci-14-15-spin-machine-253.md create mode 100644 docs/log/2026-11-13-the-first-logins-lane.md create mode 100644 docs/log/2026-11-13-udevs-coldplug-keeps-cpu.md create mode 100644 docs/log/2026-11-19-a-place-is-a-filter-node.md create mode 100644 docs/log/2026-11-19-boot-restore-first.md create mode 100644 docs/log/2026-11-19-branch-kernel-floor-patches-0007-0011-and-a.md create mode 100644 docs/log/2026-11-19-nested-against-metal.md create mode 100644 docs/log/2026-11-19-one-rule-for-where-a-checkpoint-resumes-canresume.md create mode 100644 docs/log/2026-11-19-one-surface-for-spin-machine-vm-every-machine.md create mode 100644 docs/log/2026-11-19-systemd-from-ubuntus-source-package-stage1.md create mode 100644 docs/log/2026-11-19-the-kernel-is-entered-as-a-bzimage.md create mode 100644 docs/log/2026-11-19-the-probes-become-spin-machine-dev-lab.md create mode 100644 docs/log/2026-11-19-the-release-report-is-a-ladder.md create mode 100644 docs/log/2026-11-19-the-root-mounts-storage-path.md create mode 100644 docs/log/2026-11-19-where-pid-1s-gap-between-the-unit-load.md create mode 100644 docs/log/2026-11-19-where-the-first-logins-own-time-goes-and.md create mode 100644 docs/log/2026-11-20-a-checkpoints-memory-moves-on-8-channels-by.md create mode 100644 docs/log/2026-11-20-a-named-cpu-model-what-it-costs.md create mode 100644 docs/log/2026-11-20-density-the-latency-half.md create mode 100644 docs/log/2026-11-20-each-releases-numbers-in-the-repository-measured-alone.md create mode 100644 docs/log/2026-11-20-initcalls-and-density-size-their-guests.md create mode 100644 docs/log/2026-11-20-multifd-channels-on-the-checkpoint-the-no-systemd.md create mode 100644 docs/log/2026-11-20-qemu-yml-kernel-yml-and-image-yml-are.md create mode 100644 docs/log/2026-11-20-spins-login-spins-memory-and-spin-no-longer.md create mode 100644 docs/log/2026-11-20-the-builders-are-images-and-the-apk-locks.md create mode 100644 docs/log/2026-11-20-the-hotplug-controller-scans-the-places-it-has.md create mode 100644 docs/log/2026-11-20-the-methodology-review-and-docs-boot-time-md.md create mode 100644 docs/log/2026-11-20-the-records-chart-is-an-svg-and-the.md create mode 100644 docs/log/2026-11-20-the-time-before-the-kernels-clock-gets-an.md create mode 100644 docs/log/2026-11-21-0006-0009-and-0011-deleted.md create mode 100644 docs/log/2026-11-21-a-checkpoint-and-a-resume-tell-their-phases.md create mode 100644 docs/log/2026-11-21-a-checkpoint-plans-a-30-ms-pause-not.md create mode 100644 docs/log/2026-11-21-a-checkpoint-returns-once-qemu-has-left-finish.md create mode 100644 docs/log/2026-11-21-a-checkpoints-pause-is-held-under-50-ms.md create mode 100644 docs/log/2026-11-21-a-checkpoints-stop-does-not-wait-on-the.md create mode 100644 docs/log/2026-11-21-a-checkpoints-waits-are-its-migration-events.md create mode 100644 docs/log/2026-11-21-a-contended-checkpoint-loop-how-a-qemu-bump.md create mode 100644 docs/log/2026-11-21-a-disks-counters-without-its-backing-chain-x.md create mode 100644 docs/log/2026-11-21-a-hosts-record-in-one-call-and-where.md create mode 100644 docs/log/2026-11-21-a-machine-held-at-its-cgroups-limits.md create mode 100644 docs/log/2026-11-21-a-named-cpu-model-costs-the-cold-login.md create mode 100644 docs/log/2026-11-21-a-per-disk-io-limit-the-first-actuator.md create mode 100644 docs/log/2026-11-21-a-qemu-without-x-defer-disk-flush-checkpoints.md create mode 100644 docs/log/2026-11-21-a-record-read-from-qemu-replaces-the-fingerprint.md create mode 100644 docs/log/2026-11-21-a-release-is-measured-at-its-tag-and.md create mode 100644 docs/log/2026-11-21-a-restore-reads-its-state-ahead-before-qemu.md create mode 100644 docs/log/2026-11-21-a-workspace-checkpointed-and-continued-grows-boot-cpu.md create mode 100644 docs/log/2026-11-21-deferred-struct-page-init-deleted-the-loop-and.md create mode 100644 docs/log/2026-11-21-every-doc-checked-against-the-tree-and-spins.md create mode 100644 docs/log/2026-11-21-pid-1s-quiet-logging-and-the-printk-sysctl.md create mode 100644 docs/log/2026-11-21-restores-in-a-burst.md create mode 100644 docs/log/2026-11-21-spins-login-path-starts-from-the-boots-first.md create mode 100644 docs/log/2026-11-21-the-cold-budget-in-spins-shape-and-docs.md create mode 100644 docs/log/2026-11-21-the-machine-sends-qmp-through-the-public-client.md create mode 100644 docs/log/2026-11-21-the-package-opens-a-disks-chain-and-the.md create mode 100644 docs/log/2026-11-21-the-package-starts-and-ends-the-qemu-it.md create mode 100644 docs/log/2026-11-21-the-pressure-probe.md create mode 100644 docs/log/2026-11-21-the-probes-boot-size-and-log-in-as.md create mode 100644 docs/log/2026-11-21-the-probes-boot-spins-16-controller-targets.md create mode 100644 docs/log/2026-11-21-the-pvh-boot-path-deleted.md create mode 100644 docs/log/2026-11-21-the-restore-into-a-qemu-started-ahead-taken.md create mode 100644 docs/log/2026-11-21-the-verbs-spins-runner-drives-a-qemu-by.md create mode 100644 docs/log/2026-11-21-what-a-host-gives-a-machine-spec-files.md create mode 100644 docs/log/2026-11-21-what-a-snapshot-keeps-boot-rollback.md create mode 100644 docs/log/2026-11-21-what-earned-nothing-in-spins-shape-deleted.md create mode 100644 docs/log/2026-11-21-what-qmp-and-vsock-cost-the-goals-paths.md create mode 100644 docs/log/2026-11-21-what-we-carry-and-what-it-earns.md create mode 100644 docs/log/2026-11-21-where-a-burst-of-restores-waits.md create mode 100644 docs/log/2026-11-21-where-one-vcpus-time-goes-before-the-first.md create mode 100644 docs/log/2026-11-21-would-a-higher-host-priority-for-qemu-cut.md create mode 100644 docs/log/2026-11-22-0003-has-no-postcopy-clause.md create mode 100644 docs/log/2026-11-22-0003-says-the-same-in-fewer-lines.md create mode 100644 docs/log/2026-11-22-a-boot-chart-of-every-release-and-of.md create mode 100644 docs/log/2026-11-22-a-checkpoints-stop-on-a-host-short-of.md create mode 100644 docs/log/2026-11-22-a-failed-resume-says-whether-the-checkpoint-is.md create mode 100644 docs/log/2026-11-22-a-ledger-of-the-boot-to-the-first.md create mode 100644 docs/log/2026-11-22-a-probes-login-is-not-preceded-by-a.md create mode 100644 docs/log/2026-11-22-a-restored-guests-tsc-and-udev-after-basic.md create mode 100644 docs/log/2026-11-22-a-resume-takes-its-disks-before-the-load.md create mode 100644 docs/log/2026-11-22-a-trees-spin-machine-from-any-commit-and.md create mode 100644 docs/log/2026-11-22-compat-in-minutes-and-its-qmp-half-in.md create mode 100644 docs/log/2026-11-22-cpuid-leaf-2-with-qemus-cache-descriptors.md create mode 100644 docs/log/2026-11-22-each-releases-ledger-on-a-traceable-kernel-published.md create mode 100644 docs/log/2026-11-22-every-carried-patch-has-a-test-that-fails.md create mode 100644 docs/log/2026-11-22-every-carried-patch-is-git-format-patch-output.md create mode 100644 docs/log/2026-11-22-every-login-gets-its-user-manager-again.md create mode 100644 docs/log/2026-11-22-every-releases-record-carries-its-no-systemd-floor.md create mode 100644 docs/log/2026-11-22-guestrunning-is-qemu-running-the-resumed-guest.md create mode 100644 docs/log/2026-11-22-no-host-key-made-when-spin-hands-over.md create mode 100644 docs/log/2026-11-22-refresh-yml-proposes-the-openssh-source-when-ubuntu.md create mode 100644 docs/log/2026-11-22-roots-manager-without-the-xdg-autostart-generator.md create mode 100644 docs/log/2026-11-22-six-unmeasured-deviations-measured-two-reverted-and-boot.md create mode 100644 docs/log/2026-11-22-spins-early-login-each-number-against-its-own.md create mode 100644 docs/log/2026-11-22-ssh-first-logs-in-over-the-connection-it.md create mode 100644 docs/log/2026-11-22-ssh-service-starts-without-sshd-t.md create mode 100644 docs/log/2026-11-22-sshd-delays-a-failed-userauth-and-not-a.md create mode 100644 docs/log/2026-11-22-the-boot-chart-from-spin-stacks-systemd-bootchart.md create mode 100644 docs/log/2026-11-22-the-boot-chart-without-the-things-a-reader.md create mode 100644 docs/log/2026-11-22-the-boot-charts-first-sample-wait-graph-and.md create mode 100644 docs/log/2026-11-22-the-boots-dependency-view-and-what-fills-the.md create mode 100644 docs/log/2026-11-22-the-coverage-floor-counts-what-ci-can-run.md create mode 100644 docs/log/2026-11-22-the-coverage-floor-is-go-tools-coverfloor.md create mode 100644 docs/log/2026-11-22-the-cpu-weight-while-the-boot-runs-on.md create mode 100644 docs/log/2026-11-22-the-first-login-waits-for-its-user-manager.md create mode 100644 docs/log/2026-11-22-the-floors-gap-is-a-with-its-interval.md create mode 100644 docs/log/2026-11-22-the-host-counts-the-port-i-o-exits.md create mode 100644 docs/log/2026-11-22-the-host-key-is-ed25519-alone.md create mode 100644 docs/log/2026-11-22-the-machine-loads-a-state-fast-above-1.md create mode 100644 docs/log/2026-11-22-the-read-ahead-asks-from-four-goroutines.md create mode 100644 docs/log/2026-11-22-udev-after-basic-target-and-the-no-systemd.md create mode 100644 docs/log/2026-11-22-vmlinux-btf-parsed-on-first-use-moves-the.md create mode 100644 docs/log/2026-11-22-what-a-guest-sends-on-the-pressure-port.md create mode 100644 docs/log/2026-11-22-what-a-restored-login-waits-on-and-sshds.md create mode 100644 docs/log/2026-11-23-a-bzimage-mapped-not-read-into-qemus-heap.md create mode 100644 docs/log/2026-11-23-a-guest-that-drops-its-page-cache-before.md create mode 100644 docs/log/2026-11-23-a-guests-synced-writes-on-a-saturated-host.md create mode 100644 docs/log/2026-11-23-a-probe-saves-once-the-guests-boot-has.md create mode 100644 docs/log/2026-11-23-a-regressed-release-is-withdrawn-never-deleted.md create mode 100644 docs/log/2026-11-23-a-state-of-another-length-than-its-checkpoint.md create mode 100644 docs/log/2026-11-23-a-workspaces-memory-at-boot-beats-the-same.md create mode 100644 docs/log/2026-11-23-config-hz-250-removes-587-exits-and-no.md create mode 100644 docs/log/2026-11-23-containerds-config-is-containerd-ios-own.md create mode 100644 docs/log/2026-11-23-density-on-metal-and-a-cpu-bound-crowd.md create mode 100644 docs/log/2026-11-23-docker-socket-is-dockers-own-0660-and-group.md create mode 100644 docs/log/2026-11-23-dockers-packages-pinned.md create mode 100644 docs/log/2026-11-23-each-mmio-exit-put-on-the-guest-code.md create mode 100644 docs/log/2026-11-23-leaf-2-describes-the-caches-leaf-4-does.md create mode 100644 docs/log/2026-11-23-login-spin-hands-over-spins-host-key.md create mode 100644 docs/log/2026-11-23-login-spin-s-forwarder-is-spin-supervisor-service.md create mode 100644 docs/log/2026-11-23-qemu-0007-deleted-no-release-from-v20261123-07.md create mode 100644 docs/log/2026-11-23-qemus-start-and-the-held-starts-qmp-split.md create mode 100644 docs/log/2026-11-23-systemds-first-patch-drop-in-candidate-names-derived.md create mode 100644 docs/log/2026-11-23-the-boot-charts-io-graphs-draw-each-5.md create mode 100644 docs/log/2026-11-23-the-boots-device-setup-exits-as-one-change.md create mode 100644 docs/log/2026-11-23-the-dynamic-linkers-share-of-pid-1-journald.md create mode 100644 docs/log/2026-11-23-the-executors-sandbox-a-bound-14-ms.md create mode 100644 docs/log/2026-11-23-the-executors-sandbox-costs-its-system-call-allow.md create mode 100644 docs/log/2026-11-23-the-first-logins-target.md create mode 100644 docs/log/2026-11-23-the-inventorys-blind-spot-was-mkosi.md create mode 100644 docs/log/2026-11-23-the-ioapics-table-read-once-takes-384-exits.md create mode 100644 docs/log/2026-11-23-the-kernel-entered-as-its-vmlinux-through-pvh.md create mode 100644 docs/log/2026-11-23-the-ledger-splits-the-span-before-the-kernels.md create mode 100644 docs/log/2026-11-23-the-ledgers-kernel-zero-on-the-kernels-sched.md create mode 100644 docs/log/2026-11-23-the-pressure-sender-started-by-the-boots-rest.md create mode 100644 docs/log/2026-11-23-the-record-holds-the-vcpus-properties-that-shape.md create mode 100644 docs/log/2026-11-23-the-release-is-its-vmlinux-alone-no-bzimage.md create mode 100644 docs/log/2026-11-23-the-traceable-kernel-is-a-vmlinux-entered-through.md create mode 100644 docs/log/2026-11-23-the-update-stamps-written-at-build-the-five.md create mode 100644 docs/log/2026-11-23-the-vmlinux-copied-into-guest-ram-beside-qemus.md create mode 100644 docs/log/2026-11-23-the-volatile-journal-holds-8-mb-not-4.md create mode 100644 docs/log/2026-11-23-two-levers-on-the-boots-ecam-reads-remove.md create mode 100644 docs/log/2026-11-23-tzdata-e2fsprogs-and-fuse3-are-installed.md create mode 100644 docs/log/2026-11-23-unshared-refuses-a-pool-whose-cpus-differ-in.md create mode 100644 docs/log/2026-11-23-v20261123-07-holds-645s-cold-gain-its-records.md create mode 100644 docs/log/2026-11-23-virtio-pcis-queue-selection-and-msi-x-rewrites.md create mode 100644 docs/log/2026-11-23-vmlinux-btf-is-parsed-when-a-program-first.md create mode 100644 docs/log/2026-11-23-what-setmemory-down-and-one-vcpu-cost.md create mode 100644 docs/log/2026-11-23-where-a-cold-boots-ept-violations-land.md create mode 100644 docs/log/README.md create mode 100644 docs/log/rework.md create mode 100644 gates/docs_test.go create mode 100644 internal/docsrec/docsrec_test.go delete mode 100644 internal/docsrec/split.go delete mode 100644 internal/docsrec/split_test.go create mode 100644 internal/docsrec/testdata/experiments/7-rejected-earlier.json create mode 100644 internal/docsrec/testdata/experiments/carried-one.json create mode 100644 internal/docsrec/testdata/experiments/open-one.json create mode 100644 internal/docsrec/testdata/experiments/rejected-later.json create mode 100644 internal/docsrec/testdata/log/2026-11-13-the-last-of-week-ten.md create mode 100644 internal/docsrec/testdata/log/2026-11-14-also-twenty.md create mode 100644 internal/docsrec/testdata/log/2026-11-14-second-of-the-day.md create mode 100644 internal/docsrec/testdata/log/2026-11-14-spans-two-days.md create mode 100644 internal/docsrec/testdata/log/README.md create mode 100644 internal/docsrec/testdata/log/rework.md delete mode 100644 internal/docsrec/testdata/split/boot-time.md delete mode 100644 internal/docsrec/testdata/split/kinds.txt delete mode 100644 internal/docsrec/testdata/split/log.md diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 6717354d..58c94a35 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -2,14 +2,19 @@ name: Pages # Each release's numbers as one web page to share, https://spin-stack.github.io/spin-machine/: # the chart, the tables of docs/releases.md and each record, written from docs/releases/*.json by -# spin-machine-dev releases site (docs/cli.md). A merge that changes a record publishes it again; -# nothing else on the page can change without one. Not a required check, so a paths filter is safe. +# spin-machine-dev releases site (docs/cli.md). Beside it, log.html and experiments.html: the log +# and docs/boot-time.md's tables, rendered from docs/log and docs/experiments by spin-machine-dev +# docs site, and committed nowhere else (#709). A merge that changes a record or an entry publishes +# them again; nothing else on the pages can change without one. Not a required check, so a paths +# filter is safe. on: push: branches: [main] paths: - "docs/releases/**" + - "docs/log/**" + - "docs/experiments/**" workflow_dispatch: permissions: @@ -49,6 +54,9 @@ jobs: - name: Write the site run: spin-machine-dev releases site --out _site + - name: Write the log and the tables + run: spin-machine-dev docs site --out _site + - name: Configure Pages uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0 diff --git a/AGENTS.md b/AGENTS.md index 116253c4..36c8e27a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -18,7 +18,8 @@ The second number is a checkpoint restored to the same first login (`task boot:r A change goes in when it moves one of the two, interleaved against the release, without making the other worse. A functional change (security, correctness) goes in too. Every other number, such as the console prompt, a phase, an initcall or a unit's time, is a tool for finding why one -of the two moved, never a target of its own. `docs/log.md` shows what optimising the others cost. +of the two moved, never a target of its own. The log (`docs/log`) shows what optimising the others +cost. `docs/boot-time.md` says where both stand and what each of their phases costs, and `docs/measuring.md` says how a number is taken and read. `docs/boot-time.md` also says why the @@ -122,11 +123,23 @@ full method. These are its rules. - Keep experiment outputs, overlays, initrds, firmware and caches apart from release outputs, and never open the shared base image for writing. - Remove an experiment once its question is answered. When a change decides something, kept or - rejected, add its row to `docs/boot-time.md`'s tables and its entry, dated and with its run, to - `docs/log.md`. -- **Read before starting.** Read `docs/boot-time.md`'s "Measured and rejected" table and - `docs/log.md`'s rework cycles. An idea already there needs a new reason, not a new run. - `docs/memory-and-disk.md` says what the guest's memory and disk cost. + rejected, add its record to `docs/experiments` and its entry, dated and with its run, to + `docs/log`. Each is a file of its own, so two pull requests in flight never edit the same one + (#709); the pages they make are rendered, never committed. + - **An entry** is `docs/log/-.md`: YAML front matter (`date`, `order`, the + entry's place among that day's, `area`, `title`, and the `issues`, `prs` and `runs` its text + cites), then the prose. `spin-machine-dev docs log` renders the page, its head + `**MM-DD · area · title.**`. + - **A record** is `docs/experiments/[-].json`, one row of `docs/boot-time.md`'s + tables: `decision` (`carried`, `rejected` or `open`), a rejected one's `section`, `order` + (its place in the table), and the cells its table shows. `spin-machine-dev docs tables` + renders the tables. A record that moves, from open to rejected, changes its `decision`. + - `gates/docs_test.go` refuses an entry or record that lacks a field, names a decision or + section that does not exist, or lists a run, issue or pull request its text does not cite. +- **Read before starting.** Read the "Measured and rejected" records + (`spin-machine-dev docs tables`) and the log's rework cycles (`docs/log/rework.md`). An idea + already there needs a new reason, not a new run. `docs/memory-and-disk.md` says what the + guest's memory and disk cost. - **Search outside the repository too.** Many people work on KVM, QEMU, the kernel and systemd, and a boot-time idea has usually been tried, measured or refused somewhere: the projects' mailing lists, issue trackers and commit history, conference talks (LPC, KVM Forum, All @@ -180,7 +193,7 @@ Comments here are longer than usual, on purpose. These rules are what make them - **A decision, an open question or a follow-up is an issue.** "Left as it is", "not settled", "not in this change" and "the consumer should change this" each get a GitHub issue in the repo that owns it (spin-stack/machine or spin-stack/spin), with its evidence and how to settle it. - A comment, a PR body or `docs/log.md` cites the issue and never stands in for it: a comment is + A comment, a PR body or a log entry cites the issue and never stands in for it: a comment is read only by whoever opens that file, and an issue is where the next person looks for work. An issue closed because its proposal was decided against carries the label `rejected`, and a finding that does not apply to this machine (an osv CVE, an upstream bug) carries `not-affected`, diff --git a/README.md b/README.md index 4175ec88..3d555a0b 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,8 @@ slower (7.6 s against 455 ms, lab 44848049631, 2026-11-21), and nothing chooses | [docs/boot-time.md](docs/boot-time.md) | where the two goal numbers stand, where their time goes, and what was kept, rejected and is open | | [docs/measuring.md](docs/measuring.md) | how to measure a boot-time change: the steps, the rules a comparison follows, and the pitfalls | | [docs/releases.md](docs/releases.md) | each release's numbers, measured on the bench | -| [docs/log.md](docs/log.md) | what was tried, when, why, and what it measured | +| [docs/log](docs/log) | what was tried, when, why, and what it measured: one file an entry, `spin-machine-dev docs log` | +| [docs/experiments](docs/experiments) | the rows of boot-time.md's tables, one record each, `spin-machine-dev docs tables` | | [docs/cli.md](docs/cli.md) | `spin-machine-dev`: building, verifying, measuring, releasing | | [docs/machine.md](docs/machine.md) | the definition: fixed slots, vmgenid, and the record a checkpoint is held to | | [docs/migration.md](docs/migration.md) | one VM moved to another host, and why the CPU model decides it | diff --git a/cmd/spin-machine-dev/docs.go b/cmd/spin-machine-dev/docs.go index 29569ca8..25bef2b1 100644 --- a/cmd/spin-machine-dev/docs.go +++ b/cmd/spin-machine-dev/docs.go @@ -6,8 +6,6 @@ import ( "fmt" "os" "path/filepath" - "strconv" - "strings" "github.com/spf13/cobra" @@ -25,7 +23,7 @@ a row under docs/experiments. A pull request adds files of its own, so two in fl the same one. log and tables render the pages to stdout or --out; site writes both as web pages, which pages.yml publishes beside the releases' page. Every verb refuses a file that does not parse.`, } - c.AddCommand(docsLog(), docsTables(), docsSite(), docsSplit()) + c.AddCommand(docsLog(), docsTables(), docsSite()) return c } @@ -141,63 +139,3 @@ func docsSite() *cobra.Command { _ = c.MarkFlagRequired("out") return c } - -func docsSplit() *cobra.Command { - var kinds string - c := &cobra.Command{ - Use: "split --kinds FILE", - Short: "Turn docs/log.md and boot-time.md's tables into docs/log and docs/experiments, once (#709)", - Args: cobra.NoArgs, - RunE: func(c *cobra.Command, _ []string) error { - root, err := repo() - if err != nil { - return err - } - read := func(p string) (string, error) { - data, err := os.ReadFile(filepath.Join(root, p)) - if err != nil { - return "", couldNot(fmt.Errorf("reading %s: %w", p, err)) - } - return string(data), nil - } - k := docsrec.Kinds{} - list, err := os.ReadFile(kinds) - if err != nil { - return couldNot(err) - } - for _, l := range strings.Split(strings.TrimSpace(string(list)), "\n") { - n, kind, _ := strings.Cut(l, " ") - i, err := strconv.Atoi(n) - if err != nil { - return couldNot(fmt.Errorf("%s: %q is not N issue|pr", kinds, l)) - } - k[i] = kind - } - log, err := read("docs/log.md") - if err != nil { - return err - } - bootTime, err := read("docs/boot-time.md") - if err != nil { - return err - } - files, err := docsrec.Split(log, bootTime, k) - if err != nil { - return couldNot(err) - } - for name, data := range files { - p := filepath.Join(root, name) - if err := os.MkdirAll(filepath.Dir(p), 0o755); err != nil { - return couldNot(err) - } - if err := os.WriteFile(p, data, 0o644); err != nil { //nolint:gosec // documentation - return couldNot(err) - } - } - say(c, "wrote %d files", len(files)) - return nil - }, - } - c.Flags().StringVar(&kinds, "kinds", "", "lines of N issue|pr, every number of the repository") - return c -} diff --git a/cmd/spin-machine-dev/docs_test.go b/cmd/spin-machine-dev/docs_test.go new file mode 100644 index 00000000..57231b22 --- /dev/null +++ b/cmd/spin-machine-dev/docs_test.go @@ -0,0 +1,69 @@ +// SPDX-License-Identifier: Apache-2.0 + +package main + +import ( + "os" + "path/filepath" + "strings" + "testing" +) + +// docsCheckout is a repository with a log of one entry and one record. +func docsCheckout(t *testing.T) string { + dir := checkout(t) + put(t, filepath.Join(dir, "docs/log/README.md"), "# Log\n", 0o644) + put(t, filepath.Join(dir, "docs/log/rework.md"), "## 2. Rework cycles\n", 0o644) + put(t, filepath.Join(dir, "docs/log/2026-11-23-an-entry.md"), + "---\ndate: \"2026-11-23\"\norder: 10\narea: lab\ntitle: an entry\n---\nIts prose.\n", 0o644) + put(t, filepath.Join(dir, "docs/experiments/an-idea.json"), + `{"decision": "rejected", "section": "login", "order": 10, "date": "2026-11-23", "change": "An idea", "result": "nothing", "shape": "spin", "source": "-"}`, 0o644) + return dir +} + +func TestDocsRendersTheLogAndTheTables(t *testing.T) { + dir := docsCheckout(t) + stdout, stderr, status := verb(t, "docs", "log") + if status != 0 || !strings.Contains(stdout, "### Week 12: 2026-11-21 to 11-27\n\n**11-23 · lab · an entry.** Its prose.\n") { + t.Errorf("docs log: %d, %s%s", status, stdout, stderr) + } + out := filepath.Join(t.TempDir(), "tables.md") + if _, stderr, status := verb(t, "docs", "tables", "--out", out); status != 0 { + t.Fatalf("docs tables: %d, %s", status, stderr) + } + if got := read(t, out); !strings.Contains(got, "### The login\n\n| Idea | Result | Shape | Source | Date |\n|---|---|---|---|---|\n| An idea | nothing | spin | - | 11-23 |\n") { + t.Errorf("docs tables wrote:\n%s", got) + } + site := filepath.Join(t.TempDir(), "site") + if _, stderr, status := verb(t, "docs", "site", "--out", site); status != 0 { + t.Fatalf("docs site: %d, %s", status, stderr) + } + if log := read(t, filepath.Join(site, "log.html")); !strings.Contains(log, "11-23 · lab · an entry. Its prose.") { + t.Errorf("log.html:\n%s", log) + } + if exp := read(t, filepath.Join(site, "experiments.html")); !strings.Contains(exp, "An idea") { + t.Errorf("experiments.html:\n%s", exp) + } + if err := os.Remove(filepath.Join(dir, "docs/log/rework.md")); err != nil { + t.Fatal(err) + } + if _, stderr, status := verb(t, "docs", "log"); status != 2 || !strings.Contains(stderr, "rework.md") { + t.Errorf("docs log without rework.md: %d, %s", status, stderr) + } + if _, stderr, status := verb(t, "docs", "site", "--out", site); status != 2 || !strings.Contains(stderr, "rework.md") { + t.Errorf("docs site without rework.md: %d, %s", status, stderr) + } +} + +func TestDocsRefusesARecordThatDoesNotParse(t *testing.T) { + dir := docsCheckout(t) + put(t, filepath.Join(dir, "docs/experiments/kept.json"), `{"decision": "kept"}`, 0o644) + for _, args := range [][]string{{"docs", "tables"}, {"docs", "site", "--out", t.TempDir()}} { + if _, stderr, status := verb(t, args...); status != 2 || !strings.Contains(stderr, `kept.json: decision "kept"`) { + t.Errorf("%v: %d, %s", args, status, stderr) + } + } + if _, stderr, status := verb(t, "docs", "tables", "--out", filepath.Join(dir, "none", "t.md")); status != 2 { + t.Errorf("docs tables to a directory that is not there: %d, %s", status, stderr) + } +} diff --git a/cmd/spin-machine-dev/withdraw.go b/cmd/spin-machine-dev/withdraw.go index db963199..406e8810 100644 --- a/cmd/spin-machine-dev/withdraw.go +++ b/cmd/spin-machine-dev/withdraw.go @@ -259,7 +259,7 @@ func openRegression(ctx context.Context, c *cobra.Command, r lab.Record, worse [ body := r.Release + "'s " + strings.Join(worse, "; ") + " against " + r.Against.Release + ", " + where + ". " + "Each interval is wholly above 0: slower, beyond noise. That is a regression by docs/releasing.md, " + "\"Withdrawing a release\".\n\n" + - "At 20 boots a side about 1 in 40 such flags of a number is noise, and a cost docs/log.md records as accepted " + + "At 20 boots a side about 1 in 40 such flags of a number is noise, and a cost the log (docs/log) records as accepted " + "(a correctness change) is no regression. Decide which, and either close this saying why, or withdraw the release:\n\n" + "```\ngh workflow run withdraw.yml -R " + repo + " -f tag=" + r.Release + " -f reason=\"...\" -f issue=THIS\n```\n\n" + "A measurement again, if the flag may be noise: `gh workflow run report.yml -R " + repo + " -f versions=" + r.Release + "`.\n\n" + diff --git a/docs/boot-time.md b/docs/boot-time.md index d3c30fb9..0415caa1 100644 --- a/docs/boot-time.md +++ b/docs/boot-time.md @@ -2,7 +2,10 @@ This page follows the goal's two numbers (AGENTS.md, "The goal"). It says where each stands and where its time goes. It lists what the machine carries for them and what each -item earns, what was tried and rejected, and what is open. `docs/log.md` tells each change, dated. +item earns, what was tried and rejected, and what is open: those tables are one record a row in +`docs/experiments`, rendered by `spin-machine-dev docs tables` and on +[the site](https://spin-stack.github.io/spin-machine/experiments.html). The log, `docs/log`, +tells each change, dated. Each release's own numbers are in `docs/releases.md`. What the guest's memory and disk cost is in `docs/memory-and-disk.md`. How a number is measured is [measuring.md](measuring.md), and the lab's commands are in `docs/cli.md`, "Measuring". @@ -194,7 +197,7 @@ experiments", #457.) ## What the machine carries This table lists every change the tree makes for boot time, with what it earns in spin's shape. -It is the current state. `docs/log.md` tells how each change came in. A row's evidence is one of +It is the current state. The log tells how each change came in. A row's evidence is one of these: - *measured*: its own arm, in spin's shape; @@ -209,64 +212,7 @@ A row that is not *measured* or *group* is a candidate for deletion, which rule Functional rows (security, correctness, a consumer's contract) are listed so that nobody takes them for boot time. -| Item | Where | Earns (Δp50 of taking it back) | Evidence | Run | -|---|---|---|---|---| -| Kernel patches 0001-0005, 0007, 0008, 0010 | kernel/patches | cold +67.5 [+62.5, +72.4], with 0006, 0009 and 0011 (since deleted, worth nothing) | group A | lab 44818953987 | -| Kernel 0012 (vmlinux BTF parsed on first use) and 0013 (the verifier asks for it only where a kernel type enters a program) | kernel/patches | cold −6.4 [−9.4, −1.0] at 60 a side (lab 45118194310, the kernel carried); before the review's fixes −10.0 [−12.7, −3.3] at 60 and −6.3 [−9.1, −4.6] at 120 (labs 45114405201, 45115330128); restored −1.0 [−6.0, +4.2] evicted, the state 1.3 MiB smaller (lab 45115341056) | measured | lab 45118194310 | -| Kernel 0021-0025, the boot's device-setup exits as one change (#627): the IOAPIC table read once (#590), the state save at add only where error recovery can restore it (#591 a), virtio-pci's vendor capabilities walked once (#591 b), `queue_select` written only on a change and an unchanged MSI message not rewritten (#592). 0022's gate has to grow with whatever calls error handlers next (its changelog). Alone each was within noise ("Measured and rejected") | kernel/patches | against v20261123.07: first login −9.4 [−14.2, −5.7], sshd accepting −9.5 [−14.4, −5.5], 120 a side (lab 45260781177); restored −0.4 [−2.0, +1.7] evicted and +0.2 [−6.6, +7.3] cached, the state +0.0 MiB [−0.1, +0.2], 60 a side (lab 45261629539); 838 exits fewer, 366 of them MMIO (3 a side, lab 45114428660) | measured | labs 45260781177, 45261629539 | -| `BLK_DEV_LOOP_MIN_COUNT=0`, `SERIAL_8250_RUNTIME_UARTS=1` | kernel/config-7.3-x86_64 | cold +5.3 [−3.2, +15.0]: inside the noise, but the upper bound does not rule out its ~2-4 ms ceiling | measured, 40 a side | lab 44839538785 | -| `VT=n`, `X86_MSR=n`, `X86_CPUID=n` | kernel/config-7.3-x86_64 | function: dead code, less surface | - | kernel/Dockerfile | -| qboot instead of SeaBIOS | qemu, `machine.DefaultBIOS` | cold +68.5 [+62.7, +71.7] | group F | lab 44818953987 | -| QEMU 0001 (device creation in one memory transaction) | qemu/patches | restored +11.7 [+0.9, +19.3], running +6.8 [+1.2, +8.8]: a restore starts QEMU too; cold +0.2 [−8.7, +7.1]. With `pam.patch`, cold +11.5 [+6.7, +20.2] (group B, lab 44818953987) | measured, 20 a side | lab 44993254745 | -| qboot `pam.patch` (PAM in three writes) | qemu/qboot | cold +3.9 [−3.4, +8.0]: inside the noise, and the upper bound over +5 keeps it (rule 5 of docs/measuring.md) | measured, 40 a side | lab 44993790452 | -| QEMU 0002, virtio-scsi `max_target`, which spin-machine passes | qemu/patches, machine | cold −8.9 [−15.5, −0.9] when it came in | measured | lab 44788216590 | -| QEMU 0009 (the vmlinux's segments copied into guest RAM in a thread beside the main loop at the machine's first reset, #698) | qemu/patches | first login −8.6 [−11.0, −4.0], 351 → 342, sshd accepting −9.1 [−12.4, −5.9], the console prompt −7.7 [−11.4, −5.5], QEMU's RSS unmoved, 60 a side (lab 45260098299); restored −0.1 [−1.1, +0.7] evicted, −0.3 [−2.1, +0.9] cached, and the same run's cold login −6.9 [−12.9, −0.8], 40 a side (lab 45260694485): a restore's reset copies nothing. The copy it moves off the main thread was 9.1 ms (p50 of 20, p95 9.3, lab 45257214350), and the gain is all of it. Prior art: QEMU has mapped an ELF kernel instead of reading it since 4.2 (Stefano Garzarella, `816b9fe450`, [qemu-devel 2019-07-24](https://patchew.org/QEMU/20190724143105.307042-1-sgarzare@redhat.com/20190724143105.307042-3-sgarzare@redhat.com), 2019), so #698's first candidate, mapping the file, was already upstream; what was left is the copy into guest RAM, which any loader pays: Firecracker and Cloud Hypervisor read each PT_LOAD straight into guest memory ([rust-vmm/linux-loader](https://github.com/rust-vmm/linux-loader)), one copy as QEMU's. A `pread` into guest RAM against the mapping's `memcpy` was no faster on a laptop (9-11 ms each, not nested), where half the copy was faulting in the destination's huge pages and half the copy itself. No ROM copy off the main thread found in QEMU 11.2's tree or by a web search of qemu-devel (2026-11-23) | measured | labs 45260098299, 45260694485 | -| The kernel entered as its vmlinux through PVH, randomizing itself: kernel 0014-0017 (Hou Wenlong's RFC, less its decompressor patch, deleted with the bzImage in #660; [the cover letter](https://lkml.iu.edu/2601.3/01845.html), lore `cover.1769434279.git.houwenlong.hwl@antgroup.com`, 2026-01-26, unchanged on 7.3.5), 0019 (sets `KASLR_FLAG`, without which `RANDOMIZE_MEMORY` did nothing), 0020 (RDRAND and TSC read from the registers that hold them), QEMU 0008 (a random physical base from `XEN_ELFNOTE_PHYS32_RELOC`), #645 | kernel/patches, qemu/patches, machine | first login −16.8 [−20.9, −13.0], 368 → 352, sshd accepting −16.7 [−20.2, −12.7], QEMU's RSS −13.8 MiB, 60 a side (lab 45219785493); restored −4.4 [−17.5, −2.0] evicted, −4.3 [−14.0, +10.2] cached, within noise, the state −31.9 MiB, the save −14.6 (lab 45219801969). As released, v20261123.07 against v20261123.06, each with its own spin-machine: first login −18.6 [−23.6, −14.0], 378 → 359, sshd accepting −15.3 [−21.2, −12.6], 60 a side (lab 45252584128); the release record's −3.5 [−12.9, +2.9] at 20 a side was a shifted run (#694). The bound, the same vmlinux entered with no KASLR at all: −18.9 [−22.8, −12.4] cold, −3.6 [−5.1, −2.1] restored evicted at 40 a side (labs 45213668842, 45213683698), so KASLR without the decompressor costs ~2 ms against no KASLR (inferred across runs; Hou measured ~2 ms too). Arms booted the kernel without 0020. KASLR across 10 boots (lab 45221660056): `_text` 10 distinct, the physical base 8, the direct map and vmalloc each 10 distinct 1 GiB-aligned bases. Entropy: the virtual base the decompressor's slot rule and seed sources once 0020 is in, the physical base QEMU's `getrandom` over the decompressor's range, the regions the kernel's own (#645, "entropy"). Chosen over QEMU applying the relocations (Holmes et al., "KASLR in the age of MicroVMs", EuroSys '22, 20-25 ms over an LZ4 bzImage; Firecracker #5661, parked; rust-vmm/linux-loader #84, open): no relocation format for QEMU to parse, nothing new on its command line, the kernel's own entropy code | measured, 60 a side | labs 45219785493, 45219801969, 45252584128 | -| qboot `no-pci-walk.patch` | qemu/qboot | cold +5.2 [−1.7, +9.2]: inside the noise, and the upper bound over +5 keeps it; 5.0 ms nested in `firmware-stages` | measured, 40 a side | lab 44993790452 | -| qboot `mtrr.patch`, `write-pointer.patch` | qemu/qboot | function: write-back mappings, vmgenid | - | - | -| `hpet=off` | machine | nothing on record: a timer the guest would enumerate and then not use | unmeasured | - | -| ICH9 `sata=off`, `smbus=off` | machine | kernel to init 62.3 → 60.6 (09-08) | laptop, 400 boots | `fa1803f` | -| Hotplug disks on virtio-scsi, not PCIe root ports | machine | boot −31, attach 135 → 1.5 (09-29) | runner | #25 | -| Every machine started held, so QEMU can start ahead | machine | the "QEMU started ahead" rows: ~28 ms cold, ~25 restored | measured | report 44811347183 | -| Checkpoints on 8 multifd channels | machine | restored into a QEMU started ahead 150 → 103 against 1 channel; 16 channels lose to 8 when 4 restore at once, +3.2 [+1.1, +5.8] | measured | labs 44789688221, 44792429636 | -| The resume reads the state ahead | machine | restored into a QEMU started ahead −12.9 [−14.7, −9.8] | measured | lab 44809512339 | -| `spin-machine restore` reads the state ahead before its dial (`machine.ReadAhead`), beside QEMU's start | cmd/spin-machine, machine | restored −9.3 [−12.2, −7.3] evicted, cached −0.2 [−2.2, +1.5] | measured, 30 a side | lab 44976494418 | -| The read-ahead asked for by four goroutines, each every fourth 128 KiB piece | machine | restored −6.2 [−9.1, −4.3] evicted against one goroutine, cached −0.5 [−1.6, +1.9] | measured, 30 a side | lab 44976924478 | -| CPUID leaf 2 with QEMU's cache descriptors (`x-consistent-cache=off`), so glibc does not walk leaf 4 at every process start; `x-legacy-cpuid2-cache=off` (qemu/patches/0006) makes them leaf 4's caches, first login +0.6 [−6.1, +5.5] (lab 45101932173, #586) | machine/shape.go | first login −10.3 [−14.2, −4.0], 40 a side; CPUID exits 3727 → 2176; restored +1.0 [−3.9, +4.4] evicted, in noise | measured | labs 45083473790, 45083473855, 45083754801 | -| `pci=lastbus=0` | machine/cmdline.go | kernel to init 87.6 → 51.1 (2026-09): 8192 configuration reads, each an exit | runner, mechanism | log.md, 09 | -| `no_timer_check`, `tsc=reliable` | machine/cmdline.go | nothing on record (09-07) | unmeasured | - | -| `TERM=dumb` | machine/cmdline.go | 687 → 19 ms to systemd's first line (09-10), while systemd queries the console | laptop, mechanism | `b5f361f` | -| `rootfstype=ext4` | machine/cmdline.go | lead (11-19) | laptop | - | -| `quiet`, `loglevel=3`, `panic=1`, `net.ifnames=0`, `biosdevname=0`, cgroup v2, `memhp_default_state` | machine/cmdline.go | console, function | - | - | -| systemd built from Ubuntu's source with the `stage1` profile | image/systemd | first login −47, −38, −47: no BPF verifier in PID 1 | ladder | labs 44531842773, 44537549305, 44538877783 | -| systemd's drop-in candidate names derived once per unit, not once per lookup directory: upstream #42858 (v262), backported to 259 | image/systemd/0001-dropin-derive-candidate-names-once.patch | first login −6.5 [−9.9, −1.3], 100 a side against systemd rebuilt without it; PID 1's CPU before the login 56.0 → 52.4, p50 of 5 ledgers. Prior art: Eric Curtin's PR, `manager_enumerate()` 45.35 → 38.81 ms (50 runs, ~270 units, a container); Yocto's backport to 259.5 | measured | labs 45090299768, 45090326943 | -| systemd's tools linked static | image/systemd | −10 and −1, inside the noise | ladder | the same | -| SELinux off, `pcre2` on | image/systemd | function | - | - | -| `-O ^orphan_file` | image/build.sh | lead (11-19) | laptop | - | -| `lazy_itable_init=0` | image/build.sh | function: no 16 MiB of zeros in every overlay | - | - | -| 16 more unit masks (journal-flush, fsck-root, modules-load, pstore, random-seed, four modprobe@, …) | optimize-systemd.sh | cold +57.5 [+49.0, +63.0] | group C-masks | lab 44818953987 | -| 8 generators disabled, 3 tmpfiles rules masked | optimize-systemd.sh | cold +16.7 [+11.6, +23.3] | group C-generators | lab 44818953987 | -| udev's coldplug filtered (`10-coldplug.conf`), `cpu` kept for hot-added cores | image | cold +14.9 [+8.2, +19.8]; restored +463.7, which was not the coldplug but QEMU's TSC, a guest saved with its tick running (#452, QEMU 0005) | group C-coldplug | lab 44818953987 | -| ssh.socket, ssh.service and sshd-keygen without default dependencies; logind and dbus-broker without PrivateTmp; udev at `StartupCPUWeight=1` | image drop-ins | −59.4 [−65.9, −56.2] with the probe's forwarder early as well (lab 44805051310, `login-early` and `udev-startup`). In a second run, the image's half alone (`--edit lane`) −17.4 [−25.0, −8.5] and with the forwarder early as well −68.5 [−78.0, −61.8] (lab 44807457606). Each run against its own release, v20261120.03 | measured | labs 44805051310, 44807457606 | -| ssh.service without Ubuntu's `sshd -t` before it starts (`20-no-config-test.conf`); the check stays on reload | image drop-in | −3.2 [−7.2, −0.8], sshd accepting −2.4 [−6.4, −1.1], 60 boots a side | measured | lab 44977044826 | -| udevd and its coldplug not before sysinit.target (copies of the units without that line), so basic.target does not wait for udevd's start at the lowest weight | configure-system.sh | cold −48.6 [−51.7, −42.6], restored −2.0 [−8.0, +4.7] p95 114 against 114, cached p95 126 against 128, with QEMU 0005, 30 a side; prestart cold −44.7 [−53.4, −39.4], restored into prestarted −1.3 [−4.1, +3.6] p95 98.8 against 101. Without 0005 the restored p95 is 539-548 | measured | labs 44987412171, 44987412210 | -| The boot's default target holds only what the first login needs (`spin-machine-login.target`), and `multi-user.target` starts once its units are up (`spin-machine-boot-rest.service`, `Type=idle`) | image, docs/image.md "The first login's target" | first login −21.5 [−26.4, −15.5], sshd accepting −10.0 [−16.2, −3.7], accept to login −10.7 [−12.9, −8.2], second login +0.0 [−0.8, +0.6]; restored +1.1 [−6.0, +5.2] evicted, +2.2 [−10.6, +12.9] cached. The console prompt +15.5 [+11.5, +19.0], since the getty now follows the login: nothing a workspace does waits for it. With spin's supervisor off `basic.target` (spin-stack/spin#1653) the first login −45.3 [−50.2, −39.4] but the second +43.7 [+41.1, +46.1] | measured, v20261123.02, 40 a side | labs 45098372930, 45098372897 | -| QEMU 0005: a machine made for an incoming migration writes its TSC only from the migration, so KVM takes the checkpoint's TSC as given | qemu/patches | correctness: without it a guest saved with its tick running sleeps until its old TSC deadline, ~450 ms (#452). Alone it moves neither number: cold −3.0 [−5.8, +0.1], restored −1.9 [−7.6, +2.0] | measured | lab 44987412171 | -| logind, its Varlink socket, `user-runtime-dir@`, `user@` without default dependencies; `dbus.socket` without sysinit | image drop-ins, configure-system.sh | cold +16.5 [+9.8, +20.4], prestarted +11.0 [+6.2, +18.8], restored in noise; lane 478 → 402 (11-13) | measured | lab 45034963004, lab 43518915618 | -| Sessions of class `user-early-light` | configure-system.sh | lane 472 vs 436 | lane, mechanism: a root session would start `user@0` | lab 43518044150 | -| Sessions of class `user-early` and root lingering, so a login waits for its user manager and root's starts in the boot (#467) | configure-system.sh | correctness: the first login's own `systemctl --user` failed 10 of 10 on v20261122.03 and passed 10 of 10 with it (lab 45032247920). First login +4.7 [−0.2, +12.2] at 40 a side, sshd accepting +5.6 [+1.1, +10.1]; restored −10.8 [−15.9, −6.6] evicted, −12.3 [−15.1, −5.5] cached. The lane's login as spin, whose manager does not linger, +29.7 [+22.8, +42.1] | measured | labs 45031644179, 45031644114, 45031687433 | -| The user manager's sockets' environment from `environment.d/10-user-sockets.conf`, not two `systemctl --user set-environment` | image | with the row above: first login +19.6 [+15.9, +25.6] without it (lab 45031644179); with class `user-early` alone, −17.1 [−27.0, −10.7] (lab 45030778365) | measured | labs 45031644179, 45030778365 | -| Root's manager without the XDG autostart generator, which turns a graphical session's `.desktop` files into user units (#527) | optimize-systemd.sh | first login −3.8 [−6.2, −0.7], accept to login −6.1 [−9.0, −0.3], 100 boots a side; restored −1.7 [−4.4, +2.2] evicted, in noise | measured | labs 45070150688, 45070973943 | -| Host keys made from the boot's first dispatch | spin-machine-sshd-keygen.service | cold −0.8 [−10.5, +3.5], restored in noise: not a gain in spin's shape, where they are no longer made (the row below); kept for the lane, 489 → 468 (#515) | measured | lab 45034963004, lab 43483372488 | -| No host key made when spin's handoff has placed its own at `/run/spin/ssh/ssh_host_ed25519_key` (#515) | spin-machine-sshd-keygen.service | first login −6.9 [−9.6, −2.4], sshd accepting −6.8 [−10.4, −1.8], 120 a side, both arms with `--edit spin-handoff`; restored in noise, 20 a side. Prior art: RHEL's cloud-init conditions `sshd-keygen@` off while it provisions the keys (git.centos.org rpms/cloud-init, `ci-Inhibit-sshd-keygen-.service-if-cloud-init-is-active.patch`), for function and unmeasured | measured | labs 45086250796, 45085877238 | -| sshd without OpenSSH's userauth minimum time on a login: a request that authenticated, or a public key query answered with `PK_OK`, does not wait; a failure still does (#457) | image/openssh | restored −13.6 [−14.9, −9.8] evicted, −13.6 [−16.2, −11.4] cached; cold −9.4 [−15.8, −2.6], the second login −10.9 [−12.3, −9.0] | measured, 30 a side | labs 44983986606, 44983986575 | -| An Ed25519 host key only, no ECDSA | spin-machine-sshd-keygen.service | −5.0 [−8.3, −1.8], sshd accepting −4.4 [−6.9, −1.9], 60 boots a side | measured | lab 44979726719 | -| MOTD and `pam_motd` off; `mlkem768x25519-sha256` alone | configure-system.sh | −12 on the first login; 104 → 40 a login against sntrup761 | ladder, mechanism: a root login runs the same PAM and kex | #240, lab 43479854381 | -| journald volatile, 8 MB, its flush masked | optimize-systemd.sh | cold +6.1 [+2.3, +15.8], prestarted +6.5 [+3.1, +13.1], restored in noise; 8 MB against 4 MB, first login −2.2 [−12.1, +6.4], 20 a side | measured | labs 45034963004, 45121159504 | -| docker and containerd started by their sockets, not at boot (deferred: the first `docker` command waits for them, docs/image.md) | optimize-systemd.sh | cold +13.9 [+11.4, +18.2], restored +55.7 [+12.0, +73.9], into prestarted +40.7 [+33.5, +59.0] | measured | lab 45034963004 | -| timedated, firstboot, machine-id-commit masked | optimize-systemd.sh | function: time from the host, no first-boot prompt, no identity | - | - | -| `10-seats.conf`, the getty's TERM, `/tmp`'s size | image drop-ins | function | - | - | -| The pressure probe's sender, started with `multi-user.target` by the boot's rest, at the lowest priority | spin-machine-pressure.service | function (docs/machine.md, "Pressure"); from the boot's rest in place of a timer 10 s after the boot: first login −0.8 [−7.8, +4.8], restored −0.8 [−2.9, +2.1] evicted, 20 a side; it starts at 0.37-0.38 s, after the login. Before #581, after multi-user.target beside the first login, sshd accepting to login +2.6 to +3.3 in three runs | measured | labs 45120950183, 45120950314, 45120692382; 44921602512, 44924252325, 44924755505 | +The rows are the records in `docs/experiments` with `"decision": "carried"`, rendered by `spin-machine-dev docs tables` and [on the site](https://spin-stack.github.io/spin-machine/experiments.html#what-the-machine-carries). **What holds each patch.** Every patch the table names, and QEMU's 0003 and 0004, which are not for boot time, has a test that fails when the patch is lost or rebased into doing nothing, since @@ -313,139 +259,29 @@ releases. ## Measured and rejected An idea already here needs a new reason, not a new run. The tables group ideas by the part they -touch, oldest first within a group. The "Shape" column says which shape a row was measured in, +touch, oldest first within a group. Each is the records with `"decision": "rejected"` and the +section named under its heading. The "Shape" column says which shape a row was measured in, and a row measured in another shape than spin's has such a reason. ### Kernel and its command line -| Idea | Result | Shape | Source | Date | -|---|---|---|---|---| -| Trim the 8250 driver | 154 µs | runner | `c03ed89` | 09-10 | -| Modular kernel | 0.57 ms; breaks "a release is one machine" | runner | `1a8e25c` | 09-10 | -| ACPI params (acpi=noirq, pnpacpi=off, …) | 69.9 vs 68.6 ms, slower | runner | `64d2901` | 09-10 | -| initcall_blacklist ksm/kcompactd | 0; event_trace's 6 ms is the profiler | runner | `64d2901` | 09-10 | -| `CONFIG_XFRM=n` | moves BTF's 9 ms first parse elsewhere | runner | `e285dec` | 09-10 | -| A generous vCPU ceiling | maxcpus=16 +5 ms, 64 +9 ms of kernel; the ceiling stays (invariant) | runner | `f32d527` | 09-10 | -| MICROVM | no ACPI CPU hotplug | - | `b151186` | 09-10 | -| `CONFIG_VT=n` for speed | 0 to login; 0.31 ms of kernel | runner | `e2f6b8f`, `9b5f0dd` | 09-26 | -| KSM and THP off | −0.50 ms | runner | `cda04b1` | 09-26 | -| COMPACTION off | impossible: virtio-mem needs CONTIG_ALLOC | - | `cda04b1` | 09-26 | -| erofs removed for speed | noise (100.46 vs 102.22) | runner | `5a3d509` | 09-26 | -| Smaller TCP hash tables | moved nothing | runner | `dae6a14`, #48 | 09-26 | -| ZRAM | the runaway killed later (20 vs 14 s), worst login 3.8 s | runner | kernel/Dockerfile, `430d2b3` | 09-28 | -| `pci=noearly` | the guest does not boot | - | #240 | 11-12 | -| A configuration-space snapshot over fw_cfg (QEMU and kernel) | 209 vs 211 with 0005 | ladder | lab 43514884598 | 11-13 | -| `scsi_mod.scan=manual` | kernel −9.3, but since Linux 5.10 a disk added at run time, at boot, or under `-S` never appears, silently. `max_target` took its place | spin | lab 44570773103; `drivers/scsi/virtio_scsi.c`, `scsi_scan.c` | 11-19 | -| `CONFIG_SCSI_SCAN_ASYNC` | −2.6 [−8.9, +6.8]: the scan is waited for before "Freeing", and `max_target` leaves it little | spin | #325, lab 44788216590 | 11-20 | -| The decompressor without `X86_VERBOSE_BOOTUP` | to the kernel's clock 35.1 → 32.4 ms, under the 3 ms set before the run | spin | #328, lab 44787878809 | 11-20 | -| An uncompressed bzImage payload, KASLR kept | to the kernel's clock −3 ms, but +3.3 in qboot's copy and +6-7 in QEMU's start | laptop | #326 | 11-20 | -| The same on QEMU 0007, which maps the bzImage and so no longer reads the 40 MB file in its start (#646, a lead for #645) | first login −4.0 [−7.9, +0.3], sshd accepting −2.9 [−6.9, +2.4] at 40 a side against LZ4 on the same QEMU; QEMU's RSS +32.0 MiB (+22.2 file, +9.9 anonymous). The QEMU half of the 11-20 rejection is gone; what is left is under the interval at 40 | spin | lab 45183618987 | 11-23 | -| The bzImage's decompression made cheaper, in general | ~21 ms before the kernel's clock with the bzImage against PVH; most of it is the copy and relocation KASLR needs, and KASLR stays. No candidate left | spin | lab 44787491631 | 11-20 | -| The bzImage beside the vmlinux, `KERNEL_LZ4` (its compression) and kernel 0018 (its decompressor reading `.data.reloc`), shipped since 11-19 | no release booted the bzImage after #645: spin's place.go was its last reader (spin-stack/spin#1689). Deleted: the build makes vmlinux alone, and a release from #660 on has no `kernel/bzImage`. The boot path is unchanged: first login −4.3 [−14.4, +7.4] at 20 a side, within noise, sshd accepting −5.3 [−11.1, +7.0], QEMU's RSS −1.7 MiB (the arm's kernel is also 7.3.6, main's, against .07's 7.3.5) | spin | #660, lab 45262046768 | 11-23 | -| `driver_async_probe` for rng, balloon and vsock; `rcupdate.rcu_expedited=1` (carried since 11-13 and 09-07) | taken back −1.4 [−4.9, +3.1]: one vCPU has no second CPU to probe on. Deleted | spin | lab 44818953987, #352 | 11-21 | -| Kernel 0006 (BTF parsed in the background), 0009 (a booting AP polled by local_clock()), 0011 (queue_select written only on a change) | taken back −2.5 [−8.4, +1.8] at 40 boots. Deleted | spin | labs 44818953987, 44822157367, #345 | 11-21 | -| `DEFERRED_STRUCT_PAGE_INIT` (carried since 11-13, for 2 GiB at boot) | taken back −2.5 [−9.3, +3.8] at 40 boots: spin boots 128 MiB, which the kernel does not defer, and plugged memory is never deferred. Deleted | spin | lab 44839538785, #356 | 11-21 | -| vmlinux BTF parsed on first use, not at the first kfunc registration (a kernel patch on branch `exp/btf-first-use`) | kernel to "Freeing" −7.2 [−8.6, −6.2], inet_init 6.85 → 0.14 ms (lab 44982285400, 10 boots), but the first login −1.5 [−3.1, +1.6] at 60 boots (lab 44982285406): journald's `DeviceAllow=` and `IPAddressDeny=` load cgroup BPF programs at its start, and `bpf_check()` parses the BTF there, before the login. A verifier that asks for BTF only when a program needs it is the next step | spin | labs 44982285400, 44982285406 | 11-22 | -| `CONFIG_HZ_250` for `HZ_1000` (#567), as Firecracker's and Cloud Hypervisor's guest configs build | every exit −587 [−608, −445] (MSR writes 1018 → 755, preemption timer 691 → 482, HLT 332 → 298, 3 a side, lab 45111418504), but the first login −0.6 [−5.9, +3.1] at 60 a side (lab 45111452844): a tick's exits are handled in ~1-1.5 µs each in the L1, not the ~7 µs a nested MMIO or port exit costs | spin | labs 45111418504, 45111452844 | 11-23 | -| virtio-pci writes `queue_select` only when the queue changes, a second time and alone (#592 lever 1, a kernel patch on branch `exp/592-l1-queue-select`; first as 0011) | 68 MMIO exits fewer (91 → 23 writes, 3 a side, lab 45113437048), the first login −2.8 [−6.6, +3.4] at 60 a side (lab 45114405201) and +0.6 [−1.8, +2.3] at 120 (lab 45115330128). The vector read-back stays: virtio 1.2 §4.1.5.1.2 makes it how a device refuses a vector | spin | labs 45113437048, 45114405201, 45115330128 | 11-23 | -| x86's `msi_set_affinity` skips the message write when the vector and destination did not change (#592 lever 2, a kernel patch on branch `exp/592-l2-msix-once`) | 56 MMIO exits fewer (`__pci_write_msi_msg` 168 → 112, 3 a side, lab 45113437048), the first login −0.1 [−3.1, +4.5] at 60 a side (lab 45114405201) | spin | labs 45113437048, 45114405201 | 11-23 | -| `pci_save_state()` at a device's add kept only where an error handler can restore it (#591 a, a kernel patch on branch `exp/591a-no-save-state`) | 128 MMIO exits fewer, the host's handling −3.3 [−6.2, −2.1] ms (3 a side, lab 45113437048), but the first login −4.3 [−6.8, +0.5] at 60 a side (lab 45114405201) and −1.3 [−3.5, +1.3] at 120 (lab 45115330128). Its gate has to grow by hand: upstream a2f1e22390ac took out `pci_restore_state()`'s refusal of a state never saved | spin | labs 45113437048, 45114405201, 45115330128 | 11-23 | -| virtio-pci's vendor capabilities walked once per device (#591 b, a kernel patch on branch `exp/591b-virtio-caps-once`) | 114 MMIO exits fewer (3 a side, lab 45113437048). The first login −5.8 [−8.2, −0.6] at 60 a side (lab 45114405201), three times what 114 exits can cost, and +0.9 [−1.8, +2.7] at 120 (lab 45115330128) | spin | labs 45113437048, 45114405201, 45115330128 | 11-23 | -| The IOAPIC's redirection table read once at boot, and written back only where it was masked (#590, a kernel patch on branch `exp/590-ioapic-once`) | IOAPIC accesses 589 → 205 and the host's handling −3.1 [−6.2, −1.1] ms (3 a side, lab 45113437048), but the first login −4.5 [−7.8, +0.4] at 60 a side (lab 45114405201) and −2.0 [−4.3, +0.6] at 120 (lab 45115330128). With the four other exit patches of #591 and #592, as a bound, −7.4 [−12.1, −2.8], and as one change −9.4 [−14.2, −5.7] at 120 a side: carried as 0021-0025 (#627, "What the machine carries") | spin | labs 45113437048, 45114405201, 45115330128 | 11-23 | +Records with `"section": "kernel"` ([rendered](https://spin-stack.github.io/spin-machine/experiments.html#kernel-and-its-command-line)). ### Firmware, QEMU and the machine -| Idea | Result | Shape | Source | Date | -|---|---|---|---|---| -| `usb=off`, `vmport=off`, `smm=off`, `i8042=off` | 63.0/62.6/62.3/62.5 vs 62.9 ms | laptop | `fa1803f` | 09-08 | -| A named CPU model instead of `host`, for memories that resume on any host (`--cpu baseline`) | the newest model a nested c8id runs is Cascadelake-Server-v5, not SapphireRapids or GraniteRapids; cold first login +27.2 [+13.0, +30.8], sshd accepting +23.1 [+9.7, +28.5], warm login and RSS unmoved; the cause is not measured. `host` with a pool's common features is the next candidate (spin-stack/spin#1417) | spin | lab 44855890737 | 11-21 | -| Less guest RAM (512 MiB) | 1241 vs 1256 ms, nothing | runner | `80f984b` | 09-10 | -| `cache=none` on disks | breaks the shared base's caching, fails on tmpfs | - | `8b7391a` | 09-07 | -| Overlay O_DIRECT | small reads 1490 vs 530 ms | runner | docs/memory-and-disk.md | 10-01 | -| Board init wrapped in one memory transaction | the guest prints nothing | runner | `f10383b`, lab 36662499370 | 09-30 | -| Base on virtio-pmem and DAX | ~155 MB less per VM, but a side channel | runner | #63, #65 | 10-01 | -| Remove virtio-rng | −13.6 ms to the console prompt, never on a goal number; what seeds the RNG without it is open ("Open questions") | ladder | lab 43321809471 | 11-12 | -| QEMU copies the kernel's ELF segments on threads | laptop QEMU start 30.9 → 21.6; nested it adds nothing | ladder | labs 44580080420, 44581350077, #290 | 11-19 | -| A 1 MiB readahead on the root disk (`opt_io_size=524288` on virtio-blk), for fewer requests and so fewer notifications (#566) | iowrite16 exits 895 → 927 (3 a side, lab 45098880914); first login +1.4 [−2.7, +8.0] at 40 a side. The boot's reads are not readahead-bound (inferred) | spin | lab 45098879979, #592 | 11-23 | -| QEMU's start from its exec to its first trace event made cheaper (#647) | 9.7 ms on bench (lab 45177818419), no part of it over ~2 ms. The release's QEMU is static-pie on musl, so there is no dynamic loader to time (`LD_DEBUG` reads nothing): musl relocates its 59,700 relative relocations itself. On the laptop the phase read 4.7-5.4 ms p50, 40 starts each: a trivial static-pie binary's exec 0.23, QEMU's `-version` (exec, relocation, constructors, QOM type registration, the first options) 2.0, `-sandbox` dropped −0.7 to −0.9 (libseccomp builds its filter at run time), and the rest is option parsing, the trace's and the main loop's start and the machine object up to its first address space. perf over 200 `-version` runs: the relocation 7% of it, the kernel's page faults (copy-on-write, file fault-around, zeroing) ~15%, nothing else over 2%. From exec to held, malloc (musl's mallocng) is ~2.3 of 17 ms of the main thread's CPU. Candidates and their ceilings, each inferred at ~2× the laptop on bench: a filter compiled at build time as Firecracker's seccompiler does, ≤~1.5 ms; a non-PIE binary, no relocation and fewer copy-on-write faults, ≤~1 ms and it gives up ASLR of QEMU's image; DT_RELR, ≤~0.3 ms. Every one is under the ±4-5 ms that 60 boots a side resolve, so none was built. Another allocator is a lead across all of QEMU's start, not this phase (#669) | spin, laptop | lab 45177818419, #647 | 11-23 | -| QEMU 0007 kept once no release boots a bzImage: `-kernel` mapped a bzImage read-only instead of reading it into QEMU's heap (#646, carried from 11-23). From v20261123.07 the machine enters the vmlinux through PVH, which QEMU's ELF loader maps without it (#645) | taken back, against v20261123.07: first login +3.6 [−3.3, +7.8], sshd accepting −1.6 [−6.7, +5.6], QEMU's RSS +0.3 [−1.6, +2.1] MiB (lab 45258887660); restored −0.4 [−1.5, +0.9] evicted, −0.1 [−0.9, +0.9] cached, the cold boot of the same run +2.7 [−3.1, +8.7] (lab 45258106255), 40 a side, all within noise. A release before .07 boots its bzImage with its own QEMU, which carries 0007. When it came in, on a bzImage: first login −13.4 [−16.9, −7.3], restored −9.3 [−11.2, −6.1] evicted (labs 45182382388, 45182382864). Deleted | spin | labs 45258887660, 45258106255, parts run 45256311661, #660 | 11-23 | -| Lower the vCPU ceiling, drop the balloon or ACPI | not tried: an invariant | - | AGENTS.md | 11-13 | +Records with `"section": "firmware"` ([rendered](https://spin-stack.github.io/spin-machine/experiments.html#firmware-qemu-and-the-machine)). ### systemd and the image -| Idea | Result | Shape | Source | Date | -|---|---|---|---|---| -| Mask udev | saves 0, and boots never reach a login (10 s ttyS0 timeout) | runner | `4cbd229`, `80f984b` | 09-10 | -| agetty tweaks (TTYReset, --noissue, --delay 0, …) | within the noise of agetty's sleep(1) | runner | `80f984b` | 09-10 | -| chrony or another time daemon | 10 ms; cannot know it was restored | runner | `c7af4d3` | 09-10 | -| systemd-timesyncd | SNTP only, no refclock | - | `c7af4d3` | 09-10 | -| 19 udev rules masked; loop and 8250 counts as command-line parameters | 0 to the console prompt | runner | `e2f6b8f` | 09-26 | -| A console unit instead of serial-getty | +340 ms until TERM=dumb, then equal | runner | `c6e48de`, `7b08e5a` | 09-26 | -| Fewer unit files | 300 extra: 236 vs 246 | runner | `9fab3f1` | 09-26 | -| systemd-oomd | the kernel always beat it | runner | `337c08d` | 09-28 | -| CPUWeight/IOWeight/MemoryLow on ssh.service | no change | runner | `f7cd1ab` | 09-28 | -| Getty without BindsTo dev-ttyS0 | 342 vs 345 | ladder | lab 43303190733 | 11-12 | -| The serial getty at `StartupCPUWeight=1`, out of the first login's way | +2.7 [−4.3, +7.9] at 60 boots | spin | lab 44977226981 | 11-22 | -| Mask four varlink sockets nothing uses (factory-reset, mute-console, sysext, creds) | −0.8 [−4.8, +4.3] at 60 boots | spin | the same | 11-22 | -| Keygen wanted by multi-user.target | 518 vs 514 | ladder | lab 43312419007 | 11-12 | -| Mask sshd-socket- and run-generators | login 489, no change | ladder | lab 43483372488 | 11-13 | -| Mask 11 always-failing units | 484, no change | ladder | lab 43483372488 | 11-13 | -| Mask `modprobe@drm` (logind is ordered after it) | 327/345 vs 328/337. It is masked all the same, since 09-07, one of the 16 masks of group C-masks | ladder | lab 44558035927 | 11-19 | -| Mask `systemd-udev-load-credentials` | −8 then −6 ms, p95 unchanged: not separable at 20 boots | ladder | labs 44537549305, 44538877783 | 11-19 | -| systemd with `-Db_lto=true` | Ubuntu already passes `-flto=auto`: the same packages | - | image/systemd/Dockerfile | 11-19 | -| Masks of 15 units and a generator the image does not have | they masked nothing. Deleted without a run; image/build.sh refuses such a mask | - | #352 | 11-21 | -| PID 1's `LogLevel=err`, `LogTarget=journal`, `ShowStatus=no`, `StatusUnitFormat=name`; `kernel.printk = 3 3 3 3` | taken back −1.8 [−7.7, +3.2] at 40 boots; the console stays quiet through the command line. Deleted | spin | labs 44818953987, 44822157367, #354 | 11-21 | -| logind, `user-runtime-dir@` and `user@` at `StartupCPUWeight=1000`, the units user@0's chain is (#553) | −3.6 [−10.3, +0.6] at 40 boots (−9.2 [−16.1, −0.3] at 30 in a screening run of three arms, lab 45082870346). Accept to login −7.7, sshd accepting +8.8: logind and the manager come sooner and `sysinit.target` later, on the one vCPU | spin | lab 45083184310 | 11-22 | -| `spin-machine-sshd-keygen` and `systemd-udev-load-credentials` at `StartupCPUWeight=1` (#553) | sshd accepting +22.6 [+15.9, +33.5], first login +3.4 [−3.2, +14.6] at 30 boots: ssh.service waits for the keygen, and the forwarder for ssh.service. With the arm above, first login +6.0 [+0.5, +15.1] | spin | lab 45082870346 | 11-22 | -| Mask `systemd-udev-load-credentials` again, in spin's shape on one vCPU (it was −8 and −6 on two) | −2.1 [−6.3, +0.3] at 60 boots: not separable | spin | lab 44977044826 | 11-22 | -| `systemd-user-sessions` without its ExecStart (it removes a /run/nologin the image never writes), its ExecStop kept | −0.6 [−5.2, +1.5] at 60 boots | spin | the same | 11-22 | -| Mask `sshd-socket-generator`, again on spin's path | +0.8 [−4.0, +4.7] at 60 boots | spin | the same | 11-22 | -| `DefaultMemoryAccounting=no`, for cheaper unit cgroups | +4.1 [+0.8, +7.1] at 60 boots, worse; sshd accepting +6.2 [+2.2, +8.0]. The cause is not measured | spin | the same | 11-22 | -| No unit made for a `RequiresMountsFor=` prefix with no unit file (`unit_add_mount_dependencies` checks the unit name map before it loads one) | −1.0 [−4.3, +3.9] at 100 boots, and PID 1's CPU before the login 57.2 against 56.0, p50 of 5: not separable. Whether the stubs went in those boots was not observed (no debug boot of the arm). The patch and an upstream draft, not sent, are #580 | spin | labs 45090299768, 45090326943 | 11-23 | -| The rest of the boot started by a timer 2 s after the boot, in place of `Type=idle` (#574) | −66.5 [−75.2, −56.1] against idle's −59.2 [−69.1, −47.4] in the same run, both with the supervisor early: the timer starts the rest at an arbitrary time whatever the login, and docker's socket waits for it | spin | lab 45090246267 | 11-23 | -| The rest of the boot started from sshd's PAM stack at the first session (#574) | −52.0 [−61.6, −37.4], accept to login +15.3 [+10.8, +21.7]: it runs beside the login's last steps, and every login pays its `pam_exec` | spin | lab 45090246267 | 11-23 | -| `pam_selinux` (twice) and `pam_mail` out of sshd's PAM stack: SELinux is off and there is no mail | −1.9 [−4.9, +2.8] at 60 boots | spin | lab 44979726719 | 11-22 | -| `nsswitch.conf` without the `db` entries libnss-db would serve (kept since 09, never measured); reverted to Ubuntu's | taking it back +0.8 [−8.4, +5.2] cold, restored in noise | spin | lab 45034963004 | 11-22 | -| The manager's timeouts at 15 s and 10 s, the watchdogs off (`fast-boot.conf`); reverted to systemd's defaults | taking it back +0.3 [−5.2, +3.3] cold, restored in noise | spin | lab 45034963004 | 11-22 | -| containerd's CRI-enabled config replaced by containerd.io's own (#510); reverted to the package's | first login −4.9 [−12.2, +1.6] at 20 boots, restored login −0.6 [−2.1, +1.5] evicted: containerd starts at the first docker command, after the login | spin | labs 45111391250, 45112037022 | 11-23 | -| The image's `containerd.socket` out of the boot transaction, Docker's own `docker.socket` on both sides (#509) | first login +7.4 [−4.7, +15.3], sshd accepting +7.5 [−6.6, +14.9] (lab 45111146715); prestart cold −1.1 [−8.0, +9.0], prestarted +4.5 [−4.6, +9.9], restored −0.1 [−1.0, +1.7], restored into prestarted −0.5 [−1.8, +0.7] (lab 45111146865): all within noise. The socket starts in `sockets.target`, after the first login since #581. Kept: nothing to gain, and a tool that dials containerd's socket before docker has run would lose its start | spin | lab 45111146715, 45111146865 (20 a side, v20261123.04) | 11-23 | -| PID 1, journald, logind and `user@0` linked without the dynamic linker: v262's multicall build (#42304) or a static one (#42820), for their ld.so start-up (#638) | ld.so's own start-up, `LD_DEBUG=statistics`, p50 [range] of 8 boots: PID 1 0.48 [0.46, 0.56] ms, journald 0.20 [0.14, 0.31], logind 0.20 [0.11, 0.31], `user@0` 0.21 [0.15, 0.36]; 1.1 ms for the four, under #638's 5 ms threshold, so no build was run. Relocation 0.08-0.11 ms each (2,522 symbol and 16,589 relative relocations in PID 1 and `user@0`). The instrument moved nothing: first login +3.4 [−23.0, +11.9], PID 1's CPU −1.1 [−5.1, +0.6]. The multicall build keeps libsystemd-core and libsystemd-shared dynamic and leaves journald and logind as they are; the static one has no PAM for `user@`'s `PAMName=` | spin | lab 45180856158 | 11-23 | -| journald's, logind's and `user@`'s seccomp and sandbox settings, split from #574's bound (−14.1 [−18.5, −11.5]), and one seccomp filter per unit (#637) | the seccomp half carries it, −12.0 [−21.8, −2.1]; the namespace half +0.3 [−9.4, +7.2] (lab 45228294512). Fewer filters do not: `SystemCallArchitectures=` applied first takes journald's 17 → 8 and logind's 26 → 13, the same answer to 3435 calls (`boot:seccomp`, labs 45235103665, 45235485857), and read −0.4 [−6.1, +2.7] against systemd rebuilt without it (lab 45231419187). In journald's executor `SystemCallFilter=@system-service` takes 3.7-4.0 ms of 6.7-7.2, its `seccomp_load()` 1.1-1.2 of that, every other seccomp setting ~0.6 together (labs 45238003981, 45239372741, 2 vCPUs): one filter per unit would reach the 0.6. Building the allow-list once is #686. Prior art: systemd#17451 (one program per feature; Lennart wants each filter's application checked), libseccomp#499 (one context drops a conditional rule beside an unconditional one with another action, so merging settings is unsafe) | spin | labs 45228294512, 45231419187 | 11-23 | +Records with `"section": "image"` ([rendered](https://spin-stack.github.io/spin-machine/experiments.html#systemd-and-the-image)). ### The login -| Idea | Result | Shape | Source | Date | -|---|---|---|---|---| -| sntrup761 (OpenSSH's default kex) | 104 vs 40 ms a login | ladder | #245, lab 43479854381 | 11-13 | -| The vsock socket and sshd@ without default dependencies | no sooner; dropped 7 of 22 first connections. Carried since with the lane's other drop-ins (`sshd-vsock.socket.d`, `sshd@.service.d`), which the lane kept together (lab 43518915618) | laptop | `c3c0fd1` | 11-13 | -| CPUWeight/IOWeight/Nice on the first login's lane | −2 ms over the filtered coldplug; second login 63 vs 45 | lane | lab 43518915618 | 11-13 | -| One sshd for every connection (vsock `Accept=no`, `sshd -D` early) | first login 382 vs 381; second 40 vs 48 | lane | lab 43524721490 | 11-13 | -| A login without pam_systemd (a bound) | 380 vs 436, but no session and no XDG_RUNTIME_DIR | lane | lab 43518044150 | 11-13 | -| logind's Varlink socket without default dependencies | accept to login 131 → 120, first login inside the noise; kept with the lane's other drop-ins | ladder | labs 44558035927, 44558053261 | 11-19 | -| Sessions of class `user-early` with the manager started inside the login (#462). Kept since with root lingering (#467, "What the machine carries") | first login +36.2 [+32.0, +45.7], accept to login +39.5; restored +0.5 [−3.0, +3.8] | spin | lab 44987167474, 44987167549 | 11-22 | -| Every login's user manager started beside it, not waited for (`user-runtime-dir@`'s `20-manager.conf`, #462): a command that needs the user bus at once in the first login came before the manager | correctness: the first login's own `systemctl --user` failed 10 of 10. Replaced by class `user-early` (#467) | spin | lab 45032247920 | 11-22 | -| The user manager without the XDG autostart generator, on top of class `user-early` (#467) | first login −4.8 [−11.2, +1.3], accept to login −3.7 [−7.5, −0.5] at 20 boots. Carried since #527, with root's manager in the boot: −3.8 [−6.2, −0.7] at 100 ("What the machine carries") | spin | lab 45030778365 | 11-22 | -| Both user generators masked, a bound: the environment.d one also brings `/etc/environment` to user services | first login −8.4 [−15.8, −1.0] against class `user-early` | spin | lab 45030778365 | 11-22 | -| The user manager's PAM stack down to `pam_permit` and `pam_systemd`, a bound | first login −3.5 [−11.4, +2.5] against class `user-early` | spin | lab 45030778365 | 11-22 | -| `user@`'s `After=systemd-user-sessions.service` (Ubuntu's `10-login-barrier.conf`) shadowed, for a login as spin | lane +30.6 against +29.7 without it: the barrier is not what the lane waits for | lane | lab 45031687433 | 11-22 | -| Root's manager cut to what a workspace could do without, a bound: both user generators, the PAM stack down to `pam_permit` and `pam_systemd`, `ssh-agent.socket` and `systemd-ask-password.socket` masked. Without the environment.d generator user services lose the bus's address (`10-user-sockets.conf`) and `/etc/environment`; without `pam_unix`, `pam_limits` and `pam_loginuid` the manager skips the account check, the limits and the audit login uid | first login −9.6 [−13.3, −6.7] against v20261122.06, the ledger's ~10 ms of CPU for the same cuts. The XDG generator alone was carried; the rest is function | spin | labs 45070150688, 45070208762 | 11-22 | -| No user manager for root, a bound: sessions of class `user-early-light` and root not lingering, as before #467 | first login −17.3 [−19.2, −12.4], console prompt −26.6: the manager's 17.5 ms of CPU, 1:1, on a vCPU with no idle from ~155 ms to the login. The first login's `systemctl --user` fails without it (#467) | spin | lab 45070150688 | 11-22 | -| spin's forwarder (spin's supervisor) without default dependencies, after `ssh.service` only (`--edit forwarder-early`), on v20261122.06 | cold +4.2 [+0.0, +11.0], restored −0.0 [−2.3, +2.3], restored into prestarted −4.3 [−7.7, −0.4]: not a gain on either goal number, though the forwarder was active 116-141 ms after PID 1 against 154-176 (bootchart, 3 a side). The login then waits for systemd-logind, active at 162-186 ms in both arms, before `user-runtime-dir@0` (#553). On earlier releases it read cold −60.4 (lab 44987584707); what changed since is not measured | spin | labs 45071102677 (`prestart`, 20 a side), 45071549627 | 11-22 | +Records with `"section": "login"` ([rendered](https://spin-stack.github.io/spin-machine/experiments.html#the-login)). ### The restore and checkpoints -| Idea | Result | Shape | Source | Date | -|---|---|---|---|---| -| mapped-ram with multifd ×4, 11-13 | not comparable by its own run's log; channels were measured again on 11-20 and kept | ladder | #246, lab 43483852339 | 11-13 | -| Fast snapshot load (mapped-ram and postcopy-ram on a `file:` URI) as the restore | running at 38 ms, but the login at 293/325 instead of 152/161: every page touched is a fault served by one read. `LoadOptions.Fast` stays for large states | ladder | lab 44585840498 | 11-19 | -| Fast snapshot load for every state, the caller's choice (`LoadOptions.Fast`, spin's `fast_load`) | login +394 [+388, +420] at 179 MiB of data, +103 at 1.2 GiB, −129 at 1.7 GiB, −2615 at 7.3 GiB. Replaced by the machine's choice above 1.5 GiB (#470) | spin, touched | labs 45034868686, 45035462478, 45034881876, 45034881366 | 11-22 | -| The state read ahead during a fast load | at 179 MiB the login −168 ms, still +234 over a full load; at 3.7 GiB within noise, p95 713 against 490 | spin, touched | labs 45035029887, 45035048486 | 11-22 | -| Base memory in a shared file, left out of the checkpoint (`x-ignore-shared`) | state 0.3 MiB, save 15 ms, but neither goal number improves: cold 1089 ms on disk, 709-719 on tmpfs | ladder | labs 44663272360, 44664989139, #306 | 11-20 | -| 16 multifd channels as the default | −10.1 alone, but +3.2 [+1.1, +5.8] against 8 when 4 restore at once | spin | lab 44792429636 | 11-20 | -| `direct-io` (O_DIRECT) on the channels | within the noise evicted, +45 ms cached | laptop | log.md, 11-21 | 11-21 | -| `direct-io` on the channels of a save, against dirty-page throttling in the stop | never converged beside a busy disk: each pass ~2.5 s, the save cancelled after 10 min | spin, plugged 2 GiB | lab 44973775066, docs/memory-and-disk.md | 11-22 | -| `downtime-limit` 15 instead of 30 | the guest's stop −2.5 [−7.5, +3.0] short of memory beside a busy disk, −1.5 [−6.0, +2.8] with a writer | spin, plugged 2 GiB | lab 44975130836 | 11-22 | -| The guest's clean page cache dropped right before its save (`sync; echo 1 > /proc/sys/vm/drop_caches`), #276's last idea | the state did not shrink: 183 MiB with the drop, saved at once −0.1 [−0.4, +0.3] and 3 s later −0.0 [−0.3, +0.4]. The restored login was worse, +4.7 [+3.5, +7.3] evicted at once and +5.6 [+4.6, +7.6] 3 s later, as the login read again from the guest's disk what the drop took from its cache | spin | lab 45110967817 | 11-23 | +Records with `"section": "restore"` ([rendered](https://spin-stack.github.io/spin-machine/experiments.html#the-restore-and-checkpoints)). ### QMP and vsock @@ -454,44 +290,17 @@ Both transports were measured in spin's shape on the bench, 20 boots, with the ` part cost nothing. None is above the noise (±7-9 ms cold, ±13 restored at 20 boots), so none was built. -| Idea | Result | Shape | Source | Date | -|---|---|---|---|---| -| Faster QMP in general | the cold boot waits on 14 commands, 6.2 ms from QEMU's main loop being free to `cont` answered (1.3% of 470). A restore waits on 17 before `migrate-incoming`, 6.7 ms, and 2.7 after the guest runs. The commands' own run is ~1.2 ms of each path. The rest is round trips: query-status alone is 131 µs from the client, 18 µs in QEMU. spin-machine's start and dial are off the path: its first command waits 17 ms (cold) and 19.5 (restored) for QEMU | spin | lab 44912471522 | 11-21 | -| Pipelining the bind (every command sent before the first answer) | ceiling: QEMU's wait on the client, 4.5 ms cold and 5.2 restored, under the noise. The read-ahead overlaps the restore's half, so its share is smaller | spin | the same | 11-21 | -| The held start's bind sent ahead of its answers: the run state with the places, every place's serial at once, each image's two nodes together, the reopen with the placeholder's delete; 13 round trips to 9, add-fd still waiting for its answer and `cont` for the bind's last (#649) | first login −1.7 [−5.6, +2.6], sshd accepting −2.4 [−5.5, +2.8] at 60 a side (lab 45230790902); restored −0.3 [−3.8, +3.7] evicted, +0.9 [−10.6, +7.5] cached (lab 45231358105). The split: QEMU waited 4.5 ms p50 for the client in 24 boots, 0.9 of it QEMU busy with the probe's plug monitor, so ~3.6 ms is spin-machine's own, ~0.28 ms a round trip (lab 45177818419). The four round trips removed are ~1.1 ms (inferred), and the whole of spin-machine's share is under what 60 boots resolve. Code on tag `archive/exp-649-held-start` | spin | labs 45230790902, 45231358105 | 11-23 | -| Fewer round trips (no `query-status` before the bind, places read from the Spec instead of `query-block` and `qom-get`, `Last(RESUME)` for the `query-status` after a load) | ceiling ~1.3 ms cold, ~1.9 restored | spin | the same, the detail by command | 11-21 | -| Smaller answers | nothing large is on either path: `query-block` runs in 0.12 ms. The record's 125 KB answers left the restore's clock with `Resume(here)` | spin | the same | 11-21 | -| QMP over vsock, SEQPACKET, ivshmem, virtio-serial, gRPC or protobuf framing | QMP does not ride vsock: it is a Unix socket between the host and QEMU. vsock carries the login, and a login is 10 round trips of 47.8 µs (57.5 through the forwarder), 0.6 ms of a 32.8 ms warm login. Every vsock change shares that ceiling | spin | the same | 11-21 | -| `kvm.halt_poll_ns`, CPU pinning, for vsock | bounded by the same 0.6 ms a login. What they do to the boot's other wake-ups is a different question, not measured here | spin | the same | 11-21 | -| An `iothread=` for the disks, against QMP stalls beside a guest's synced writes on a busy host disk (#391) | no stall to take off the monitor: 2,400 query-status round trips beside 4 KiB `oflag=dsync` writes, with the scratch NVMe idle, 99-100% busy with O_DIRECT writes and 100% busy through the page cache, never took more than 1.2 ms (p50 0.24-0.56 ms), while the guest's writes fell from ~115,000 to 1,500-3,100 in the row. The laptop's 175-950 ms was QEMU's main thread blocked in the host, by #402 in reclaim, the mmap lock or a cgroup throttle, which an iothread does not move | spin | labs 45111443524, 45112573850, `stall` probe archived as `archive/qmp-stall-391` | 11-23 | +Records with `"section": "qmp"` ([rendered](https://spin-stack.github.io/spin-machine/experiments.html#qmp-and-vsock)). ### Memory and the host -| Idea | Result | Shape | Source | Date | -|---|---|---|---|---| -| Lower `memhp_default_state` (unplug policies) | kept `online` | runner | `2903d8c`, #48 | 09-30 | -| DAMON_RECLAIM, MGLRU eviction | slower, or not selective | runner | docs/memory-and-disk.md | 10-01 | -| `page_reporting_order` 0 or 3 | ~100 MB transient vs ~180 MB of huge pages lost | runner | docs/memory-and-disk.md, #83 | 10-01 | -| Prefetch the boot's files | 47 ms to win 24 | runner | run 36803912357 | 10-01 | -| A second limit (`memory.high`) | `memory.max` suffices | - | docs/memory-and-disk.md | 10-01 | -| KSM, free page hinting, virtio-fs DAX | security, correctness, unsupported | - | docs/memory-and-disk.md | 10-01 | -| QEMU at a higher host priority (cgroup `cpu.weight`, nice, a real-time class) on an idle host | ceiling: QEMU's threads wait 0.2/1.1 ms for a CPU from its exec to the cold first login and 0.1/0.2 to the restored one, the guest's steal 0. Priority can win back only that wait. On a busy host it is a lead for spin ("Open experiments") | spin | lab 44925573288, `run-delay` | 11-21 | -| A burst of restores bound by host CPU0 | no: busy time, interrupts and QEMU's threads spread over all 16 CPUs, and irqbalance runs | spin | lab 44817486118 | 11-21 | +Records with `"section": "memory"` ([rendered](https://spin-stack.github.io/spin-machine/experiments.html#memory-and-the-host)). ## Open experiments The rows are ranked by ceiling. A row stays here until it is decided, and then moves. -| Experiment | Number | Phase, p50, ceiling | Decided by | State | -|---|---|---|---|---| -| A burst of restores: 8 at once read ~190-240 ms each under `defer`, against ~100 alone | restore, as a host sees it; spin restores concurrently with no host-wide limit | the burst's ~100-140 ms over one restore alone | `restore-together`, `together=1 8`, evicted, with the change against without it | open. The host's CPUs are 72-78% busy in the burst, and direct reclaim runs as the states fill the page cache (lab 44817486118). Next candidates: `vm.watermark_scale_factor`, and the CPU one restore costs | -| A login without OpenSSH's exec per connection and PAM | both | a warm login, ~25-43 ms, is in both numbers | a bound first: `prestart` with the login replaced | lead (log.md, 11-20, "spin's login, spin's memory"). spin's path already runs one sshd, and PAM and pam_systemd are what spin's sessions are made of | -| Carried items never measured alone: kernel patches 0005, 0007, 0008 and 0010 each (group A is +67.5 together); `pci=lastbus=0` (2026-09, before patches 0004 and 0010); logind's early varlink socket (measured on 2 vCPUs); QEMU 0001 and qboot's `pam.patch` apart; `no_timer_check`, `tsc=reliable`; `hpet=off`; systemd's static tools; `-O ^orphan_file`; `rootfstype=ext4`; the lane's drop-ins on spin's path | cold | each ≤ a few ms; B together +11.5 | rule 5, an arm each, 40 boots | open. The static tools and `orphan_file` need an image build (`--systemd` builds only an experiment patch) | -| What functional items cost, last measured on another machine: BPF JIT and BTF (+21.4 ms to "Freeing", 09-07, a vmlinux through PVH, before the ftrace patches), lockdown at confidentiality (nothing told from noise, 10-01, a host at load 6-10) | cold | a few ms each, unknown in spin's shape | `ssh-first` with a `--kernel` built without each, 20 boots | open. They stay for function, so a number says what they cost and decides nothing | -| The no-systemd floor, each release | a bound | how much of the cold number is systemd's to give back: 445 → 240 in spin's shape | `ssh-first` on the release with `--edit floor --append init=/usr/local/sbin/spin-floor` and `login=lane`; `releases measure` does it beside every release, and report.yml records it (docs/releases.md, "Bounds") | last measured 11-22 on v20261122.02: the lane's first login 407 → 241, −166.3 [−174.7, −160.3] (report.yml run 45018301368, 20 boots). On v20261122.01: 404 → 250, −153.9 [−162.5, −151.2], sshd accepting 242 → 197 (lab 44978079694, 20 boots). 11-20: 445 → 240 (lab 44750322384) | -| A workspace's cgroup at a higher `cpu.weight` while it boots or restores, on a busy host (spin's runner owns the cgroup) | restore, as a busy host sees it | with 16 workspaces keeping the 16 CPUs busy, the restored first login is 306 ms against 115 idle, and QEMU's threads wait 282 ms for a CPU (lab 44925573288). The same weight ratio as QEMU at nice −10, set as the crowd at nice 10: restored −79.3 [−93.5, −71.0], cold −104.7 [−258.3, +150.9], within noise (lab 44927312303) | spin's `restore-together` or a crowd on its runner, with the weight raised through the workspace's cgroup and set back after the login, against without it | a proposal for spin. Measured in one cgroup, where each thread competes alone. In spin each workspace is a cgroup, and the weight is shared by its threads. The idle host has nothing to win (Measured and rejected, "Memory and the host") | -| The restore with more than 2 GiB of RAM | restore | unmeasured (#242's checklist) | `restore-first` with `plugged` above 2048 | open | -| A workspace's 2048 MiB at boot (`memory=2048 plugged=0`) instead of 128 plugged to 2048 through virtio-mem during the boot (#561) | cold | the plug and the onlining of 2048 MiB on the one vCPU while the boot runs; separate runs read −15 nested and −8 metal (v20261122.06, labs 45074465204, 45074579100, 45074680619, 45078339515), so the ceiling is ~15 ms. Prior art: the kernel onlines hotplugged memory strictly in sequence, one memory block after another, and deferred struct page init, which spreads the boot's own memory over threads, does not apply to it (David Hildenbrand on linux-mm, [lore](https://lore.kernel.org/linux-mm/87v9disj2s.fsf@oracle.com/T/)). Squeezy (arXiv 2411.12893, 2024) measured virtio-mem's operations in seconds at GiB sizes and found init_on_free slows a plug. Neither measured a boot. The kernel has init_on_alloc and init_on_free off | `ssh-first`, the two shapes as two trees of one run (`--opt` on a tree), 40 a side on bench and on bench-metal, `restore-first` beside them; 3 ledgers of each shape for the onlining's CPU | a proposal for spin, spin-stack/spin#1660. Measured as two trees of one run (v20261123.04, spin's login): cold first login −5.5 [−10.9, −0.7] nested at 80 a side (lab 45111507862; −2.5 [−7.3, +2.0] at 40, lab 45110554589), −7.0 [−11.4, −3.4] on metal at 40 (lab 45110570912); restored login −2.5 [−3.7, −1.0], the state −17.6 MiB, QEMU's RSS −26 MiB (labs 45110562994, 45111507862). The ledger (lab 45110580480, 3 boots each) shows `kworker/0:1` on the vCPU ~8 ms before PID 1 when plugged and not at all when the memory is at boot, which costs the kernel's own setup ~4.5 ms more: PID 1 −4.0 ms on the kernel's clock (−3.4 on CLOCK_MONOTONIC, before #644). The probes keep spin's shape until spin changes it | +The rows are the records in `docs/experiments` with `"decision": "open"`, rendered by `spin-machine-dev docs tables` and [on the site](https://spin-stack.github.io/spin-machine/experiments.html#open-experiments). The floor is a bound and never a candidate: systemd stays (AGENTS.md, "What must not break"). @@ -512,6 +321,6 @@ No lab run answers these questions. - **The kernel CVE judge.** 9 CVEs apply with a fix later in 7.3, and 1 has no fix (`0ce27ad`, against 7.3.1; the kernel is 7.3.5 on 2026-11-20). - **The min_ttl_ms evidence disagrees.** `47aa681` and the LRU_GEN comment in `kernel/Dockerfile` - say different things (docs/log.md, 09-28). + say different things (docs/log/2026-09-28-f7cd1ab-47aa681-337c08d.md). - **The guest clock on 09-30.** `1d5e7f5` blames chrony, which had left the image on 09-10 (`c7af4d3`). The fix (time by `/proc/uptime`) stands either way. diff --git a/docs/cli.md b/docs/cli.md index 6a2cf165..7389d6d2 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -148,7 +148,7 @@ withdraw.yml task bin ; spin-machine-dev releases withdraw|restore TAG ; task gi spin-machine-dev releases propose --branch --title osv.yml spin-machine-dev osv --issues ; spin-machine-dev cves lab.yml task vsock ; task lab:ci -pages.yml task bin ; spin-machine-dev releases site --out _site +pages.yml task bin ; spin-machine-dev releases site --out _site ; spin-machine-dev docs site --out _site ``` A build in CI reads BuildKit's cache from GitHub's registry (`--cache-registry`, @@ -158,6 +158,24 @@ after. The cache lives in the registry and not in the Actions cache, because the cannot read the Actions cache, and the Actions cache evicted a lane's layers between a merge and the release that needed them. +## The log and the experiments + +The log is one file an entry under `docs/log`, and the rows of `docs/boot-time.md`'s tables are one +record each under `docs/experiments` (AGENTS.md, "Experiments", says what each holds). A pull +request adds files of its own, so two in flight do not conflict. The pages they make are rendered, +never committed (#709): + +``` +spin-machine-dev docs log [--out FILE] the log: docs/log's head, the entries by date under their weeks, rework.md +spin-machine-dev docs tables [--out FILE] what the machine carries, what was measured and rejected, what is open +spin-machine-dev docs site --out OUT both as web pages, OUT/log.html and OUT/experiments.html +``` + +pages.yml publishes the site's two pages beside the releases' page, at +https://spin-stack.github.io/spin-machine/log.html and +https://spin-stack.github.io/spin-machine/experiments.html. Each verb refuses a file that does not +parse, as `gates/docs_test.go` does. + ## The Taskfile What a person types is spin-machine-dev. The Taskfile is go-tools' gates, the same in every diff --git a/docs/experiments/10-seats-conf-the-gettys-term.json b/docs/experiments/10-seats-conf-the-gettys-term.json new file mode 100644 index 00000000..add24cae --- /dev/null +++ b/docs/experiments/10-seats-conf-the-gettys-term.json @@ -0,0 +1,9 @@ +{ + "decision": "carried", + "order": 550, + "change": "`10-seats.conf`, the getty's TERM, `/tmp`'s size", + "where": "image drop-ins", + "result": "function", + "evidence": "-", + "source": "-" +} diff --git a/docs/experiments/16-more-unit-masks.json b/docs/experiments/16-more-unit-masks.json new file mode 100644 index 00000000..659d057c --- /dev/null +++ b/docs/experiments/16-more-unit-masks.json @@ -0,0 +1,12 @@ +{ + "decision": "carried", + "order": 340, + "change": "16 more unit masks (journal-flush, fsck-root, modules-load, pstore, random-seed, four modprobe@, …)", + "where": "optimize-systemd.sh", + "result": "cold +57.5 [+49.0, +63.0]", + "evidence": "group C-masks", + "source": "lab 44818953987", + "runs": [ + 44818953987 + ] +} diff --git a/docs/experiments/16-multifd-channels-as-the-default.json b/docs/experiments/16-multifd-channels-as-the-default.json new file mode 100644 index 00000000..a706206a --- /dev/null +++ b/docs/experiments/16-multifd-channels-as-the-default.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "restore", + "order": 60, + "date": "2026-11-20", + "change": "16 multifd channels as the default", + "result": "−10.1 alone, but +3.2 [+1.1, +5.8] against 8 when 4 restore at once", + "shape": "spin", + "source": "lab 44792429636", + "runs": [ + 44792429636 + ] +} diff --git a/docs/experiments/19-udev-rules-masked-loop-and.json b/docs/experiments/19-udev-rules-masked-loop-and.json new file mode 100644 index 00000000..62772a7e --- /dev/null +++ b/docs/experiments/19-udev-rules-masked-loop-and.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "image", + "order": 50, + "date": "2026-09-26", + "change": "19 udev rules masked; loop and 8250 counts as command-line parameters", + "result": "0 to the console prompt", + "shape": "runner", + "source": "`e2f6b8f`" +} diff --git a/docs/experiments/391-an-iothread-for-the-disks-against.json b/docs/experiments/391-an-iothread-for-the-disks-against.json new file mode 100644 index 00000000..89aab1df --- /dev/null +++ b/docs/experiments/391-an-iothread-for-the-disks-against.json @@ -0,0 +1,18 @@ +{ + "decision": "rejected", + "section": "qmp", + "order": 80, + "date": "2026-11-23", + "change": "An `iothread=` for the disks, against QMP stalls beside a guest's synced writes on a busy host disk (#391)", + "result": "no stall to take off the monitor: 2,400 query-status round trips beside 4 KiB `oflag=dsync` writes, with the scratch NVMe idle, 99-100% busy with O_DIRECT writes and 100% busy through the page cache, never took more than 1.2 ms (p50 0.24-0.56 ms), while the guest's writes fell from ~115,000 to 1,500-3,100 in the row. The laptop's 175-950 ms was QEMU's main thread blocked in the host, by #402 in reclaim, the mmap lock or a cgroup throttle, which an iothread does not move", + "shape": "spin", + "source": "labs 45111443524, 45112573850, `stall` probe archived as `archive/qmp-stall-391`", + "issues": [ + 391, + 402 + ], + "runs": [ + 45111443524, + 45112573850 + ] +} diff --git a/docs/experiments/457-sshd-without-opensshs-userauth-minimum-time.json b/docs/experiments/457-sshd-without-opensshs-userauth-minimum-time.json new file mode 100644 index 00000000..a1aa3141 --- /dev/null +++ b/docs/experiments/457-sshd-without-opensshs-userauth-minimum-time.json @@ -0,0 +1,16 @@ +{ + "decision": "carried", + "order": 490, + "change": "sshd without OpenSSH's userauth minimum time on a login: a request that authenticated, or a public key query answered with `PK_OK`, does not wait; a failure still does (#457)", + "where": "image/openssh", + "result": "restored −13.6 [−14.9, −9.8] evicted, −13.6 [−16.2, −11.4] cached; cold −9.4 [−15.8, −2.6], the second login −10.9 [−12.3, −9.0]", + "evidence": "measured, 30 a side", + "source": "labs 44983986606, 44983986575", + "issues": [ + 457 + ], + "runs": [ + 44983986575, + 44983986606 + ] +} diff --git a/docs/experiments/462-sessions-of-class-user-early-with.json b/docs/experiments/462-sessions-of-class-user-early-with.json new file mode 100644 index 00000000..ac80c896 --- /dev/null +++ b/docs/experiments/462-sessions-of-class-user-early-with.json @@ -0,0 +1,18 @@ +{ + "decision": "rejected", + "section": "login", + "order": 70, + "date": "2026-11-22", + "change": "Sessions of class `user-early` with the manager started inside the login (#462). Kept since with root lingering (#467, \"What the machine carries\")", + "result": "first login +36.2 [+32.0, +45.7], accept to login +39.5; restored +0.5 [−3.0, +3.8]", + "shape": "spin", + "source": "lab 44987167474, 44987167549", + "issues": [ + 462, + 467 + ], + "runs": [ + 44987167474, + 44987167549 + ] +} diff --git a/docs/experiments/467-no-user-manager-for-root-a.json b/docs/experiments/467-no-user-manager-for-root-a.json new file mode 100644 index 00000000..b3d220e9 --- /dev/null +++ b/docs/experiments/467-no-user-manager-for-root-a.json @@ -0,0 +1,16 @@ +{ + "decision": "rejected", + "section": "login", + "order": 140, + "date": "2026-11-22", + "change": "No user manager for root, a bound: sessions of class `user-early-light` and root not lingering, as before #467", + "result": "first login −17.3 [−19.2, −12.4], console prompt −26.6: the manager's 17.5 ms of CPU, 1:1, on a vCPU with no idle from ~155 ms to the login. The first login's `systemctl --user` fails without it (#467)", + "shape": "spin", + "source": "lab 45070150688", + "issues": [ + 467 + ], + "runs": [ + 45070150688 + ] +} diff --git a/docs/experiments/467-sessions-of-class-user-early-and.json b/docs/experiments/467-sessions-of-class-user-early-and.json new file mode 100644 index 00000000..6ae20250 --- /dev/null +++ b/docs/experiments/467-sessions-of-class-user-early-and.json @@ -0,0 +1,18 @@ +{ + "decision": "carried", + "order": 440, + "change": "Sessions of class `user-early` and root lingering, so a login waits for its user manager and root's starts in the boot (#467)", + "where": "configure-system.sh", + "result": "correctness: the first login's own `systemctl --user` failed 10 of 10 on v20261122.03 and passed 10 of 10 with it (lab 45032247920). First login +4.7 [−0.2, +12.2] at 40 a side, sshd accepting +5.6 [+1.1, +10.1]; restored −10.8 [−15.9, −6.6] evicted, −12.3 [−15.1, −5.5] cached. The lane's login as spin, whose manager does not linger, +29.7 [+22.8, +42.1]", + "evidence": "measured", + "source": "labs 45031644179, 45031644114, 45031687433", + "issues": [ + 467 + ], + "runs": [ + 45031644114, + 45031644179, + 45031687433, + 45032247920 + ] +} diff --git a/docs/experiments/467-the-user-manager-without-the-xdg.json b/docs/experiments/467-the-user-manager-without-the-xdg.json new file mode 100644 index 00000000..da57f9b0 --- /dev/null +++ b/docs/experiments/467-the-user-manager-without-the-xdg.json @@ -0,0 +1,17 @@ +{ + "decision": "rejected", + "section": "login", + "order": 90, + "date": "2026-11-22", + "change": "The user manager without the XDG autostart generator, on top of class `user-early` (#467)", + "result": "first login −4.8 [−11.2, +1.3], accept to login −3.7 [−7.5, −0.5] at 20 boots. Carried since #527, with root's manager in the boot: −3.8 [−6.2, −0.7] at 100 (\"What the machine carries\")", + "shape": "spin", + "source": "lab 45030778365", + "issues": [ + 467, + 527 + ], + "runs": [ + 45030778365 + ] +} diff --git a/docs/experiments/509-the-images-containerd-socket-out-of.json b/docs/experiments/509-the-images-containerd-socket-out-of.json new file mode 100644 index 00000000..7b577d1d --- /dev/null +++ b/docs/experiments/509-the-images-containerd-socket-out-of.json @@ -0,0 +1,20 @@ +{ + "decision": "rejected", + "section": "image", + "order": 340, + "date": "2026-11-23", + "change": "The image's `containerd.socket` out of the boot transaction, Docker's own `docker.socket` on both sides (#509)", + "result": "first login +7.4 [−4.7, +15.3], sshd accepting +7.5 [−6.6, +14.9] (lab 45111146715); prestart cold −1.1 [−8.0, +9.0], prestarted +4.5 [−4.6, +9.9], restored −0.1 [−1.0, +1.7], restored into prestarted −0.5 [−1.8, +0.7] (lab 45111146865): all within noise. The socket starts in `sockets.target`, after the first login since #581. Kept: nothing to gain, and a tool that dials containerd's socket before docker has run would lose its start", + "shape": "spin", + "source": "lab 45111146715, 45111146865 (20 a side, v20261123.04)", + "issues": [ + 509 + ], + "prs": [ + 581 + ], + "runs": [ + 45111146715, + 45111146865 + ] +} diff --git a/docs/experiments/510-containerds-cri-enabled-config-replaced-by.json b/docs/experiments/510-containerds-cri-enabled-config-replaced-by.json new file mode 100644 index 00000000..dda560a7 --- /dev/null +++ b/docs/experiments/510-containerds-cri-enabled-config-replaced-by.json @@ -0,0 +1,17 @@ +{ + "decision": "rejected", + "section": "image", + "order": 330, + "date": "2026-11-23", + "change": "containerd's CRI-enabled config replaced by containerd.io's own (#510); reverted to the package's", + "result": "first login −4.9 [−12.2, +1.6] at 20 boots, restored login −0.6 [−2.1, +1.5] evicted: containerd starts at the first docker command, after the login", + "shape": "spin", + "source": "labs 45111391250, 45112037022", + "issues": [ + 510 + ], + "runs": [ + 45111391250, + 45112037022 + ] +} diff --git a/docs/experiments/515-no-host-key-made-when-spins.json b/docs/experiments/515-no-host-key-made-when-spins.json new file mode 100644 index 00000000..847e5a31 --- /dev/null +++ b/docs/experiments/515-no-host-key-made-when-spins.json @@ -0,0 +1,16 @@ +{ + "decision": "carried", + "order": 480, + "change": "No host key made when spin's handoff has placed its own at `/run/spin/ssh/ssh_host_ed25519_key` (#515)", + "where": "spin-machine-sshd-keygen.service", + "result": "first login −6.9 [−9.6, −2.4], sshd accepting −6.8 [−10.4, −1.8], 120 a side, both arms with `--edit spin-handoff`; restored in noise, 20 a side. Prior art: RHEL's cloud-init conditions `sshd-keygen@` off while it provisions the keys (git.centos.org rpms/cloud-init, `ci-Inhibit-sshd-keygen-.service-if-cloud-init-is-active.patch`), for function and unmeasured", + "evidence": "measured", + "source": "labs 45086250796, 45085877238", + "issues": [ + 515 + ], + "runs": [ + 45085877238, + 45086250796 + ] +} diff --git a/docs/experiments/527-roots-manager-without-the-xdg-autostart.json b/docs/experiments/527-roots-manager-without-the-xdg-autostart.json new file mode 100644 index 00000000..2ec9b7c7 --- /dev/null +++ b/docs/experiments/527-roots-manager-without-the-xdg-autostart.json @@ -0,0 +1,16 @@ +{ + "decision": "carried", + "order": 460, + "change": "Root's manager without the XDG autostart generator, which turns a graphical session's `.desktop` files into user units (#527)", + "where": "optimize-systemd.sh", + "result": "first login −3.8 [−6.2, −0.7], accept to login −6.1 [−9.0, −0.3], 100 boots a side; restored −1.7 [−4.4, +2.2] evicted, in noise", + "evidence": "measured", + "source": "labs 45070150688, 45070973943", + "issues": [ + 527 + ], + "runs": [ + 45070150688, + 45070973943 + ] +} diff --git a/docs/experiments/553-logind-user-runtime-dir-and-user.json b/docs/experiments/553-logind-user-runtime-dir-and-user.json new file mode 100644 index 00000000..2c5435e6 --- /dev/null +++ b/docs/experiments/553-logind-user-runtime-dir-and-user.json @@ -0,0 +1,17 @@ +{ + "decision": "rejected", + "section": "image", + "order": 210, + "date": "2026-11-22", + "change": "logind, `user-runtime-dir@` and `user@` at `StartupCPUWeight=1000`, the units user@0's chain is (#553)", + "result": "−3.6 [−10.3, +0.6] at 40 boots (−9.2 [−16.1, −0.3] at 30 in a screening run of three arms, lab 45082870346). Accept to login −7.7, sshd accepting +8.8: logind and the manager come sooner and `sysinit.target` later, on the one vCPU", + "shape": "spin", + "source": "lab 45083184310", + "issues": [ + 553 + ], + "runs": [ + 45082870346, + 45083184310 + ] +} diff --git a/docs/experiments/553-spin-machine-sshd-keygen-and-systemd.json b/docs/experiments/553-spin-machine-sshd-keygen-and-systemd.json new file mode 100644 index 00000000..d21a92d3 --- /dev/null +++ b/docs/experiments/553-spin-machine-sshd-keygen-and-systemd.json @@ -0,0 +1,16 @@ +{ + "decision": "rejected", + "section": "image", + "order": 220, + "date": "2026-11-22", + "change": "`spin-machine-sshd-keygen` and `systemd-udev-load-credentials` at `StartupCPUWeight=1` (#553)", + "result": "sshd accepting +22.6 [+15.9, +33.5], first login +3.4 [−3.2, +14.6] at 30 boots: ssh.service waits for the keygen, and the forwarder for ssh.service. With the arm above, first login +6.0 [+0.5, +15.1]", + "shape": "spin", + "source": "lab 45082870346", + "issues": [ + 553 + ], + "runs": [ + 45082870346 + ] +} diff --git a/docs/experiments/561-a-workspaces-2048-mib-at-boot.json b/docs/experiments/561-a-workspaces-2048-mib-at-boot.json new file mode 100644 index 00000000..accf16df --- /dev/null +++ b/docs/experiments/561-a-workspaces-2048-mib-at-boot.json @@ -0,0 +1,24 @@ +{ + "decision": "open", + "order": 80, + "change": "A workspace's 2048 MiB at boot (`memory=2048 plugged=0`) instead of 128 plugged to 2048 through virtio-mem during the boot (#561)", + "number": "cold", + "phase": "the plug and the onlining of 2048 MiB on the one vCPU while the boot runs; separate runs read −15 nested and −8 metal (v20261122.06, labs 45074465204, 45074579100, 45074680619, 45078339515), so the ceiling is ~15 ms. Prior art: the kernel onlines hotplugged memory strictly in sequence, one memory block after another, and deferred struct page init, which spreads the boot's own memory over threads, does not apply to it (David Hildenbrand on linux-mm, [lore](https://lore.kernel.org/linux-mm/87v9disj2s.fsf@oracle.com/T/)). Squeezy (arXiv 2411.12893, 2024) measured virtio-mem's operations in seconds at GiB sizes and found init_on_free slows a plug. Neither measured a boot. The kernel has init_on_alloc and init_on_free off", + "decided_by": "`ssh-first`, the two shapes as two trees of one run (`--opt` on a tree), 40 a side on bench and on bench-metal, `restore-first` beside them; 3 ledgers of each shape for the onlining's CPU", + "state": "a proposal for spin, spin-stack/spin#1660. Measured as two trees of one run (v20261123.04, spin's login): cold first login −5.5 [−10.9, −0.7] nested at 80 a side (lab 45111507862; −2.5 [−7.3, +2.0] at 40, lab 45110554589), −7.0 [−11.4, −3.4] on metal at 40 (lab 45110570912); restored login −2.5 [−3.7, −1.0], the state −17.6 MiB, QEMU's RSS −26 MiB (labs 45110562994, 45111507862). The ledger (lab 45110580480, 3 boots each) shows `kworker/0:1` on the vCPU ~8 ms before PID 1 when plugged and not at all when the memory is at boot, which costs the kernel's own setup ~4.5 ms more: PID 1 −4.0 ms on the kernel's clock (−3.4 on CLOCK_MONOTONIC, before #644). The probes keep spin's shape until spin changes it", + "issues": [ + 561, + 644 + ], + "runs": [ + 45074465204, + 45074579100, + 45074680619, + 45078339515, + 45110554589, + 45110562994, + 45110570912, + 45110580480, + 45111507862 + ] +} diff --git a/docs/experiments/566-a-1-mib-readahead-on-the.json b/docs/experiments/566-a-1-mib-readahead-on-the.json new file mode 100644 index 00000000..a856798e --- /dev/null +++ b/docs/experiments/566-a-1-mib-readahead-on-the.json @@ -0,0 +1,17 @@ +{ + "decision": "rejected", + "section": "firmware", + "order": 100, + "date": "2026-11-23", + "change": "A 1 MiB readahead on the root disk (`opt_io_size=524288` on virtio-blk), for fewer requests and so fewer notifications (#566)", + "result": "iowrite16 exits 895 → 927 (3 a side, lab 45098880914); first login +1.4 [−2.7, +8.0] at 40 a side. The boot's reads are not readahead-bound (inferred)", + "shape": "spin", + "source": "lab 45098879979, #592", + "issues": [ + 566 + ], + "runs": [ + 45098879979, + 45098880914 + ] +} diff --git a/docs/experiments/567-config-hz-250-for-hz-1000.json b/docs/experiments/567-config-hz-250-for-hz-1000.json new file mode 100644 index 00000000..f1c93936 --- /dev/null +++ b/docs/experiments/567-config-hz-250-for-hz-1000.json @@ -0,0 +1,17 @@ +{ + "decision": "rejected", + "section": "kernel", + "order": 270, + "date": "2026-11-23", + "change": "`CONFIG_HZ_250` for `HZ_1000` (#567), as Firecracker's and Cloud Hypervisor's guest configs build", + "result": "every exit −587 [−608, −445] (MSR writes 1018 → 755, preemption timer 691 → 482, HLT 332 → 298, 3 a side, lab 45111418504), but the first login −0.6 [−5.9, +3.1] at 60 a side (lab 45111452844): a tick's exits are handled in ~1-1.5 µs each in the L1, not the ~7 µs a nested MMIO or port exit costs", + "shape": "spin", + "source": "labs 45111418504, 45111452844", + "issues": [ + 567 + ], + "runs": [ + 45111418504, + 45111452844 + ] +} diff --git a/docs/experiments/574-journalds-loginds-and-user-s-seccomp.json b/docs/experiments/574-journalds-loginds-and-user-s-seccomp.json new file mode 100644 index 00000000..bd3a185c --- /dev/null +++ b/docs/experiments/574-journalds-loginds-and-user-s-seccomp.json @@ -0,0 +1,23 @@ +{ + "decision": "rejected", + "section": "image", + "order": 360, + "date": "2026-11-23", + "change": "journald's, logind's and `user@`'s seccomp and sandbox settings, split from #574's bound (−14.1 [−18.5, −11.5]), and one seccomp filter per unit (#637)", + "result": "the seccomp half carries it, −12.0 [−21.8, −2.1]; the namespace half +0.3 [−9.4, +7.2] (lab 45228294512). Fewer filters do not: `SystemCallArchitectures=` applied first takes journald's 17 → 8 and logind's 26 → 13, the same answer to 3435 calls (`boot:seccomp`, labs 45235103665, 45235485857), and read −0.4 [−6.1, +2.7] against systemd rebuilt without it (lab 45231419187). In journald's executor `SystemCallFilter=@system-service` takes 3.7-4.0 ms of 6.7-7.2, its `seccomp_load()` 1.1-1.2 of that, every other seccomp setting ~0.6 together (labs 45238003981, 45239372741, 2 vCPUs): one filter per unit would reach the 0.6. Building the allow-list once is #686. Prior art: systemd#17451 (one program per feature; Lennart wants each filter's application checked), libseccomp#499 (one context drops a conditional rule beside an unconditional one with another action, so merging settings is unsafe)", + "shape": "spin", + "source": "labs 45228294512, 45231419187", + "issues": [ + 574, + 637, + 686 + ], + "runs": [ + 45228294512, + 45231419187, + 45235103665, + 45235485857, + 45238003981, + 45239372741 + ] +} diff --git a/docs/experiments/574-the-rest-of-the-boot-started-2.json b/docs/experiments/574-the-rest-of-the-boot-started-2.json new file mode 100644 index 00000000..35bda817 --- /dev/null +++ b/docs/experiments/574-the-rest-of-the-boot-started-2.json @@ -0,0 +1,16 @@ +{ + "decision": "rejected", + "section": "image", + "order": 290, + "date": "2026-11-23", + "change": "The rest of the boot started from sshd's PAM stack at the first session (#574)", + "result": "−52.0 [−61.6, −37.4], accept to login +15.3 [+10.8, +21.7]: it runs beside the login's last steps, and every login pays its `pam_exec`", + "shape": "spin", + "source": "lab 45090246267", + "issues": [ + 574 + ], + "runs": [ + 45090246267 + ] +} diff --git a/docs/experiments/574-the-rest-of-the-boot-started.json b/docs/experiments/574-the-rest-of-the-boot-started.json new file mode 100644 index 00000000..e5bc4540 --- /dev/null +++ b/docs/experiments/574-the-rest-of-the-boot-started.json @@ -0,0 +1,16 @@ +{ + "decision": "rejected", + "section": "image", + "order": 280, + "date": "2026-11-23", + "change": "The rest of the boot started by a timer 2 s after the boot, in place of `Type=idle` (#574)", + "result": "−66.5 [−75.2, −56.1] against idle's −59.2 [−69.1, −47.4] in the same run, both with the supervisor early: the timer starts the rest at an arbitrary time whatever the login, and docker's socket waits for it", + "shape": "spin", + "source": "lab 45090246267", + "issues": [ + 574 + ], + "runs": [ + 45090246267 + ] +} diff --git a/docs/experiments/590-the-ioapics-redirection-table-read-once.json b/docs/experiments/590-the-ioapics-redirection-table-read-once.json new file mode 100644 index 00000000..3ad707ea --- /dev/null +++ b/docs/experiments/590-the-ioapics-redirection-table-read-once.json @@ -0,0 +1,21 @@ +{ + "decision": "rejected", + "section": "kernel", + "order": 320, + "date": "2026-11-23", + "change": "The IOAPIC's redirection table read once at boot, and written back only where it was masked (#590, a kernel patch on branch `exp/590-ioapic-once`)", + "result": "IOAPIC accesses 589 → 205 and the host's handling −3.1 [−6.2, −1.1] ms (3 a side, lab 45113437048), but the first login −4.5 [−7.8, +0.4] at 60 a side (lab 45114405201) and −2.0 [−4.3, +0.6] at 120 (lab 45115330128). With the four other exit patches of #591 and #592, as a bound, −7.4 [−12.1, −2.8], and as one change −9.4 [−14.2, −5.7] at 120 a side: carried as 0021-0025 (#627, \"What the machine carries\")", + "shape": "spin", + "source": "labs 45113437048, 45114405201, 45115330128", + "issues": [ + 590, + 591, + 592, + 627 + ], + "runs": [ + 45113437048, + 45114405201, + 45115330128 + ] +} diff --git a/docs/experiments/591-pci-save-state-at-a-devices.json b/docs/experiments/591-pci-save-state-at-a-devices.json new file mode 100644 index 00000000..f4de7208 --- /dev/null +++ b/docs/experiments/591-pci-save-state-at-a-devices.json @@ -0,0 +1,18 @@ +{ + "decision": "rejected", + "section": "kernel", + "order": 300, + "date": "2026-11-23", + "change": "`pci_save_state()` at a device's add kept only where an error handler can restore it (#591 a, a kernel patch on branch `exp/591a-no-save-state`)", + "result": "128 MMIO exits fewer, the host's handling −3.3 [−6.2, −2.1] ms (3 a side, lab 45113437048), but the first login −4.3 [−6.8, +0.5] at 60 a side (lab 45114405201) and −1.3 [−3.5, +1.3] at 120 (lab 45115330128). Its gate has to grow by hand: upstream a2f1e22390ac took out `pci_restore_state()`'s refusal of a state never saved", + "shape": "spin", + "source": "labs 45113437048, 45114405201, 45115330128", + "issues": [ + 591 + ], + "runs": [ + 45113437048, + 45114405201, + 45115330128 + ] +} diff --git a/docs/experiments/591-virtio-pcis-vendor-capabilities-walked-once.json b/docs/experiments/591-virtio-pcis-vendor-capabilities-walked-once.json new file mode 100644 index 00000000..7cbf5524 --- /dev/null +++ b/docs/experiments/591-virtio-pcis-vendor-capabilities-walked-once.json @@ -0,0 +1,18 @@ +{ + "decision": "rejected", + "section": "kernel", + "order": 310, + "date": "2026-11-23", + "change": "virtio-pci's vendor capabilities walked once per device (#591 b, a kernel patch on branch `exp/591b-virtio-caps-once`)", + "result": "114 MMIO exits fewer (3 a side, lab 45113437048). The first login −5.8 [−8.2, −0.6] at 60 a side (lab 45114405201), three times what 114 exits can cost, and +0.9 [−1.8, +2.7] at 120 (lab 45115330128)", + "shape": "spin", + "source": "labs 45113437048, 45114405201, 45115330128", + "issues": [ + 591 + ], + "runs": [ + 45113437048, + 45114405201, + 45115330128 + ] +} diff --git a/docs/experiments/592-virtio-pci-writes-queue-select-only.json b/docs/experiments/592-virtio-pci-writes-queue-select-only.json new file mode 100644 index 00000000..1b8f1b2b --- /dev/null +++ b/docs/experiments/592-virtio-pci-writes-queue-select-only.json @@ -0,0 +1,18 @@ +{ + "decision": "rejected", + "section": "kernel", + "order": 280, + "date": "2026-11-23", + "change": "virtio-pci writes `queue_select` only when the queue changes, a second time and alone (#592 lever 1, a kernel patch on branch `exp/592-l1-queue-select`; first as 0011)", + "result": "68 MMIO exits fewer (91 → 23 writes, 3 a side, lab 45113437048), the first login −2.8 [−6.6, +3.4] at 60 a side (lab 45114405201) and +0.6 [−1.8, +2.3] at 120 (lab 45115330128). The vector read-back stays: virtio 1.2 §4.1.5.1.2 makes it how a device refuses a vector", + "shape": "spin", + "source": "labs 45113437048, 45114405201, 45115330128", + "issues": [ + 592 + ], + "runs": [ + 45113437048, + 45114405201, + 45115330128 + ] +} diff --git a/docs/experiments/592-x86s-msi-set-affinity-skips-the.json b/docs/experiments/592-x86s-msi-set-affinity-skips-the.json new file mode 100644 index 00000000..5a7bfdda --- /dev/null +++ b/docs/experiments/592-x86s-msi-set-affinity-skips-the.json @@ -0,0 +1,17 @@ +{ + "decision": "rejected", + "section": "kernel", + "order": 290, + "date": "2026-11-23", + "change": "x86's `msi_set_affinity` skips the message write when the vector and destination did not change (#592 lever 2, a kernel patch on branch `exp/592-l2-msix-once`)", + "result": "56 MMIO exits fewer (`__pci_write_msi_msg` 168 → 112, 3 a side, lab 45113437048), the first login −0.1 [−3.1, +4.5] at 60 a side (lab 45114405201)", + "shape": "spin", + "source": "labs 45113437048, 45114405201", + "issues": [ + 592 + ], + "runs": [ + 45113437048, + 45114405201 + ] +} diff --git a/docs/experiments/627-kernel-0021-0025-the-boots-device.json b/docs/experiments/627-kernel-0021-0025-the-boots-device.json new file mode 100644 index 00000000..8aeb274e --- /dev/null +++ b/docs/experiments/627-kernel-0021-0025-the-boots-device.json @@ -0,0 +1,20 @@ +{ + "decision": "carried", + "order": 30, + "change": "Kernel 0021-0025, the boot's device-setup exits as one change (#627): the IOAPIC table read once (#590), the state save at add only where error recovery can restore it (#591 a), virtio-pci's vendor capabilities walked once (#591 b), `queue_select` written only on a change and an unchanged MSI message not rewritten (#592). 0022's gate has to grow with whatever calls error handlers next (its changelog). Alone each was within noise (\"Measured and rejected\")", + "where": "kernel/patches", + "result": "against v20261123.07: first login −9.4 [−14.2, −5.7], sshd accepting −9.5 [−14.4, −5.5], 120 a side (lab 45260781177); restored −0.4 [−2.0, +1.7] evicted and +0.2 [−6.6, +7.3] cached, the state +0.0 MiB [−0.1, +0.2], 60 a side (lab 45261629539); 838 exits fewer, 366 of them MMIO (3 a side, lab 45114428660)", + "evidence": "measured", + "source": "labs 45260781177, 45261629539", + "issues": [ + 590, + 591, + 592, + 627 + ], + "runs": [ + 45114428660, + 45260781177, + 45261629539 + ] +} diff --git a/docs/experiments/638-pid-1-journald-logind-and-user.json b/docs/experiments/638-pid-1-journald-logind-and-user.json new file mode 100644 index 00000000..6a0ee03f --- /dev/null +++ b/docs/experiments/638-pid-1-journald-logind-and-user.json @@ -0,0 +1,16 @@ +{ + "decision": "rejected", + "section": "image", + "order": 350, + "date": "2026-11-23", + "change": "PID 1, journald, logind and `user@0` linked without the dynamic linker: v262's multicall build (#42304) or a static one (#42820), for their ld.so start-up (#638)", + "result": "ld.so's own start-up, `LD_DEBUG=statistics`, p50 [range] of 8 boots: PID 1 0.48 [0.46, 0.56] ms, journald 0.20 [0.14, 0.31], logind 0.20 [0.11, 0.31], `user@0` 0.21 [0.15, 0.36]; 1.1 ms for the four, under #638's 5 ms threshold, so no build was run. Relocation 0.08-0.11 ms each (2,522 symbol and 16,589 relative relocations in PID 1 and `user@0`). The instrument moved nothing: first login +3.4 [−23.0, +11.9], PID 1's CPU −1.1 [−5.1, +0.6]. The multicall build keeps libsystemd-core and libsystemd-shared dynamic and leaves journald and logind as they are; the static one has no PAM for `user@`'s `PAMName=`", + "shape": "spin", + "source": "lab 45180856158", + "issues": [ + 638 + ], + "runs": [ + 45180856158 + ] +} diff --git a/docs/experiments/646-qemu-0007-kept-once-no-release.json b/docs/experiments/646-qemu-0007-kept-once-no-release.json new file mode 100644 index 00000000..bfd463e4 --- /dev/null +++ b/docs/experiments/646-qemu-0007-kept-once-no-release.json @@ -0,0 +1,21 @@ +{ + "decision": "rejected", + "section": "firmware", + "order": 120, + "date": "2026-11-23", + "change": "QEMU 0007 kept once no release boots a bzImage: `-kernel` mapped a bzImage read-only instead of reading it into QEMU's heap (#646, carried from 11-23). From v20261123.07 the machine enters the vmlinux through PVH, which QEMU's ELF loader maps without it (#645)", + "result": "taken back, against v20261123.07: first login +3.6 [−3.3, +7.8], sshd accepting −1.6 [−6.7, +5.6], QEMU's RSS +0.3 [−1.6, +2.1] MiB (lab 45258887660); restored −0.4 [−1.5, +0.9] evicted, −0.1 [−0.9, +0.9] cached, the cold boot of the same run +2.7 [−3.1, +8.7] (lab 45258106255), 40 a side, all within noise. A release before .07 boots its bzImage with its own QEMU, which carries 0007. When it came in, on a bzImage: first login −13.4 [−16.9, −7.3], restored −9.3 [−11.2, −6.1] evicted (labs 45182382388, 45182382864). Deleted", + "shape": "spin", + "source": "labs 45258887660, 45258106255, parts run 45256311661, #660", + "issues": [ + 645, + 646 + ], + "runs": [ + 45182382388, + 45182382864, + 45256311661, + 45258106255, + 45258887660 + ] +} diff --git a/docs/experiments/646-the-same-on-qemu-0007-which.json b/docs/experiments/646-the-same-on-qemu-0007-which.json new file mode 100644 index 00000000..0a611d8c --- /dev/null +++ b/docs/experiments/646-the-same-on-qemu-0007-which.json @@ -0,0 +1,17 @@ +{ + "decision": "rejected", + "section": "kernel", + "order": 200, + "date": "2026-11-23", + "change": "The same on QEMU 0007, which maps the bzImage and so no longer reads the 40 MB file in its start (#646, a lead for #645)", + "result": "first login −4.0 [−7.9, +0.3], sshd accepting −2.9 [−6.9, +2.4] at 40 a side against LZ4 on the same QEMU; QEMU's RSS +32.0 MiB (+22.2 file, +9.9 anonymous). The QEMU half of the 11-20 rejection is gone; what is left is under the interval at 40", + "shape": "spin", + "source": "lab 45183618987", + "issues": [ + 645, + 646 + ], + "runs": [ + 45183618987 + ] +} diff --git a/docs/experiments/647-qemus-start-from-its-exec-to.json b/docs/experiments/647-qemus-start-from-its-exec-to.json new file mode 100644 index 00000000..c5c7d654 --- /dev/null +++ b/docs/experiments/647-qemus-start-from-its-exec-to.json @@ -0,0 +1,17 @@ +{ + "decision": "rejected", + "section": "firmware", + "order": 110, + "date": "2026-11-23", + "change": "QEMU's start from its exec to its first trace event made cheaper (#647)", + "result": "9.7 ms on bench (lab 45177818419), no part of it over ~2 ms. The release's QEMU is static-pie on musl, so there is no dynamic loader to time (`LD_DEBUG` reads nothing): musl relocates its 59,700 relative relocations itself. On the laptop the phase read 4.7-5.4 ms p50, 40 starts each: a trivial static-pie binary's exec 0.23, QEMU's `-version` (exec, relocation, constructors, QOM type registration, the first options) 2.0, `-sandbox` dropped −0.7 to −0.9 (libseccomp builds its filter at run time), and the rest is option parsing, the trace's and the main loop's start and the machine object up to its first address space. perf over 200 `-version` runs: the relocation 7% of it, the kernel's page faults (copy-on-write, file fault-around, zeroing) ~15%, nothing else over 2%. From exec to held, malloc (musl's mallocng) is ~2.3 of 17 ms of the main thread's CPU. Candidates and their ceilings, each inferred at ~2× the laptop on bench: a filter compiled at build time as Firecracker's seccompiler does, ≤~1.5 ms; a non-PIE binary, no relocation and fewer copy-on-write faults, ≤~1 ms and it gives up ASLR of QEMU's image; DT_RELR, ≤~0.3 ms. Every one is under the ±4-5 ms that 60 boots a side resolve, so none was built. Another allocator is a lead across all of QEMU's start, not this phase (#669)", + "shape": "spin, laptop", + "source": "lab 45177818419, #647", + "issues": [ + 647, + 669 + ], + "runs": [ + 45177818419 + ] +} diff --git a/docs/experiments/649-the-held-starts-bind-sent-ahead.json b/docs/experiments/649-the-held-starts-bind-sent-ahead.json new file mode 100644 index 00000000..927c1f63 --- /dev/null +++ b/docs/experiments/649-the-held-starts-bind-sent-ahead.json @@ -0,0 +1,18 @@ +{ + "decision": "rejected", + "section": "qmp", + "order": 30, + "date": "2026-11-23", + "change": "The held start's bind sent ahead of its answers: the run state with the places, every place's serial at once, each image's two nodes together, the reopen with the placeholder's delete; 13 round trips to 9, add-fd still waiting for its answer and `cont` for the bind's last (#649)", + "result": "first login −1.7 [−5.6, +2.6], sshd accepting −2.4 [−5.5, +2.8] at 60 a side (lab 45230790902); restored −0.3 [−3.8, +3.7] evicted, +0.9 [−10.6, +7.5] cached (lab 45231358105). The split: QEMU waited 4.5 ms p50 for the client in 24 boots, 0.9 of it QEMU busy with the probe's plug monitor, so ~3.6 ms is spin-machine's own, ~0.28 ms a round trip (lab 45177818419). The four round trips removed are ~1.1 ms (inferred), and the whole of spin-machine's share is under what 60 boots resolve. Code on tag `archive/exp-649-held-start`", + "shape": "spin", + "source": "labs 45230790902, 45231358105", + "issues": [ + 649 + ], + "runs": [ + 45177818419, + 45230790902, + 45231358105 + ] +} diff --git a/docs/experiments/660-the-kernel-entered-as-its-vmlinux.json b/docs/experiments/660-the-kernel-entered-as-its-vmlinux.json new file mode 100644 index 00000000..7852f32e --- /dev/null +++ b/docs/experiments/660-the-kernel-entered-as-its-vmlinux.json @@ -0,0 +1,22 @@ +{ + "decision": "carried", + "order": 110, + "change": "The kernel entered as its vmlinux through PVH, randomizing itself: kernel 0014-0017 (Hou Wenlong's RFC, less its decompressor patch, deleted with the bzImage in #660; [the cover letter](https://lkml.iu.edu/2601.3/01845.html), lore `cover.1769434279.git.houwenlong.hwl@antgroup.com`, 2026-01-26, unchanged on 7.3.5), 0019 (sets `KASLR_FLAG`, without which `RANDOMIZE_MEMORY` did nothing), 0020 (RDRAND and TSC read from the registers that hold them), QEMU 0008 (a random physical base from `XEN_ELFNOTE_PHYS32_RELOC`), #645", + "where": "kernel/patches, qemu/patches, machine", + "result": "first login −16.8 [−20.9, −13.0], 368 → 352, sshd accepting −16.7 [−20.2, −12.7], QEMU's RSS −13.8 MiB, 60 a side (lab 45219785493); restored −4.4 [−17.5, −2.0] evicted, −4.3 [−14.0, +10.2] cached, within noise, the state −31.9 MiB, the save −14.6 (lab 45219801969). As released, v20261123.07 against v20261123.06, each with its own spin-machine: first login −18.6 [−23.6, −14.0], 378 → 359, sshd accepting −15.3 [−21.2, −12.6], 60 a side (lab 45252584128); the release record's −3.5 [−12.9, +2.9] at 20 a side was a shifted run (#694). The bound, the same vmlinux entered with no KASLR at all: −18.9 [−22.8, −12.4] cold, −3.6 [−5.1, −2.1] restored evicted at 40 a side (labs 45213668842, 45213683698), so KASLR without the decompressor costs ~2 ms against no KASLR (inferred across runs; Hou measured ~2 ms too). Arms booted the kernel without 0020. KASLR across 10 boots (lab 45221660056): `_text` 10 distinct, the physical base 8, the direct map and vmalloc each 10 distinct 1 GiB-aligned bases. Entropy: the virtual base the decompressor's slot rule and seed sources once 0020 is in, the physical base QEMU's `getrandom` over the decompressor's range, the regions the kernel's own (#645, \"entropy\"). Chosen over QEMU applying the relocations (Holmes et al., \"KASLR in the age of MicroVMs\", EuroSys '22, 20-25 ms over an LZ4 bzImage; Firecracker #5661, parked; rust-vmm/linux-loader #84, open): no relocation format for QEMU to parse, nothing new on its command line, the kernel's own entropy code", + "evidence": "measured, 60 a side", + "source": "labs 45219785493, 45219801969, 45252584128", + "issues": [ + 645, + 660, + 694 + ], + "runs": [ + 45213668842, + 45213683698, + 45219785493, + 45219801969, + 45221660056, + 45252584128 + ] +} diff --git a/docs/experiments/8-generators-disabled-3-tmpfiles-rules.json b/docs/experiments/8-generators-disabled-3-tmpfiles-rules.json new file mode 100644 index 00000000..f1502eec --- /dev/null +++ b/docs/experiments/8-generators-disabled-3-tmpfiles-rules.json @@ -0,0 +1,12 @@ +{ + "decision": "carried", + "order": 350, + "change": "8 generators disabled, 3 tmpfiles rules masked", + "where": "optimize-systemd.sh", + "result": "cold +16.7 [+11.6, +23.3]", + "evidence": "group C-generators", + "source": "lab 44818953987", + "runs": [ + 44818953987 + ] +} diff --git a/docs/experiments/a-burst-of-restores-8-at.json b/docs/experiments/a-burst-of-restores-8-at.json new file mode 100644 index 00000000..ccad3ece --- /dev/null +++ b/docs/experiments/a-burst-of-restores-8-at.json @@ -0,0 +1,12 @@ +{ + "decision": "open", + "order": 10, + "change": "A burst of restores: 8 at once read ~190-240 ms each under `defer`, against ~100 alone", + "number": "restore, as a host sees it; spin restores concurrently with no host-wide limit", + "phase": "the burst's ~100-140 ms over one restore alone", + "decided_by": "`restore-together`, `together=1 8`, evicted, with the change against without it", + "state": "open. The host's CPUs are 72-78% busy in the burst, and direct reclaim runs as the states fill the page cache (lab 44817486118). Next candidates: `vm.watermark_scale_factor`, and the CPU one restore costs", + "runs": [ + 44817486118 + ] +} diff --git a/docs/experiments/a-burst-of-restores-bound-by.json b/docs/experiments/a-burst-of-restores-bound-by.json new file mode 100644 index 00000000..769da632 --- /dev/null +++ b/docs/experiments/a-burst-of-restores-bound-by.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "memory", + "order": 80, + "date": "2026-11-21", + "change": "A burst of restores bound by host CPU0", + "result": "no: busy time, interrupts and QEMU's threads spread over all 16 CPUs, and irqbalance runs", + "shape": "spin", + "source": "lab 44817486118", + "runs": [ + 44817486118 + ] +} diff --git a/docs/experiments/a-configuration-space-snapshot-over-fw.json b/docs/experiments/a-configuration-space-snapshot-over-fw.json new file mode 100644 index 00000000..4bf4a97f --- /dev/null +++ b/docs/experiments/a-configuration-space-snapshot-over-fw.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "kernel", + "order": 150, + "date": "2026-11-13", + "change": "A configuration-space snapshot over fw_cfg (QEMU and kernel)", + "result": "209 vs 211 with 0005", + "shape": "ladder", + "source": "lab 43514884598", + "runs": [ + 43514884598 + ] +} diff --git a/docs/experiments/a-console-unit-instead-of-serial.json b/docs/experiments/a-console-unit-instead-of-serial.json new file mode 100644 index 00000000..f3e69634 --- /dev/null +++ b/docs/experiments/a-console-unit-instead-of-serial.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "image", + "order": 60, + "date": "2026-09-26", + "change": "A console unit instead of serial-getty", + "result": "+340 ms until TERM=dumb, then equal", + "shape": "runner", + "source": "`c6e48de`, `7b08e5a`" +} diff --git a/docs/experiments/a-generous-vcpu-ceiling.json b/docs/experiments/a-generous-vcpu-ceiling.json new file mode 100644 index 00000000..51d4f184 --- /dev/null +++ b/docs/experiments/a-generous-vcpu-ceiling.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "kernel", + "order": 60, + "date": "2026-09-10", + "change": "A generous vCPU ceiling", + "result": "maxcpus=16 +5 ms, 64 +9 ms of kernel; the ceiling stays (invariant)", + "shape": "runner", + "source": "`f32d527`" +} diff --git a/docs/experiments/a-login-without-opensshs-exec-per.json b/docs/experiments/a-login-without-opensshs-exec-per.json new file mode 100644 index 00000000..6b163849 --- /dev/null +++ b/docs/experiments/a-login-without-opensshs-exec-per.json @@ -0,0 +1,9 @@ +{ + "decision": "open", + "order": 20, + "change": "A login without OpenSSH's exec per connection and PAM", + "number": "both", + "phase": "a warm login, ~25-43 ms, is in both numbers", + "decided_by": "a bound first: `prestart` with the login replaced", + "state": "lead (docs/log/2026-11-20-spins-login-spins-memory-and-spin-no-longer.md). spin's path already runs one sshd, and PAM and pam_systemd are what spin's sessions are made of" +} diff --git a/docs/experiments/a-login-without-pam-systemd.json b/docs/experiments/a-login-without-pam-systemd.json new file mode 100644 index 00000000..828ada47 --- /dev/null +++ b/docs/experiments/a-login-without-pam-systemd.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "login", + "order": 50, + "date": "2026-11-13", + "change": "A login without pam_systemd (a bound)", + "result": "380 vs 436, but no session and no XDG_RUNTIME_DIR", + "shape": "lane", + "source": "lab 43518044150", + "runs": [ + 43518044150 + ] +} diff --git a/docs/experiments/a-named-cpu-model-instead-of.json b/docs/experiments/a-named-cpu-model-instead-of.json new file mode 100644 index 00000000..f0c5641c --- /dev/null +++ b/docs/experiments/a-named-cpu-model-instead-of.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "firmware", + "order": 20, + "date": "2026-11-21", + "change": "A named CPU model instead of `host`, for memories that resume on any host (`--cpu baseline`)", + "result": "the newest model a nested c8id runs is Cascadelake-Server-v5, not SapphireRapids or GraniteRapids; cold first login +27.2 [+13.0, +30.8], sshd accepting +23.1 [+9.7, +28.5], warm login and RSS unmoved; the cause is not measured. `host` with a pool's common features is the next candidate (spin-stack/spin#1417)", + "shape": "spin", + "source": "lab 44855890737", + "runs": [ + 44855890737 + ] +} diff --git a/docs/experiments/a-second-limit.json b/docs/experiments/a-second-limit.json new file mode 100644 index 00000000..f20e9c2f --- /dev/null +++ b/docs/experiments/a-second-limit.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "memory", + "order": 50, + "date": "2026-10-01", + "change": "A second limit (`memory.high`)", + "result": "`memory.max` suffices", + "shape": "-", + "source": "docs/memory-and-disk.md" +} diff --git a/docs/experiments/a-workspaces-cgroup-at-a-higher.json b/docs/experiments/a-workspaces-cgroup-at-a-higher.json new file mode 100644 index 00000000..9e62e098 --- /dev/null +++ b/docs/experiments/a-workspaces-cgroup-at-a-higher.json @@ -0,0 +1,13 @@ +{ + "decision": "open", + "order": 60, + "change": "A workspace's cgroup at a higher `cpu.weight` while it boots or restores, on a busy host (spin's runner owns the cgroup)", + "number": "restore, as a busy host sees it", + "phase": "with 16 workspaces keeping the 16 CPUs busy, the restored first login is 306 ms against 115 idle, and QEMU's threads wait 282 ms for a CPU (lab 44925573288). The same weight ratio as QEMU at nice −10, set as the crowd at nice 10: restored −79.3 [−93.5, −71.0], cold −104.7 [−258.3, +150.9], within noise (lab 44927312303)", + "decided_by": "spin's `restore-together` or a crowd on its runner, with the weight raised through the workspace's cgroup and set back after the login, against without it", + "state": "a proposal for spin. Measured in one cgroup, where each thread competes alone. In spin each workspace is a cgroup, and the weight is shared by its threads. The idle host has nothing to win (Measured and rejected, \"Memory and the host\")", + "runs": [ + 44925573288, + 44927312303 + ] +} diff --git a/docs/experiments/acpi-params.json b/docs/experiments/acpi-params.json new file mode 100644 index 00000000..9296078b --- /dev/null +++ b/docs/experiments/acpi-params.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "kernel", + "order": 30, + "date": "2026-09-10", + "change": "ACPI params (acpi=noirq, pnpacpi=off, …)", + "result": "69.9 vs 68.6 ms, slower", + "shape": "runner", + "source": "`64d2901`" +} diff --git a/docs/experiments/agetty-tweaks.json b/docs/experiments/agetty-tweaks.json new file mode 100644 index 00000000..18decb44 --- /dev/null +++ b/docs/experiments/agetty-tweaks.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "image", + "order": 20, + "date": "2026-09-10", + "change": "agetty tweaks (TTYReset, --noissue, --delay 0, …)", + "result": "within the noise of agetty's sleep(1)", + "shape": "runner", + "source": "`80f984b`" +} diff --git a/docs/experiments/an-ed25519-host-key-only-no.json b/docs/experiments/an-ed25519-host-key-only-no.json new file mode 100644 index 00000000..38724788 --- /dev/null +++ b/docs/experiments/an-ed25519-host-key-only-no.json @@ -0,0 +1,12 @@ +{ + "decision": "carried", + "order": 500, + "change": "An Ed25519 host key only, no ECDSA", + "where": "spin-machine-sshd-keygen.service", + "result": "−5.0 [−8.3, −1.8], sshd accepting −4.4 [−6.9, −1.9], 60 boots a side", + "evidence": "measured", + "source": "lab 44979726719", + "runs": [ + 44979726719 + ] +} diff --git a/docs/experiments/an-uncompressed-bzimage-payload-kaslr-kept.json b/docs/experiments/an-uncompressed-bzimage-payload-kaslr-kept.json new file mode 100644 index 00000000..dd548d99 --- /dev/null +++ b/docs/experiments/an-uncompressed-bzimage-payload-kaslr-kept.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "kernel", + "order": 190, + "date": "2026-11-20", + "change": "An uncompressed bzImage payload, KASLR kept", + "result": "to the kernel's clock −3 ms, but +3.3 in qboot's copy and +6-7 in QEMU's start", + "shape": "laptop", + "source": "#326" +} diff --git a/docs/experiments/base-memory-in-a-shared-file.json b/docs/experiments/base-memory-in-a-shared-file.json new file mode 100644 index 00000000..b9cbad85 --- /dev/null +++ b/docs/experiments/base-memory-in-a-shared-file.json @@ -0,0 +1,14 @@ +{ + "decision": "rejected", + "section": "restore", + "order": 50, + "date": "2026-11-20", + "change": "Base memory in a shared file, left out of the checkpoint (`x-ignore-shared`)", + "result": "state 0.3 MiB, save 15 ms, but neither goal number improves: cold 1089 ms on disk, 709-719 on tmpfs", + "shape": "ladder", + "source": "labs 44663272360, 44664989139, #306", + "runs": [ + 44663272360, + 44664989139 + ] +} diff --git a/docs/experiments/base-on-virtio-pmem-and-dax.json b/docs/experiments/base-on-virtio-pmem-and-dax.json new file mode 100644 index 00000000..d30782dd --- /dev/null +++ b/docs/experiments/base-on-virtio-pmem-and-dax.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "firmware", + "order": 70, + "date": "2026-10-01", + "change": "Base on virtio-pmem and DAX", + "result": "~155 MB less per VM, but a side channel", + "shape": "runner", + "source": "#63, #65" +} diff --git a/docs/experiments/blk-dev-loop-min-count-0.json b/docs/experiments/blk-dev-loop-min-count-0.json new file mode 100644 index 00000000..30f8e855 --- /dev/null +++ b/docs/experiments/blk-dev-loop-min-count-0.json @@ -0,0 +1,12 @@ +{ + "decision": "carried", + "order": 40, + "change": "`BLK_DEV_LOOP_MIN_COUNT=0`, `SERIAL_8250_RUNTIME_UARTS=1`", + "where": "kernel/config-7.3-x86_64", + "result": "cold +5.3 [−3.2, +15.0]: inside the noise, but the upper bound does not rule out its ~2-4 ms ceiling", + "evidence": "measured, 40 a side", + "source": "lab 44839538785", + "runs": [ + 44839538785 + ] +} diff --git a/docs/experiments/board-init-wrapped-in-one-memory.json b/docs/experiments/board-init-wrapped-in-one-memory.json new file mode 100644 index 00000000..66516e5e --- /dev/null +++ b/docs/experiments/board-init-wrapped-in-one-memory.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "firmware", + "order": 60, + "date": "2026-09-30", + "change": "Board init wrapped in one memory transaction", + "result": "the guest prints nothing", + "shape": "runner", + "source": "`f10383b`, lab 36662499370", + "runs": [ + 36662499370 + ] +} diff --git a/docs/experiments/both-user-generators-masked-a-bound.json b/docs/experiments/both-user-generators-masked-a-bound.json new file mode 100644 index 00000000..43f3414b --- /dev/null +++ b/docs/experiments/both-user-generators-masked-a-bound.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "login", + "order": 100, + "date": "2026-11-22", + "change": "Both user generators masked, a bound: the environment.d one also brings `/etc/environment` to user services", + "result": "first login −8.4 [−15.8, −1.0] against class `user-early`", + "shape": "spin", + "source": "lab 45030778365", + "runs": [ + 45030778365 + ] +} diff --git a/docs/experiments/cache-none-on-disks.json b/docs/experiments/cache-none-on-disks.json new file mode 100644 index 00000000..a48fa3a6 --- /dev/null +++ b/docs/experiments/cache-none-on-disks.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "firmware", + "order": 40, + "date": "2026-09-07", + "change": "`cache=none` on disks", + "result": "breaks the shared base's caching, fails on tmpfs", + "shape": "-", + "source": "`8b7391a`" +} diff --git a/docs/experiments/carried-items-never-measured-alone-kernel.json b/docs/experiments/carried-items-never-measured-alone-kernel.json new file mode 100644 index 00000000..ff3652cc --- /dev/null +++ b/docs/experiments/carried-items-never-measured-alone-kernel.json @@ -0,0 +1,9 @@ +{ + "decision": "open", + "order": 30, + "change": "Carried items never measured alone: kernel patches 0005, 0007, 0008 and 0010 each (group A is +67.5 together); `pci=lastbus=0` (2026-09, before patches 0004 and 0010); logind's early varlink socket (measured on 2 vCPUs); QEMU 0001 and qboot's `pam.patch` apart; `no_timer_check`, `tsc=reliable`; `hpet=off`; systemd's static tools; `-O ^orphan_file`; `rootfstype=ext4`; the lane's drop-ins on spin's path", + "number": "cold", + "phase": "each ≤ a few ms; B together +11.5", + "decided_by": "rule 5, an arm each, 40 boots", + "state": "open. The static tools and `orphan_file` need an image build (`--systemd` builds only an experiment patch)" +} diff --git a/docs/experiments/checkpoints-on-8-multifd-channels.json b/docs/experiments/checkpoints-on-8-multifd-channels.json new file mode 100644 index 00000000..2e639e04 --- /dev/null +++ b/docs/experiments/checkpoints-on-8-multifd-channels.json @@ -0,0 +1,13 @@ +{ + "decision": "carried", + "order": 180, + "change": "Checkpoints on 8 multifd channels", + "where": "machine", + "result": "restored into a QEMU started ahead 150 → 103 against 1 channel; 16 channels lose to 8 when 4 restore at once, +3.2 [+1.1, +5.8]", + "evidence": "measured", + "source": "labs 44789688221, 44792429636", + "runs": [ + 44789688221, + 44792429636 + ] +} diff --git a/docs/experiments/chrony-or-another-time-daemon.json b/docs/experiments/chrony-or-another-time-daemon.json new file mode 100644 index 00000000..5dae2c9b --- /dev/null +++ b/docs/experiments/chrony-or-another-time-daemon.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "image", + "order": 30, + "date": "2026-09-10", + "change": "chrony or another time daemon", + "result": "10 ms; cannot know it was restored", + "shape": "runner", + "source": "`c7af4d3`" +} diff --git a/docs/experiments/compaction-off.json b/docs/experiments/compaction-off.json new file mode 100644 index 00000000..8ab03b8d --- /dev/null +++ b/docs/experiments/compaction-off.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "kernel", + "order": 100, + "date": "2026-09-26", + "change": "COMPACTION off", + "result": "impossible: virtio-mem needs CONTIG_ALLOC", + "shape": "-", + "source": "`cda04b1`" +} diff --git a/docs/experiments/config-scsi-scan-async.json b/docs/experiments/config-scsi-scan-async.json new file mode 100644 index 00000000..b728947a --- /dev/null +++ b/docs/experiments/config-scsi-scan-async.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "kernel", + "order": 170, + "date": "2026-11-20", + "change": "`CONFIG_SCSI_SCAN_ASYNC`", + "result": "−2.6 [−8.9, +6.8]: the scan is waited for before \"Freeing\", and `max_target` leaves it little", + "shape": "spin", + "source": "#325, lab 44788216590", + "runs": [ + 44788216590 + ] +} diff --git a/docs/experiments/config-vt-n-for-speed.json b/docs/experiments/config-vt-n-for-speed.json new file mode 100644 index 00000000..db85a964 --- /dev/null +++ b/docs/experiments/config-vt-n-for-speed.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "kernel", + "order": 80, + "date": "2026-09-26", + "change": "`CONFIG_VT=n` for speed", + "result": "0 to login; 0.31 ms of kernel", + "shape": "runner", + "source": "`e2f6b8f`, `9b5f0dd`" +} diff --git a/docs/experiments/config-xfrm-n.json b/docs/experiments/config-xfrm-n.json new file mode 100644 index 00000000..273c5a36 --- /dev/null +++ b/docs/experiments/config-xfrm-n.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "kernel", + "order": 50, + "date": "2026-09-10", + "change": "`CONFIG_XFRM=n`", + "result": "moves BTF's 9 ms first parse elsewhere", + "shape": "runner", + "source": "`e285dec`" +} diff --git a/docs/experiments/cpuid-leaf-2-with-qemus-cache.json b/docs/experiments/cpuid-leaf-2-with-qemus-cache.json new file mode 100644 index 00000000..8b0eb3b8 --- /dev/null +++ b/docs/experiments/cpuid-leaf-2-with-qemus-cache.json @@ -0,0 +1,15 @@ +{ + "decision": "carried", + "order": 220, + "change": "CPUID leaf 2 with QEMU's cache descriptors (`x-consistent-cache=off`), so glibc does not walk leaf 4 at every process start; `x-legacy-cpuid2-cache=off` (qemu/patches/0006) makes them leaf 4's caches, first login +0.6 [−6.1, +5.5] (lab 45101932173, #586)", + "where": "machine/shape.go", + "result": "first login −10.3 [−14.2, −4.0], 40 a side; CPUID exits 3727 → 2176; restored +1.0 [−3.9, +4.4] evicted, in noise", + "evidence": "measured", + "source": "labs 45083473790, 45083473855, 45083754801", + "runs": [ + 45083473790, + 45083473855, + 45083754801, + 45101932173 + ] +} diff --git a/docs/experiments/cpuweight-ioweight-memorylow-on-ssh-service.json b/docs/experiments/cpuweight-ioweight-memorylow-on-ssh-service.json new file mode 100644 index 00000000..1b8349fb --- /dev/null +++ b/docs/experiments/cpuweight-ioweight-memorylow-on-ssh-service.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "image", + "order": 90, + "date": "2026-09-28", + "change": "CPUWeight/IOWeight/MemoryLow on ssh.service", + "result": "no change", + "shape": "runner", + "source": "`f7cd1ab`" +} diff --git a/docs/experiments/cpuweight-ioweight-nice-on-the-first.json b/docs/experiments/cpuweight-ioweight-nice-on-the-first.json new file mode 100644 index 00000000..854532a3 --- /dev/null +++ b/docs/experiments/cpuweight-ioweight-nice-on-the-first.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "login", + "order": 30, + "date": "2026-11-13", + "change": "CPUWeight/IOWeight/Nice on the first login's lane", + "result": "−2 ms over the filtered coldplug; second login 63 vs 45", + "shape": "lane", + "source": "lab 43518915618", + "runs": [ + 43518915618 + ] +} diff --git a/docs/experiments/damon-reclaim-mglru-eviction.json b/docs/experiments/damon-reclaim-mglru-eviction.json new file mode 100644 index 00000000..0af4f278 --- /dev/null +++ b/docs/experiments/damon-reclaim-mglru-eviction.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "memory", + "order": 20, + "date": "2026-10-01", + "change": "DAMON_RECLAIM, MGLRU eviction", + "result": "slower, or not selective", + "shape": "runner", + "source": "docs/memory-and-disk.md" +} diff --git a/docs/experiments/defaultmemoryaccounting-no-for-cheaper-unit-cgroups.json b/docs/experiments/defaultmemoryaccounting-no-for-cheaper-unit-cgroups.json new file mode 100644 index 00000000..3d09e67e --- /dev/null +++ b/docs/experiments/defaultmemoryaccounting-no-for-cheaper-unit-cgroups.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "image", + "order": 260, + "date": "2026-11-22", + "change": "`DefaultMemoryAccounting=no`, for cheaper unit cgroups", + "result": "+4.1 [+0.8, +7.1] at 60 boots, worse; sshd accepting +6.2 [+2.2, +8.0]. The cause is not measured", + "shape": "spin", + "source": "the same" +} diff --git a/docs/experiments/deferred-struct-page-init.json b/docs/experiments/deferred-struct-page-init.json new file mode 100644 index 00000000..c35b59b3 --- /dev/null +++ b/docs/experiments/deferred-struct-page-init.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "kernel", + "order": 250, + "date": "2026-11-21", + "change": "`DEFERRED_STRUCT_PAGE_INIT` (carried since 11-13, for 2 GiB at boot)", + "result": "taken back −2.5 [−9.3, +3.8] at 40 boots: spin boots 128 MiB, which the kernel does not defer, and plugged memory is never deferred. Deleted", + "shape": "spin", + "source": "lab 44839538785, #356", + "runs": [ + 44839538785 + ] +} diff --git a/docs/experiments/direct-io-on-the-channels-of.json b/docs/experiments/direct-io-on-the-channels-of.json new file mode 100644 index 00000000..2d9f3954 --- /dev/null +++ b/docs/experiments/direct-io-on-the-channels-of.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "restore", + "order": 80, + "date": "2026-11-22", + "change": "`direct-io` on the channels of a save, against dirty-page throttling in the stop", + "result": "never converged beside a busy disk: each pass ~2.5 s, the save cancelled after 10 min", + "shape": "spin, plugged 2 GiB", + "source": "lab 44973775066, docs/memory-and-disk.md", + "runs": [ + 44973775066 + ] +} diff --git a/docs/experiments/direct-io-on-the-channels.json b/docs/experiments/direct-io-on-the-channels.json new file mode 100644 index 00000000..9bfe81aa --- /dev/null +++ b/docs/experiments/direct-io-on-the-channels.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "restore", + "order": 70, + "date": "2026-11-21", + "change": "`direct-io` (O_DIRECT) on the channels", + "result": "within the noise evicted, +45 ms cached", + "shape": "laptop", + "source": "docs/log/2026-11-21-the-restore-into-a-qemu-started-ahead-taken.md" +} diff --git a/docs/experiments/docker-and-containerd-started-by-their.json b/docs/experiments/docker-and-containerd-started-by-their.json new file mode 100644 index 00000000..d4ecbc28 --- /dev/null +++ b/docs/experiments/docker-and-containerd-started-by-their.json @@ -0,0 +1,12 @@ +{ + "decision": "carried", + "order": 530, + "change": "docker and containerd started by their sockets, not at boot (deferred: the first `docker` command waits for them, docs/image.md)", + "where": "optimize-systemd.sh", + "result": "cold +13.9 [+11.4, +18.2], restored +55.7 [+12.0, +73.9], into prestarted +40.7 [+33.5, +59.0]", + "evidence": "measured", + "source": "lab 45034963004", + "runs": [ + 45034963004 + ] +} diff --git a/docs/experiments/downtime-limit-15-instead-of-30.json b/docs/experiments/downtime-limit-15-instead-of-30.json new file mode 100644 index 00000000..1fa87a28 --- /dev/null +++ b/docs/experiments/downtime-limit-15-instead-of-30.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "restore", + "order": 90, + "date": "2026-11-22", + "change": "`downtime-limit` 15 instead of 30", + "result": "the guest's stop −2.5 [−7.5, +3.0] short of memory beside a busy disk, −1.5 [−6.0, +2.8] with a writer", + "shape": "spin, plugged 2 GiB", + "source": "lab 44975130836", + "runs": [ + 44975130836 + ] +} diff --git a/docs/experiments/driver-async-probe-for-rng-balloon.json b/docs/experiments/driver-async-probe-for-rng-balloon.json new file mode 100644 index 00000000..3e11a64b --- /dev/null +++ b/docs/experiments/driver-async-probe-for-rng-balloon.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "kernel", + "order": 230, + "date": "2026-11-21", + "change": "`driver_async_probe` for rng, balloon and vsock; `rcupdate.rcu_expedited=1` (carried since 11-13 and 09-07)", + "result": "taken back −1.4 [−4.9, +3.1]: one vCPU has no second CPU to probe on. Deleted", + "shape": "spin", + "source": "lab 44818953987, #352", + "runs": [ + 44818953987 + ] +} diff --git a/docs/experiments/erofs-removed-for-speed.json b/docs/experiments/erofs-removed-for-speed.json new file mode 100644 index 00000000..9288b644 --- /dev/null +++ b/docs/experiments/erofs-removed-for-speed.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "kernel", + "order": 110, + "date": "2026-09-26", + "change": "erofs removed for speed", + "result": "noise (100.46 vs 102.22)", + "shape": "runner", + "source": "`5a3d509`" +} diff --git a/docs/experiments/every-logins-user-manager-started-beside.json b/docs/experiments/every-logins-user-manager-started-beside.json new file mode 100644 index 00000000..431a89fb --- /dev/null +++ b/docs/experiments/every-logins-user-manager-started-beside.json @@ -0,0 +1,16 @@ +{ + "decision": "rejected", + "section": "login", + "order": 80, + "date": "2026-11-22", + "change": "Every login's user manager started beside it, not waited for (`user-runtime-dir@`'s `20-manager.conf`, #462): a command that needs the user bus at once in the first login came before the manager", + "result": "correctness: the first login's own `systemctl --user` failed 10 of 10. Replaced by class `user-early` (#467)", + "shape": "spin", + "source": "lab 45032247920", + "issues": [ + 467 + ], + "runs": [ + 45032247920 + ] +} diff --git a/docs/experiments/every-machine-started-held-so-qemu.json b/docs/experiments/every-machine-started-held-so-qemu.json new file mode 100644 index 00000000..b835ff0e --- /dev/null +++ b/docs/experiments/every-machine-started-held-so-qemu.json @@ -0,0 +1,12 @@ +{ + "decision": "carried", + "order": 170, + "change": "Every machine started held, so QEMU can start ahead", + "where": "machine", + "result": "the \"QEMU started ahead\" rows: ~28 ms cold, ~25 restored", + "evidence": "measured", + "source": "report 44811347183", + "runs": [ + 44811347183 + ] +} diff --git a/docs/experiments/fast-snapshot-load-as-the-restore.json b/docs/experiments/fast-snapshot-load-as-the-restore.json new file mode 100644 index 00000000..58fd18ce --- /dev/null +++ b/docs/experiments/fast-snapshot-load-as-the-restore.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "restore", + "order": 20, + "date": "2026-11-19", + "change": "Fast snapshot load (mapped-ram and postcopy-ram on a `file:` URI) as the restore", + "result": "running at 38 ms, but the login at 293/325 instead of 152/161: every page touched is a fault served by one read. `LoadOptions.Fast` stays for large states", + "shape": "ladder", + "source": "lab 44585840498", + "runs": [ + 44585840498 + ] +} diff --git a/docs/experiments/fast-snapshot-load-for-every-state.json b/docs/experiments/fast-snapshot-load-for-every-state.json new file mode 100644 index 00000000..1c5d5d85 --- /dev/null +++ b/docs/experiments/fast-snapshot-load-for-every-state.json @@ -0,0 +1,19 @@ +{ + "decision": "rejected", + "section": "restore", + "order": 30, + "date": "2026-11-22", + "change": "Fast snapshot load for every state, the caller's choice (`LoadOptions.Fast`, spin's `fast_load`)", + "result": "login +394 [+388, +420] at 179 MiB of data, +103 at 1.2 GiB, −129 at 1.7 GiB, −2615 at 7.3 GiB. Replaced by the machine's choice above 1.5 GiB (#470)", + "shape": "spin, touched", + "source": "labs 45034868686, 45035462478, 45034881876, 45034881366", + "issues": [ + 470 + ], + "runs": [ + 45034868686, + 45034881366, + 45034881876, + 45035462478 + ] +} diff --git a/docs/experiments/faster-qmp-in-general.json b/docs/experiments/faster-qmp-in-general.json new file mode 100644 index 00000000..cce25c36 --- /dev/null +++ b/docs/experiments/faster-qmp-in-general.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "qmp", + "order": 10, + "date": "2026-11-21", + "change": "Faster QMP in general", + "result": "the cold boot waits on 14 commands, 6.2 ms from QEMU's main loop being free to `cont` answered (1.3% of 470). A restore waits on 17 before `migrate-incoming`, 6.7 ms, and 2.7 after the guest runs. The commands' own run is ~1.2 ms of each path. The rest is round trips: query-status alone is 131 µs from the client, 18 µs in QEMU. spin-machine's start and dial are off the path: its first command waits 17 ms (cold) and 19.5 (restored) for QEMU", + "shape": "spin", + "source": "lab 44912471522", + "runs": [ + 44912471522 + ] +} diff --git a/docs/experiments/fewer-round-trips-no-query-status.json b/docs/experiments/fewer-round-trips-no-query-status.json new file mode 100644 index 00000000..8359bf5d --- /dev/null +++ b/docs/experiments/fewer-round-trips-no-query-status.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "qmp", + "order": 40, + "date": "2026-11-21", + "change": "Fewer round trips (no `query-status` before the bind, places read from the Spec instead of `query-block` and `qom-get`, `Last(RESUME)` for the `query-status` after a load)", + "result": "ceiling ~1.3 ms cold, ~1.9 restored", + "shape": "spin", + "source": "the same, the detail by command" +} diff --git a/docs/experiments/fewer-unit-files.json b/docs/experiments/fewer-unit-files.json new file mode 100644 index 00000000..c5fbdbcb --- /dev/null +++ b/docs/experiments/fewer-unit-files.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "image", + "order": 70, + "date": "2026-09-26", + "change": "Fewer unit files", + "result": "300 extra: 236 vs 246", + "shape": "runner", + "source": "`9fab3f1`" +} diff --git a/docs/experiments/getty-without-bindsto-dev-ttys0.json b/docs/experiments/getty-without-bindsto-dev-ttys0.json new file mode 100644 index 00000000..8beaf6e2 --- /dev/null +++ b/docs/experiments/getty-without-bindsto-dev-ttys0.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "image", + "order": 100, + "date": "2026-11-12", + "change": "Getty without BindsTo dev-ttyS0", + "result": "342 vs 345", + "shape": "ladder", + "source": "lab 43303190733", + "runs": [ + 43303190733 + ] +} diff --git a/docs/experiments/host-keys-made-from-the-boots.json b/docs/experiments/host-keys-made-from-the-boots.json new file mode 100644 index 00000000..f6f1686d --- /dev/null +++ b/docs/experiments/host-keys-made-from-the-boots.json @@ -0,0 +1,16 @@ +{ + "decision": "carried", + "order": 470, + "change": "Host keys made from the boot's first dispatch", + "where": "spin-machine-sshd-keygen.service", + "result": "cold −0.8 [−10.5, +3.5], restored in noise: not a gain in spin's shape, where they are no longer made (the row below); kept for the lane, 489 → 468 (#515)", + "evidence": "measured", + "source": "lab 45034963004, lab 43483372488", + "issues": [ + 515 + ], + "runs": [ + 43483372488, + 45034963004 + ] +} diff --git a/docs/experiments/hotplug-disks-on-virtio-scsi-not.json b/docs/experiments/hotplug-disks-on-virtio-scsi-not.json new file mode 100644 index 00000000..0ef9ae50 --- /dev/null +++ b/docs/experiments/hotplug-disks-on-virtio-scsi-not.json @@ -0,0 +1,9 @@ +{ + "decision": "carried", + "order": 160, + "change": "Hotplug disks on virtio-scsi, not PCIe root ports", + "where": "machine", + "result": "boot −31, attach 135 → 1.5 (09-29)", + "evidence": "runner", + "source": "#25" +} diff --git a/docs/experiments/hpet-off.json b/docs/experiments/hpet-off.json new file mode 100644 index 00000000..f903e2c9 --- /dev/null +++ b/docs/experiments/hpet-off.json @@ -0,0 +1,9 @@ +{ + "decision": "carried", + "order": 140, + "change": "`hpet=off`", + "where": "machine", + "result": "nothing on record: a timer the guest would enumerate and then not use", + "evidence": "unmeasured", + "source": "-" +} diff --git a/docs/experiments/ich9-sata-off-smbus-off.json b/docs/experiments/ich9-sata-off-smbus-off.json new file mode 100644 index 00000000..ee6518c9 --- /dev/null +++ b/docs/experiments/ich9-sata-off-smbus-off.json @@ -0,0 +1,9 @@ +{ + "decision": "carried", + "order": 150, + "change": "ICH9 `sata=off`, `smbus=off`", + "where": "machine", + "result": "kernel to init 62.3 → 60.6 (09-08)", + "evidence": "laptop, 400 boots", + "source": "`fa1803f`" +} diff --git a/docs/experiments/initcall-blacklist-ksm-kcompactd.json b/docs/experiments/initcall-blacklist-ksm-kcompactd.json new file mode 100644 index 00000000..eed21adc --- /dev/null +++ b/docs/experiments/initcall-blacklist-ksm-kcompactd.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "kernel", + "order": 40, + "date": "2026-09-10", + "change": "initcall_blacklist ksm/kcompactd", + "result": "0; event_trace's 6 ms is the profiler", + "shape": "runner", + "source": "`64d2901`" +} diff --git a/docs/experiments/journald-volatile-8-mb-its-flush.json b/docs/experiments/journald-volatile-8-mb-its-flush.json new file mode 100644 index 00000000..2de8e1cc --- /dev/null +++ b/docs/experiments/journald-volatile-8-mb-its-flush.json @@ -0,0 +1,13 @@ +{ + "decision": "carried", + "order": 520, + "change": "journald volatile, 8 MB, its flush masked", + "where": "optimize-systemd.sh", + "result": "cold +6.1 [+2.3, +15.8], prestarted +6.5 [+3.1, +13.1], restored in noise; 8 MB against 4 MB, first login −2.2 [−12.1, +6.4], 20 a side", + "evidence": "measured", + "source": "labs 45034963004, 45121159504", + "runs": [ + 45034963004, + 45121159504 + ] +} diff --git a/docs/experiments/kernel-0006-0009-a-booting-ap.json b/docs/experiments/kernel-0006-0009-a-booting-ap.json new file mode 100644 index 00000000..bbe9b399 --- /dev/null +++ b/docs/experiments/kernel-0006-0009-a-booting-ap.json @@ -0,0 +1,14 @@ +{ + "decision": "rejected", + "section": "kernel", + "order": 240, + "date": "2026-11-21", + "change": "Kernel 0006 (BTF parsed in the background), 0009 (a booting AP polled by local_clock()), 0011 (queue_select written only on a change)", + "result": "taken back −2.5 [−8.4, +1.8] at 40 boots. Deleted", + "shape": "spin", + "source": "labs 44818953987, 44822157367, #345", + "runs": [ + 44818953987, + 44822157367 + ] +} diff --git a/docs/experiments/kernel-0012-and-0013.json b/docs/experiments/kernel-0012-and-0013.json new file mode 100644 index 00000000..7b07972c --- /dev/null +++ b/docs/experiments/kernel-0012-and-0013.json @@ -0,0 +1,15 @@ +{ + "decision": "carried", + "order": 20, + "change": "Kernel 0012 (vmlinux BTF parsed on first use) and 0013 (the verifier asks for it only where a kernel type enters a program)", + "where": "kernel/patches", + "result": "cold −6.4 [−9.4, −1.0] at 60 a side (lab 45118194310, the kernel carried); before the review's fixes −10.0 [−12.7, −3.3] at 60 and −6.3 [−9.1, −4.6] at 120 (labs 45114405201, 45115330128); restored −1.0 [−6.0, +4.2] evicted, the state 1.3 MiB smaller (lab 45115341056)", + "evidence": "measured", + "source": "lab 45118194310", + "runs": [ + 45114405201, + 45115330128, + 45115341056, + 45118194310 + ] +} diff --git a/docs/experiments/kernel-patches-0001-0005-0007-0008.json b/docs/experiments/kernel-patches-0001-0005-0007-0008.json new file mode 100644 index 00000000..c3c9ef26 --- /dev/null +++ b/docs/experiments/kernel-patches-0001-0005-0007-0008.json @@ -0,0 +1,12 @@ +{ + "decision": "carried", + "order": 10, + "change": "Kernel patches 0001-0005, 0007, 0008, 0010", + "where": "kernel/patches", + "result": "cold +67.5 [+62.5, +72.4], with 0006, 0009 and 0011 (since deleted, worth nothing)", + "evidence": "group A", + "source": "lab 44818953987", + "runs": [ + 44818953987 + ] +} diff --git a/docs/experiments/keygen-wanted-by-multi-user-target.json b/docs/experiments/keygen-wanted-by-multi-user-target.json new file mode 100644 index 00000000..7b218c0b --- /dev/null +++ b/docs/experiments/keygen-wanted-by-multi-user-target.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "image", + "order": 130, + "date": "2026-11-12", + "change": "Keygen wanted by multi-user.target", + "result": "518 vs 514", + "shape": "ladder", + "source": "lab 43312419007", + "runs": [ + 43312419007 + ] +} diff --git a/docs/experiments/ksm-and-thp-off.json b/docs/experiments/ksm-and-thp-off.json new file mode 100644 index 00000000..3624a93e --- /dev/null +++ b/docs/experiments/ksm-and-thp-off.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "kernel", + "order": 90, + "date": "2026-09-26", + "change": "KSM and THP off", + "result": "−0.50 ms", + "shape": "runner", + "source": "`cda04b1`" +} diff --git a/docs/experiments/ksm-free-page-hinting-virtio-fs.json b/docs/experiments/ksm-free-page-hinting-virtio-fs.json new file mode 100644 index 00000000..fc3a95c3 --- /dev/null +++ b/docs/experiments/ksm-free-page-hinting-virtio-fs.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "memory", + "order": 60, + "date": "2026-10-01", + "change": "KSM, free page hinting, virtio-fs DAX", + "result": "security, correctness, unsupported", + "shape": "-", + "source": "docs/memory-and-disk.md" +} diff --git a/docs/experiments/kvm-halt-poll-ns-cpu-pinning.json b/docs/experiments/kvm-halt-poll-ns-cpu-pinning.json new file mode 100644 index 00000000..6f2a5c98 --- /dev/null +++ b/docs/experiments/kvm-halt-poll-ns-cpu-pinning.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "qmp", + "order": 70, + "date": "2026-11-21", + "change": "`kvm.halt_poll_ns`, CPU pinning, for vsock", + "result": "bounded by the same 0.6 ms a login. What they do to the boot's other wake-ups is a different question, not measured here", + "shape": "spin", + "source": "the same" +} diff --git a/docs/experiments/lazy-itable-init-0.json b/docs/experiments/lazy-itable-init-0.json new file mode 100644 index 00000000..857d4daa --- /dev/null +++ b/docs/experiments/lazy-itable-init-0.json @@ -0,0 +1,9 @@ +{ + "decision": "carried", + "order": 330, + "change": "`lazy_itable_init=0`", + "where": "image/build.sh", + "result": "function: no 16 MiB of zeros in every overlay", + "evidence": "-", + "source": "-" +} diff --git a/docs/experiments/less-guest-ram.json b/docs/experiments/less-guest-ram.json new file mode 100644 index 00000000..d75b4029 --- /dev/null +++ b/docs/experiments/less-guest-ram.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "firmware", + "order": 30, + "date": "2026-09-10", + "change": "Less guest RAM (512 MiB)", + "result": "1241 vs 1256 ms, nothing", + "shape": "runner", + "source": "`80f984b`" +} diff --git a/docs/experiments/logind-its-varlink-socket-user-runtime.json b/docs/experiments/logind-its-varlink-socket-user-runtime.json new file mode 100644 index 00000000..85e8ac2b --- /dev/null +++ b/docs/experiments/logind-its-varlink-socket-user-runtime.json @@ -0,0 +1,13 @@ +{ + "decision": "carried", + "order": 420, + "change": "logind, its Varlink socket, `user-runtime-dir@`, `user@` without default dependencies; `dbus.socket` without sysinit", + "where": "image drop-ins, configure-system.sh", + "result": "cold +16.5 [+9.8, +20.4], prestarted +11.0 [+6.2, +18.8], restored in noise; lane 478 → 402 (11-13)", + "evidence": "measured", + "source": "lab 45034963004, lab 43518915618", + "runs": [ + 43518915618, + 45034963004 + ] +} diff --git a/docs/experiments/loginds-varlink-socket-without-default-dependencies.json b/docs/experiments/loginds-varlink-socket-without-default-dependencies.json new file mode 100644 index 00000000..80362e4c --- /dev/null +++ b/docs/experiments/loginds-varlink-socket-without-default-dependencies.json @@ -0,0 +1,14 @@ +{ + "decision": "rejected", + "section": "login", + "order": 60, + "date": "2026-11-19", + "change": "logind's Varlink socket without default dependencies", + "result": "accept to login 131 → 120, first login inside the noise; kept with the lane's other drop-ins", + "shape": "ladder", + "source": "labs 44558035927, 44558053261", + "runs": [ + 44558035927, + 44558053261 + ] +} diff --git a/docs/experiments/lower-memhp-default-state.json b/docs/experiments/lower-memhp-default-state.json new file mode 100644 index 00000000..1b63730d --- /dev/null +++ b/docs/experiments/lower-memhp-default-state.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "memory", + "order": 10, + "date": "2026-09-30", + "change": "Lower `memhp_default_state` (unplug policies)", + "result": "kept `online`", + "shape": "runner", + "source": "`2903d8c`, #48" +} diff --git a/docs/experiments/lower-the-vcpu-ceiling-drop-the.json b/docs/experiments/lower-the-vcpu-ceiling-drop-the.json new file mode 100644 index 00000000..2401bf8d --- /dev/null +++ b/docs/experiments/lower-the-vcpu-ceiling-drop-the.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "firmware", + "order": 130, + "date": "2026-11-13", + "change": "Lower the vCPU ceiling, drop the balloon or ACPI", + "result": "not tried: an invariant", + "shape": "-", + "source": "AGENTS.md" +} diff --git a/docs/experiments/mapped-ram-with-multifd-4-11.json b/docs/experiments/mapped-ram-with-multifd-4-11.json new file mode 100644 index 00000000..86f7d451 --- /dev/null +++ b/docs/experiments/mapped-ram-with-multifd-4-11.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "restore", + "order": 10, + "date": "2026-11-13", + "change": "mapped-ram with multifd ×4, 11-13", + "result": "not comparable by its own run's log; channels were measured again on 11-20 and kept", + "shape": "ladder", + "source": "#246, lab 43483852339", + "runs": [ + 43483852339 + ] +} diff --git a/docs/experiments/mask-11-always-failing-units.json b/docs/experiments/mask-11-always-failing-units.json new file mode 100644 index 00000000..35e3dc36 --- /dev/null +++ b/docs/experiments/mask-11-always-failing-units.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "image", + "order": 150, + "date": "2026-11-13", + "change": "Mask 11 always-failing units", + "result": "484, no change", + "shape": "ladder", + "source": "lab 43483372488", + "runs": [ + 43483372488 + ] +} diff --git a/docs/experiments/mask-four-varlink-sockets-nothing-uses.json b/docs/experiments/mask-four-varlink-sockets-nothing-uses.json new file mode 100644 index 00000000..286bcae6 --- /dev/null +++ b/docs/experiments/mask-four-varlink-sockets-nothing-uses.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "image", + "order": 120, + "date": "2026-11-22", + "change": "Mask four varlink sockets nothing uses (factory-reset, mute-console, sysext, creds)", + "result": "−0.8 [−4.8, +4.3] at 60 boots", + "shape": "spin", + "source": "the same" +} diff --git a/docs/experiments/mask-modprobe-drm.json b/docs/experiments/mask-modprobe-drm.json new file mode 100644 index 00000000..db3f1d32 --- /dev/null +++ b/docs/experiments/mask-modprobe-drm.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "image", + "order": 160, + "date": "2026-11-19", + "change": "Mask `modprobe@drm` (logind is ordered after it)", + "result": "327/345 vs 328/337. It is masked all the same, since 09-07, one of the 16 masks of group C-masks", + "shape": "ladder", + "source": "lab 44558035927", + "runs": [ + 44558035927 + ] +} diff --git a/docs/experiments/mask-sshd-socket-and-run-generators.json b/docs/experiments/mask-sshd-socket-and-run-generators.json new file mode 100644 index 00000000..433e0537 --- /dev/null +++ b/docs/experiments/mask-sshd-socket-and-run-generators.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "image", + "order": 140, + "date": "2026-11-13", + "change": "Mask sshd-socket- and run-generators", + "result": "login 489, no change", + "shape": "ladder", + "source": "lab 43483372488", + "runs": [ + 43483372488 + ] +} diff --git a/docs/experiments/mask-sshd-socket-generator-again-on.json b/docs/experiments/mask-sshd-socket-generator-again-on.json new file mode 100644 index 00000000..ef34ecc8 --- /dev/null +++ b/docs/experiments/mask-sshd-socket-generator-again-on.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "image", + "order": 250, + "date": "2026-11-22", + "change": "Mask `sshd-socket-generator`, again on spin's path", + "result": "+0.8 [−4.0, +4.7] at 60 boots", + "shape": "spin", + "source": "the same" +} diff --git a/docs/experiments/mask-systemd-udev-load-credentials-again.json b/docs/experiments/mask-systemd-udev-load-credentials-again.json new file mode 100644 index 00000000..7291efbf --- /dev/null +++ b/docs/experiments/mask-systemd-udev-load-credentials-again.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "image", + "order": 230, + "date": "2026-11-22", + "change": "Mask `systemd-udev-load-credentials` again, in spin's shape on one vCPU (it was −8 and −6 on two)", + "result": "−2.1 [−6.3, +0.3] at 60 boots: not separable", + "shape": "spin", + "source": "lab 44977044826", + "runs": [ + 44977044826 + ] +} diff --git a/docs/experiments/mask-systemd-udev-load-credentials.json b/docs/experiments/mask-systemd-udev-load-credentials.json new file mode 100644 index 00000000..6b3cb9a9 --- /dev/null +++ b/docs/experiments/mask-systemd-udev-load-credentials.json @@ -0,0 +1,14 @@ +{ + "decision": "rejected", + "section": "image", + "order": 170, + "date": "2026-11-19", + "change": "Mask `systemd-udev-load-credentials`", + "result": "−8 then −6 ms, p95 unchanged: not separable at 20 boots", + "shape": "ladder", + "source": "labs 44537549305, 44538877783", + "runs": [ + 44537549305, + 44538877783 + ] +} diff --git a/docs/experiments/mask-udev.json b/docs/experiments/mask-udev.json new file mode 100644 index 00000000..09e6c780 --- /dev/null +++ b/docs/experiments/mask-udev.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "image", + "order": 10, + "date": "2026-09-10", + "change": "Mask udev", + "result": "saves 0, and boots never reach a login (10 s ttyS0 timeout)", + "shape": "runner", + "source": "`4cbd229`, `80f984b`" +} diff --git a/docs/experiments/masks-of-15-units-and-a.json b/docs/experiments/masks-of-15-units-and-a.json new file mode 100644 index 00000000..fb704166 --- /dev/null +++ b/docs/experiments/masks-of-15-units-and-a.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "image", + "order": 190, + "date": "2026-11-21", + "change": "Masks of 15 units and a generator the image does not have", + "result": "they masked nothing. Deleted without a run; image/build.sh refuses such a mask", + "shape": "-", + "source": "#352" +} diff --git a/docs/experiments/microvm.json b/docs/experiments/microvm.json new file mode 100644 index 00000000..39e22423 --- /dev/null +++ b/docs/experiments/microvm.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "kernel", + "order": 70, + "date": "2026-09-10", + "change": "MICROVM", + "result": "no ACPI CPU hotplug", + "shape": "-", + "source": "`b151186`" +} diff --git a/docs/experiments/modular-kernel.json b/docs/experiments/modular-kernel.json new file mode 100644 index 00000000..10a2c284 --- /dev/null +++ b/docs/experiments/modular-kernel.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "kernel", + "order": 20, + "date": "2026-09-10", + "change": "Modular kernel", + "result": "0.57 ms; breaks \"a release is one machine\"", + "shape": "runner", + "source": "`1a8e25c`" +} diff --git a/docs/experiments/motd-and-pam-motd-off-mlkem768x25519.json b/docs/experiments/motd-and-pam-motd-off-mlkem768x25519.json new file mode 100644 index 00000000..f66b393e --- /dev/null +++ b/docs/experiments/motd-and-pam-motd-off-mlkem768x25519.json @@ -0,0 +1,12 @@ +{ + "decision": "carried", + "order": 510, + "change": "MOTD and `pam_motd` off; `mlkem768x25519-sha256` alone", + "where": "configure-system.sh", + "result": "−12 on the first login; 104 → 40 a login against sntrup761", + "evidence": "ladder, mechanism: a root login runs the same PAM and kex", + "source": "#240, lab 43479854381", + "runs": [ + 43479854381 + ] +} diff --git a/docs/experiments/no-timer-check-tsc-reliable.json b/docs/experiments/no-timer-check-tsc-reliable.json new file mode 100644 index 00000000..5fbbbe1f --- /dev/null +++ b/docs/experiments/no-timer-check-tsc-reliable.json @@ -0,0 +1,9 @@ +{ + "decision": "carried", + "order": 240, + "change": "`no_timer_check`, `tsc=reliable`", + "where": "machine/cmdline.go", + "result": "nothing on record (09-07)", + "evidence": "unmeasured", + "source": "-" +} diff --git a/docs/experiments/no-unit-made-for-a-requiresmountsfor.json b/docs/experiments/no-unit-made-for-a-requiresmountsfor.json new file mode 100644 index 00000000..857468d4 --- /dev/null +++ b/docs/experiments/no-unit-made-for-a-requiresmountsfor.json @@ -0,0 +1,17 @@ +{ + "decision": "rejected", + "section": "image", + "order": 270, + "date": "2026-11-23", + "change": "No unit made for a `RequiresMountsFor=` prefix with no unit file (`unit_add_mount_dependencies` checks the unit name map before it loads one)", + "result": "−1.0 [−4.3, +3.9] at 100 boots, and PID 1's CPU before the login 57.2 against 56.0, p50 of 5: not separable. Whether the stubs went in those boots was not observed (no debug boot of the arm). The patch and an upstream draft, not sent, are #580", + "shape": "spin", + "source": "labs 45090299768, 45090326943", + "issues": [ + 580 + ], + "runs": [ + 45090299768, + 45090326943 + ] +} diff --git a/docs/experiments/nsswitch-conf-without-the-db-entries.json b/docs/experiments/nsswitch-conf-without-the-db-entries.json new file mode 100644 index 00000000..59582735 --- /dev/null +++ b/docs/experiments/nsswitch-conf-without-the-db-entries.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "image", + "order": 310, + "date": "2026-11-22", + "change": "`nsswitch.conf` without the `db` entries libnss-db would serve (kept since 09, never measured); reverted to Ubuntu's", + "result": "taking it back +0.8 [−8.4, +5.2] cold, restored in noise", + "shape": "spin", + "source": "lab 45034963004", + "runs": [ + 45034963004 + ] +} diff --git a/docs/experiments/o-orphan-file.json b/docs/experiments/o-orphan-file.json new file mode 100644 index 00000000..65af8ddb --- /dev/null +++ b/docs/experiments/o-orphan-file.json @@ -0,0 +1,9 @@ +{ + "decision": "carried", + "order": 320, + "change": "`-O ^orphan_file`", + "where": "image/build.sh", + "result": "lead (11-19)", + "evidence": "laptop", + "source": "-" +} diff --git a/docs/experiments/one-sshd-for-every-connection.json b/docs/experiments/one-sshd-for-every-connection.json new file mode 100644 index 00000000..13e2bd46 --- /dev/null +++ b/docs/experiments/one-sshd-for-every-connection.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "login", + "order": 40, + "date": "2026-11-13", + "change": "One sshd for every connection (vsock `Accept=no`, `sshd -D` early)", + "result": "first login 382 vs 381; second 40 vs 48", + "shape": "lane", + "source": "lab 43524721490", + "runs": [ + 43524721490 + ] +} diff --git a/docs/experiments/overlay-o-direct.json b/docs/experiments/overlay-o-direct.json new file mode 100644 index 00000000..812f383e --- /dev/null +++ b/docs/experiments/overlay-o-direct.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "firmware", + "order": 50, + "date": "2026-10-01", + "change": "Overlay O_DIRECT", + "result": "small reads 1490 vs 530 ms", + "shape": "runner", + "source": "docs/memory-and-disk.md" +} diff --git a/docs/experiments/page-reporting-order-0-or-3.json b/docs/experiments/page-reporting-order-0-or-3.json new file mode 100644 index 00000000..a11ed1c2 --- /dev/null +++ b/docs/experiments/page-reporting-order-0-or-3.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "memory", + "order": 30, + "date": "2026-10-01", + "change": "`page_reporting_order` 0 or 3", + "result": "~100 MB transient vs ~180 MB of huge pages lost", + "shape": "runner", + "source": "docs/memory-and-disk.md, #83" +} diff --git a/docs/experiments/pam-selinux-and-pam-mail-out.json b/docs/experiments/pam-selinux-and-pam-mail-out.json new file mode 100644 index 00000000..471b5dc4 --- /dev/null +++ b/docs/experiments/pam-selinux-and-pam-mail-out.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "image", + "order": 300, + "date": "2026-11-22", + "change": "`pam_selinux` (twice) and `pam_mail` out of sshd's PAM stack: SELinux is off and there is no mail", + "result": "−1.9 [−4.9, +2.8] at 60 boots", + "shape": "spin", + "source": "lab 44979726719", + "runs": [ + 44979726719 + ] +} diff --git a/docs/experiments/pci-lastbus-0.json b/docs/experiments/pci-lastbus-0.json new file mode 100644 index 00000000..f469c80f --- /dev/null +++ b/docs/experiments/pci-lastbus-0.json @@ -0,0 +1,9 @@ +{ + "decision": "carried", + "order": 230, + "change": "`pci=lastbus=0`", + "where": "machine/cmdline.go", + "result": "kernel to init 87.6 → 51.1 (2026-09): 8192 configuration reads, each an exit", + "evidence": "runner, mechanism", + "source": "`5e7d60e`, docs/machine.md" +} diff --git a/docs/experiments/pci-noearly.json b/docs/experiments/pci-noearly.json new file mode 100644 index 00000000..e0255967 --- /dev/null +++ b/docs/experiments/pci-noearly.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "kernel", + "order": 140, + "date": "2026-11-12", + "change": "`pci=noearly`", + "result": "the guest does not boot", + "shape": "-", + "source": "#240" +} diff --git a/docs/experiments/pid-1s-loglevel-err-logtarget-journal.json b/docs/experiments/pid-1s-loglevel-err-logtarget-journal.json new file mode 100644 index 00000000..eae30e54 --- /dev/null +++ b/docs/experiments/pid-1s-loglevel-err-logtarget-journal.json @@ -0,0 +1,14 @@ +{ + "decision": "rejected", + "section": "image", + "order": 200, + "date": "2026-11-21", + "change": "PID 1's `LogLevel=err`, `LogTarget=journal`, `ShowStatus=no`, `StatusUnitFormat=name`; `kernel.printk = 3 3 3 3`", + "result": "taken back −1.8 [−7.7, +3.2] at 40 boots; the console stays quiet through the command line. Deleted", + "shape": "spin", + "source": "labs 44818953987, 44822157367, #354", + "runs": [ + 44818953987, + 44822157367 + ] +} diff --git a/docs/experiments/pipelining-the-bind.json b/docs/experiments/pipelining-the-bind.json new file mode 100644 index 00000000..9ce69291 --- /dev/null +++ b/docs/experiments/pipelining-the-bind.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "qmp", + "order": 20, + "date": "2026-11-21", + "change": "Pipelining the bind (every command sent before the first answer)", + "result": "ceiling: QEMU's wait on the client, 4.5 ms cold and 5.2 restored, under the noise. The read-ahead overlaps the restore's half, so its share is smaller", + "shape": "spin", + "source": "the same" +} diff --git a/docs/experiments/prefetch-the-boots-files.json b/docs/experiments/prefetch-the-boots-files.json new file mode 100644 index 00000000..5f7bdc45 --- /dev/null +++ b/docs/experiments/prefetch-the-boots-files.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "memory", + "order": 40, + "date": "2026-10-01", + "change": "Prefetch the boot's files", + "result": "47 ms to win 24", + "shape": "runner", + "source": "run 36803912357", + "runs": [ + 36803912357 + ] +} diff --git a/docs/experiments/qboot-instead-of-seabios.json b/docs/experiments/qboot-instead-of-seabios.json new file mode 100644 index 00000000..f445fb44 --- /dev/null +++ b/docs/experiments/qboot-instead-of-seabios.json @@ -0,0 +1,12 @@ +{ + "decision": "carried", + "order": 60, + "change": "qboot instead of SeaBIOS", + "where": "qemu, `machine.DefaultBIOS`", + "result": "cold +68.5 [+62.7, +71.7]", + "evidence": "group F", + "source": "lab 44818953987", + "runs": [ + 44818953987 + ] +} diff --git a/docs/experiments/qboot-mtrr-patch-write-pointer-patch.json b/docs/experiments/qboot-mtrr-patch-write-pointer-patch.json new file mode 100644 index 00000000..1a5f0903 --- /dev/null +++ b/docs/experiments/qboot-mtrr-patch-write-pointer-patch.json @@ -0,0 +1,9 @@ +{ + "decision": "carried", + "order": 130, + "change": "qboot `mtrr.patch`, `write-pointer.patch`", + "where": "qemu/qboot", + "result": "function: write-back mappings, vmgenid", + "evidence": "-", + "source": "-" +} diff --git a/docs/experiments/qboot-no-pci-walk-patch.json b/docs/experiments/qboot-no-pci-walk-patch.json new file mode 100644 index 00000000..12a789cc --- /dev/null +++ b/docs/experiments/qboot-no-pci-walk-patch.json @@ -0,0 +1,12 @@ +{ + "decision": "carried", + "order": 120, + "change": "qboot `no-pci-walk.patch`", + "where": "qemu/qboot", + "result": "cold +5.2 [−1.7, +9.2]: inside the noise, and the upper bound over +5 keeps it; 5.0 ms nested in `firmware-stages`", + "evidence": "measured, 40 a side", + "source": "lab 44993790452", + "runs": [ + 44993790452 + ] +} diff --git a/docs/experiments/qboot-pam-patch.json b/docs/experiments/qboot-pam-patch.json new file mode 100644 index 00000000..434d2a17 --- /dev/null +++ b/docs/experiments/qboot-pam-patch.json @@ -0,0 +1,12 @@ +{ + "decision": "carried", + "order": 80, + "change": "qboot `pam.patch` (PAM in three writes)", + "where": "qemu/qboot", + "result": "cold +3.9 [−3.4, +8.0]: inside the noise, and the upper bound over +5 keeps it (rule 5 of docs/measuring.md)", + "evidence": "measured, 40 a side", + "source": "lab 44993790452", + "runs": [ + 44993790452 + ] +} diff --git a/docs/experiments/qemu-0001.json b/docs/experiments/qemu-0001.json new file mode 100644 index 00000000..a75e71c8 --- /dev/null +++ b/docs/experiments/qemu-0001.json @@ -0,0 +1,13 @@ +{ + "decision": "carried", + "order": 70, + "change": "QEMU 0001 (device creation in one memory transaction)", + "where": "qemu/patches", + "result": "restored +11.7 [+0.9, +19.3], running +6.8 [+1.2, +8.8]: a restore starts QEMU too; cold +0.2 [−8.7, +7.1]. With `pam.patch`, cold +11.5 [+6.7, +20.2] (group B, lab 44818953987)", + "evidence": "measured, 20 a side", + "source": "lab 44993254745", + "runs": [ + 44818953987, + 44993254745 + ] +} diff --git a/docs/experiments/qemu-0002-virtio-scsi-max-target.json b/docs/experiments/qemu-0002-virtio-scsi-max-target.json new file mode 100644 index 00000000..2da59c7a --- /dev/null +++ b/docs/experiments/qemu-0002-virtio-scsi-max-target.json @@ -0,0 +1,12 @@ +{ + "decision": "carried", + "order": 90, + "change": "QEMU 0002, virtio-scsi `max_target`, which spin-machine passes", + "where": "qemu/patches, machine", + "result": "cold −8.9 [−15.5, −0.9] when it came in", + "evidence": "measured", + "source": "lab 44788216590", + "runs": [ + 44788216590 + ] +} diff --git a/docs/experiments/qemu-0005-a-machine-made-for.json b/docs/experiments/qemu-0005-a-machine-made-for.json new file mode 100644 index 00000000..26f9bc5a --- /dev/null +++ b/docs/experiments/qemu-0005-a-machine-made-for.json @@ -0,0 +1,15 @@ +{ + "decision": "carried", + "order": 410, + "change": "QEMU 0005: a machine made for an incoming migration writes its TSC only from the migration, so KVM takes the checkpoint's TSC as given", + "where": "qemu/patches", + "result": "correctness: without it a guest saved with its tick running sleeps until its old TSC deadline, ~450 ms (#452). Alone it moves neither number: cold −3.0 [−5.8, +0.1], restored −1.9 [−7.6, +2.0]", + "evidence": "measured", + "source": "lab 44987412171", + "issues": [ + 452 + ], + "runs": [ + 44987412171 + ] +} diff --git a/docs/experiments/qemu-0009.json b/docs/experiments/qemu-0009.json new file mode 100644 index 00000000..cfefdb38 --- /dev/null +++ b/docs/experiments/qemu-0009.json @@ -0,0 +1,17 @@ +{ + "decision": "carried", + "order": 100, + "change": "QEMU 0009 (the vmlinux's segments copied into guest RAM in a thread beside the main loop at the machine's first reset, #698)", + "where": "qemu/patches", + "result": "first login −8.6 [−11.0, −4.0], 351 → 342, sshd accepting −9.1 [−12.4, −5.9], the console prompt −7.7 [−11.4, −5.5], QEMU's RSS unmoved, 60 a side (lab 45260098299); restored −0.1 [−1.1, +0.7] evicted, −0.3 [−2.1, +0.9] cached, and the same run's cold login −6.9 [−12.9, −0.8], 40 a side (lab 45260694485): a restore's reset copies nothing. The copy it moves off the main thread was 9.1 ms (p50 of 20, p95 9.3, lab 45257214350), and the gain is all of it. Prior art: QEMU has mapped an ELF kernel instead of reading it since 4.2 (Stefano Garzarella, `816b9fe450`, [qemu-devel 2019-07-24](https://patchew.org/QEMU/20190724143105.307042-1-sgarzare@redhat.com/20190724143105.307042-3-sgarzare@redhat.com), 2019), so #698's first candidate, mapping the file, was already upstream; what was left is the copy into guest RAM, which any loader pays: Firecracker and Cloud Hypervisor read each PT_LOAD straight into guest memory ([rust-vmm/linux-loader](https://github.com/rust-vmm/linux-loader)), one copy as QEMU's. A `pread` into guest RAM against the mapping's `memcpy` was no faster on a laptop (9-11 ms each, not nested), where half the copy was faulting in the destination's huge pages and half the copy itself. No ROM copy off the main thread found in QEMU 11.2's tree or by a web search of qemu-devel (2026-11-23)", + "evidence": "measured", + "source": "labs 45260098299, 45260694485", + "issues": [ + 698 + ], + "runs": [ + 45257214350, + 45260098299, + 45260694485 + ] +} diff --git a/docs/experiments/qemu-at-a-higher-host-priority.json b/docs/experiments/qemu-at-a-higher-host-priority.json new file mode 100644 index 00000000..c0cfcbfb --- /dev/null +++ b/docs/experiments/qemu-at-a-higher-host-priority.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "memory", + "order": 70, + "date": "2026-11-21", + "change": "QEMU at a higher host priority (cgroup `cpu.weight`, nice, a real-time class) on an idle host", + "result": "ceiling: QEMU's threads wait 0.2/1.1 ms for a CPU from its exec to the cold first login and 0.1/0.2 to the restored one, the guest's steal 0. Priority can win back only that wait. On a busy host it is a lead for spin (\"Open experiments\")", + "shape": "spin", + "source": "lab 44925573288, `run-delay`", + "runs": [ + 44925573288 + ] +} diff --git a/docs/experiments/qemu-copies-the-kernels-elf-segments.json b/docs/experiments/qemu-copies-the-kernels-elf-segments.json new file mode 100644 index 00000000..1ae2ba05 --- /dev/null +++ b/docs/experiments/qemu-copies-the-kernels-elf-segments.json @@ -0,0 +1,14 @@ +{ + "decision": "rejected", + "section": "firmware", + "order": 90, + "date": "2026-11-19", + "change": "QEMU copies the kernel's ELF segments on threads", + "result": "laptop QEMU start 30.9 → 21.6; nested it adds nothing", + "shape": "ladder", + "source": "labs 44580080420, 44581350077, #290", + "runs": [ + 44580080420, + 44581350077 + ] +} diff --git a/docs/experiments/qmp-over-vsock-seqpacket-ivshmem-virtio.json b/docs/experiments/qmp-over-vsock-seqpacket-ivshmem-virtio.json new file mode 100644 index 00000000..26ea734f --- /dev/null +++ b/docs/experiments/qmp-over-vsock-seqpacket-ivshmem-virtio.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "qmp", + "order": 60, + "date": "2026-11-21", + "change": "QMP over vsock, SEQPACKET, ivshmem, virtio-serial, gRPC or protobuf framing", + "result": "QMP does not ride vsock: it is a Unix socket between the host and QEMU. vsock carries the login, and a login is 10 round trips of 47.8 µs (57.5 through the forwarder), 0.6 ms of a 32.8 ms warm login. Every vsock change shares that ceiling", + "shape": "spin", + "source": "the same" +} diff --git a/docs/experiments/quiet-loglevel-3-panic-1-net.json b/docs/experiments/quiet-loglevel-3-panic-1-net.json new file mode 100644 index 00000000..59e844db --- /dev/null +++ b/docs/experiments/quiet-loglevel-3-panic-1-net.json @@ -0,0 +1,9 @@ +{ + "decision": "carried", + "order": 270, + "change": "`quiet`, `loglevel=3`, `panic=1`, `net.ifnames=0`, `biosdevname=0`, cgroup v2, `memhp_default_state`", + "where": "machine/cmdline.go", + "result": "console, function", + "evidence": "-", + "source": "-" +} diff --git a/docs/experiments/remove-virtio-rng.json b/docs/experiments/remove-virtio-rng.json new file mode 100644 index 00000000..23ed03ec --- /dev/null +++ b/docs/experiments/remove-virtio-rng.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "firmware", + "order": 80, + "date": "2026-11-12", + "change": "Remove virtio-rng", + "result": "−13.6 ms to the console prompt, never on a goal number; what seeds the RNG without it is open (\"Open questions\")", + "shape": "ladder", + "source": "lab 43321809471", + "runs": [ + 43321809471 + ] +} diff --git a/docs/experiments/rootfstype-ext4.json b/docs/experiments/rootfstype-ext4.json new file mode 100644 index 00000000..e36d179c --- /dev/null +++ b/docs/experiments/rootfstype-ext4.json @@ -0,0 +1,9 @@ +{ + "decision": "carried", + "order": 260, + "change": "`rootfstype=ext4`", + "where": "machine/cmdline.go", + "result": "lead (11-19)", + "evidence": "laptop", + "source": "-" +} diff --git a/docs/experiments/roots-manager-cut-to-what-a.json b/docs/experiments/roots-manager-cut-to-what-a.json new file mode 100644 index 00000000..bc7d420d --- /dev/null +++ b/docs/experiments/roots-manager-cut-to-what-a.json @@ -0,0 +1,14 @@ +{ + "decision": "rejected", + "section": "login", + "order": 130, + "date": "2026-11-22", + "change": "Root's manager cut to what a workspace could do without, a bound: both user generators, the PAM stack down to `pam_permit` and `pam_systemd`, `ssh-agent.socket` and `systemd-ask-password.socket` masked. Without the environment.d generator user services lose the bus's address (`10-user-sockets.conf`) and `/etc/environment`; without `pam_unix`, `pam_limits` and `pam_loginuid` the manager skips the account check, the limits and the audit login uid", + "result": "first login −9.6 [−13.3, −6.7] against v20261122.06, the ledger's ~10 ms of CPU for the same cuts. The XDG generator alone was carried; the rest is function", + "shape": "spin", + "source": "labs 45070150688, 45070208762", + "runs": [ + 45070150688, + 45070208762 + ] +} diff --git a/docs/experiments/scsi-mod-scan-manual.json b/docs/experiments/scsi-mod-scan-manual.json new file mode 100644 index 00000000..9c254321 --- /dev/null +++ b/docs/experiments/scsi-mod-scan-manual.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "kernel", + "order": 160, + "date": "2026-11-19", + "change": "`scsi_mod.scan=manual`", + "result": "kernel −9.3, but since Linux 5.10 a disk added at run time, at boot, or under `-S` never appears, silently. `max_target` took its place", + "shape": "spin", + "source": "lab 44570773103; `drivers/scsi/virtio_scsi.c`, `scsi_scan.c`", + "runs": [ + 44570773103 + ] +} diff --git a/docs/experiments/selinux-off-pcre2-on.json b/docs/experiments/selinux-off-pcre2-on.json new file mode 100644 index 00000000..65520ed6 --- /dev/null +++ b/docs/experiments/selinux-off-pcre2-on.json @@ -0,0 +1,9 @@ +{ + "decision": "carried", + "order": 310, + "change": "SELinux off, `pcre2` on", + "where": "image/systemd", + "result": "function", + "evidence": "-", + "source": "-" +} diff --git a/docs/experiments/sessions-of-class-user-early-light.json b/docs/experiments/sessions-of-class-user-early-light.json new file mode 100644 index 00000000..fbd33b98 --- /dev/null +++ b/docs/experiments/sessions-of-class-user-early-light.json @@ -0,0 +1,12 @@ +{ + "decision": "carried", + "order": 430, + "change": "Sessions of class `user-early-light`", + "where": "configure-system.sh", + "result": "lane 472 vs 436", + "evidence": "lane, mechanism: a root session would start `user@0`", + "source": "lab 43518044150", + "runs": [ + 43518044150 + ] +} diff --git a/docs/experiments/smaller-answers.json b/docs/experiments/smaller-answers.json new file mode 100644 index 00000000..7b04a57c --- /dev/null +++ b/docs/experiments/smaller-answers.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "qmp", + "order": 50, + "date": "2026-11-21", + "change": "Smaller answers", + "result": "nothing large is on either path: `query-block` runs in 0.12 ms. The record's 125 KB answers left the restore's clock with `Resume(here)`", + "shape": "spin", + "source": "the same" +} diff --git a/docs/experiments/smaller-tcp-hash-tables.json b/docs/experiments/smaller-tcp-hash-tables.json new file mode 100644 index 00000000..bef77355 --- /dev/null +++ b/docs/experiments/smaller-tcp-hash-tables.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "kernel", + "order": 120, + "date": "2026-09-26", + "change": "Smaller TCP hash tables", + "result": "moved nothing", + "shape": "runner", + "source": "`dae6a14`, #48" +} diff --git a/docs/experiments/sntrup761.json b/docs/experiments/sntrup761.json new file mode 100644 index 00000000..a8566b7c --- /dev/null +++ b/docs/experiments/sntrup761.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "login", + "order": 10, + "date": "2026-11-13", + "change": "sntrup761 (OpenSSH's default kex)", + "result": "104 vs 40 ms a login", + "shape": "ladder", + "source": "#245, lab 43479854381", + "runs": [ + 43479854381 + ] +} diff --git a/docs/experiments/spin-machine-restore-reads-the-state.json b/docs/experiments/spin-machine-restore-reads-the-state.json new file mode 100644 index 00000000..04904663 --- /dev/null +++ b/docs/experiments/spin-machine-restore-reads-the-state.json @@ -0,0 +1,12 @@ +{ + "decision": "carried", + "order": 200, + "change": "`spin-machine restore` reads the state ahead before its dial (`machine.ReadAhead`), beside QEMU's start", + "where": "cmd/spin-machine, machine", + "result": "restored −9.3 [−12.2, −7.3] evicted, cached −0.2 [−2.2, +1.5]", + "evidence": "measured, 30 a side", + "source": "lab 44976494418", + "runs": [ + 44976494418 + ] +} diff --git a/docs/experiments/spins-forwarder-without-default-dependencies-after.json b/docs/experiments/spins-forwarder-without-default-dependencies-after.json new file mode 100644 index 00000000..439b6860 --- /dev/null +++ b/docs/experiments/spins-forwarder-without-default-dependencies-after.json @@ -0,0 +1,18 @@ +{ + "decision": "rejected", + "section": "login", + "order": 150, + "date": "2026-11-22", + "change": "spin's forwarder (spin's supervisor) without default dependencies, after `ssh.service` only (`--edit forwarder-early`), on v20261122.06", + "result": "cold +4.2 [+0.0, +11.0], restored −0.0 [−2.3, +2.3], restored into prestarted −4.3 [−7.7, −0.4]: not a gain on either goal number, though the forwarder was active 116-141 ms after PID 1 against 154-176 (bootchart, 3 a side). The login then waits for systemd-logind, active at 162-186 ms in both arms, before `user-runtime-dir@0` (#553). On earlier releases it read cold −60.4 (lab 44987584707); what changed since is not measured", + "shape": "spin", + "source": "labs 45071102677 (`prestart`, 20 a side), 45071549627", + "issues": [ + 553 + ], + "runs": [ + 44987584707, + 45071102677, + 45071549627 + ] +} diff --git a/docs/experiments/ssh-service-without-ubuntus-sshd-t.json b/docs/experiments/ssh-service-without-ubuntus-sshd-t.json new file mode 100644 index 00000000..d6bb4484 --- /dev/null +++ b/docs/experiments/ssh-service-without-ubuntus-sshd-t.json @@ -0,0 +1,12 @@ +{ + "decision": "carried", + "order": 380, + "change": "ssh.service without Ubuntu's `sshd -t` before it starts (`20-no-config-test.conf`); the check stays on reload", + "where": "image drop-in", + "result": "−3.2 [−7.2, −0.8], sshd accepting −2.4 [−6.4, −1.1], 60 boots a side", + "evidence": "measured", + "source": "lab 44977044826", + "runs": [ + 44977044826 + ] +} diff --git a/docs/experiments/ssh-socket-ssh-service-and-sshd.json b/docs/experiments/ssh-socket-ssh-service-and-sshd.json new file mode 100644 index 00000000..1ec808c1 --- /dev/null +++ b/docs/experiments/ssh-socket-ssh-service-and-sshd.json @@ -0,0 +1,13 @@ +{ + "decision": "carried", + "order": 370, + "change": "ssh.socket, ssh.service and sshd-keygen without default dependencies; logind and dbus-broker without PrivateTmp; udev at `StartupCPUWeight=1`", + "where": "image drop-ins", + "result": "−59.4 [−65.9, −56.2] with the probe's forwarder early as well (lab 44805051310, `login-early` and `udev-startup`). In a second run, the image's half alone (`--edit lane`) −17.4 [−25.0, −8.5] and with the forwarder early as well −68.5 [−78.0, −61.8] (lab 44807457606). Each run against its own release, v20261120.03", + "evidence": "measured", + "source": "labs 44805051310, 44807457606", + "runs": [ + 44805051310, + 44807457606 + ] +} diff --git a/docs/experiments/systemd-built-from-ubuntus-source-with.json b/docs/experiments/systemd-built-from-ubuntus-source-with.json new file mode 100644 index 00000000..84222285 --- /dev/null +++ b/docs/experiments/systemd-built-from-ubuntus-source-with.json @@ -0,0 +1,14 @@ +{ + "decision": "carried", + "order": 280, + "change": "systemd built from Ubuntu's source with the `stage1` profile", + "where": "image/systemd", + "result": "first login −47, −38, −47: no BPF verifier in PID 1", + "evidence": "ladder", + "source": "labs 44531842773, 44537549305, 44538877783", + "runs": [ + 44531842773, + 44537549305, + 44538877783 + ] +} diff --git a/docs/experiments/systemd-oomd.json b/docs/experiments/systemd-oomd.json new file mode 100644 index 00000000..5cc968e5 --- /dev/null +++ b/docs/experiments/systemd-oomd.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "image", + "order": 80, + "date": "2026-09-28", + "change": "systemd-oomd", + "result": "the kernel always beat it", + "shape": "runner", + "source": "`337c08d`" +} diff --git a/docs/experiments/systemd-timesyncd.json b/docs/experiments/systemd-timesyncd.json new file mode 100644 index 00000000..724bda2b --- /dev/null +++ b/docs/experiments/systemd-timesyncd.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "image", + "order": 40, + "date": "2026-09-10", + "change": "systemd-timesyncd", + "result": "SNTP only, no refclock", + "shape": "-", + "source": "`c7af4d3`" +} diff --git a/docs/experiments/systemd-user-sessions-without-its-execstart.json b/docs/experiments/systemd-user-sessions-without-its-execstart.json new file mode 100644 index 00000000..8ccdbb84 --- /dev/null +++ b/docs/experiments/systemd-user-sessions-without-its-execstart.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "image", + "order": 240, + "date": "2026-11-22", + "change": "`systemd-user-sessions` without its ExecStart (it removes a /run/nologin the image never writes), its ExecStop kept", + "result": "−0.6 [−5.2, +1.5] at 60 boots", + "shape": "spin", + "source": "the same" +} diff --git a/docs/experiments/systemd-with-db-lto-true.json b/docs/experiments/systemd-with-db-lto-true.json new file mode 100644 index 00000000..3d06c998 --- /dev/null +++ b/docs/experiments/systemd-with-db-lto-true.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "image", + "order": 180, + "date": "2026-11-19", + "change": "systemd with `-Db_lto=true`", + "result": "Ubuntu already passes `-flto=auto`: the same packages", + "shape": "-", + "source": "image/systemd/Dockerfile" +} diff --git a/docs/experiments/systemds-drop-in-candidate-names-derived.json b/docs/experiments/systemds-drop-in-candidate-names-derived.json new file mode 100644 index 00000000..3b1f4ff4 --- /dev/null +++ b/docs/experiments/systemds-drop-in-candidate-names-derived.json @@ -0,0 +1,13 @@ +{ + "decision": "carried", + "order": 290, + "change": "systemd's drop-in candidate names derived once per unit, not once per lookup directory: upstream #42858 (v262), backported to 259", + "where": "image/systemd/0001-dropin-derive-candidate-names-once.patch", + "result": "first login −6.5 [−9.9, −1.3], 100 a side against systemd rebuilt without it; PID 1's CPU before the login 56.0 → 52.4, p50 of 5 ledgers. Prior art: Eric Curtin's PR, `manager_enumerate()` 45.35 → 38.81 ms (50 runs, ~270 units, a container); Yocto's backport to 259.5", + "evidence": "measured", + "source": "labs 45090299768, 45090326943", + "runs": [ + 45090299768, + 45090326943 + ] +} diff --git a/docs/experiments/systemds-tools-linked-static.json b/docs/experiments/systemds-tools-linked-static.json new file mode 100644 index 00000000..398d0558 --- /dev/null +++ b/docs/experiments/systemds-tools-linked-static.json @@ -0,0 +1,9 @@ +{ + "decision": "carried", + "order": 300, + "change": "systemd's tools linked static", + "where": "image/systemd", + "result": "−10 and −1, inside the noise", + "evidence": "ladder", + "source": "the same" +} diff --git a/docs/experiments/term-dumb.json b/docs/experiments/term-dumb.json new file mode 100644 index 00000000..0a102146 --- /dev/null +++ b/docs/experiments/term-dumb.json @@ -0,0 +1,9 @@ +{ + "decision": "carried", + "order": 250, + "change": "`TERM=dumb`", + "where": "machine/cmdline.go", + "result": "687 → 19 ms to systemd's first line (09-10), while systemd queries the console", + "evidence": "laptop, mechanism", + "source": "`b5f361f`" +} diff --git a/docs/experiments/the-boots-default-target-holds-only.json b/docs/experiments/the-boots-default-target-holds-only.json new file mode 100644 index 00000000..8f10c8de --- /dev/null +++ b/docs/experiments/the-boots-default-target-holds-only.json @@ -0,0 +1,13 @@ +{ + "decision": "carried", + "order": 400, + "change": "The boot's default target holds only what the first login needs (`spin-machine-login.target`), and `multi-user.target` starts once its units are up (`spin-machine-boot-rest.service`, `Type=idle`)", + "where": "image, docs/image.md \"The first login's target\"", + "result": "first login −21.5 [−26.4, −15.5], sshd accepting −10.0 [−16.2, −3.7], accept to login −10.7 [−12.9, −8.2], second login +0.0 [−0.8, +0.6]; restored +1.1 [−6.0, +5.2] evicted, +2.2 [−10.6, +12.9] cached. The console prompt +15.5 [+11.5, +19.0], since the getty now follows the login: nothing a workspace does waits for it. With spin's supervisor off `basic.target` (spin-stack/spin#1653) the first login −45.3 [−50.2, −39.4] but the second +43.7 [+41.1, +46.1]", + "evidence": "measured, v20261123.02, 40 a side", + "source": "labs 45098372930, 45098372897", + "runs": [ + 45098372897, + 45098372930 + ] +} diff --git a/docs/experiments/the-bzimage-beside-the-vmlinux-kernel.json b/docs/experiments/the-bzimage-beside-the-vmlinux-kernel.json new file mode 100644 index 00000000..0e5f98d5 --- /dev/null +++ b/docs/experiments/the-bzimage-beside-the-vmlinux-kernel.json @@ -0,0 +1,17 @@ +{ + "decision": "rejected", + "section": "kernel", + "order": 220, + "date": "2026-11-23", + "change": "The bzImage beside the vmlinux, `KERNEL_LZ4` (its compression) and kernel 0018 (its decompressor reading `.data.reloc`), shipped since 11-19", + "result": "no release booted the bzImage after #645: spin's place.go was its last reader (spin-stack/spin#1689). Deleted: the build makes vmlinux alone, and a release from #660 on has no `kernel/bzImage`. The boot path is unchanged: first login −4.3 [−14.4, +7.4] at 20 a side, within noise, sshd accepting −5.3 [−11.1, +7.0], QEMU's RSS −1.7 MiB (the arm's kernel is also 7.3.6, main's, against .07's 7.3.5)", + "shape": "spin", + "source": "#660, lab 45262046768", + "issues": [ + 645, + 660 + ], + "runs": [ + 45262046768 + ] +} diff --git a/docs/experiments/the-bzimages-decompression-made-cheaper-in.json b/docs/experiments/the-bzimages-decompression-made-cheaper-in.json new file mode 100644 index 00000000..2d6587a1 --- /dev/null +++ b/docs/experiments/the-bzimages-decompression-made-cheaper-in.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "kernel", + "order": 210, + "date": "2026-11-20", + "change": "The bzImage's decompression made cheaper, in general", + "result": "~21 ms before the kernel's clock with the bzImage against PVH; most of it is the copy and relocation KASLR needs, and KASLR stays. No candidate left", + "shape": "spin", + "source": "lab 44787491631", + "runs": [ + 44787491631 + ] +} diff --git a/docs/experiments/the-decompressor-without-x86-verbose-bootup.json b/docs/experiments/the-decompressor-without-x86-verbose-bootup.json new file mode 100644 index 00000000..f7ea62f8 --- /dev/null +++ b/docs/experiments/the-decompressor-without-x86-verbose-bootup.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "kernel", + "order": 180, + "date": "2026-11-20", + "change": "The decompressor without `X86_VERBOSE_BOOTUP`", + "result": "to the kernel's clock 35.1 → 32.4 ms, under the 3 ms set before the run", + "shape": "spin", + "source": "#328, lab 44787878809", + "runs": [ + 44787878809 + ] +} diff --git a/docs/experiments/the-guests-clean-page-cache-dropped.json b/docs/experiments/the-guests-clean-page-cache-dropped.json new file mode 100644 index 00000000..1c1d674c --- /dev/null +++ b/docs/experiments/the-guests-clean-page-cache-dropped.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "restore", + "order": 100, + "date": "2026-11-23", + "change": "The guest's clean page cache dropped right before its save (`sync; echo 1 > /proc/sys/vm/drop_caches`), #276's last idea", + "result": "the state did not shrink: 183 MiB with the drop, saved at once −0.1 [−0.4, +0.3] and 3 s later −0.0 [−0.3, +0.4]. The restored login was worse, +4.7 [+3.5, +7.3] evicted at once and +5.6 [+4.6, +7.6] 3 s later, as the login read again from the guest's disk what the drop took from its cache", + "shape": "spin", + "source": "lab 45110967817", + "runs": [ + 45110967817 + ] +} diff --git a/docs/experiments/the-managers-timeouts-at-15-s.json b/docs/experiments/the-managers-timeouts-at-15-s.json new file mode 100644 index 00000000..98072e26 --- /dev/null +++ b/docs/experiments/the-managers-timeouts-at-15-s.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "image", + "order": 320, + "date": "2026-11-22", + "change": "The manager's timeouts at 15 s and 10 s, the watchdogs off (`fast-boot.conf`); reverted to systemd's defaults", + "result": "taking it back +0.3 [−5.2, +3.3] cold, restored in noise", + "shape": "spin", + "source": "lab 45034963004", + "runs": [ + 45034963004 + ] +} diff --git a/docs/experiments/the-no-systemd-floor-each-release.json b/docs/experiments/the-no-systemd-floor-each-release.json new file mode 100644 index 00000000..0331ffab --- /dev/null +++ b/docs/experiments/the-no-systemd-floor-each-release.json @@ -0,0 +1,14 @@ +{ + "decision": "open", + "order": 50, + "change": "The no-systemd floor, each release", + "number": "a bound", + "phase": "how much of the cold number is systemd's to give back: 445 → 240 in spin's shape", + "decided_by": "`ssh-first` on the release with `--edit floor --append init=/usr/local/sbin/spin-floor` and `login=lane`; `releases measure` does it beside every release, and report.yml records it (docs/releases.md, \"Bounds\")", + "state": "last measured 11-22 on v20261122.02: the lane's first login 407 → 241, −166.3 [−174.7, −160.3] (report.yml run 45018301368, 20 boots). On v20261122.01: 404 → 250, −153.9 [−162.5, −151.2], sshd accepting 242 → 197 (lab 44978079694, 20 boots). 11-20: 445 → 240 (lab 44750322384)", + "runs": [ + 44750322384, + 44978079694, + 45018301368 + ] +} diff --git a/docs/experiments/the-pressure-probes-sender-started-with.json b/docs/experiments/the-pressure-probes-sender-started-with.json new file mode 100644 index 00000000..29a3cfe2 --- /dev/null +++ b/docs/experiments/the-pressure-probes-sender-started-with.json @@ -0,0 +1,20 @@ +{ + "decision": "carried", + "order": 560, + "change": "The pressure probe's sender, started with `multi-user.target` by the boot's rest, at the lowest priority", + "where": "spin-machine-pressure.service", + "result": "function (docs/machine.md, \"Pressure\"); from the boot's rest in place of a timer 10 s after the boot: first login −0.8 [−7.8, +4.8], restored −0.8 [−2.9, +2.1] evicted, 20 a side; it starts at 0.37-0.38 s, after the login. Before #581, after multi-user.target beside the first login, sshd accepting to login +2.6 to +3.3 in three runs", + "evidence": "measured", + "source": "labs 45120950183, 45120950314, 45120692382; 44921602512, 44924252325, 44924755505", + "prs": [ + 581 + ], + "runs": [ + 44921602512, + 44924252325, + 44924755505, + 45120692382, + 45120950183, + 45120950314 + ] +} diff --git a/docs/experiments/the-read-ahead-asked-for-by.json b/docs/experiments/the-read-ahead-asked-for-by.json new file mode 100644 index 00000000..667457f8 --- /dev/null +++ b/docs/experiments/the-read-ahead-asked-for-by.json @@ -0,0 +1,12 @@ +{ + "decision": "carried", + "order": 210, + "change": "The read-ahead asked for by four goroutines, each every fourth 128 KiB piece", + "where": "machine", + "result": "restored −6.2 [−9.1, −4.3] evicted against one goroutine, cached −0.5 [−1.6, +1.9]", + "evidence": "measured, 30 a side", + "source": "lab 44976924478", + "runs": [ + 44976924478 + ] +} diff --git a/docs/experiments/the-restore-with-more-than-2.json b/docs/experiments/the-restore-with-more-than-2.json new file mode 100644 index 00000000..0a14b5c3 --- /dev/null +++ b/docs/experiments/the-restore-with-more-than-2.json @@ -0,0 +1,12 @@ +{ + "decision": "open", + "order": 70, + "change": "The restore with more than 2 GiB of RAM", + "number": "restore", + "phase": "unmeasured (#242's checklist)", + "decided_by": "`restore-first` with `plugged` above 2048", + "state": "open", + "prs": [ + 242 + ] +} diff --git a/docs/experiments/the-resume-reads-the-state-ahead.json b/docs/experiments/the-resume-reads-the-state-ahead.json new file mode 100644 index 00000000..4a2fd750 --- /dev/null +++ b/docs/experiments/the-resume-reads-the-state-ahead.json @@ -0,0 +1,12 @@ +{ + "decision": "carried", + "order": 190, + "change": "The resume reads the state ahead", + "where": "machine", + "result": "restored into a QEMU started ahead −12.9 [−14.7, −9.8]", + "evidence": "measured", + "source": "lab 44809512339", + "runs": [ + 44809512339 + ] +} diff --git a/docs/experiments/the-serial-getty-at-startupcpuweight-1.json b/docs/experiments/the-serial-getty-at-startupcpuweight-1.json new file mode 100644 index 00000000..945136f6 --- /dev/null +++ b/docs/experiments/the-serial-getty-at-startupcpuweight-1.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "image", + "order": 110, + "date": "2026-11-22", + "change": "The serial getty at `StartupCPUWeight=1`, out of the first login's way", + "result": "+2.7 [−4.3, +7.9] at 60 boots", + "shape": "spin", + "source": "lab 44977226981", + "runs": [ + 44977226981 + ] +} diff --git a/docs/experiments/the-state-read-ahead-during-a.json b/docs/experiments/the-state-read-ahead-during-a.json new file mode 100644 index 00000000..bebfd19a --- /dev/null +++ b/docs/experiments/the-state-read-ahead-during-a.json @@ -0,0 +1,14 @@ +{ + "decision": "rejected", + "section": "restore", + "order": 40, + "date": "2026-11-22", + "change": "The state read ahead during a fast load", + "result": "at 179 MiB the login −168 ms, still +234 over a full load; at 3.7 GiB within noise, p95 713 against 490", + "shape": "spin, touched", + "source": "labs 45035029887, 45035048486", + "runs": [ + 45035029887, + 45035048486 + ] +} diff --git a/docs/experiments/the-user-managers-pam-stack-down.json b/docs/experiments/the-user-managers-pam-stack-down.json new file mode 100644 index 00000000..ccb92e08 --- /dev/null +++ b/docs/experiments/the-user-managers-pam-stack-down.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "login", + "order": 110, + "date": "2026-11-22", + "change": "The user manager's PAM stack down to `pam_permit` and `pam_systemd`, a bound", + "result": "first login −3.5 [−11.4, +2.5] against class `user-early`", + "shape": "spin", + "source": "lab 45030778365", + "runs": [ + 45030778365 + ] +} diff --git a/docs/experiments/the-user-managers-sockets-environment-from.json b/docs/experiments/the-user-managers-sockets-environment-from.json new file mode 100644 index 00000000..c3fac9c9 --- /dev/null +++ b/docs/experiments/the-user-managers-sockets-environment-from.json @@ -0,0 +1,13 @@ +{ + "decision": "carried", + "order": 450, + "change": "The user manager's sockets' environment from `environment.d/10-user-sockets.conf`, not two `systemctl --user set-environment`", + "where": "image", + "result": "with the row above: first login +19.6 [+15.9, +25.6] without it (lab 45031644179); with class `user-early` alone, −17.1 [−27.0, −10.7] (lab 45030778365)", + "evidence": "measured", + "source": "labs 45031644179, 45030778365", + "runs": [ + 45030778365, + 45031644179 + ] +} diff --git a/docs/experiments/the-vsock-socket-and-sshd-without.json b/docs/experiments/the-vsock-socket-and-sshd-without.json new file mode 100644 index 00000000..a0965347 --- /dev/null +++ b/docs/experiments/the-vsock-socket-and-sshd-without.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "login", + "order": 20, + "date": "2026-11-13", + "change": "The vsock socket and sshd@ without default dependencies", + "result": "no sooner; dropped 7 of 22 first connections. Carried since with the lane's other drop-ins (`sshd-vsock.socket.d`, `sshd@.service.d`), which the lane kept together (lab 43518915618)", + "shape": "laptop", + "source": "`c3c0fd1`", + "runs": [ + 43518915618 + ] +} diff --git a/docs/experiments/timedated-firstboot-machine-id-commit-masked.json b/docs/experiments/timedated-firstboot-machine-id-commit-masked.json new file mode 100644 index 00000000..51bee4ba --- /dev/null +++ b/docs/experiments/timedated-firstboot-machine-id-commit-masked.json @@ -0,0 +1,9 @@ +{ + "decision": "carried", + "order": 540, + "change": "timedated, firstboot, machine-id-commit masked", + "where": "optimize-systemd.sh", + "result": "function: time from the host, no first-boot prompt, no identity", + "evidence": "-", + "source": "-" +} diff --git a/docs/experiments/trim-the-8250-driver.json b/docs/experiments/trim-the-8250-driver.json new file mode 100644 index 00000000..6145922b --- /dev/null +++ b/docs/experiments/trim-the-8250-driver.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "kernel", + "order": 10, + "date": "2026-09-10", + "change": "Trim the 8250 driver", + "result": "154 µs", + "shape": "runner", + "source": "`c03ed89`" +} diff --git a/docs/experiments/udevd-and-its-coldplug-not-before.json b/docs/experiments/udevd-and-its-coldplug-not-before.json new file mode 100644 index 00000000..db3e880b --- /dev/null +++ b/docs/experiments/udevd-and-its-coldplug-not-before.json @@ -0,0 +1,13 @@ +{ + "decision": "carried", + "order": 390, + "change": "udevd and its coldplug not before sysinit.target (copies of the units without that line), so basic.target does not wait for udevd's start at the lowest weight", + "where": "configure-system.sh", + "result": "cold −48.6 [−51.7, −42.6], restored −2.0 [−8.0, +4.7] p95 114 against 114, cached p95 126 against 128, with QEMU 0005, 30 a side; prestart cold −44.7 [−53.4, −39.4], restored into prestarted −1.3 [−4.1, +3.6] p95 98.8 against 101. Without 0005 the restored p95 is 539-548", + "evidence": "measured", + "source": "labs 44987412171, 44987412210", + "runs": [ + 44987412171, + 44987412210 + ] +} diff --git a/docs/experiments/udevs-coldplug-filtered-cpu-kept-for.json b/docs/experiments/udevs-coldplug-filtered-cpu-kept-for.json new file mode 100644 index 00000000..b3172ac5 --- /dev/null +++ b/docs/experiments/udevs-coldplug-filtered-cpu-kept-for.json @@ -0,0 +1,15 @@ +{ + "decision": "carried", + "order": 360, + "change": "udev's coldplug filtered (`10-coldplug.conf`), `cpu` kept for hot-added cores", + "where": "image", + "result": "cold +14.9 [+8.2, +19.8]; restored +463.7, which was not the coldplug but QEMU's TSC, a guest saved with its tick running (#452, QEMU 0005)", + "evidence": "group C-coldplug", + "source": "lab 44818953987", + "issues": [ + 452 + ], + "runs": [ + 44818953987 + ] +} diff --git a/docs/experiments/usb-off-vmport-off-smm-off.json b/docs/experiments/usb-off-vmport-off-smm-off.json new file mode 100644 index 00000000..892000fa --- /dev/null +++ b/docs/experiments/usb-off-vmport-off-smm-off.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "firmware", + "order": 10, + "date": "2026-09-08", + "change": "`usb=off`, `vmport=off`, `smm=off`, `i8042=off`", + "result": "63.0/62.6/62.3/62.5 vs 62.9 ms", + "shape": "laptop", + "source": "`fa1803f`" +} diff --git a/docs/experiments/user-s-after-systemd-user-sessions.json b/docs/experiments/user-s-after-systemd-user-sessions.json new file mode 100644 index 00000000..0d9c9f72 --- /dev/null +++ b/docs/experiments/user-s-after-systemd-user-sessions.json @@ -0,0 +1,13 @@ +{ + "decision": "rejected", + "section": "login", + "order": 120, + "date": "2026-11-22", + "change": "`user@`'s `After=systemd-user-sessions.service` (Ubuntu's `10-login-barrier.conf`) shadowed, for a login as spin", + "result": "lane +30.6 against +29.7 without it: the barrier is not what the lane waits for", + "shape": "lane", + "source": "lab 45031687433", + "runs": [ + 45031687433 + ] +} diff --git a/docs/experiments/vmlinux-btf-parsed-on-first-use.json b/docs/experiments/vmlinux-btf-parsed-on-first-use.json new file mode 100644 index 00000000..9b2d248f --- /dev/null +++ b/docs/experiments/vmlinux-btf-parsed-on-first-use.json @@ -0,0 +1,14 @@ +{ + "decision": "rejected", + "section": "kernel", + "order": 260, + "date": "2026-11-22", + "change": "vmlinux BTF parsed on first use, not at the first kfunc registration (a kernel patch on branch `exp/btf-first-use`)", + "result": "kernel to \"Freeing\" −7.2 [−8.6, −6.2], inet_init 6.85 → 0.14 ms (lab 44982285400, 10 boots), but the first login −1.5 [−3.1, +1.6] at 60 boots (lab 44982285406): journald's `DeviceAllow=` and `IPAddressDeny=` load cgroup BPF programs at its start, and `bpf_check()` parses the BTF there, before the login. A verifier that asks for BTF only when a program needs it is the next step", + "shape": "spin", + "source": "labs 44982285400, 44982285406", + "runs": [ + 44982285400, + 44982285406 + ] +} diff --git a/docs/experiments/vt-n-x86-msr-n-x86.json b/docs/experiments/vt-n-x86-msr-n-x86.json new file mode 100644 index 00000000..86810aaa --- /dev/null +++ b/docs/experiments/vt-n-x86-msr-n-x86.json @@ -0,0 +1,9 @@ +{ + "decision": "carried", + "order": 50, + "change": "`VT=n`, `X86_MSR=n`, `X86_CPUID=n`", + "where": "kernel/config-7.3-x86_64", + "result": "function: dead code, less surface", + "evidence": "-", + "source": "kernel/Dockerfile" +} diff --git a/docs/experiments/what-functional-items-cost-last-measured.json b/docs/experiments/what-functional-items-cost-last-measured.json new file mode 100644 index 00000000..12244591 --- /dev/null +++ b/docs/experiments/what-functional-items-cost-last-measured.json @@ -0,0 +1,9 @@ +{ + "decision": "open", + "order": 40, + "change": "What functional items cost, last measured on another machine: BPF JIT and BTF (+21.4 ms to \"Freeing\", 09-07, a vmlinux through PVH, before the ftrace patches), lockdown at confidentiality (nothing told from noise, 10-01, a host at load 6-10)", + "number": "cold", + "phase": "a few ms each, unknown in spin's shape", + "decided_by": "`ssh-first` with a `--kernel` built without each, 20 boots", + "state": "open. They stay for function, so a number says what they cost and decides nothing" +} diff --git a/docs/experiments/zram.json b/docs/experiments/zram.json new file mode 100644 index 00000000..764b821a --- /dev/null +++ b/docs/experiments/zram.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "kernel", + "order": 130, + "date": "2026-09-28", + "change": "ZRAM", + "result": "the runaway killed later (20 vs 14 s), worst login 3.8 s", + "shape": "runner", + "source": "kernel/Dockerfile, `430d2b3`" +} diff --git a/docs/image.md b/docs/image.md index 53b6a724..78f27ccb 100644 --- a/docs/image.md +++ b/docs/image.md @@ -527,7 +527,7 @@ and `basic.target`; each of these drop-ins keeps `Conflicts=shutdown.target` and | `/etc/systemd/network/99-default.link.d/traditional-naming.conf` | configuration | Interfaces keep the kernel's names (`eth0`), which is what `net.ifnames=0` on the command line also asks for. | function | Nothing. | | `/etc/locale.conf`, `/etc/default/locale` | configuration | `LANG=en_US.UTF-8`, and that locale generated at build time. | function; `boot:workspace` checks it sets without a warning | Other locales must be generated with `locale-gen`. | | `tmp.mount.d/10-size.conf` | configuration | `/tmp` is a tmpfs capped at 25% of memory. It is in RAM, so a workspace that fills it takes memory, and a cap keeps one runaway from taking all of it. | function | `/tmp` larger than a quarter of memory. | -| `lru-gen.conf` | configuration | MGLRU's `min_ttl_ms=1000`, so the kernel's OOM killer acts before a guest thrashes. | measured, memory (`47aa681`; docs/log.md, 09-28) | Nothing. | +| `lru-gen.conf` | configuration | MGLRU's `min_ttl_ms=1000`, so the kernel's OOM killer acts before a guest thrashes. | measured, memory (`47aa681`; docs/log/2026-09-28-f7cd1ab-47aa681-337c08d.md) | Nothing. | | `/etc/udev/rules.d/40-spin-hotadd.rules` | added | A hot-plugged CPU comes online. Without it, a core attached to a running workspace stays offline. | function; `boot:hotadd`, `boot:cpu-plug` | Nothing. | | `spin-machine-pressure.service`, `multi-user.target.wants/spin-machine-pressure.service` | added, deferred | The pressure probe's sender, started with `multi-user.target`, which the boot's rest starts after the first login's units (#581), at idle priority. | measured: neither number moved (labs 45120950183, 45120950314) | Deferred: the host gets no pressure reports for the boot's first ~0.3-0.4 s, which end before the first login. | diff --git a/docs/log.md b/docs/log.md deleted file mode 100644 index 4299085c..00000000 --- a/docs/log.md +++ /dev/null @@ -1,815 +0,0 @@ -# Log: what was done, why, and what it measured - -First built on 2026-11-13 from `git log origin/main` (327 commits, to `3e8075f`), the 150 pull requests of that day (merged, closed and open), the 44 releases' notes, the tree at `origin/main` (comments, `docs/`, `boot/*_test.go` row comments), and spin-stack/spin#1206 and spin-stack/open-remote-ssh#8. Hashes are short commit ids on `origin/main`; `#N` is a pull request here; "lab N" is a `lab.yml` run id as the tree or a PR quotes it. Dates are UTC, as the bench fleet and spin keep them. A commit made in UTC−3 can carry the day before. Nothing here was re-measured. Every change that decides something since adds its entry. - -Where boot time stands, what each phase costs, how a number is measured, and the tables of what was kept, measured and rejected, and is next are `docs/boot-time.md`. This log is the chronology. - ---- - -## 1. Chronological log - -Format: **date · area · refs**, then what was done, why, the result and its status. - -### Week 1: 2026-09-07 to 09-13 - -**09-07 · all · `2afac47`, `219b98a`.** The repository is created from spinbox's and storage's QEMU, kernel and image (image ported to mkosi, ext4 in a read-only qcow2). qemu-nbd dropped, Taskfile split per part, `task shell` added. *Why:* they were one machine, duplicated across repositories. *Result:* "boots as one machine … in 151 ms" (`2afac47`, consumer's initrd). *Status:* in place. - -**09-07 · machine/fingerprint · `5e7d60e`, `b476f6d`, `57e827a`, `b882171`, `17d844f`, `02709d7`.** `machine/` defines the slot map, the shape and the cmdline. `Fingerprint` hashes QEMU, the kernel and the initrd by content, plus the shape. Same day: -- the device topology goes into the hash (`b476f6d`); -- the host CPU goes back in under `-cpu host` (`57e827a`); -- the topology is corrected to leave out disks and NICs (`b882171`: templates have neither); -- the encoding is made length-prefixed (`17d844f`); -- an identity split is added for memoising (`02709d7`). - -*Status:* superseded. See the fingerprint cycle in §2. - -**09-07 · machine · `656d55b` → `b882171`.** `spin-machine save` and `boot --incoming file:` are added, then reverted the same day as "lifecycle" that belongs to the consumer. Kept: `Spec.CPU` with `enforce=on`. Measured: a state saved with Broadwell-v4 resumes on Broadwell-v4 and Skylake-Client-v4, and Nehalem refuses (`656d55b`, now in `docs/migration.md`). *Status:* save/restore came back as checkpoint commands (`c202568`, 09-28; kept after #51). - -**09-07 · tooling · `5e7d60e`, `8aee03a`, `24c8a06`.** `cmd/spin-machine-init` is a debug initramfs, and `spin-machine-console.service` is shipped but not enabled. *Why:* systemd gave no serial login, because the image masked udev, so `dev-ttyS0.device` never appeared. *Status:* the init was deleted `8eeb01c` (09-10) and the console unit deleted `3a7864d` (11-12). See §2. - -**09-07 · qemu · `31a57e7`.** QEMU is linked statically against musl. *Measured:* process start to QMP quit, 44 ms glibc vs 43 ms musl over 5 runs. Not measured: a long-running guest under load (musl allocator, thread stack). *Status:* in place; the load question is still open. - -**09-07 · image/kernel · `2df3dbf`.** Changes: -- root password removed; -- SSH host keys generated per boot (unit hung off ssh.service); -- chrony via `/dev/ptp0`; -- BPF_JIT and BTF on, at +21.4 ms of kernel boot and 5.0 MB (5 runs each way; also `kernel/README.md`); -- `-no-reboot`. - -BPF_LSM was left off. *Status:* BPF on and in place; chrony removed 09-10; BPF_LSM turned on 10-01 (`1400f6a`); the keys moved 3 more times (§2). - -**09-07 · qemu/machine · `8b7391a`.** aio=io_uring, discard=unmap, vhost=on requested, qom_cast_debug off. *Rejected:* -- `cache=none`: the shared base must stay in the host page cache, and O_DIRECT fails on tmpfs; -- `--enable-virtfs`; -- four configure flags that do not exist in 11.1.1. - -*Status:* in place. - -**09-07 · machine/kernel · `b476f6d`, `ee34d31`.** virtio-balloon with free-page-reporting. *Measured:* "costs nothing measurable", 158.9-162.5 ms with vs 157.9-171.6 without, noise ~14 ms. virtio-mem replaces DIMM slots, with `memhp_default_state=online` required: without it a request for 2048 then 3072 MiB plugged 1024 and stopped. Measured 0→2048→3072→512→2 MiB. *Status:* in place. - -**09-07 · machine · `58d404e`.** `tsc=reliable` restored; it had been lost in the move from spinbox. Not measured. In place. - -**09-08 · machine · `fa1803f`.** ICH9 `sata=off`, `smbus=off`. *Measured:* 400 boots per variant, kernel to init: 62.3 baseline, 61.3 sata=off, 61.7 smbus=off, 60.6 both; an earlier 150-boot series agrees. *Measured and rejected:* `usb=off` 63.0 vs 62.9; `vmport=off` 62.6; `smm=off` 62.3; `i8042=off` 62.5. *Status:* in place. - -**09-08 · CI · `fe332b4` (#4).** `task verify:args` starts 9 Specs under the TCG binary with `-S` and requires a QMP answer. *Why:* nothing checked that QEMU accepts the command line. In place (it became `TestQEMUAcceptsEveryArgument`). - -**09-09 · kernel cmdline · `9ca453a`.** `nohz=off` removed. *Measured:* a forced tick is 1.7% of a core per idle vCPU. Boot 821-853 ms vs 843-846; restore 113-221 vs 124-216 (template era). In place. - -**09-09 · machine · `76aacf9`, `7cafdf6`, `6599829`, `2b46d78`, `354c8a6`.** Changes: -- PCIe root ports for hotplug: no measured change to boot or restore; -- a NIC through a root port via `netdev_add fd=`; -- NIC count and `host_mtu` go into the fingerprint, while MAC and fd stay out; -- a second QMP monitor. - -*Status:* root ports were replaced by virtio-scsi on 09-29 (`2b19096`); NIC hotplug was dropped then; MTU and NIC in the fingerprint were superseded by `Spec.Contract` (`fa3041c`). - -**09-10 · boot probes/image · `4cbd229`, `bab6f16`, `c2c4c6a`, `722d468`, `b5f361f`.** `task boot:matrix` (shell). *Found:* masking udev buys nothing (826 vs 829 ms), and masking it costs a 10 s `dev-ttyS0.device` timeout with no login. udev was unmasked (`722d468`) and `40-spin-hotadd.rules` added for CPU and memory. Two stalls of 334 ms waiting on the console (XTGETTCAP and a terminal reset) are fixed by `TERM=dumb` on the kernel cmdline: 687→19 ms, and the whole boot 855→163-207 ms (`b5f361f`). The harness itself was contaminated: `unmask_udev` had become a no-op, so the first udev rows (826/829) were wrong (`b5f361f`). *Status:* udev on and TERM=dumb in place. The memory half of the hot-add rule was removed 11-12 (`3c8da99`). - -**09-10 · tooling · `8eeb01c`.** Debug initramfs deleted. "this repository does not ship an init". With udev on, the serial getty works: 204 ms to a login prompt. In place. - -**09-10 · boot probes · `80f984b`.** The boot bench is ported to Go and the shell harness deleted. *Found:* -- `systemd.mask=` on the cmdline does nothing (debug-generator masked), so every earlier row that used it measured nothing; -- agetty has an unconditional `sleep(1)`; -- the shell harness throttled the console (it read 1424 ms where the guest said 190); -- a Percentile bug. - -*Measured (15 boots, laptop):* as shipped 1256/1276; without agetty 253/320; 512 MiB 1241/1261; 1 vCPU 1309/1326; udev masked: 15 of 15 boots never reached a login. Superseded by `boot:bench`; `boot:bench` was deleted in #250. - -**09-10 · kernel · `c03ed89`, `1a8e25c`, `a31d7b2`, `f32d527`, `64d2901`, `e285dec`.** A kernel-phase investigation. Results, each recorded in `kernel/Dockerfile`: -- initcall_debug with a console attached measures the console (103.9 vs 42.8 ms); -- the 8250 trim is worth 154 µs; -- a modular kernel buys 0.57 ms and was rejected; -- acpi_bus_scan scales with the vCPU ceiling: maxcpus=16 +5 ms and maxcpus=64 +9 ms of kernel (63.0/68.1/72.1 ms), recorded at `Spec.MaxCPUs`; -- four ACPI cmdline parameters are worth 0 (69.9 vs 68.6); -- ksm_init and kcompactd_init are worth 0; -- `event_trace_enable_again`'s 6 ms is the profiler; -- inet_init's 9 ms is BTF's first parse, not XFRM. - -*Status:* rejected (docs/boot-time.md, "Measured and rejected"). - -**09-10 · image · `6aba37b`, `064c4f4`, `c7bab94`, `c7af4d3`, `08c56e1`.** Changes and measurements: -- logind 63 ms on the chain, worth 24 ms; chrony worth 10 (15 boots, laptop); -- Type=idle on the getty measured at 25 ms (291/344 vs 266/283); -- `disable-udev-settle.rules` deleted as wrong; -- chrony deleted: 248/322 vs 261/288; "a restore is invisible from the inside", and correcting the clock belongs to whoever restores; -- blame figures that summed to ~380 ms out of a 175 ms userspace are kept only as history. - -*Status:* chrony removed and in place. - -**09-10 · qemu · `b151186`.** The device list is turned into an allowlist (`--without-default-devices`): 363→225 instantiable types and a 23.7→8.7 MB binary. MICROVM rejected ("no ACPI CPU hotplug"). Boot unchanged (240/274 vs 245/265, laptop). In place. - -**09-10 · boot probes · `c049a21`, `8eef89d`, `a0efd65`.** QEMU's startup split: 1.4 ms launcher, ~27 ms exec to first instruction, ~7 ms guest to first console byte. The QMP greeting is not a checkpoint: it comes before the board is built, so the real QMP reply is at 18-20 ms, not 8. Cold-start cost is the host zeroing pages (18.8%) plus rom_reset; a restore pays neither (09-26). Not acted on. - -**09-11 · machine · `21a830c`.** `Disk.DirectOverBacking`, with a cache-modes bench of 16 VMs. Writes were inconclusive: the disk was 94% full and times moved tenfold. `mincore` reports every page resident for a file the caller does not own. *Status:* the field is now in `machine/vm.go`; the bench was deleted in #48; `Disk.Cache` was removed in #94. - -**09-11 · image · `ec008b0`.** sshd `TrustedUserCAKeys` (the CA file is written by the consumer). #101 (10-03): without the CA nothing logs in. In place. - -**09-12 · machine · `9177475`.** `Spec.Accel` (tcg). TCG guest to PID 1 in 6.5 s vs 33 ms under KVM. In place. - -**09-12 · image · `bb6bb89` (#5).** logind out of the boot transaction. The first login starts it through the varlink socket and a `/run/systemd/seats` drop-in (`10-seats.conf`). *Measured:* 249/287 vs 273/297, 25 boots, two runs (laptop). `boot:logind` holds sessions. *Status:* **reversed 11-12** (#240). See §2. - -### Week 2: 2026-09-14 to 09-20 - -**09-14 · image · `9335335`, `fe7d4ab`, `891e2f7`, `b5908ee`.** Changes: -- the image is sized in two passes: 974 MiB with 132 free, was 1163 with 317; -- e2fsprogs 1.47.4 is built static and pinned; -- `-m 0` for reserved blocks; -- a 64 MiB journal. - -Bug: `891e2f7` (shipped in v20260914.01) made a 4.08 GiB filesystem, because `-b` read the size as a block count. Fixed in `b5908ee`. In place. - -**09-14 · kernel · `b9d1985`.** A trixie toolchain and a reproducible vmlinux. *Why:* v20260914.01 and .02 had different kernels from the same source. bookworm's pahole 1.24 encoded `.BTF` in parallel, in a non-deterministic order, and the banner carried the build date. Two `--no-cache` builds now give the same vmlinux. Usable 503/575 vs 509/547 with gcc 12 (laptop, 20 boots). In place. - -**09-15 · CI · `c767cd5`.** The BuildKit `type=gha` cache had never stored anything: the runtime token does not reach `run:` steps, and every build shared one scope. Fixed with named scopes. Superseded by the registry cache (`1666cb5`, 11-12). - -**09-18 · machine · `da17b34`, `f023b56`, `5d4a01c`, `4947281`.** A restore opens its template read-only. Disks can be given as a chain of descriptors (`-add-fd`), and so can the console, `/dev/kvm`, vhost-vsock and vhost-net. In place, apart from the template parts. - -**09-20 · CI · `f63aa38` (#10).** Workflows move to Blacksmith. Superseded 10-24 (`f29e59d`). - -### Week 3: 2026-09-21 to 09-27 - -**09-21 · machine · `3d10256`, `56f6fea`.** `FingerprintCache` added. *Status:* removed `2d9b7e3` (09-29), with no caller; the identity split went in `c5baaa7` (10-01). - -**09-24 · machine · `35df9cf`.** No VMX/SVM in the guest. Measured with 3 hot-added cores: vmx=1,0,0,0 plus a warning before, vmx=0 on all after. Fingerprint moved. In place. - -**09-24 · image · `a01c847`.** Host keys made without RSA. RSA was 309 ms in blame in a guest, and on the host 141 ms vs 6 (ECDSA) and 5 (Ed25519). In place. - -**09-26 · image · `f36ae13`.** `/tmp` is a tmpfs again and tmpfiles-setup is unmasked. The imported optimizer had masked both. 223/230 vs 220/232, within noise. In place; `/tmp` was capped at a quarter of memory in `47aa681`. - -**09-26 · machine · `8063bcd`.** discard=unmap on the format node of a chain. Before this, fstrim freed nothing and deleted data stayed readable. Not measured. In place. - -**09-26 · firmware/qboot · `e4f456f` (#12).** The qboot experiment: `write-pointer.patch` (vmgenid needs WRITE_POINTER), built in a pinned container. The compiler moves the number: 6.32 ms saved with GCC 15.2 vs 3.86 with GCC 14.2 (`qemu/qboot/README.md`). Not adopted yet, because firmware was not in the fingerprint. *Status:* adopted 09-29 (`f2f4da0`). - -**09-26 · boot probes · `5221690`, `c6e48de`, `adc52cd`, `e2f6b8f`, `b9707e3`, `7b08e5a`.** Probes added: `boot:initcalls`, `boot:userspace`, `boot:systemd`. Findings: -- p50 98.2 ms kernel to "Freeing", of which 54.5 ms is 680 initcalls; -- udev coldplugs 266 devices, 64 of them `ttyN`; -- `CONFIG_VT=n` was predicted at 5-12 ms and measured at 0 (228/237 vs 228/246); -- 19 udev rule files masked: 0; -- device-count boot parameters: 0; -- the console-unit swap measured 340 ms worse, and the cause was finally found to be a 334 ms XTGETTCAP timeout, fixed with `TERM=dumb` on that unit (221/233 vs 558/572). - -*Status:* findings recorded. The rows were deleted in `3f669ef` and #90. `boot:userspace` and `boot:systemd` were deleted in #250. - -**09-26 · kernel · `dae6a14`, `5a3d509`, `cda04b1`, `9b5f0dd`.** A floor kernel (tinyconfig + PVH): release 97.95 vs floor 52.33 ms, so the config costs 45.6 ms (BTF, ACPI, ftrace). lz4 instead of gzip for an initrd: 6.4 ms. erofs removed (100.46 vs 102.22, noise). KSM and THP off: -0.50 ms, rejected. `CONFIG_VT` off as dead config. The 2.09 ms quoted for it was withdrawn (0.31 ms over 40 boots on an idle host). *Status:* erofs and VT off are in place. The floor probe and `kernel/minimal` were deleted in #48 (09-30). - -**09-26 · image · `9fab3f1`, `ad05544`, `9b5f0dd`.** Unit-file count does not matter: 300 extra units gave 236 vs 246. Unit loading costs 26 ms per `systemd --test`, not the 212 the debug log suggested. Masking the tpm2 and factory-reset generators is worth 1.0 ms of that 26. An empty `/etc/machine-id` skips the preset pass. *Status:* the masks are in place, except the tpm2 generator's, deleted 11-20 (#352). `boot:unitload` was deleted in #88. - -**09-26 · machine · `ab4844c`.** `drop-cache=off` on chain images: a restore had been issuing `POSIX_FADV_DONTNEED` on the shared base. Restore exec-to-running 29 ms with an overlay vs 24 without disks; `cont` 8.9→2.8 ms; a cold cache has been measured at 251 ms. In place. - -**09-26 · CI · `aa157cf`, `1ef95d1`.** The Blacksmith builder v2 required a `cache-key` and silently fell back to a local builder without it. Fixed with `nofallback`. Superseded 10-24. - -**09-27 · machine · `7ec3601`, `2f5a7b0`.** ACPI PCI hotplug is turned off and the guest's pciehp used instead. *Why:* device_del never completed, and spin's lane waited 30 s. Fingerprint moved. *Status:* superseded by virtio-scsi (09-29). - -**09-27 · tooling · `0b1f470`, `51c1fe9`, `2f03d09`, `e7e52db`.** `boot` with no disk uses `-snapshot`. Added: attach/detach, and the rule that checks go through the CLI. boot now execs QEMU, and the QMP handshake has a 5 s deadline. Validation was hardened, and the fingerprint moved again (`-accel` became its own argument). In place. - -### Week 4: 2026-09-28 to 10-04 - -**09-28 · machine/CLI · `c202568`.** `save --template` and `restore` added, plus `boot:restore`: restore ~20 ms; first request 14 ms warm, 33 cold, 31 after a reclaim. *Status:* the template parts were removed 09-30 (#51); restore was not measured again until 11-13. - -**09-28 · tooling · `30b717b`, `a8e2737`.** Every pin goes into `versions.yaml` with a gate test; the versions tool moved to go-tools. In place. - -**09-28 · kernel · `2fd0fff`, `430d2b3`.** 7.2.8 with PSI; then MGLRU, PARAVIRT_SPINLOCKS, PARAVIRT_TIME_ACCOUNTING, fq_codel and hung-task detectors. 322 vs 333 ms usable (15 boots). ZRAM rejected. In place. - -**09-28 · boot probes/image · `f7cd1ab`, `47aa681`, `337c08d`.** `boot:ssh-load`: CPU load does not slow a login, and 16 MiB available doubles one to ~210-310 ms. CPUWeight/IOWeight/MemoryLow on ssh.service changed nothing and are not shipped. MGLRU `min_ttl_ms=1000` and `/tmp` at a quarter of memory. **The sources disagree** on min_ttl_ms: `47aa681` says worst login 1369-7106 ms without vs 94-128 with; `kernel/Dockerfile:192-194` says 611-1785 vs 105-106. *Status:* in place; `boot:memory-policy` was deleted in #88, and `boot:ssh-load` was deleted in #250. - -**09-28 · CI · `5332e97`, `3bef421`, `e6a0a1b`, `6b0f338`.** Actions pinned by commit, actionlint, the race detector, `task mutate`, a coverage floor. The floor was set at 85% against a local 85.7%. CI measures 84.7%, so it broke main and was lowered to 80% (`e6a0a1b`). In place. - -**09-29 · machine/qemu · `43fb03b` (#24), `2b19096` (#25).** Hotplugged disks go on virtio-scsi instead of PCIe root ports. *Measured 2026-09-29, 4 ports vs 1 controller:* boot -31 ms; attach 135 → 1.5 ms; detach 6.1 s → 0.7 ms. NIC hotplug dropped. In place. - -**09-29 · boot probes/CI · `a503db7` (#23), `e9e0c8e`, `de9b7db` (#29).** A report feature matrix (96 rows) published with every release, and `lab.yml` on the self-hosted KVM runner. *Why:* a laptop read 61 vs 105 ms minutes apart. Fixed along the way: -- the lab went green having measured nothing (a skip) (`8d8e97b`); -- a concurrency group cancelled queued experiments (`a3ba5a6`); -- two runners both took nbd0 (`b21e100`); -- an NBD device was mounted before it had a size (`8946f67`). - -In place, with the lab on the bench fleet since 10-24. - -**09-29/30 · kernel · `349dacb` (#33), `20fd702`, `3e26963` (#40).** Four local patches: 0001 objtool writes NOPs, -7.0 ms; 0002 skips the weak-function scan, 11.9 ms; 0003 rewrites the eval maps on first use, -9.0 ms; 0004 PCI config through ECAM, -4.5 ms. Kernel boot 109.4 → 73.7 ms (lab runner, workspace shape, 15-20 boots). The whole report boots on it (run 36651858261). Fingerprint moved. In place. - -**09-29 · firmware · `ae6ab48` (#37), `f2f4da0` (#39).** qboot becomes the default BIOS and the firmware goes into the fingerprint. SeaBIOS 121.89 vs qboot 114.76 ms p50, 7.14 ms saved (lab runner, run 36650049960); 106 rows boot (run 36650559189). In place; the firmware *contents* were later dropped from the fingerprint and only its size kept (`fa3041c`). - -**09-30 · qemu/firmware · `6f65249` (#42), `f10383b` (#43).** qboot writes the PAM registers in 3 writes instead of 7, at ~0.5 ms each. QEMU patch 0001 wraps device creation in one memory transaction (438 flat-view rebuilds). The first version also wrapped board init and the guest printed nothing (lab run 36662499370). In place. - -**09-30 · kernel · `98c3589` (#47).** 7.3-rc5, 1.2 ms slower than 7.2.8 (30 boots). Superseded by 7.3 (10-26) and then 7.3.x. - -**09-30 · boot probes · `f2c47f7` (#48).** Probes deleted with their conclusions kept: `boot:floor` and `kernel/minimal`, `boot:kernel-pages` (#44, added the same day), `boot:memory-unplug` (#46, same day), `cache_bench`, the report's disk axis (96 → 32 rows), the console-swap rows, and the SeaBIOS timing. See §2. - -**09-30 · machine · `a9d6083` (#51).** **Templates removed** (spin #194). `Memory.File`, `x-ignore-shared`, `save/restore --template`, `boot:restore` and `docs/templates.md` all go. The fingerprint now means "a checkpoint resumes only onto a machine with the same fingerprint". Fingerprint moved. In place. - -**09-30/10-01 · boot probes (memory/disk) · #57-#62, #64, #67-#74, #77, #78, #83, #84, #89.** The page-cache lab on construct (AMD Ryzen 9 5900X, Spin OS metal), recorded in `docs/memory-and-disk.md`. Kept as defaults: writeback overlay; hourly fstrim; discard accounting; qboot MTRRs; `page_reporting_order` stays 9. Rejected: docs/boot-time.md, "Measured and rejected". Sub-probes deleted in #89. `caches` and `reclaim` remained until c3c0fd1 (11-19). - -**10-01 · firmware · `4511798` (#75).** qboot programs the MTRRs. virtio-pmem read at 8.3 MB/s uncached-minus vs 1.1 GB/s with SeaBIOS (runs 36818224412, 36818721809). No boot cost: 103.5 vs 103.1 ms. Fingerprint moved. In place. - -**10-01 · image · `5b7b1dc` (#76).** fstrim hourly: 657 → 21 MB on disk, 657 → 20 MB in the host's cache (run 36815822140). In place. - -**10-01 · qemu · `aaf2d86` (#79).** Upstream's virtio-blk discard accounting is carried as a patch: before it, `query-blockstats` showed 0 unmaps for 1.1 GiB trimmed (run 36815822140); with it, 10-12 operations and 1123 MB (run 36884702758). "to delete in the bump that brings it". In place. Deleted 11-19 with QEMU 11.2.0-rc0, which has it upstream (#289). - -**10-01 · kernel · `1400f6a` (#80).** Lockdown at confidentiality plus the BPF LSM; no `/dev/mem` or `/proc/kcore`. "No cost that can be told from noise." *Side effect, found later:* SPIN_GRAPH and SPIN_CPU_SHARE silently traced nothing until #240 (11-13). In place. - -**10-01 · CI/release · `2cd98f0` (#81).** Release notes say what changed, and the report boots each row 20 times, KVM only. *Why:* at 3 boots a row every KVM row read 5-11% slower between two releases that 20 alternated boots put within 5 ms. Also: `v20261001.01` shipped a `qboot.bin` without `mtrr.patch` in the tarball, because hack/release named the patches one by one. In place. The report's 20 boots a row went with the feature matrix 11-19 (#303). - -**10-01 · boot probes · #88, #90.** `unitload` deleted (it compared the image with itself) and `memory-policy` deleted. Bench rows reduced to "as shipped" and "baseline", with findings left as notes. In place. The bench rows went with `boot:bench` 11-13 (#250). - -**10-01 · machine · `c5baaa7` (#97), `ca7b54f` (#98), #94.** The fingerprint becomes one hash, and `Incoming` one field. The release verdict was blind to `machine/` changes, so `fingerprint_sha256` is now recorded. `Disk.Cache` removed. In place. - -### Week 5: 2026-10-05 to 10-11 - -**10-09 · qemu · `f0ec1e0` (#103).** QEMU 11.1.2. "A new machine: every checkpoint taken on 11.1.1 stops resuming." That stranded v20261002.01's checkpoints (v20261013.01). Led to the next entry. - -### Week 6: 2026-10-12 to 10-18 - -**10-13 · CI/release · `d692a7c`, `03aeb28`, `96a39d2`, `845fb5d`, `f033995` (#109), `b207bee` (#110), `302ced2` (#111), `99e31f9`.** Supply chain: -- signing and attestation, an SBOM, release from main only, apk locks; -- a reusable builder (#109, #110), reverted the same day (#111): it never achieved SLSA L3 and needed guards; -- an OSV scan, kept; -- attestations checked by digest, because the 338 MB tarball was over cosign's 128 MiB limit. - -In place, apart from the reusable builder. The apk locks gave way to pinned builder images 11-20 (#309). - -**10-13 · machine/fingerprint · `fa3041c` (#114).** **The fingerprint is the machine's contract.** `MachineType=pc-q35-11.1`. It hashes: the shape; `Spec.Contract` (every device as Args writes it); the BIOS's size; and the host CPU under `-cpu host`. It no longer hashes the QEMU, kernel, initrd or pvh.bin bytes. Added `boot:roms`, `boot:compat` (a v20261002.01 checkpoint resumes on 11.1.2), and `hack/machinetype`. One break by design. In place; `fingerprint_sha256=2bd7da6b…` from v20261013.02 onward. - -**10-13/14 · CI · `7628981`, `4f7d55e`, `8c6d1c7`.** compat runs on main and before a release, not on PRs, because the KVM runner refuses pull_request jobs. cosign is built from its pin. Docker Hub images come from mirror.gcr.io after a 429. In place. - -### Week 7: 2026-10-19 to 10-25 - -**10-19 · image · `fb39fd5` (#210).** GNU coreutils instead of uutils: 21 OSV findings against rust-coreutils 0.10.0; image 855M vs 877M. In place. - -**10-19 · CI · `7bf5429` (#197).** One OSV issue per package; there had been 77 open. In place. - -**10-24 · CI · `c75f144` (#214), `f29e59d` (#215), `d67afc4`, `97a6de1`.** Every workflow step is one task. Builds move to GitHub's runners. **Report and lab move to the bench fleet** (one instance type) and compat to the kvm fleet. A fix: vhost-vsock permissions were reset by udev after `modprobe` (`97a6de1`). In place. The first report on the fleet (v20261026.01) compared a Ryzen 9 5900X with a Xeon 6975P-C, and its notes say so (docs/measuring.md, "Avoid the pitfalls"). - -### Week 8: 2026-10-26 to 11-01 - -**10-26/29 · kernel · `1c12413`, `0bb00ce`, `fc1079c`.** Kernel 7.3; the apk locks moved; the kernel now tracks mainline. Superseded: refresh.yml now proposes the newest stable release of the 7.3 series (`spin-machine-dev refresh kernel`). - -### Week 9: 2026-11-02 to 11-08 - -**11-03 · qemu/kernel · `7c37270`, `b4b67c3`, `6e7ba47`.** QEMU 11.1.3, kernel 7.3.1. The apk lock broke because Alpine's mirror dropped python3 3.14.8. In place. Superseded by QEMU 11.2.0-rc0 11-19 (#289) and kernel 7.3.5 11-17 (#266). - -### Week 10: 2026-11-09 to 11-13 - -**11-09 · kernel/CI · `00db122` (#223), `0ce27ad` (#224), `8d495c5` (#225).** Kernel 7.3.3, with the config named by series and a daily proposal job. A kernel CVE judge: of 18221 CVEs against 7.3.1, 9 apply with a fix later in 7.3 and 1 has no fix. The apk lock broke again (zlib 1.4). In place; the kernel is 7.3.5 since 11-17 (#266). - -**11-09 · tooling · `ed4ad86`, `e1d40ad`, `6e25bb3`.** Retries and tokens for GitHub downloads after 504s. Task and go-tools as released binaries (455 → 81 modules). In place. - -**11-11 · kernel · `cce320f` (#229).** 7.3.4. In place. Superseded by 7.3.5 11-17 (#266). - -**11-12 · docs/image · `e452afc` (#232), `3a7864d`.** A comment sweep: several comments still said a QEMU or kernel bump strands checkpoints, which has been false since `fa3041c`. Dead code deleted: `spin-machine-console.service`, the modprobe blacklist, and the getty@tty2-6 masks. In place. - -**11-12 · image · `02c58b9` (#235).** bubblewrap, socat and ripgrep for agent sandboxes. In place. - -**11-12 · CI · `c6c29b5` (#236), `ec2c7fb` (#237), `1666cb5` (#239).** A daily apk-lock refresh PR. *Why:* the lock broke three times (`6e7ba47`, `8d495c5`, release run 43157106109). The BuildKit cache moved to ghcr: on the fleet the gha cache read a store nobody wrote, so compat compiled cold on every run and failed on main 4 times from 11-09; both release attempts on 11-12 failed. In place. The daily apk-lock refresh was replaced by pinned builder images 11-20 (#309). - -**11-12 · image · `3c8da99` (#238).** The hot-add rule onlines CPUs only. udev's memory "online" write raced the kernel's `memhp_default_state=online` and logged EINVAL for every block. Closes #230. In place. - -**11-12/13 · image/kernel/boot probes · #240 (`bc41f44`, `a8df865`, `28823fb`, `8fb1dd9`, `e5b8003`).** -- Kernel patch 0005, each PCI capability list walked once: kernel 95.1 → 88.9 ms; ECAM accesses 1,032 → 680 (lab 43327612594). -- **logind back in the boot, and spin lingers:** first SSH login 570/626 → 510/525 (lab 43308825692, 10 boots). -- MOTD and pam_motd off: -7 ms per login, -12 on the first. -- `sshd@` waits for the host keys. Before this, SSH over vsock "worked not at all". -- New probes: `boot:waits`, `boot:jobs` (+ jobwatch, godbus), `boot:ssh-first` (+ vsockproxy), `boot:exits`, `boot:mmio`. - -Measured and not shipped: -- the getty without BindsTo: 342 vs 345 (lab 43303190733); -- keygen in the boot: 518 vs 514 (lab 43312419007); -- virtio-rng removed: -13.6 ms to the prompt (lab 43321809471), not done because it would move the fingerprint; -- `pci=noearly`: the guest does not boot; -- PID 1 spends ~25 ms in the BPF verifier. - -*Side effect:* v20261113.01's console prompt came 21-25% later (release notes). *Status:* patch 0005 and the exits/mmio/jobs probes were deleted in #249 (11-13). 0005 came back the same day (#255) and is in place. - -**11-13 · image · `43de41e` (#241).** serial-getty Type=simple. *Why:* with linger, `user@1000` runs inside the boot transaction, and Type=idle held the getty for 91.8 ms (lab 43361486792). 346/358 vs 423/441 (lab 43362067503); v20261112.01 was 344/353. Released in v20261113.02. *Status:* removed in #249 (11-13): nothing a workspace does waits for the console's prompt. - -**11-13 · boot probes/machine · #242, #246 (both closed).** Restore measured, and a **mapped-ram** checkpoint layout proposed twice: -- #242 (draft): `--channels`; mapped-ram ×4 restore-to-login 394/410 vs stream 877/1888 (lab 43364516874). Those numbers were later declared contaminated by restored VMs leaking between repetitions. -- #246: mapped-ram put in `Spec.Contract`, which would move the fingerprint, plus `boot:score`. On the fleet, with every cold boot run before every restore: restore login 385/400 mapped-ram vs 386/399 stream (lab 43483852339); also lab 43482829958, 373/402 vs 376/416. Closed: "does not earn moving the fingerprint". A laptop lead of 188/358 vs 412/732 was called "a lead, not a finding". - -*Status:* rejected; #242 and #246 closed. - -**11-13 · image · `d895543` (#245), `5e0cc2f`.** sshd offers only `mlkem768x25519-sha256`. ML-KEM costs the same as curve25519: first login 461 for both; a second login 40 vs 39; OpenSSH 9.6 with sntrup761 took 489 first and 104 for a second (lab 43479854381, also 43463472762). `boot:ssh-first` logs in with x/crypto/ssh, and vsockproxy is removed. *Status:* merged 18:30Z. #245's own body said "Do not merge before the clients move": open-remote-ssh#8 merged at 18:57Z, and spin-stack/spin#1206 (the spin CLI refusing OpenSSH < 9.9) merged after its CI and KVM lanes passed. Not yet released. Released in v20261113.03. - -**11-13 · image · `3e8075f` (#247 → #248).** SSH host keys are made from the boot's first dispatch (wanted by sysinit.target, `DefaultDependencies=no`). First login 489/506 → 468/494; accept to login 177 → 154 (lab 43483372488). Rejected in the same run: masking two generators (489), and masking 11 always-failing units (484). Not released. Released in v20261113.03. - -**11-13 · boot probes · #249, #250.** Removed: -- kernel patch 0005 ("6 ms of a ~470 ms first SSH login, for a local patch carried across every kernel bump"); -- the getty Type=simple drop-in ("nothing a workspace does waits for that prompt"); -- `boot:exits`, `boot:mmio`, `boot:jobs`/jobwatch/godbus. - -#250 also removes `boot:bench`, `boot:trace`, `boot:userspace`, `boot:systemd` and `boot:ssh-load`, keeping "a gate …, the release's report, the metric a workspace waits for (ssh-first), and one tool per layer". - -**11-13 · goal · #251, #252, #254.** The goal is written down: a cold boot to the first SSH login in under 100 ms (AGENTS.md), with restore as the second number. The rules that held exploration back are removed (no init in a release, the fingerprint as an event to avoid, one default per experiment, the bench fleet alone deciding); hotplug and dynamic memory become an invariant that is never traded for boot time. - -**11-13 · boot probes · branch `floor-kernel` (experiment).** The floor without systemd: PID 1 a script that mounts what sshd needs, makes an Ed25519 key and has socat hand vsock connections to `sshd -i`. First login 467 → 220 ms (lab 43492686353), 506 → 240 (lab 43493135230); guest uptime puts init at ~90 ms of kernel and the keys 10-20 ms later. What is left at the floor: QEMU and firmware ~44 ms (boot:firmware-stages, lab 43494513791: QEMU's own start 35.9, qboot ~8.5, of QEMU's start 7.9 copying vmlinux), kernel ~80-90, init ~20, the login ~44. `/proc/uptime` starts partway into the kernel, so it hides ~35 ms that an earlier reading charged to QEMU. - -**11-13 · CI · spin-stack/ci#14, #15, spin-machine#253.** A `bench-metal` fleet (c8i.metal-48xl, then r7i.metal-24xl behind it) and lab.yml's `host` input. It has not run: metal spot scored 1-3 of 10 for placement and failed `UnfulfillableCapacity` in every zone; on-demand failed `VcpuLimitExceeded` at a quota of 96 vCPU. An increase to 288 was requested the same day (case open). *Status:* the fleet first ran 11-19 (spin-stack/ci#20; below). - -**11-13 · kernel · #255 (this change).** Where the kernel's ~100 ms goes on the bench fleet (boot:initcalls lab 43495583323): initcalls 52 (acpi_init 12, of which `acpi_pci_root_create`, bus 0's enumeration, 11.2 traced on a kernel without forced lockdown, lab 43499868986; inet_init 7.9, which is vmlinux BTF's first parse; the virtio probes ~17), before the first initcall ~15-20 (SPIN_EARLY, lab 43507472288; ~4 of it the probe's own 18 MB log buffer), SMP ~4, the root mount ~6. Kept: patch 0005 back, 0006 (BTF parsed in the background from a core_initcall), `CONFIG_DEFERRED_STRUCT_PAGE_INIT=y`: kernel 96.3 → 87.1 ms (lab 43505126131), first login 466 → 456 as built and 223 → 214 at the floor (lab 43501992969). `driver_async_probe` for rng, balloon and vsock on the command line: 214 → 209 at the floor (lab 43506390106). *Status:* 0005 in place; `driver_async_probe` deleted 11-20 (#352), 0006 11-20 (#345), `DEFERRED_STRUCT_PAGE_INIT` 11-21 (#356). - -**11-13 · image · the first login's lane (this change).** Where systemd's ~250 ms over the floor went, on the bench fleet: ~60 before sshd accepts (sysinit, udev, journald), ~105 in pam_systemd, and ~65 in a handshake competing for the CPU. logind answers a session of class `user` only once the user's manager has started, and orders its scope after `systemd-user-sessions` (systemd v259.9 source, `logind-session.c`). The vsock socket, `sshd@`, dbus, logind, `user-runtime-dir@` and `user@` without default dependencies, no `/run/nologin` at boot (pam_nologin refused the lane's first login: "Access denied for user spin by PAM account configuration"), sessions of class `user-early-light`, and udev's coldplug filtered to block, net, virtio, misc, input, rtc, ptp and ttyS0: first login 478 → 402 ms (lab 43518915618). Measured and left out: priority (`CPUWeight`, `Nice`) on the lane, −2 ms over the filter and a slower second login (63 vs 45 ms). - -**11-13 · kernel/qemu · branches `kernel-snapshot`, `qemu-snapshot` (rejected).** QEMU publishes bus 0's configuration space over fw_cfg after the firmware (etc/spin/pci-config) and the kernel answers boot-time configuration reads from it until each dword is written. It works (`PCI: configuration space of 5 devices on bus 0`) and is worth -14 ms against the same kernel without it (lab 43514550646), but only 2-3 ms against 0005, which already removes most repeated reads: 209/217 against 211/222 (lab 43514884598). Not worth a QEMU patch and a 250-line kernel patch. - -**11-13 · boot/qemu · branch `first-login-report` (this change).** v20261113.03's report read +11-18% on every row: the report times the serial console's prompt, and the getty drop-in removed in #250 left it Type=idle, waiting for the lane's units. The first login it does not time went from 478/500 (v20261113.02, lab 43524334205) to 381/410 ms (v20261113.03, lab 43524721490), two runs and not interleaved. The report now logs into the release over SSH too (`first_login`), and compare writes it first. The QEMU build asserts static-pie, full RELRO, an NX stack and stack canaries, which come from QEMU's and Alpine's defaults and no flag here. Measured and left out: one sshd for every connection (the vsock socket with Accept=no, an `sshd -D` from the first dispatch), first login 382/393 against 381/410 and a second 40 against 48 ms (lab 43524721490). - -**11-13 · image · udev's coldplug keeps cpu (this change).** The coldplug filtered in `630fa2c` left out cpu, and a core attached before systemd starts is onlined by that replay reaching `40-spin-hotadd.rules` and by nothing else. spin gives a workspace its cores while its own init is PID 1, so with v20261113.03 every workspace came up with one core whatever it was sized to (spin's kvm run 43527839765, four tests "still waiting for the guest to have its floor's two cores"). `task boot:hotadd` attaches a core before systemd and reads `online` after: `0` on v20261113.03's image, `0-1` with cpu in the filter. What cpu costs the first login was not measured; it is one device per core. - -### Week 11: 2026-11-14 to 11-20 - -**11-19 · image · systemd from Ubuntu's source package, stage1 (this change).** The image installs Ubuntu's own systemd 259.9-0ubuntu0.1, rebuilt from its .dsc (versions.yaml `systemd-source`) by `image/systemd/Dockerfile`. The build uses Debian's `stage1` build profile (no BPF framework, audit, AppArmor, SELinux, OpenSSL, TPM2, homed, cryptsetup…) and links systemd-executor, udevd, systemctl and journalctl statically against libsystemd-shared. The packages are versioned `+spin1` and held. *Why:* PID 1 spent ~25 ms in the BPF verifier on socket-bind at every boot (#240, "measured, nothing done"), and restrict-fs failed to load under lockdown on every boot (#261). *Measured:* -- `boot:ssh-first` on the bench fleet, 20 boots of each, interleaved, first login p50 against the archive's systemd: - - stage1: −47 (lab 44531842773), −38 (44537549305) and −47 ms (44538877783); - - static over stage1: −10 and −1 ms, within noise. Accept to login was −7 ms in both runs. -- `boot:waits` on a laptop: PID 1's setup before the generators goes from 25.8 to 5.6 ms. -- `boot:restore-first` (new, below): unchanged. The guest's part, from running to login, is ~50 ms with either systemd (44533227886). - -*Left out:* masking `systemd-udev-load-credentials` (−8, −6 ms) and `-Db_lto=true` (Ubuntu already builds with `-flto=auto`); see docs/boot-time.md, "Measured and rejected". The patch that would make restrict-fs load under lockdown, reading `s_magic` through BTF, loaded in this guest. It is for systemd upstream and is not needed here. *Cost:* a rebuild whenever Ubuntu publishes a systemd. The archive serves only the current source, so the build fails the day it moves, and `refresh:systemd` proposes the move. - -**11-19 · boot · `boot:restore-first` (this change).** The goal's second number had had no probe in the tree since #246 closed. Every row of `boot:ssh-first` is booted cold, logged into and saved, then restored with its state evicted from the page cache (checked with mincore) and logged into again. Every cold boot runs before every restore. On the bench fleet a restore reaches the first login at 841/913 ms, ~790 of it before the guest runs, reading the state from the runner's gp3 volume (44533227886). #246 read 386 ms on 11-13. What moved is not known. On a c8i.metal-48xl it is 905/942 (44535167653), so the restore is the host's disk, not the virtualization. - -**11-19 · lab · nested against metal.** `bench-metal` ran for the first time (spin-stack/ci#20 keeps it to c8i.metal-48xl, on-demand when spot has none; spin-machine#272 caps the job at 60 minutes). The same CPU (Xeon 6975P-C) on both, p50: -- first login: 378-392 ms nested (two runs) against 332 metal (44537498507), so **nesting costs ~50-60 ms**; -- `boot:firmware-stages`: QEMU start 30.5 against 28.1, the PCI walk 5.00 against 2.22 (173 exits, ~29 against 13 µs each), kernel and init 108.7 against 69.5 (44535161371, 44535156851). - -An r7i.metal-24xl (Sapphire Rapids, slower per core) read 296 ms (44534028478), faster than the c8i.metal. Unexplained. Repeat it before quoting it. Every bench-fleet number in this log and in docs/boot-time.md is nested. - -**11-19 · boot/image · where the first login's own time goes, and logind's socket early (this change).** `boot:login-lane` marks the guest's journal through the first login: accept → authenticated 55.5, PAM's session → logind's new session 29.0, → scope 4.3, → command 8.4 ms (v20261119.01, lab 44555905383). Its diagnostic rows (`SPIN_LANE_DIAG`, sshd at DEBUG1 and logind at debug, lab 44557162195) say what they are: -- **Before authentication.** PID 1 starting `sshd@` takes ~11 ms, and OpenSSH 10's three execs (`sshd` → `sshd-session` → `sshd-auth`) ~12. Loading PAM's modules cold takes 8.3 ms, against 0.9 at the second login. ML-KEM is 3.5. -- **The hop to logind** is logind not running yet. Its Varlink socket kept its default dependencies, so logind waited behind `sysinit.target` and udevd, ready ~230 ms into the boot (`boot:waits TARGET=systemd-logind.service`, lab 44557605832). The first login waited ~32 ms for it, the second 1. - -The socket without default dependencies (`systemd-logind-varlink.socket.d/20-lane.conf`), 20 boots of each (labs 44558035927, 44558053261): -- the hop: 24.5/41.8 → 15.8/22.7; -- accept to login: 131/137 → 120/128; -- the first login: 332/355 → 328/337. The p50 moves little because logind starting sooner takes the CPU sshd was starting on. - -Masking `modprobe@drm`, which logind is ordered after, added nothing (327/345). What is left of the login is CPU contention on 2 vCPUs, `user@1000` (38 ms) and the host key generation (21 ms) starting in the same window, rather than waits. - -**11-19 · systemd/boot · where PID 1's gap between the unit load and the first job goes (experiment, tooling kept).** `image/systemd/experiments/pid1-marks.patch` makes PID 1 append its monotonic clock, its own CPU time, the units loaded and the time in `unit_load` after each step of `manager_startup` and `do_queue_default_job` to `/run/spin-pid1-marks`. `boot:waits` reads the file. `lab.yml`'s `systemd_experiment` builds the patched systemd on the runner and puts it into each overlay. Bench fleet, 10 boots (lab 44561762624), p50 ms: -- bus, varlink, coldplug, vacuum, ready: < 0.2 together; -- **loading what `default.target` reaches: 28.4 wall, 20.9 of it PID 1's CPU, 192 units** (~0.11 ms of CPU each; the rest is likely cold reads); -- building the transaction: 0.30; -- the first dispatch: 0.87. - -The gap is unit loading, not the transaction that 11-13's single debug-logged boot named. 96 of the units a boot lists are inactive, loaded because another unit names them in `After=`/`Wants=`: `initrd-*`, `plymouth-*`, `modprobe@*`, hibernate, cryptsetup's targets, `firewalld` and `auditd` named by docker. Masking does not spare a load (a masked unit is still looked up and loaded as masked), which is why masking 11 units moved nothing (docs/boot-time.md, "Measured and rejected"). - -**11-19 · image/machine · the root mount's storage path (branch `ext4-mount`, not yet on the fleet).** The kernel gap `security_initcall_late_sync` → `EXT4-fs (vda): mounted` was 6.8 ms nested and 5.0 metal (`boot:initcalls`). Three changes, from reading Linux 7.3 and the image: -- the image without `orphan_file`, a mke2fs.conf default since 1.47.0: every mount, read-only included, reads it one block at a time (`ext4_init_orphan_info`, ~73 single-block reads with no readahead). Crash correctness is the classic orphan list's; -- `lazy_itable_init=0`: `mke2fs -d` left no group `ITABLE_ZEROED`, so each overlay's first read-write mount had `ext4lazyinit` zero every inode table in the first second of the boot. After one `--init /bin/sh` boot the overlay held 16.06 MiB of zero clusters, and none with the tables zeroed at build. The thread still starts, to prefetch block bitmaps (it does not with `no_prefetch_block_bitmaps`). The image is 256 KiB smaller; -- `rootfstype=ext4`: without it the root mount tries ext3, then ext2 (`EXT4_USE_FOR_EXT2`), on the superblock before ext4. - -Laptop lead only, on a host at load ~30: the gap's p50 over three alternated rounds of `TestKernelInitcalls` (8-10 boots each) was 8.8/2.8/4.3 ms with the release, 4.1/3.2/2.9 with `rootfstype` alone, and under 2.4 (below the rows printed)/1.3/1.2 with all three. Not decided until `boot:ssh-first` and `boot:restore-first` run interleaved on the bench fleet. *Status:* merged 11-19 (#286) and in place; `rootfstype` and `^orphan_file` are still leads, not measured on the bench (docs/boot-time.md, "What the machine carries"). - -**11-19 · kernel/qemu/machine · the kernel is entered as a bzImage (this change, functional: security).** KASLR was inactive under PVH. The PVH entry into `vmlinux` skips `arch/x86/boot/compressed`, where KASLR picks the random base and sets `KASLR_FLAG`, so `CONFIG_RANDOMIZE_BASE` and `RANDOMIZE_MEMORY` did nothing: every PVH boot had `_text` at `ffffffff81000000`. The machine now boots `kernel/bzImage` (LZ4, as the config already had: x86 has no `KERNEL_UNCOMPRESSED`), which qboot loads from fw_cfg itself (`boot_from_fwcfg`); `linuxboot_dma.bin`, the ROM QEMU adds for a bzImage and SeaBIOS runs, ships again. `vmlinux` and `pvh.bin` stay, for `--kernel vmlinux`, debugging and BTF. A tree without a bzImage (every release before this one) still boots its `vmlinux`, which boot:compat needs. Two builds, the second on a fresh BuildKit with no cache, gave the same bzImage (`ff9f0ec6…`) and vmlinux (`ff53d597…`). *Checked:* `boot:lockdown` now requires `_text` present and not `ffffffff81000000`, and no `nokaslr`; it fails on the PVH tree. Three bzImage boots: `_text` `ffffffffb5c00000`, `ffffffffa2a00000`, `ffffffff90800000`, the physical base moving too (`/proc/iomem`); the PVH `vmlinux`, three times `ffffffff81000000`. The fingerprint does not move (`2bd7da6b…` either way) and `boot:roms` passes: on q35 an option ROM is a fw_cfg file, not a RAM block. *Cost on a laptop (i9-13900HK), a lead only that the bench fleet decides:* `boot:firmware-stages` REPS=5, QEMU exec to the diagnostic init 105.6 vs 83.6 ms p50 summed (qboot copying the bzImage 2.3 ms; the rest the decompressor and the kernel after it); kernel start to init over 10 boots 34-92 ms, p50 ~51, against 34-37 for PVH, so the spread is the bzImage's and not yet explained. `boot:ssh-first` alternated A/B/A/B/A/B at REPS=5: first login 500/658/603 vs 504/587/764 ms p50. The laptop's noise is larger than the difference. Kept whatever the bench fleet says: it is a security fix, and what it costs is the next thing to make cheaper. - -Bench, nested (2026-11-19): it costs nothing measurable. `boot:initcalls` in the workspace shape, kernel start to "Freeing" 94.5 → 93.9 ms (lab 44577696958): the laptop's 34-92 ms spread did not reproduce. `boot:ssh-first` against the PVH release, sshd accepts 199 → 198 ms and first login 328 → 317 (lab 44583379559, 20 each); the login gain is in accept-to-login and is main's, not the bzImage's. The LZ4 decompression and the fw_cfg load do not show. - -**11-19 · machine · one surface for spin: `machine.VM`, every machine started held (this change).** spin built a `Spec`, exec'd `Args()` and drove QMP with a client of its own, so what a checkpoint is (the migration capabilities both ends must agree on), how a disk reaches a device, and the `-S` before a CPU plug lived in spin. Now `machine.VM` (QEMU's: `machine.Attach`) is that conversation: `Boot`, `Resume` with `Load{Fast}`, `Loaded`, `Checkpoint` with a seal at pre-switchover, `Continue`, `AttachDisk`/`DetachDisk`, `SetCPUs`, `SetMemory`, `CPU`. An interface on purpose, so another VMM can be put behind it and compared. Every machine starts held, `-S` or `-incoming defer` (`Spec.Restore`): under `-incoming defer`, `cont` leaves QEMU in `inmigrate` (11.2.0-rc0), so one QEMU cannot wait for both. A disk is bound to its place (`Spec.Disks`, a raw node over an empty `null-co`) by serial, `blockdev-reopen` onto the chain handed over `add-fd`: the device's serial and read-only-ness are fixed at realize, and QEMU 11.2 has no `blockdev-replace`, so the raw node stays and a seal targets `machine.TopNode`. The prestart prototype measured it on the bench fleet: cold first login 313→291, restore 170→153 ms (lab 44573266140). Checkpoints are written in mapped-ram (`FormatMappedRAM`, recorded in `Saved`); a stream checkpoint from before still loads, in full (`boot:compat`). The host CPU's model name left the fingerprint: a checkpoint records the CPU its guest was shown and `CanResume` checks it (spin#1348). Fast load needs userfaultfd for QEMU's user and was not run here: an unprivileged QEMU refuses postcopy ("Userfaultfd not available"). *Status:* PR, measured on the bench fleet with `boot:restore-first` (`SPIN_RESTORE_FAST=1`) and `boot:prestart`. Merged 11-19 (#293). - -**11-19 · machine · one rule for where a checkpoint resumes: `CanResume(Saved, Target)` (this change, functional).** After #293 a checkpoint recorded its format and CPU, but the machine it was of was still spin's `machine_identity` string, and nothing recorded the QEMU that wrote it: QEMU loads what an older QEMU of the same machine type wrote and promises nothing the other way, so during a rolling update a checkpoint from an updated host could be placed on one not yet updated with an identical fingerprint (spin-stack/spin#1348). `Saved` now carries `Fingerprint` and `VMM` ("qemu 11.1.90"), a machine says what it resumes (`VM.Target`: formats, fingerprint, VMM, CPU), and `CanResume` is the one rule a placement and `Resume` both ask: the format read, the same fingerprint, the same VMM at the writer's version or newer, the CPU shown again. `Args` names the machine by its fingerprint (`-name guest=spin-machine:`, read back with `query-name`), which the guest does not see and `Contract` does not hash. Records from before a field was kept are not checked on it. - -**11-19 · machine · a place is a filter node (this change, functional).** A place's node was raw over the bound disk's top image. spin's storage compacts a chain by rewriting a bound image's backing file (`change-backing-file`), which QEMU takes only on a root node whose chain, followed by backing and filter links, contains the image: on the root it answered "'slot0' and image file are not in the same chain", on the image "Need a root block node" (QEMU 11.2.0-rc0). A place is now a `throttle` node in a group with no limits: a filter, so the chain is seen through it, and pass-through. copy-on-read, compress and preallocate are filters too, and each changes what is written. Checked on QEMU 11.2.0-rc0: bind by `blockdev-reopen`, then `change-backing-file` through the place, then a seal under an overlay. The fingerprint does not move (`-object` is not in `Contract`). Its cost per I/O is the bench's to say. - -**11-19 · kernel · branch `kernel-floor`, patches 0007-0011 and a config trim (this change).** The kernel was 78.0 ms nested against 45.0 on metal, same CPU (boot:initcalls, labs 44563496308, 44563512999). Five of its gaps, each a patch: -- 0007, ORC's lookup table by one merge pass instead of 59,650 binary searches: 3.5 ms on both hosts. Every block checked against the binary search, 0 differ. -- 0008, init's 1,989 ftrace records freed with one memmove: 2.6 ms on both hosts. -- 0009, the boot CPU polls for an AP by `local_clock()` while booting: 4.1 ms nested, under 1.4 on metal. -- 0010, no early-quirks PCI scan under KVM: 2.1 ms nested. pci=noearly also defers MMCONFIG; this skips only the scan. -- 0011, virtio-pci's `queue_select` written only when the queue changes: 84 → 22 writes. - -Config: `X86_MSR`, `X86_CPUID` off (nothing in the image or spin opens `/dev/cpu`); `BLK_DEV_LOOP_MIN_COUNT=0` and `SERIAL_8250_RUNTIME_UARTS=1` (from `kernel-trim`). *Measured:* only on a laptop, not nested, 10 boots each interleaved, a lead: the ORC gap 4.59 → 0.93 and 4.45 → 0.72, the WAET gap 0.44 → 0.07 and 0.32 → 0.06, the ftrace gap 2.7 → under 1.1 ms. 0009 and 0011 cannot move there: the AP never waits and exits are cheap. The kernel's total read 61.5 → 55.7 in one run and 53.0 → 54.3 in the other on a host building QEMU at the time: noise. Not yet measured on the bench fleet or against the first login. - -Bench, nested, workspace shape (2026-11-19, lab 44587603255, 20 boots each): kernel start to "Freeing" 96.4 → 86.6 ms (−9.8), in initcalls 61.7 → 58.7, outside them 35.1 → 27.8, where ORC and ftrace are. `virtio_pci_driver_init` 8.57 → 8.59: 0011 does not show even nested. *Status:* merged 11-19 (#291); 0009 and 0011 deleted 11-20 (#345); 0007, 0008, 0010 and the config trim in place. - -**11-19 · lab · the probes become `spin-machine-dev lab` (branch `dev-cli-lab`, this change).** Each probe was a Go test behind a `SPIN_*` switch of its own, and took a second kernel, a second QEMU, an edit of the image or a rebuilt systemd each through another environment variable (`SPIN_KERNEL_B`, `SPIN_KERNEL_C`, `SPIN_MACHINE_OUTPUT_B`, `SPIN_APPEND_B`, `SPIN_SYSTEMD_DEBS`), laid out by lab.yml's `variant=beside|instead`. Two failures in one day came from that shape: `boot:restore-first` read no `SPIN_MACHINE_OUTPUT_B` and measured the release's QEMU under the name of 11.2's (lab 44584214362), and a Kernel run from before the bzImage failed `lab:place` with no message (lab 44587254371). Now a tree is a whole machine with a manifest naming every part's source, refused when it is not whole, and a probe is handed trees (`internal/lab`, docs/cli.md). Ported: `ssh-first`, `restore-first` (its `fast` rows an option), `prestart`, `initcalls` (totals, the initcalls of interest per tree, each tree's slowest initcalls and largest gaps). The "as this branch" row is the tree edit `lane`. Not ported, and kept as `boot:` targets `lab check` runs on any tree: `firmware-stages`, `waits`. Deleted, each question answered and its answer in this log or beside it: -- `boot:login-lane` (`boot/login_lane_test.go`): where the first login's own time goes, on the guest's clock. See the 11-19 entry above and docs/boot-time.md's cold-boot budget, lab 44555905383. -- `boot:density` (`boot/density_test.go`): one idle workspace's host memory, ~125 MiB (lab 44546329726). -- `boot:page-cache` (`boot/pagecache_test.go`): the page caches a machine has. See docs/memory-and-disk.md and docs/boot-time.md's "Measured and rejected". -- initcalls' extra passes, not ported: `SPIN_GRAPH` (function_graph under chosen functions, `boot/graph_test.go`), `SPIN_CPU_SHARE` (who had the CPU during one initcall, `boot/cpushare_test.go`), `SPIN_EARLY` (the lines before the first initcall) and `SPIN_FORMAT_CHECK` (an event's format after patch 0003). Each served one question, answered above. When another asks for one, it comes back from git (`boot/initcalls_test.go` and those two files before this change) as an option of the `initcalls` probe. -- `boot:ssh-first`, `boot:restore-first`, `boot:prestart`, `boot:initcalls` are now lab runs over `OUTPUT_DIR`, the same targets. - -Checked against the probe it replaced on the bench fleet, `lab dispatch ssh-first`, the release and the release with the lane, 20 each (lab 44596983249): sshd accepts 215/228 and 216/229, first login 349/366 and 339/353. The old probe's rows read 215/223 and 216/223, 348/360 and 335/345 (lab 44585268429). A release ships no spin-machine. The old targets' `:tools` built this checkout's into the release tree, and a tree does the same, named in its manifest (the first dispatch, 44596065601, failed on it). - -**11-19 · lab · the release report is a ladder (this change).** The report measured each release alone, through the feature matrix (eight combinations of memory, vsock and hotplug, and the image's boot variants, each timed to the serial console's prompt), and compared its report.json with the previous release's, taken on another day on another instance. For v20261119.02 it said sshd accepted 7.3% later than v20261119.01 (202.6 → 217.3 ms); the two interleaved on one host said 199 → 198 (lab 44583379559). And the goal's second number, a restore to the first login, was not in it. Now `spin-machine-dev lab ladder` boots the newest five releases on one bench host, each with the spin-machine of its own commit, interleaved: a cold boot and a restore to the first login, both into a QEMU started ahead, and save, state, the kernel and QEMU's RSS as diagnostics. report.yml runs it after each release (ladder.json beside it, the table in its notes) and weekly. A release whose spin-machine cannot run a probe is a dash with the reason. boot:compat is now `lab compat`: every release since the fingerprint last moved, fetched against its sha256 and signature, and CanResume held to QEMU's one-way promise against each one's QEMU. The feature matrix is deleted: its last answer is v20261119.02's report.json asset and the "Feature matrix" section of its notes (no row moved beyond 5%, every row 344-389 ms usable), and git has the code (boot/report.go, boot/report_test.go). *Status:* the report measures each release alone since 11-20 (#314); `lab ladder` and `lab compat` in place. - -**11-20 · machine · a named CPU model, what it costs (#222).** spin-machine can show the guest a named model the fleet shares (`CanResume`, `Models`, `Baseline`, #293). The question left was its cost. The bench host is nested, and its L0 hides features the Xeon 6 has (la57, TSX, fsrm): QEMU refuses GraniteRapids-v1, SapphireRapids-v1 and Icelake-Server-v2 there ("Host doesn't support requested features", lab 44657973748, cancelled after 50 minutes of boots each waiting out its login; `lab` now refuses such a tree at its first boot). The newest model it runs, chosen on the runner (`lab tree --cpu baseline`), is Cascadelake-Server-v5. Against `-cpu host`, 20 boots each, interleaved: the cold boot's first login 327/342 → 343/353 ms (+16.4, sshd accepts +12.6; lab 44664362024); the restore's 160/170 → 161/170 evicted and 167/188 → 165/203 cached (lab 44664603720). A fleet that takes a baseline model pays ~16 ms on every cold boot for checkpoints that cross host generations. On one generation `-cpu host` with `CanResume`'s feature check is free. - -**11-20 · lab · density, the latency half (#273).** #278 answered the memory half (an idle workspace costs its host ~165-170 MiB). `lab` probe `density` boots the row's number of workspaces, logs into each, lets them settle 10 s, times one more's first login, and ends them all before the next measurement. On the bench (c8id.4xlarge, 16 vCPUs, 32 GiB, nested), 2 vCPU / 2 GiB workspaces, idle, 10 of each interleaved: with 0, 4, 8 and 16 already running the first login is 332/343, 328/340, 328/345 and 326/338 ms (lab 44667235868). Each of the crowd took ~625 ms to boot and log into. Idle workspaces do not move the first number up to 16 on this host. The 25% point is past that. Not measured yet: a CPU-bound crowd (`load=cpu`), more than 16, and metal. A first run left every crowd up until the experiment ended (m.Cleanup runs then) and measured a host carrying a growing pile of machines (lab 44665519945); the probe ends its crowd itself. - -**11-20 · lab/machine · multifd channels on the checkpoint, the no-systemd floor, and spin's shape (#320, lab 44750713447, lab 44750322384).** The two experiments of the methodology review, and the first runs in spin's shape (#319). *multifd:* `spin-machine save` and `restore` move a checkpoint's memory over `--channels` threads (QEMU's multifd on mapped-ram); with QEMU started ahead, in the ladder's shape, the restore's first login reads 140.9/152.0 at one channel, 140.5/178.0 at two (inside the noise), 101.5/117.4 at eight and 93.5/114.9 at sixteen, Δp50 −47.4 [−54.4, −39.4]: the first goal number under 100 ms. In spin's shape the p50 falls 149 → 114 but ~20% of restores with channels (56 of 280) stall ~400 ms between running and the login, against 5% at one, and the p95 goes 254 → 435. *Floor:* `lab tree --edit floor` boots sshd with no systemd before it, a bound only: the ladder's shape 322 → 219 (Δ −103.5 [−108.6, −100.5]), spin's 445 → 240 (Δ −204.8); sshd accepts at 173 and 189 ms with nothing before it. *Spin's shape:* the cold first login is 445 ms against 322, Δ +122.9 [+116.6, +129.8]; accept to login 214 against 114. *Later the same day:* the stall was a guest left at 128 MiB. At 128 MiB MGLRU's `min_ttl_ms` (armed by tmpfiles at boot) forbids eviction for the first second, so the guest OOM-kills sshd-session, logind and systemd units, and the client retries (lab 44784196287: kills up to 27, failed logins up to 14 a login); a second, idle ~400 ms stall in states saved with 8 channels sat inside sshd's key authentication. spin sizes every workspace to 2048 MiB right after its start (spin's `vmm.resize`), and sized so (`plugged=2048`) neither appears: no kills, every row's gap p95 under 69 ms (lab 44788801555). Restored into a QEMU started ahead, spin's shape and login: 150/156 at one channel, 103/108 at 8, 92.7/111 at 16, Δp50 −57.4 [−59.4, −54.3], and 16 against 8 −11.0 [−13.0, −7.9] (lab 44789688221). *Status:* channels kept. Restores run side by side decide the default count: 8 since 11-20 (#332). The floor edit is kept as the bound's instrument. - -**11-20 · qemu/machine · the hotplug controller scans the places it has (#324, lab 44788216590).** In spin's shape the 4 hotplug disks' virtio-scsi controller made the guest scan 256 targets at boot: `virtio_scsi_init` 12.1 ms (lab 44587603255), ~460 of the boot's exits (QEMU's trace, laptop). `qemu/patches/0002` gives virtio-scsi a `max_target` property (default 255, a disk plugged above it is refused, the build asserts the property), and the machine sets it to the hotplug disks less one, so the guest scans the places a disk can be attached to and no more. Every place is still scanned, unlike `scsi_mod.scan=manual` (rejected: it loses disks); 4 disks attached to a running guest all appear. On the bench, spin's shape (`plugged=2048`, `login=spin`), 20 each against the same QEMU without the property: first login 512/531 → 503/514, Δp50 −8.9 [−15.5, −0.9], sshd accepts −10.3 [−18.8, −0.2], the console prompt −12.5 [−19.0, −5.3]. The fingerprint moves for machines with hotplug disks, so their older checkpoints boot cold. In the same run `CONFIG_SCSI_SCAN_ASYNC` (#325) read −2.6 [−8.9, +6.8]: rejected. The decompressor without its VGA cursor (#328) and an uncompressed payload (#326) are in "Measured and rejected" (docs/boot-time.md). *Status:* kept. - -**11-20 · machine/lab · a checkpoint's memory moves on 8 channels by default (this change, lab 44792429636).** One restore at a time, 16 channels were best in spin's shape (92.7 against 103 at 8, lab 44789688221), but each channel is a thread of QEMU's and restores share a host. `lab` probe `restore-together` lets 1, 4 and 8 restores go at once, each from its own checkpoint into its own QEMU started ahead, evicted from the page cache. On the bench (spin's shape and login, 30 bursts, first logins pooled; the pooled interval is narrower than the truth, since restores in one burst are not independent): alone 152 / 100 / 90.2 ms at 1 / 8 / 16 channels; 4 at once 184 / 140 / 143; 8 at once 400 / 329 / 337. Against 8, 16 gains −10.1 [−12.2, −7.6] alone and loses +3.2 [+1.1, +5.8] at 4 at once (+10.9 [−4.7, +30.4] at 8). The rule set before the run picked 8: it gains on 1 at every count. `machine.DefaultChannels` is 8. A Save or Load that names a count, and `spin-machine save/restore --channels`, still choose any. A fast load or a stream state stays at one thread. The release record's restore numbers measure each release at its own default, so this release's Δ against the one before it is the change. Eight restores at once take ~330-400 ms whatever the count: what a host does with a burst is its own question. *Status:* kept. - -**11-20 · CI · the builders are images, and the apk locks are gone (this change).** The daily apk-lock refresh (`c6c29b5`) kept the locks buildable, at a price: Alpine's mirror serves only the newest build of each package, so a lock moved every two or three days (11-09, two on 11-12, 11-19, #308 on 11-20), and the lock is the first layer of QEMU's build, so each move compiled QEMU cold on its pull request (17-21 min) and again on main (12 min), since only main exports the cache. #308 was libxml2 r2 → r3, which nothing links. QEMU's and e2fsprogs' builders are now images, Alpine with the part's apk.list installed (`builder/Dockerfile`), published to ghcr and pinned by digest (`qemu-builder`, `e2fsprogs-builder`). An image keeps its packages after the mirror drops them, so nothing forces a move: refresh.yml makes them again weekly and proposes the ones whose packages moved, with the list of what did. The tag is a hash of the Alpine, the list and every package installed, so it never names two images. A part's build stops at its first step when the tree's apk.list is not the builder's. In place. - -**11-20 · CI · qemu.yml, kernel.yml and image.yml are parts.yml (this change).** Three workflows of the same shape, each a path-filtered `changed` job and build, and none of them a required check, since a path-filtered workflow does not report on a change outside its paths: a pull request could merge with its QEMU build red (#309's was not blocking). One workflow now, with no path filter: `changed` decides for each part, the builds run when it says so, and `parts` (`spin-machine-dev needs`) fails when one that ran did not pass, which gives a ruleset one check to require. A change that reaches all three runs one `changed` where it ran three (each a billed minute). Over the 200 runs before it (gha-optimize, 2026-11-20): build p50 1m01s cached, cold 10-22 min; `changed` 20 s. In place. - -**11-20 · lab · each release's numbers in the repository, measured alone (this change).** The ladder (11-19) made every release re-measure the newest five on the bench (~13 min of the `report` job), uploaded a 31 MB ladder.json as a release asset and ended the release's notes with a table: numbers no one could share or read back but by downloading the asset, and the same five releases booted again with every release. Now the `report` job measures the release alone (`spin-machine-dev releases measure`, a ladder of one), keeps its p50/p95s as `docs/releases/RELEASE.json` with its host, date and run (whose artifact keeps every sample, 90 days), writes `docs/releases.md` from every record (a Mermaid chart of each goal number release by release, the tables, where each was measured), and proposes both as a pull request as the release app. It boots one release where it booted five, and nothing goes on the release. *Why alone, not beside the release before:* every record is then read the same way, one run each, and the page says plainly what that costs: the 11-19 report said v20261119.02 accepted SSH 7.3% later than v20261119.01, and the two interleaved said they did not (labs 44583379559, 44600043625), so a Δ on the page is a lead and a decision is `lab ladder` over the two, interleaved. `releases compare A B` prints two records with each one's host and date, and that command. Past releases are `releases missing`, measured by `report.yml` dispatched with `versions` (each alone, one after another, proposed together). Seeded from the two ladder.json assets there were, taking only each one's newest release, the one that run was for: v20261120.01 (cold 327/337, restore 159/164, run 44641240861) and v20261120.02 (cold 323/329, restore 168/180, run 44727451080); the older releases inside them were measured interleaved, and are left for `releases measure`. `lab publish` and the release-notes section are deleted. - -**11-20 · lab · the records' chart is an SVG, and the records a web page (this change).** The page's two Mermaid `xychart-beta` blocks drew one p50 line each and could not draw a gap: a release without a number was left off that chart's axis, so the cold and the restore charts had different x axes, and neither showed the p95. `spin-machine-dev releases doc` now writes `docs/releases.svg` beside the page, from the same code (`lab.Chart`, hand-written, no dependency): both goal numbers on one axis, each a p50 line over a band to its p95, broken where a release has not the number, the 100 ms goal dashed, a tooltip on every point. One SVG is shown on GitHub's light page and its dark one, and an image cannot follow the theme, so its two colours were chosen to clear 3:1 on both (#2a78d6, #d95926; dataviz's palette checks against #ffffff and #0d1117) with text in a mid grey (3.9:1 and 4.8:1). `releases site` writes the same page as one HTML file with the chart inline, so its tooltips show, and each record beside it. `pages.yml` publishes it at https://spin-stack.github.io/spin-machine/ from every merge that changes a record. The tables are one list of rows that the Markdown and the HTML both write, so the two cannot say different things. Each release in "Where each was measured" now links its record. - -**11-20 · lab/docs · the methodology review, and docs/boot-time.md (this change).** Two adversarial reviews of how boot time is measured, each finding re-run on the ladders of runs 44641240861 and 44727451080 (five releases interleaved, 20 boots each). *Found:* -- No per-phase budget existed, so nothing said whether 100 ms is reachable. Split by phase, the cold boot spends ~125-135 ms in QEMU, qboot and the kernel before PID 1 runs. The no-systemd floor (209 ms) was measured once, on 11-13, on an 87 ms kernel. -- The goal probes boot a shape and a login path spin does not: no CPU or memory ceilings, where spin boots 1 CPU and 128 MiB with ceilings of 16 and 8 GiB (the kernel 86.6 ms against 62, lab 44587603255), and an `sshd-vsock.socket` that spin turns off. -- Effects inside the noise were accepted. Two releases booting the same guest read Δp50 of the first login in [−8.7, +4.8] ms (bootstrap, n=20), yet the logind socket's −4 and `driver_async_probe`'s −5 were kept while −8 and −6 were rejected as noise. -- `docs/releases.md`'s Δ is drift between runs: v20261120.01's restore login read 158.9 and 167.0 in the two runs. -- The bzImage's cost was recorded as zero by a clock that starts after decompression: sshd accepted ~10-13 ms later from v20261119.01 to .02 while "Freeing" went 76 → 62.5. -- `restore-first`'s `read` reads the mapped-ram file's holes (2 GiB for 155 MiB of data), and its `up` times the monitor socket. - -*Decided by the maintainer:* the kernel, systemd, QEMU and qboot may all be patched without limit. systemd is a must, so a no-systemd init is only ever a bound. *Done:* `docs/boot-time.md` holds where both numbers stand, the per-phase budget, the method with one acceptance rule (a gain when the 95% interval of Δp50 excludes 0), the kept and rejected tables, the measurement pitfalls, and what is next. This log's former "Where we stand", "Measured and rejected", "Measurement pitfalls found" and "Open questions" moved there. *Next:* the probes in spin's shape (branch `lab-measure`); multifd channels on the restore and the no-systemd floor on today's kernel, both on the bench. - -**11-20 · lab/image · spin's login, spin's memory, and spin no longer lingers (this change).** What spin expects of the guest's SSH server, read in spin-stack/spin at 1bd3414: sshd on 127.0.0.1:22 reached through its supervisor's vsock forwarder (a Go dialer, so TCP_NODELAY), ssh.service started by the supervisor's `systemctl reload-or-restart` when it installs the user CA and before it lets SSH through, a certificate for **root** (the CLI, the exec server and the terminal agent all log in as root), sessions in `user.slice` (spin writes its memory limits there, internal/guest/sessionmem), and a workspace sized to 2048 MiB through virtio-mem right after its start, before the guest's handoff (vmm.go, resize). The goal probes did none of it: they logged in as spin through systemd's vsock socket, an `sshd@` a connection, and left spin's shape at 128 MiB. *Found, on a laptop (leads, not nested):* -- At 128 MiB the guest's OOM killer runs through the boot and the logins: user@1000, logind, `sshd@`, `ssh.service` and session scopes killed, ssh.service hitting its start limit, logins lost and retried, in every boot of spin's shape. Sized to 2048 MiB right after its start (67-79 ms to plug) nothing is killed. Every number in spin's shape so far measured a guest spin never runs. The ~400 ms stalls between running and the login in ~20% of multifd restores (lab 44750713447) look like it. -- spin's path costs less than the lane's: accept to the first login 67-70 against 142-155 ms, a warm login 27-30 against 33-37 (6 boots each, 2048 MiB). socat as the forwarder without `nodelay` read 69 ms warm against 26 with it: Nagle against the delayed ACK, which spin's Go forwarder does not have. -- On spin's path, sessions of class `user-early-light` and nobody logged in as spin, the lingering user@1000 is a systemd --user started in every boot for nobody: without it accept to login 40 against 70 ms and the first login 294 against 316 (6 each); through `lab run`, 8 each, first login −13.1 [−33.3, +5.6], accept to login −7.1 [−28.5, −2.4], the console prompt −37.8 [−63.2, −22.4]. The lane's login as spin did not move (283 against 281). -- Measured and not kept, each a lead on spin's path: `UsePAM no` refuses root, whose password is locked, and would take the session and `user.slice` with it; pam_systemd removed, −15 ms on the first login and −5 warm, but no session, no `XDG_RUNTIME_DIR` and no `user.slice`, where spin holds a person's sessions below the machine's memory; the sshd PAM stack cut to pam_nologin, pam_unix, pam_loginuid and pam_systemd, nothing (70 against 67). Exec costs, warm: `sshd-auth` 1.7 ms a start against 0.56 for `true` (16 libraries, 7 of them Kerberos'), `sshd-session` 0.9, `sshd -t` 2.2; a rebuilt OpenSSH without GSSAPI has a ceiling of ~1-2 ms a login, under the bench's noise. - -*Changed:* `lab`'s shape options `plugged=MIB` (the guest sized right after its start, as spin does) and `login=spin` (root, through a socat forwarder to ssh.service, systemd's vsock socket masked), both off by default. The image no longer lingers spin, and `--edit nolinger` puts that into a release's overlay. *Measured on the bench* (spin's shape, `plugged=2048`, `login=spin`, 20 each, interleaved): the first cold login 532/551 → 496/514, Δp50 −36.1 [−45.8, −23.6], accept to login −26.9 [−39.8, −18.9], the console prompt −89.5 [−103.6, −73.9], QEMU's RSS −7.9 MiB (lab 44785179901); `prestart` cold −27.4 [−32.7, −19.9], prestarted −25.8 [−35.2, −15.1], both restore rows within the noise (lab 44785565313). *Status:* kept. - -**11-20 · boot · the time before the kernel's clock gets an instrument (this change).** docs/measuring.md's rule 7 (then docs/boot-time.md's rule 6): the bzImage's decompression ran where no clock looked. QEMU zeroes kvm-clock as the machine goes to "running" (`kvmclock_vm_state_change`, KVM_SET_CLOCK with the 0 a machine never run has), and the kernel prints the kvm-clock it read when it made it the scheduler's clock ("kvm-clock: using sched offset of N cycles", in ns). The probe init prints that line and "Freeing" with their kmsg times, and `boot:firmware-stages` places them on QEMU's trace: after the firmware's last select, "to the kernel's clock" (the initrd's copy, the jump, the decompression and the kernel's setup until kvmclock_init), "kernel to Freeing", and "Freeing to SPIN-READY", what is left, which a wrong anchor would push below zero and the probe refuses. Its default shape is spin's (1 CPU, 128 MiB, ceilings 16 and 8 GiB, 4 hotplug disks), and `lab check` hands a second tree to it as SPIN_MACHINE_OUTPUT_B. *Checked, laptop, a lead (8 boots each interleaved):* v20261120.02 (bzImage) against v20261119.01 (PVH, no decompressor): to the kernel's clock 24.3 against 7.9 ms, kernel to Freeing 28.4 against 34.3, and Freeing to SPIN-READY 9.5 against 9.7: what moved is the phase the bzImage added, and the residual on the other side of the anchor did not. The bench reading is next. - -**11-20 · lab · initcalls and density size their guests (this change).** v20261120.03's release report failed on a diagnostic: `initcalls` lost 3 of 40 boots, and the report of 63049ff 4 of 40, each `never saw "SPIN-DMESG-END" in 1m30s` with an empty console tail (report runs 44800662338, 44805222647). ssh-first and the restores lost none in either, and initcalls lost none in the 2-vCPU, 2 GiB shape (44735598126). `plugged=2048` became every probe's default, but only ssh-first, restore-first, prestart and restore-together called `Plug`: initcalls and density booted spin's shape and left it at 128 MiB, while the record said "sized to 2048 MiB". Such a guest had 6 MiB of its 72 free, and had already stalled on memory, when the dump ran (laptop, 3 boots; sized, 1.9 GiB free and no stall), so the bench's loss reads as a guest at the edge of its memory. That is a lead: the laptop lost none of 20 at 128 MiB, and the tail that would say so was empty because `readUntil` returned nothing on a timeout, which it now does not. Both probes now plug as the others do, and a test holds that every probe taking `plugged` needs `memory --to`. initcalls' numbers are now of the kernel booting while virtio-mem plugs, which is what spin's kernel does, so its record moves with this: "Freeing" read 43.1/50.2 sized against 33.6/212 unsized (laptop, 20 each, two runs apart: a lead, not a Δ). *Decided by:* 0 lost in 40+ bench boots (the dispatch on the PR). - -### Week 12: 2026-11-21 to 11-27 - -**11-21 · lab · the probes boot, size and log in as spin does, unless asked (this change).** #319 made spin's shape the probes' default, but left the guest at 128 MiB and logged in by the lane, and both made numbers spin never sees: at 128 MiB the guest OOM-kills its way through the boot (lab 44784196287), and on spin's path the cold first login read 532 ms where the lane's read 445 (labs 44785179901, 44750322384). `plugged` is now 2048 and `login` spin unless a run says otherwise; `plugged=0 login=lane` with the old shape options is the shape before. The release records measure what the probes measure, so the first record after this one is the first in spin's shape, and its pair's Δ (`against`) is measured in the same shape. The `floor` edit's sshd serves the lane, so a floor run passes `login=lane`. - -**11-21 · image/lab · where one vCPU's time goes before the first login, and what the CPU weights do (laptop leads, PR #329 closed).** With the guest sized to 2048 MiB (`plugged=2048`) one vCPU adds ~85 ms to the first login against two, on the lane and on spin's path alike (4 boots each). The guest spends ~225 ms of CPU to the login either way, with 0 ms idle at one vCPU: the second CPU used to run beside the login what one CPU runs before it, and no unit waits longer of its own. Up to the login, in ms of CPU at one vCPU on spin's path: PID 1 ~49, udevd with its workers, trigger and credentials ~41, the kernel and its threads ~31, the lingering user@1000 ~20 (gone since #327), `ssh.service` with its `sshd -t` ~20, journald ~13, logind ~13, the session ~9-12, dbus-broker ~7, the host-key generation ~5, getty ~3. `StartupCPUWeight=1` on udevd and its coldplug trigger took the lane's first login 285 → 240 ms (Δp50 −45.7 [−49.3, −35.8], 12 boots each) and did nothing on spin's path (308 against 307): there `ssh.service` and the forwarder wait for `basic.target`, which waits for udev, so its CPU is on the login's path whatever its weight. `children_max=2` and journald's `ReadKMsg=no` gained nothing. On spin's path the host keys `spin-machine-sshd-keygen` makes are not loaded (spin's own key comes first), ~5 ms of CPU `ssh.service` waits for: spin could mask the unit at its handoff. Not benched. The lever is the order spin starts the login in (docs/boot-time.md, "Open experiments"). - -**11-21 · lab · restores in a burst (lab 44792429636).** Beside picking 8 channels (above), `restore-together` showed that 8 restores let go at once take ~330-400 ms each to the first login at any channel count, against ~100 alone and ~140 four at once. Not explained (docs/boot-time.md, "Open experiments"). - -**11-21 · image · spin's login path starts from the boot's first dispatch, beside udev at the lowest weight (lab 44805051310, PR #338's edits).** docs/boot-time.md's "Open experiments" row, a bound on spin's path. ssh.service alone without default dependencies had still started right after basic.target: it is after Ubuntu's `sshd-keygen.service`, wanted by it and with default dependencies, whose `ConditionFirstBoot` never holds here: a job waits for its ordering before PID 1 checks its condition. logind and dbus-broker had none, but `PrivateTmp=` orders a unit after `systemd-tmpfiles-setup.service`. `lab` edits `login-early` (ssh.socket, ssh.service, sshd-keygen and the probe's forwarder without default dependencies, shutdown conflicts kept; logind and the broker with `PrivateTmp=no`) and `udev-startup` (udevd and its trigger at `StartupCPUWeight=1`). On the bench, spin's shape and login, v20261120.03, 20 boots each interleaved: `login-early` first login −10.8 [−16.3, −5.2], sshd accepts −33.6, accept to login +23.0, console prompt +18, because with the login early it ran beside udev's coldplug on the one vCPU. Both edits −59.4 [−65.9, −56.2], accepts −56.0, accept to login −4.6, second login +6.1 [+3.7, +7.9], console prompt +51.4 (the serial getty waits for dev-ttyS0, which the coldplug announces). On a laptop, sessions had their `XDG_RUNTIME_DIR`, no unit failed and poweroff stopped QEMU in ~123 ms as the release does. *Side effects:* logind and the bus share the machine's /tmp (read-only to logind under ProtectSystem=strict); the console prompt later; udev's coldplug finishes later. *Status:* the image's half kept (`image/`: the three `10-lane.conf`, `30-privatetmp.conf`, `20-startup.conf`, asserted by build.sh). spin's supervisor forwarder is spin's to order, proposed in docs/boot-time.md's "Open experiments". parts.yml keeps no image artifact, so the image is measured as the release with `--edit lane`, which now carries these drop-ins, and `--edit forwarder-early` orders the probe's forwarder as spin's supervisor would be. A laptop lead, 8 boots each: the image with the forwarder as spin orders its supervisor today (after basic.target) +21.3 [-46.1, +261.0], with it early -56.0 [-116.5, +169.8]: with udev at the lowest weight, basic.target can come later, and the image alone may cost spin until its supervisor moves. The bench decides. - -**11-21 · lab/machine · the restore into a QEMU started ahead, taken apart (laptop leads; the `split` probe, branch `restore-split-lab`, not for main).** 106/112 ms on the bench (lab 44798669409): running at 59, the login ~47 after. `lab` probe `split` runs the prestarted QEMU under its trace with host timestamps and reads the guest's journal and per-task CPU. *To running* (laptop, spin's shape, 8 channels, state evicted, 24 restores): spin-machine's exec and dial 2.1 ms, ~20 QMP round trips to migrate-incoming 6.0 (query-cpu-model-expansion 0.5 of it, each round trip ~0.25), the header 1.5-9 (the first read of a cold file), the RAM load 50.4, the device state 3.4 (~0.4 a virtio device), to running 1.1, the reply 1.5. The state is 181 MiB of data: the guest's ~117 MiB in use, the memmap of 2 GiB plugged, the kernel; settling 10 s before the save took off 3 MiB, so free page reporting has little to give. Read from the page cache the load is ~10 ms instead of 50 (running 29.6 against 78, 6 each), so the load evicted is the disk. `direct-io` (O_DIRECT for the channels) was within the noise evicted and +45 ms cached. *Running to the login* (laptop ~33 ms, guest clock from vmgenid's "crng reseeded due to virtual machine fork"): the accept probe's connection ~5 ms (socat's child, sshd forking an sshd-session that reads EOF), the connection to "Accepted publickey" ~22, the session and `true` ~4. A second login right after reads 25-29, so the restore costs the first login ~5 ms over a warm one here. The probes' logins were never closed (`Key.Run` gave Go a blocking socket, closed only once nothing read it): the checkpoint held the cold login's session, and the restore's vsock transport reset tore it down beside the login timed. Closing it: 37.1 → 34.8 ms after running, dropping the accept probe as well 31.5 (8 each). *On the bench* (spin's shape, v20261120.03, 20 each): `split` (lab 44809015139) read to running 58.7 ms, of it the RAM load 38.8, the QMP round trips 8.3, the dial 2.3, the device state 4.5; the login left open cost the first login ~5 ms (104 → 99.1), the accept probe ~4 more (95.3). `prestart` (lab 44809512339), the read-ahead against the release: restored into a QEMU started ahead 95.0/100 → 82.1/87.4, Δp50 −12.9 [−14.7, −9.8], running −11.9; restored −12.1 [−15.3, −8.9]; the cold boots within the noise. *Changed:* the probes close their logins; `machine.Resume` reads the state's data ahead from its first line. spin resumes through `machine.VM.Resume` (`internal/runner/qemu/checkpoint.go`), so it takes the read-ahead with the pin. *Status:* kept. - -**11-21 · lab · where a burst of restores waits (laptop leads; this change).** Lab 44792429636's samples, read again: the eight-at-once rows read ~210 ms to the first login (running 165-177) in their first three bursts, at 1, 8 and 16 channels alike, and 285-480 in every burst after; the extra is before running (1 channel: running max 168 → 369 p50, the median login 44 ms after it both times; 8 channels 166 → 272, 46 → 67 after), one and four at once at 8 and 16 channels do not move over the run, four at once at 1 channel creeps 165 → ~190, and no restore is slower for its place in the order (each index's mean rank 2.8-4.1 of 0-7). A host whose state changed during the run, which only a burst feels. `restore-together` now records what the host counted during each burst (PSI stall time of CPU, I/O and memory; `/proc/vmstat`'s direct reclaim, compaction stalls and huge-page fallbacks, MiB read; CPU busy; memory free and cached going in) and every restore's `running`, and takes `states=cached` (the disk out of the burst) and `defrag` (the host's THP defrag policy for the burst). *Laptop, i9-13900HK, not nested, 5-6 bursts a row, leads only:* 8 at once from the disk read 590-740 ms against 107-110 alone, the disk the bound (1.4 GiB at ~2.7 GB/s, I/O PSI full ~120-260 ms a burst) with or without huge pages. From the page cache: 440-445 ms under the default `madvise`, with ~3000 compaction stalls that all failed, ~2.4 GiB scanned by direct reclaim and memory PSI full ~250 ms a burst, and 85% of 20 CPUs busy; 133 ms with huge pages off for QEMU (PR_SET_THP_DISABLE, a wrapper, Δ −307 [−437, −156]); 150 under `defrag=defer` with no compaction and memory PSI 3 ms. Alone, huge pages off cost +16.0 [+8.9, +22.6] after running (the guest on 4 KiB pages), and `defer` 74.5 → 80.3 (5 each). QEMU marks guest RAM MADV_HUGEPAGE, so under `madvise` every fault of a load that finds no free 2 MiB block compacts and reclaims before it returns: one restore finds the ~90 blocks it needs, eight need ~700 at once and fight over them, and a host that has run a while (a page cache full of states, the bench after its first ~20 GiB) has none to spare. spin restores workspaces concurrently (spin-stack/spin at 1bd3414: an actor goroutine per workspace in `internal/runner/reconcile`, a per-workspace lock in `workspace.Manager.Resume`, up to 10 commands at once in `handler`), and leaves the host's THP policy as the distribution sets it. *On the bench* (lab 44810128678, v20261120.03, spin's shape, 8 channels, 30 bursts a row, every restore one sample): under `defer` against `madvise`, 1 at once 99.6 → 99.5, Δ −0.1 [−2.0, +1.6]; 8 at once from the disk 283/384 → 239/281, Δ −44.1 [−53.2, −35.2]; from the page cache 1 at once 72.3 → 72.0, 8 at once 268/317 → 193/241, Δ −74.9 [−83.2, −64.9]. *Decided:* THP defrag `defer` is a requirement of spin's host (`/sys/kernel/mm/transparent_hugepage/defrag`; `docs/memory-and-disk.md`): it gains in a burst and costs one restore alone nothing, spin never sets the policy and Ubuntu's default is `madvise`. *Not explained:* 8 at once under `defer` still read ~190-240 against ~100 alone, and from the cache barely less than from the disk. `restore-together` now records where a burst ran on the host's CPUs: each CPU's busy time (/proc/stat) and interrupts by line (/proc/interrupts), the CPUs QEMU's running threads were on, sampled every 5 ms, and the QEMUs', the job's CPU lists and irqbalance. It records them because nothing pins QEMU (spin-machine runs it with `-sandbox resourcecontrol=deny`, spin sets only a cgroup `cpu.weight`) and one CPU taking the disk's interrupts or the threads would look like this. *Where on the host's CPUs* (lab 44817486118, v20261120.04, 20 bursts): not one CPU. In the 8-at-once rows the busiest CPU held 6-7% of the busy time (16 CPUs evenly would be 6%), CPU 0 was busy 212-270 ms a burst against the others' 221-276, the interrupts were spread (the busiest CPU 7%, an NVMe queue on top), irqbalance runs, and the job and every QEMU may run on 0-15; QEMU's threads ran on every CPU about alike. What the burst is instead: the host's CPUs 72-78% busy (CPU PSI some 84-190 ms a burst), so 8 restores of ~1 CPU-burst each on 16 CPUs are near the host's capacity, and direct reclaim of the page cache that the states fill (MemFree ~2 GiB of 32 against 28 GiB cached; pgscan_direct 408k pages under `madvise`, 48k under `defer`, with 743 allocation stalls). Here `defer` read 379/445 → 302/388 at 8 at once and 83.2 → 84.0 alone. *Next:* the host keeping memory free ahead of a burst (kswapd's watermarks, `vm.watermark_scale_factor`), and the CPU a restore costs. - ---- - -**11-21 · CI · a release is measured at its tag and recorded by main (this change).** report.yml checked out the release's tag and ran `releases measure`, which wrote the record and the page with the tag's code, and `releases propose` put them on main (#337). v20261120.04's proposal (#350) failed main's TestTheCommittedPageIsTheRecords: #342 had changed `lab.Chart` after the tag, so the tag's page was not the one main writes from the same records, and it was fixed by hand with main's `releases doc` (75a3b24). Measuring stays at the tag, which boots each release with its own spin-machine and the tag's probes, and `releases measure` now only keeps the ladders. A second checkout of main builds its own spin-machine-dev, `releases record` (now taking every ladder.json) writes the records and the page, and `propose` runs there. Functional: no boot number moves. - -**11-21 · lab · what we carry, and what it earns (this change, lab 44818953987).** The reverse of a kept change: every boot-time modification the tree carries, with the shape and host it was kept on, in docs/boot-time.md's section of that name, grouped for removal one arm a group. Found before the bench: 15 masks and 1 disabled generator name units the image does not have (deleted, #352). The 5 masks of `ConditionNeedsUpdate` units are load-bearing, because the image has no `/etc/.updated`, and unmasked they rebuild hwdb.bin and the linker cache at every boot (first login +260 ms, QEMU's RSS +90 MiB, laptop). *Measured* (prestart, spin's shape, 20 each against v20261120.04, the removal's Δp50 of the cold first login): every kernel patch +67.5 [+62.5, +72.4]; SeaBIOS for qboot +68.5; the 16 other masks +57.5; the generators +16.7; the coldplug filter +14.9, and without it a restore +464 (a guest saved with its coldplug still running, a guess); QEMU 0001 with qboot's PAM patch +11.5 [+6.7, +20.2]; `driver_async_probe` with `rcu_expedited` −1.4 [−4.9, +3.1]; kernel 0006, 0009, 0011 and the in-doubt options +1.2 [−4.5, +8.3]; PID 1's quiet logging +2.4 [−2.3, +7.8]. In one vCPU what runs before the login is on its path, so most of what was kept on two still earns. *Status:* the command-line pair deleted (#352); A1 and the logging measured again at 40 boots, cold; the rest kept, with what it earns in the table. A1 deleted 11-20 (#345), the logging 11-20 (#354). - -**11-21 · machine/image · what earned nothing in spin's shape, deleted (lab 44818953987).** The first decisions of the carry ablation (docs/boot-time.md, "What the machine carries"; #349). `driver_async_probe=` for rng, balloon and vsock (11-13, 2 vCPUs, inside the noise at the floor) and `rcupdate.rcu_expedited=1` (09-07, never measured) leave the command line: taken out together, on the bench in spin's shape, 20 boots each against v20261120.04, the first login read −1.4 [−4.9, +3.1] ms cold, +1.4 restored and +1.7 into a QEMU started ahead. With one vCPU an asynchronous probe has no second CPU to run beside. The command line is not in `Spec.Contract`, so the fingerprint does not move. And 16 masks in optimize-systemd.sh named units no package installs (timesyncd, pcrmachine, both tpm2-setups and the tpm2 generator of a systemd built without TPM2, boot-system-token, avahi, cups, bluetooth, smartd, both e2scrubs, both multipathds, lvm2-monitor, run-lock.mount): deleted without a run, and image/build.sh now fails a mask that shadows nothing. *Status:* in place. - -**11-21 · kernel · 0006, 0009 and 0011 deleted (labs 44818953987, 44822157367, #345).** The kernel's half of the carry ablation that read nothing in spin's shape (docs/boot-time.md, "What the machine carries"): 0006 parses vmlinux BTF on another CPU and 0009 polls for a booting AP, and spin boots one vCPU. 0011 had never shown a time, even nested. Taken out together, against v20261120.04, the cold first login read +1.2 [−4.5, +8.3] ms at 20 boots and −2.5 [−8.4, +1.8] at 40 (sshd accepts −1.9, the console +4.2, both within noise). The arm was meant to carry `DEFERRED_STRUCT_PAGE_INIT=n` and the loop and 8250 counts back as well, and did not: the branch's commit staged the patches' removal and not the config, so the parts run (44812044088) built the three patches' removal alone and those options were measured only inside the whole stack's arm, which is kept. *Status:* the three patches deleted; the options open. `DEFERRED_STRUCT_PAGE_INIT` deleted 11-21 (#356); the loop and 8250 counts kept, #357 closed. - -**11-21 · image · PID 1's quiet logging and the printk sysctl deleted (labs 44818953987, 44822157367, #354).** optimize-systemd.sh set the manager's `LogLevel=err`, `LogTarget=journal`, `ShowStatus=no` and `StatusUnitFormat=name`, and wrote `kernel.printk = 3 3 3 3`, for a quiet, fast boot, never measured. Taken back together (`lab` edit `carry-logging`) against v20261120.04 in spin's shape, the cold first login read +2.4 [−2.3, +7.8] ms at 20 boots and −1.8 [−7.7, +3.2] at 40; accept to login +1.7 [+0.2, +3.2], the second login +1.8 within noise. The console is quiet through the command line's `quiet loglevel=3` either way. The timeouts in fast-boot.conf stay. The `carry-*` edits stay too, as the tool to run the ablation again (docs/boot-time.md). *Status:* deleted. - -**11-21 · kernel · `DEFERRED_STRUCT_PAGE_INIT` deleted, the loop and 8250 counts kept (lab 44839538785, #356, #357).** The three options #345's arm meant to measure and did not, one arm each against main's kernel (d255113), prestart in spin's shape, 40 boots a side, v20261120.04's QEMU and image. `DEFERRED_STRUCT_PAGE_INIT` off, upstream's default: cold first login −2.5 [−9.3, +3.8] ms, restored +1.1 [−6.4, +7.9], into a QEMU started ahead −4.0 [−13.0, +13.3]. It was kept on 11-13 for a memmap of 5.2 ms at 2 GiB at boot (lab 43495583323). spin boots 128 MiB, which the kernel does not defer, and plugs the rest through virtio-mem, which it never defers. A boot option does not run in a restored guest, so the restored row's upper bound over +5 says the run's noise, not the option. Upstream's 8 loop devices and 4 runtime ports: cold +5.3 [−3.2, +15.0], restored +1.7 [−6.7, +12.7]: within noise, but the cold bound does not rule out the 2-4 ms the initcalls and udev's coldplug of 8 more block devices would cost, so the counts stay. *Status:* the deferred page init deleted; the counts kept. - -**11-21 · docs · the cold budget in spin's shape, and docs/boot-time.md (lab 44841266997, this change).** `ssh-first` on v20261120.04 as published, spin's shape and login, 20 boots: sshd accepts 396/406, first login 465/479, accept to login 68.4, a second login 35.9. With the release's report (QEMU's exec to a guest ready ~28 by difference, "Freeing" 79.9) and `firmware-stages` (33.6 to the kernel's clock), PID 1 to sshd accepting is ~255 ms, more than half the cold boot. The budget measured before was in the ladder's shape and showed ~75-85. A QEMU started ahead removes the first ~28 ms only: firmware and the kernel run after `cont`. docs/lab.md is renamed docs/boot-time.md and reordered for the next investigation: the numbers, both budgets in spin's shape, the method with the deletion rule, one ledger of what the machine carries, the rejected ideas by part with the shape each was measured in, the open experiments with their budget entries, and the questions no run answers. *Status:* in place. - -**11-21 · machine/kernel/qemu · the PVH boot path deleted (this change).** Since v20261119.02 the machine boots a bzImage through qboot and fw_cfg, and PVH stayed only as a fallback: `machine.OpenRelease` booted a release's vmlinux through `pvh.bin` when it had no bzImage, `--kernel` took a vmlinux, and machine's QEMU tests loaded an ELF stub through `pvh.bin`. Nothing called any of it. `OpenRelease` now requires `kernel/bzImage` and `linuxboot_dma.bin` and names the missing file. `--kernel` refuses a file without the bzImage's `HdrS` header. `pvh.bin` no longer ships, and machine.env loses `pvh_sha256`. The machine's QEMU tests load a bzImage stub instead. The kernel config changes: `CONFIG_PVH` is off, so the kernel and its checksum change, and the vmlinux still ships for what reads its symbols. *What it costs:* `lab compat` stops at the first release without a bzImage, which is v20261119.01 and every release before it, so v20261119.02 is the oldest it checks. spin's Taskfile.yml:250 checks for `_output/qemu/pvh.bin` and must drop that line. The fingerprint does not move: it hashes neither the kernel nor the option ROM. *Status:* in place. - -**11-21 · lab · the probes boot spin's 16 controller targets (lab 44847364468, this change).** spin's c0ffbc0 (2026-11-20) gave the hotplug controller 16 targets, 4 for disks attached at run time and the rest for the extensions a workspace boots with, where the probes booted 4. `ssh-first` on v20261120.04, 20 boots each, interleaved: first login −3.8 [−11.1, +4.5], sshd accepting −2.3 [−6.3, +2.4], within noise. *Why:* the probes measure spin's shape. *Result:* `hotplug-disks` defaults to 16, and the budget's rows taken with 4 stand. *Status:* in place. - -**11-21 · docs · every doc checked against the tree and spin's main (this change).** A pass over every document for claims the code no longer bears out: names, defaults, files, spin's policy (read at spin's d4f62bd), and *Status* lines. Numbers that only a run can settle are listed in docs/boot-time.md's open experiments, not changed. Two were measured: TCG reaches the first login in 7604 ms against KVM's 455, ~17 times, where the docs said fifty (`ssh-first`, lab 44848049631, 5 boots each). QEMU's mapped files are 6.6 MiB resident on v20261120.04 against the ~42 MB of 11-14, because the bzImage is read into QEMU's memory where the vmlinux was mapped (`ssh-first`'s new `qemu_rss_anon`, `qemu_rss_file` and `qemu_rss_shmem`, lab 44847770977). *Status:* in place. - -**11-21 · machine/lab · a named CPU model costs the cold login 27 ms on the bench (lab 44855890737).** For memories that resume on any host of a pool, `ssh-first` compared `host` with `lab tree --cpu baseline`, which is `machine.Models` plus `machine.Baseline` on the runner. The nested c8id's newest runnable model is Cascadelake-Server-v5: Nitro's L1 does not expose enough for SapphireRapids or GraniteRapids. Against `host`: first login +27.2 [+13.0, +30.8], sshd accepting +23.1 [+9.7, +28.5], warm login −0.4 within noise, QEMU's RSS unmoved. *Why:* spin runs `-cpu host`, so a memory resumes only on a host showing every saved feature (spin-stack/spin#1417). *Result:* a fleet-wide named model is rejected for now. `Baseline` stays public for spin. *Status:* open. Next is `host` minus the features a pool's hosts do not share, measured the same way. - -**11-21 · machine · a record read from QEMU replaces the fingerprint (this change).** The fingerprint was a sha256 over a prediction of the machine (`Spec.Contract`, the shape, the BIOS file's size), passed to QEMU as `-name` and read back. A refusal could not say what differed. spin overwrote its probe's fingerprint with one computed from a Spec of placeholders. And the release's `fingerprint_sha256` hashed the CLI's default machine, not spin's, so v20261120.03's notes said checkpoints still resume when spin's shape had moved (`max_target`). *Measured* (laptop KVM, QEMU 11.2.0-rc0, v20261120.04, mapped-ram, the fingerprint taken out so that QEMU decides): QEMU refuses by itself fewer or more boot vCPUs, another vCPU ceiling, another virtio-mem size, a missing device, a smaller RAM or BIOS block and another machine type. It loads silently an extra device (a vsock the guest never finds), a larger BIOS block and more base RAM, because mapped-ram's `parse_ramblock` refuses only a smaller block, and a larger `max_target`, whose extra targets the guest used. A QMP dump of spin's shape: between a machine held and the same machine after a boot, a memory plug, the balloon polled, a vCPU and a disk added, only the balloon's statistics, virtio-mem's sizes, ICH9-LPC's `pm_io_base` and `gpe0_blk` and the RTC's date moved; between two machines, the MAC, the vsock's context id and vmgenid's GUID. *Result:* `QEMU.Target` reads the machine from the running QEMU (every device it was started with and every property but those, its options, its RAM blocks, the features its vCPU has on), and `CanResume` compares two records and returns a `*Refusal` naming every difference. `max_target` may grow; the CPU's features compare as one set, so a richer host is refused too. At spin's shape the record is 25.6 KB of JSON and 126 features, read in 8 round trips, 8.4 ms (boot:record). boot:record holds a machine to its own checkpoint and the silent cases to a refusal by name. boot:compat checkpoints the release before with this tree's `spin-machine save` and compares records; its local run on v20261120.04 resumed. *What it costs:* read inside `Resume`, the destination's record put its 8 round trips on the second goal number: restore-first's first login +4.3 ms [+0.2, +7.5] evicted and +8.2 [+6.2, +10.8] cached against v20261120.04 (bench, lab 44868324811). None of it could leave the clock: QEMU answers no monitor while it loads a state, and a read on a second monitor from QEMU's greeting stayed on it (laptop, +29 ms against +16 read in `Resume`), because QEMU's main loop is busy from its exec to the end of the load. The source's record is read while QEMU writes the state, where QEMU does answer, which brought `spin-machine save` from +7.0 and +10.6 ms (lab 44866054104) to within the noise (lab 44868324811). *Decided* (the maintainer, option C): the destination's record is a constant of a host, its QEMU binary, its CPU and the shape it resumes into, so `Resume` takes it from the caller (`here`), runs `CanResume` before it sends QEMU anything, and never asks QEMU. spin computes it once at runner start and holds each pool machine to it once (spin-stack/spin#1416). `spin-machine restore --target FILE` takes one as given, `spin-machine target` prints one, and the restore probes read each tree's record once before measuring, from a machine held for a checkpoint in the probe's shape. With it, against v20261120.04, whose restore reads its fingerprint record (name, version and CPU, five round trips) inside the restore (bench, spin's shape, 20 each): restore-first's first login +1.0 ms [-2.3, +4.1] evicted and -3.0 [-6.2, +0.0] cached, running +0.1 [-1.7, +1.3] and -1.4 [-2.9, -0.7] (lab 44871809382); prestart within the noise in every row, its restored login -2.5 [-4.3, +0.3] and restored into a QEMU started ahead -1.6 [-3.1, +2.1] (lab 44872699993). A checkpoint or a stored identity from before is refused, as a `vmm` difference, and boots from disk once. A newer QEMU that adds a property to a device is a refusal, which boot:compat reports at the bump. `Spec.CPUWithout` and `Unshared` are there for spin#1417's pools, not yet measured. *Status:* in place; spin follows (spin-stack/spin#1416). - -**11-21 · machine/qmp · the machine sends QMP through the public client, each command defined once (this change).** `machine.QEMU` runs on `*qmp.Client`, and machine/qmp.go, the third QMP client after spin's two, is deleted. Every command the machine sends is a `qmpdef.Define`d value beside the code that sends it, and the block and descriptor commands spin's storage agent also sends are public in qmp/block.go. `spin-machine-dev verify qemu` holds all of them to the binary's query-qmp-schema, which refused the record's `query-kvm`: QEMU 11.2.0-rc0 deprecates it. The accelerator is read from `query-accelerators`, whose `enabled` is the accelerator's name, `kvm` or `tcg` for every machine `Spec.Args` starts, so the record's part stays `{"accel", "kvm"}` or `{"accel", "tcg"}`. The version comes from the monitor's greeting, which is query-version's answer, so a record is 7 round trips. *Measured* (laptop, v20261120.04 with QEMU 11.2.0-rc0, spin's shape, `spin-machine` built before and after): the record of a running machine and of one held for a checkpoint are byte-identical under KVM and under TCG, a checkpoint saved by the old `spin-machine` restores with the new one (`restore --target`), and boot:record passes. A round trip costs more through the client: query-memory-size-summary's p50 went from 216 to 263 µs, +47 [+44, +49], and in a second run from 136 to 159, +23 [+21, +27] (laptop under load, one held machine of spin's shape, the old and new client in turn, 6000 and 4500 each). What it pays for is the reader waking the waiting call on another thread: the same client under GOMAXPROCS=1 read 106 µs, below the old client. The record's read moved −0.4 ms [−2.6, +1.7] with one round trip fewer. A restore sends ~20 commands before QEMU loads its state, so 0.5-1 ms more on restore-first is expected (inferred, under the bench's noise at 20 boots). The query-migrate polls stay; events replace them in a change of their own, interleaved against the release on the bench, which decides both. *Status:* in place; no checkpoint is stranded. - -**11-21 · machine · a checkpoint's waits are its MIGRATION events (this change, labs 44898418357, 44898581478, 44898910862).** Checkpoint, Resume and Loaded asked `query-migrate` every millisecond until the migration reached the state they waited for. They now turn on the `events` capability with the others they set, arm a `qmp.Expect` for `MIGRATION` before the command that moves the migration, and wait on it. `query-migrate` is asked only after a save that failed, for its reason. *What QEMU 11.2.0-rc0 sends* (`TestACheckpointIsWaitedOnByItsEvents`, in `boot:record`, laptop and bench): a save sends setup, active, `STOP`, pre-switchover, device, completed. A full load sends setup, active, `RESUME`, completed, so the guest runs before the event. A fast load sends setup, active, postcopy-device, postcopy-active, `RESUME`, completed (bench only, where the runner turns userfaultfd on), so `Resume` returns before the guest runs, as it did when it polled. Half a state sends setup, active, failed, and QEMU exits (migrate-incoming's exit-on-error) with the reason on its stderr. A `query-migrate` after that event found the connection reset, so a failed load asks nothing and says where the reason is. *Measured* on the bench, spin's shape and login, 20 each interleaved, v20261120.04 with its own spin-machine against the same tree with this branch's (which also carries the record, the module rename and the public QMP client): restore-first's first login −0.4 [−2.9, +0.8] evicted and −1.4 [−3.2, +0.8] cached, running −0.3 [−1.8, +0.7] and −0.7 [−1.7, +0.3], all within noise (lab 44898581478). ssh-first's first login +0.9 [−5.4, +5.3], sshd accepts −0.2 [−5.1, +5.2], within noise; the console prompt read +6.1 [+0.3, +9.0], a diagnostic on a path this change does not touch (a cold boot waits on no migration), left for the next release's record to confirm or not (lab 44898910862). The 23-47 µs a round trip costs more through the client (the entry above) does not show at 20 boots. *Status:* in place; nothing a checkpoint records changes. - -**11-21 · machine · the verbs spin's runner drives a QEMU by (this change).** `machine.QEMU` gains `CPUs`, `Status`, `Hold`, `Shutdown`, `Done`, `End` and `GuestMemory`. `Memory` returns `MemorySize{Now, Base, Ceiling, Block}`, and `Checkpoint` returns the save's `Cost{Paused, Total, RAM}` from one `query-migrate` after it completes. `VM` gains `CPUs` and the two new returns. The balloon gets an id, `balloon0`, so that `GuestMemory` reads it at a fixed path. It turns the guest's reports on at its first call, so no timer runs in a boot that never asks. *The record:* a held machine of spin's shape read the same 34170 bytes of record with and without the id (laptop, v20261120.04, `spin-machine target` from each build), because the record leaves every id out and names the balloon by its slot. *Shutdown, decided by observation:* spin's runner pressed ctrl-alt-del and pressed the power button only if QEMU refused the keys. QEMU takes them, and the guest never sees them: its kernel has no i8042 or AT keyboard driver. Booted to systemd, a machine sent the keys ran until it was killed (SHUTDOWN host-signal), and one whose power button was pressed powered off 0.64 s later (SHUTDOWN guest-shutdown). So `Shutdown` presses the button alone. *What `End` says* (`TestTheMachineSaysHowItEnded`, in `boot:record`): `poweroff -f` ends as {guest, guest-shutdown}, `Shutdown` under systemd as {guest, guest-shutdown}, and a panic as {guest, guest-reset}, since `panic=1` reboots and `-no-reboot` ends the reboot. No panic device exists, so `GUEST_PANICKED` is never sent. A checkpoint of a 128 MiB guest at the `/bin/sh` prompt cost a 5 ms pause, 56 ms in all and 86 MiB of RAM written. No goal path changes timing: `Boot` and `Resume` send what they sent, and the cost's round trip is on the save, before either clock. *Status:* in place; no checkpoint is refused. - -**11-21 · lab · what QMP and vsock cost the goal's paths: the `transport` probe (lab 44912471522, this change).** The question was how to make QMP faster, posed as if QMP ran over vsock, with vsock RTT tuning, CPU pinning, `halt_poll_ns`, SEQPACKET, ivshmem, virtio-serial and gRPC framing as candidates. QMP is a Unix socket between the host and QEMU. vsock is between the host and the guest, and carries spin's SSH login. So two questions: how much of each goal number is QMP, and how much is the login's vsock. `transport` boots and restores spin's shape with QEMU traced (`qmp_enter_*`, the monitor's queue and answers, the run state, host time). After the cold login it times query-status, a one-byte echo over vsock and through a forwarder hop, and a warm login's round trips. *Measured* (bench, spin's shape and login, v20261121.01, 20 boots, 0 lost): the cold boot waits on 14 commands, 6.2/6.6 ms from QEMU's main loop being free to `cont` answered, 1.3% of the traced first login's 470. Of that, 4.5 ms is QEMU waiting for spin-machine's next command, and the commands' own run is ~1.2. A restore waits on 17 commands before `migrate-incoming`, 6.7/7.6 ms (5.2 of it waiting on the client), and 2.7 ms from the guest running to the restore's last answer, of a 114 ms first login. spin-machine's start and dial are off both paths: its first command waits 17.1 ms (cold) and 19.5 (restored) for QEMU to finish making the machine. query-status takes 131/142 µs from a Go client and 18 µs inside QEMU. A vsock round trip is 47.8 µs, 57.5 through a forwarder like spin's, and a login is 10 of them: 0.6 ms of a 32.8 ms warm login. *Why not double:* each QMP round trip on the path is ~0.25-0.9 ms where the command runs in ~0.02-0.35. The rest is the client's turn in a process that has just started, on a nested host. *Decided:* no change. If QMP cost nothing, the cold number would gain at most 6.2 ms and the restore at most ~9.4. Pipelining the bind gains at most 4.5 cold and 5.2 restored, and the read-ahead overlaps the restore's half. Dropping the round trips that can go gains ~1.3 cold and ~1.9 restored. Every vsock idea is bounded by 0.6 ms a login. All of these are under the noise at 20 boots (±7-9 ms cold, ±13 restored), so none was built (docs/boot-time.md, "QMP and vsock"). The laptop agreed (i9-13900HK, under load): 14 and 17 commands, vsock 13-16 µs, 10 turns a login. *Status:* the probe is kept so the split can be taken again. - -**11-21 · machine · the package starts and ends the QEMU it defines (labs 44912292706, 44912896763, 44914490616, 44914952228, this change).** Every caller assembled one QEMU's life itself: exec it, wait for the monitor's socket, dial, `qmp.New`, `Attach`, keep its output, kill and reap. In this tree there were ~7 such wrappers and ~8 dial loops, with poll intervals of 1, 5 and 20 ms, socket waits from 5 s to unbounded and handshake timeouts from 5 s to 2 min, and spin's runner had its own. `machine.Start(ctx, Spec, StartOptions)` now returns a `*machine.Process`: the `*machine.QEMU` its own monitor drives, with the process under it. Start opens and hands QEMU every descriptor the Spec implies (each monitor's socket, bound by Start, `/dev/kvm`, `/dev/vhost-vsock`, `/dev/vhost-net` per NIC, a `file:` console), so QEMU opens no path. The caller keeps its TAPs and disks, and shapes the process (uid, chroot, namespaces, cgroup) through `StartOptions.Cmd`, which runs after the opens. Readiness is Start's own monitor, bound and connected before QEMU exists and answered by QEMU's main loop once the machine is made. Nothing is polled. `Exit` holds the wait status, the last `SHUTDOWN`, the console's panic line when Start reads the console, and stderr's last 4 KiB. `Stop` presses the power button of a running guest, then quits, then sends SIGKILL, each step bounded. A monitor silent for 1 s (a QEMU loading a state) is killed. `machine.Dial` replaces the dial loops for a second monitor. `spin-machine boot` starts QEMU through Start and waits beside it, with Pdeathsig, instead of exec'ing it with a `_bind` helper. *Observed on real QEMU* (laptop, KVM and TCG, v20261121.01's QEMU): a held machine stopped is quit, `exit status 0` with SHUTDOWN host-qmp-quit. Killed, it reads `signal: killed` with no SHUTDOWN. A refused device fails the start at once with QEMU's line (`Property 'virtio-balloon-pci.no-such-property' not found`). `poweroff -f`, `Shutdown` under systemd and a panic end as guest-shutdown, guest-shutdown and guest-reset, exit status 0 (boot:record). *Measured* on the bench, spin's shape and login, v20261121.01 with its own spin-machine against the same tree with this branch's: ssh-first's first login +0.5 [−5.2, +8.3] at 20 boots (lab 44912292706) and −2.9 [−7.0, +5.0] at 40 (lab 44914952228), sshd accepting −3.5 [−6.8, +3.1], within noise. restore-first at 20 read the cached login +3.6 [+1.5, +4.5] (lab 44912896763), and at 40 +0.4 [−1.7, +3.1] evicted and +0.7 [−2.1, +3.1] cached, running +2.2 [−0.1, +5.2] and +0.4 [−1.1, +2.9], within noise (lab 44914490616). The cached cold login inside that run read +4.9 [+1.8, +9.5], where ssh-first's 40 cold logins read −2.9, so it is read as the probe's noise and left for the next release to confirm or not. *Why no gain:* the dial polls were never on the clock. A client polling the socket found it long before QEMU could answer, because QEMU makes the socket early in its start and answers only once the machine is made (the `transport` entry above: spin-machine's first command waits 17 ms on QEMU). *Status:* in place. spin follows, in place of its runner's own start, handover and shutdown. - -**11-21 · machine · the package opens a disk's chain, and the base only to read (this change).** A `machine.Disk` took open files, and each caller read the chain itself: `cmd/spin-machine/chain.go` from the qcow2 headers, the boot tests by hand, and spin's runner through `qemu-img info --backing-chain` under Landlock, refusing an image outside the disk's own. `machine.OpenDisk(DiskPath)` now opens the top read-write unless the disk is read-only and every image below it read-only. It reads the chain from the headers and refuses a backing file that is not a regular file under the caller's `Under` (files or directories), symbolic links resolved. A writable top that is one of `Under`'s images, the shared base, is refused (rule 1). Each backing file is opened `O_PATH`, checked through its descriptor and reopened through it, so no rename falls between the check and what QEMU is handed. A FIFO is never opened to find out what it is. A chain that comes back on itself, a missing backing format, an encrypted image, an external data file, a backing name over QEMU's 1023 bytes and a header that claims more than its first cluster are refused, each naming the file. `Image.Size` carries the size the guest sees, which spin bounds QEMU's writes by. `spin-machine --disk` takes the release's base as `Under` unless `--disk-under` names others, and `lab compat` names the previous release's. *Header parser vs qemu-img, measured* (laptop under load, one chain of overlay, overlay and the release's base): `qemu-img info -U --backing-chain` 3.4 ms p50 over 50 runs, `OpenDisk` 0.045-0.050 ms, the reader it replaces 0.015 ms. *Landlock:* not needed in process. It confined qemu-img's C parser to the images it was given. This reader executes nothing, opens nothing before checking it, and bounds every read by the first cluster (at most 2 MiB). *Goal numbers:* not run on the bench. The 0.03 ms the checks add to a boot's or a restore's disk open is under the ±7-9 ms a 20-boot interval resolves. boot:record passes on a tree of v20261121.01 with this spin-machine, its root disk now opened by `OpenDisk`. *Status:* in place. spin adopts it in place of `backingChain`, passing its disk's images other than the top as `Under`. - -**11-21 · machine · a host's record in one call, and where a checkpoint's state is synced (this change).** spin's runner started a held machine only to read `QEMU.Target` and kept the answer (spin-stack/spin#1416). spin also synced the state file every 100 ms while QEMU wrote it, synced it again inside the seal, and bounded a resume by the state's written blocks. *Built:* `machine.ReadTarget(ctx, Spec, StartOptions)` starts a machine of the Spec held, reads its `Target` and stops it. The caller's monitors are dropped. Each NIC is put on a hub port, so no TAP and no `/dev/vhost-net` is needed. The console writes to nothing, but the serial port is kept. *Measured* (laptop, v20261121.01, spin's shape, 2026-11-21): a machine whose NIC was on a real TAP with vhost read a record byte-identical to `ReadTarget`'s, and 25 589 bytes. One call took 72-76 ms p50 over 20 (QEMU's start 28, the record 11, its quit 37). It runs at a runner's start, off both goal clocks. boot:record now holds a machine's own checkpoint to `ReadTarget`'s record of its shape held for a checkpoint. Its first run failed with `device isa-serial: checkpoint isa-serial, here none`, because the test's Spec had no console. The record names the serial port, so the caller's Spec has to carry the console its machines have. The lab still reads a tree's record through that tree's `spin-machine target`, because the lab can drive a binary that predates `ReadTarget`. `restore` and the probes that resume into a machine they just started still ask that machine, which is the right call when there is no host constant. *Checkpoint sync, decided by measurement* (laptop ext4 NVMe, 99% full and shared; spin's shape plugged to 2 GiB, 1.5 GiB touched, 1.6 GiB written per save, mapped-ram with 8 channels; a seal that creates and syncs a file; 16 interleaved saves an arm, medians over the saves that did not stall on the disk): with the sync inside the seal, the pause's sync was 275 ms and the guest stopped 683 ms from seal to `cont`. Every 100 ms and then inside the seal gave 167 ms and 566. After `cont` gave 0 and 506. Over every save, the sync after `cont` beat the periodic arm in the pause by 183 ms [−1676, −160] and in QEMU's total by 232 [−2027, −124]. The guest's whole pause does not resolve over every save, because the stalls were seconds long and hit every arm. The sync after `cont` took 2-3 ms. QEMU syncs nothing itself (strace). The seal's file took 2-7 ms with ~830 MiB dirty, so spin's reason for the periodic sync did not reproduce on ext4. *Decided:* `Checkpoint` syncs nothing, and the caller fdatasyncs after `Continue`. The resume bound stays with the caller, because it rests on the host's slowest disk. `Resume` is unchanged, so restore-first was not re-run. Both decisions are written down in docs/memory-and-disk.md. `Cost.Paused`, QEMU's downtime, reads 200-250 ms under the caller's clock from the seal to `cont`. That gap is not yet traced. *Status:* in place. spin replaces `qemu.Target` with `ReadTarget` and moves its `fdatasync` after `Continue`/`Hold`. - -**11-21 · machine/image · the pressure probe (labs 44921602512, 44921841077, 44923048262, 44924252325, 44924755505, 44926664003, 44926917170, this change).** A runner hosts ~20 workspaces. The platform has to say which of them is short of CPU, memory or IO, which one causes it, and when QMP is slow, so that an agent can later act on one machine at a time. The machine now owns both ends of a probe. In every guest, `spin-machine-pressure.timer` starts a static sender 10 s after the boot. It runs at Nice 19, on the idle scheduler and IO class, as root, out of the OOM killer's way. It arms PSI triggers (150 ms in 1 s) on the guest's CPU, memory and IO, watches its OOM kills, and writes a line to host vsock port 1032 each time one fires. On the host, `machine.ListenPressure` routes each connection by the CID the kernel names. `StartOptions.Pressure` adds the same triggers on QEMU's cgroup, and times every QMP command against what that command took before. `Process.Usage` reads the counters that say who causes a stall: the cgroup, `query-blockstats`, and the balloon's OOM kills and allocation stalls. A prototype settled the shape first. Guest PSI is blind to the host taking a vCPU, and a fast OOM killed before any trigger fired. Host cgroup PSI tells the two apart, but a trigger with a window under 2 s is root's alone. No QMP event carries pressure, and a QEMU loading a state answers no command, so the timing follows the migration's events. *Observed on real QEMU* (task boot:pressure, laptop, v20261121.01, one vCPU, 1 GiB, QEMU pinned to one core, several runs). Three loops brought guest CPU stalls each second and no host ones. One loop with two host hogs on its core brought host CPU stalls each second, and `query-blockstats` took 536 ms against a 14 ms baseline, a `SlowCommand`. Two readers of the disk, 4 KiB at a time, brought guest IO stalls; 1 MiB reads from one reader stalled the guest only now and then. A working set reread through what a 700 MiB tmpfs left brought guest memory stalls. A stream read once did not, because clean cache is reclaimed without a stall. A 3000 MiB allocation brought `OOMKill{1}`. The lane found two bugs. The sender spun at ~0.8 s of the guest's CPU a second, because a kernfs file polls as changed until it is read again. And the OOM killer took the sender in the very OOM it was there to report. *Measured* on the bench, spin's shape and login, v20261121.01 against the same release with the sender put into its overlays (`--edit pressure`), interleaved. Ordered after multi-user.target, the sender started beside the first login. The first login read +0.5 [−2.6, +6.7] at 20 boots (lab 44921602512) and +2.5 [−2.1, +7.6] at 40 (lab 44924252325). With `Type=idle` it read +6.1 [+2.3, +10.0] (lab 44924755505), because the boot's jobs are done just before the login arrives. sshd accepting to the login read +2.6, +3.3 and +2.9 in those three runs, each excluding 0. Started by the timer, the first login read −0.5 [−3.6, +2.9] and accept-to-login −0.5 [−1.8, +0.9] (lab 44926664003, 40 boots). The restored login read +0.2 [−3.0, +2.7] evicted and +1.4 [−3.8, +4.7] cached at 20 (lab 44921841077), and +0.3 [−2.5, +3.2] and +1.1 [−3.6, +4.7] at 40 (lab 44923048262), with the sender running in the checkpoint. With the timer it read +1.8 [−2.0, +5.2] evicted and +0.9 [−2.5, +3.4] cached at 40 boots, the sender not yet started when the state was saved (lab 44926917170). *Status:* in place. A guest's first 10 s go unreported. spin follows with one listener and a watch per Start. Its guest supervisor's `POST /v2/memory-pressure` on port 1027 is then deleted in favour of `Stall{Guest, MemoryPressure}`. The actuators are #395 and #396, and the open questions #391-#394. - -**11-21 · lab · would a higher host priority for QEMU cut either goal number: the `run-delay` probe (labs 44925573288, 44927312303, this change).** A weight, a nice value or a real-time class changes only who runs when two threads want one CPU. So the most any of them can win is the time QEMU's threads spend runnable and not running, and that was measured before anything was built. `run-delay` samples every QEMU thread's `/proc/PID/task/TID/schedstat` every 5 ms, from before the exec to the first login, cold and restored (evicted). It keeps an exited thread's last sample and splits the wait at the guest's first run, from QEMU's trace. Its rows are crowds of workspaces already running, as `density` boots them. *The instrument sees what it claims:* the guest's steal time, which KVM takes from the vCPU thread's run_delay, read 330-340 ms cold on the busy host against the vCPU thread's 304-331. *Idle host* (bench, spin's shape and login, v20261121.01, 20 boots, 0 lost; lab 44925573288): QEMU's threads wait 0.2/1.1 ms in all to the cold first login (467/479) and 0.1/0.2 to the restored one (115). That is the ceiling of any priority change on the host the goal is measured on, and it is under the noise by ~40×. *Busy host,* 16 workspaces each keeping its vCPU busy on the bench's 16 CPUs: the cold first login reads 1184/1490 and the restored 306/321. QEMU's threads wait 824 ms cold, summed over threads that wait at the same time (331 of it the vCPU's, 248 the main thread's, the rest vhost and io_uring workers), and 282 restored, 224 of it before the guest runs. The host's own steal read 0 in every row, so the bench's hypervisor (L0) took nothing visible at 10 ms ticks. Only the host's (L1's) wait is in reach of a priority, and that is what was measured. *The arm* (lab 44927312303, 20 boots a row, interleaved): the crowd at nice 10 against the crowd at 0. The lab runs unprivileged, and 10 steps either way is the same ratio of weights (110:1024 against 1024:9548), so this is QEMU at −10 as the scheduler sees it. The restored first login fell −79.3 [−93.5, −71.0] (316 → 238) and its wait 290 → 116 ms. The cold first login moved −104.7 [−258.3, +150.9], within noise: the vCPU's wait fell 304 → 119 ms, but the main thread's rose 208 → 289 and the vhost workers' 90 → 122. QEMU's own CPU time grows from 503 ms idle to ~605 busy, which no priority wins back. *Decided:* nothing changes in the machine. On the idle host there is nothing to win. On a busy host, restores gain clearly, and the lever, a workspace's cgroup `cpu.weight`, is spin's runner's (machine.Start's `Cmd` places QEMU in it). That is a proposal for spin ("Open experiments"), to be measured there. The lab put every QEMU in one cgroup, where each thread competes on its own. In spin each workspace is a cgroup whose weight its threads share, which may give less. SCHED_FIFO was not tried, because a weight already shows the gain and a FIFO QEMU could starve the host. *Status:* the probe is kept, so the wait can be read again on a host whose load is spin's. - -**11-21 · machine · a machine held at its cgroup's limits (#403, this change).** spin sets `cpu.max`, `memory.high` or `memory.max`, and `io.max` on a workspace's cgroup, and the limit applied silently. A host CPU Stall could be the host squeezing the machine or spin's own `cpu.max`. *Built:* the host side of the probe reads QEMU's cgroup each second, beside its PSI triggers, and tells the watch a `Limited` each second a limit held: `cpu.max` when `nr_throttled` moved, `memory.high`, `memory.max` and its OOM kill when `memory.events` moved, and a key of `io.max` when a device's rate reached 90% of it. Each carries the limit, its device, the limit's value, what was used, how many times the kernel held the machine, and since when. The last reading is taken at QEMU's exit. `Usage` gains `CPU.Throttles` and `memory.events`' four counters. *Checked first:* cgroup v2 has no counter of what `io.max` throttled. `io.stat` gained no field on Linux 7.0 with `CONFIG_BLK_DEV_THROTTLING=y`, under an `io.max` that held `dd` for 6.4 s. *Observed on real QEMU* (task boot:pressure, laptop, v20261120.04 with this checkout's sender, one vCPU, 1 GiB). Under `cpu.max` of 0.2 CPU, one loop brought a `Limited` each second at 199,500-200,200 µs a second and 10 throttles, and a host CPU Stall each second with it. With `memory.high` 32 MiB above QEMU's memory, rereading a second disk brought 2,200-4,300 `high` events a second, `memory.current` within 0.1% of the limit. Under an `rbps` of 4 MiB/s, QEMU read at 4,188,788-4,189,940 B/s. Its cgroup's `io.pressure` total did not move in those 5 s, because io_uring leaves no QEMU thread waiting, so the rate is the one sign. No phase before the limits brought a `Limited`. *Not measured:* boot and restore. The limits are read in a watch's own goroutine, and neither goal measurement starts a watch. *Status:* in place. - -**11-21 · machine · a checkpoint and a resume tell their phases, and a checkpoint's guest no longer waits on ext4 (labs 44932635041, 44932944601, this change).** A checkpoint reported only at its end, with `Cost`. spin's snapshot showed nothing until then, and the guest stayed stopped 200-250 ms past `Cost.Paused` for no traced reason (#399). *Built* (#407): `SaveOptions.Phases` and `LoadOptions.Phases` take a func told each typed `machine.Phase` of one call. A save is `SaveStarted`, `RAMWritten` (a `query-migrate` every 100 ms while the guest runs), `GuestStopped`, `Sealed{Took}` and `SaveCompleted{Cost}`, then `GuestRunning` from `Continue` or `GuestHeld` from `Hold`. A load is `LoadStarted`, `StateLoaded{Bytes}` and `GuestRunning`, and after a fast load `Loaded` tells `StateLoaded`. The hook is per call and not per machine, because spin's timeline is per snapshot (spin-stack/spin#1481). Without `Phases`, a save and a load send the same commands as before. `spin-machine save` and `restore` print the timeline. *Observed on real QEMU* (boot:record, laptop, v20261121.01, a 128 MiB guest): a save told SaveStarted at 0, GuestStopped and Sealed at 45.4 ms, SaveCompleted at 50.2 and GuestHeld at 51.0. A load told LoadStarted at 0, StateLoaded at 35.3 and GuestRunning at 35.8. *#399 traced* (laptop ext4, spin's shape with 2 GiB plugged and 1.5 GiB of tmpfs filled, 1.6 GiB a save, 8 channels, every command and event timed): the gap fell between `remove-fd`'s answer and the next command. Each command took under a millisecond, and `cont` 2-3 ms. QEMU `ftruncate`s the state it writes, and ext4's `auto_da_alloc` writes a truncated file's dirty pages back on its last close. That last close was Checkpoint's copy of the file, closed before Checkpoint returned. Closed on a goroutine, with 16 saves an arm interleaved on one guest: `completed` to `cont`'s return fell from 238 ms p50 to 6, and the guest's stop to `cont` from 451 to 198, −252 [−4354, −33]. The caller's `fdatasync` after `Continue` rose from 3 ms to 259, so the time to a durable state did not change (−19 [−4088, +3963]). The phases also showed that the last `RAMWritten` before the stop was 0.3-0.9 GiB short of `Cost.RAM`. QEMU writes that RAM after the seal, with the guest stopped (#415). *Measured* (bench, spin's shape and login, v20261121.01's spin-machine against this branch's at cd966d5, which also carries main since the release; 20 each, interleaved): restore-first's login +2.5 [−0.2, +6.1] evicted and −2.3 [−5.0, +1.7] cached, within noise; `running` +2.3 [+1.7, +3.5] evicted and −0.1 [−1.2, +1.3] cached (#416). ssh-first's first login +0.3 [−4.9, +7.1], within noise. `StateLoaded.Bytes`, one `fstat`, came after these runs. *Status:* in place. spin takes `Phases` into its snapshot timeline, and syncs the state after `Continue` as before. - -**11-21 · boot · what a snapshot keeps: `boot:rollback` (#408, lab 44937567816, this change).** Nothing checked that a rollback brings back the same memory and disk, byte for byte. boot:record checked that a counter goes on after a restore, and boot:compat that a release's checkpoint resumes. *Built:* `TestARollbackBringsBackTheSameMemoryAndDisk` (`task boot:rollback`, lab.yml's `check:rollback`). It boots spin's shape plugged to 2 GiB to systemd, logs in as root over SSH through vsock, and runs the maintainer's terminal loop `while true; do date +%T.%N; sleep 0.1; done` detached, beside a Perl process that holds 4 MiB of random bytes and a counter and stamps each line with both of the guest's clocks on the serial console. Then it takes four steps. A checkpoint with memory is sealed as spin's storage seals a disk and continued in place. A rollback with memory goes onto the sealed disk after the guest changed the file and the bytes. A disk-only snapshot is `stop`, `blockdev-snapshot` and `cont`. A cold boot comes from the sealed disk. Left at 128 MiB, the guest's OOM killer took the SSH session, as the lab's Plug says. *Observed* (v20261121.01, 3 runs on the laptop and 1 on the bench, which agreed). The checkpoint stopped the guest 11-17 ms (`Cost.Paused` 11-14), inside one of the loop's sleeps, so the loop's largest step stayed at 101-105 ms. After the rollback the process had the same PID and the same bytes. The file matched from memory and again from the disk. The loop and the counter went on from their lines at the checkpoint, and the kernel reseeded its RNG (vmgenid). The cold boot had the synced file and not the later one. The loop's log, written 3 s and never synced, was not on the disk at all, because the seal is crash-consistent. The disk-only snapshot stopped the guest 7-14 ms. The guest's clocks stop with it. A stop held 1.00 s left the guest's wall clock 1.001 s further behind, and both clocks stepped 101 ms across it. The resumed guest read the checkpoint's time, 6.34 s behind 48 ms after the resume, and nothing in the machine corrected it, by the 09-10 decision. spin steps it at the supervisor's next registration, and after a snapshot continued in place nothing steps it (spin-stack/spin#1498). An SSH session open at the checkpoint did not survive the rollback. The restored sshd read `Transport endpoint is not connected` within 3 ms, its pty shell was gone at the first look, and the guest's kernel logged nothing of vhost-vsock's reset (spin-stack/spin#1483). *Status:* in place. `lab dispatch` takes no `check:TARGET` yet (#419). - -**11-21 · machine · a checkpoint plans a 30 ms pause, not QEMU's 300 (#415, lab 44940051596, this change).** The phases showed a 1.6 GiB checkpoint's guest stopping with 0.3-0.9 GiB still to write, and that remainder was most of `Cost.Paused`. *Explained:* QEMU stops the guest once what is left fits in `downtime-limit` times the rate it measured over the last 100 ms. The machine never set the limit, so it was the default 300 ms. Into the page cache the rate read 30-34 Gbit/s, so the guest stopped with up to ~1.2 GB to go. An idle guest stopped part-way through QEMU's first pass, and what was written after the stop was memory QEMU had not reached yet, not memory the guest had dirtied. Mapped-ram, multifd and pause-before-switchover leave that test as it is (QEMU 11.2's `migration/migration.c`). *Measured* (bench, nested KVM, v20261121.01, spin's shape plugged to 2 GiB, 20 saves an arm interleaved on one guest, branch `exp/415-downtime`): at 30 ms QEMU's downtime fell from 192 ms to 6 for an idle guest with 1.5 GiB of tmpfs filled, −186 [−189, −184], and the save's total did not move, +4 [−2, +6]. With a writer rewriting 64 MiB of a 512 MiB set every ~100 ms it fell from 221 ms to 8, −213 [−218, −208]. The total rose 39 ms [+33, +45] for one more pass and 195 MiB more written while the guest ran. The laptop agreed, at 238 to 12 and 209 to 11. A writer rewriting 256 MiB of a 1 GiB set with no pause converged at 30 ms in all 10 saves (laptop). *Rejected:* 100 ms (60 ms of downtime with the writer, laptop); auto-converge, whose throttle never engaged in any save; `avail-switchover-bandwidth`, not run, since it only stands in for the rate in the same test. *Found on the way:* `cont` right after `Checkpoint` once failed with "Migration is not finalized yet", because QEMU sends `completed` before it moves the run state to `postmigrate`. That is #421. *Status:* in place. A checkpoint is on neither goal clock, and `Resume` reads the same file, so restore-first was not re-run. boot:record resumed a checkpoint saved at 30 ms. - -**11-21 · machine · a checkpoint returns once QEMU has left finish-migrate (#421, this change).** `Continue` right after `Checkpoint` failed once in about 235 checkpoints with `cont: GenericError: Migration is not finalized yet`, and the guest stayed stopped. *Explained* (QEMU 11.2.0-rc0's `migration/migration.c`): the migration thread sets `completed`, sends `MIGRATION{completed}` and lets the BQL go in `migration_completion_end`, and moves the run state from `finish-migrate` to `postmigrate` only once it holds the BQL again, in `migration_iteration_finish`. `qmp_cont` refuses `finish-migrate` (`monitor/qmp-cmds.c`), and `runstate_set` sends no event. `blockdev-set-active` is not refused there, so a `Hold` in the window succeeded and left the machine in `finish-migrate`. *Reproduced* (laptop, real KVM, v20261121.01 with this checkout's spin-machine, spin's shape plugged to 2 GiB, a guest rewriting 600 MiB of tmpfs, Checkpoint then Continue in a loop): 0 refusals in 2000 checkpoints on an idle host. With QEMU and the test pinned to two host CPUs kept busy by two spin loops, 102 of 300 `cont`s were refused, `query-status` reading `finish-migrate` at the refusal, and with `Hold` first, 88 of 300 Holds left the machine in `finish-migrate` and 79 `cont`s were refused. *Built:* `Checkpoint` asks `query-status` after the cost's `query-migrate`, and again every millisecond while it reads `finish-migrate`, bounded by its context. Making `Continue` retry `cont` was rejected: `Hold` and `Status` would still see `finish-migrate`. *Measured:* under the same contention, 0 of 300 refused, and 0 of 300 with `Hold` first. The guest's stop to `GuestRunning`, 8 runs of 60 checkpoints an arm interleaved on the idle laptop, moved from 6.62 ms p50 to 6.82, +0.20 [+0.08, +0.33], one QMP round trip. *Status:* in place. A checkpoint is on neither goal clock. - -**11-21 · boot, lab · a checkpoint's pause is held under 50 ms: `boot:checkpoint-pause` (#423, #419, lab 44944984313, this change).** What re-measured `checkpointDowntime` lived only on `exp/415-downtime`, and `lab dispatch` took no `check:TARGET`, so that run was dispatched with `gh workflow run`. *Built:* `TestACheckpointPausesTheGuestBriefly` (`task boot:checkpoint-pause`, lab.yml's `check:checkpoint-pause`), from the experiment with its arms gone. It uses the two guests that decided 30 ms, saves each 10 times at the machine's own setting, continues and syncs after each, and logs the guest's stop to `GuestRunning`, QEMU's downtime, what was left at the stop and the total. The median of the larger of the stop and QEMU's downtime must stay under 50 ms. That is the 30 ms QEMU plans plus 20 for what it writes past the plan and for `cont`. QEMU's default read 199 and 231 ms. compat.yml runs it on every change to QEMU on main and before every release. `lab dispatch check:TARGET` now sends the check, waits, prints the last 60 lines of the `lab:ci` step from the job's log through the API, and exits 1 unless the run succeeded. *Measured* (bench, nested KVM, c8id.4xlarge, v20261121.01, spin's shape plugged to 2 GiB, 10 saves a guest, dispatched with `lab dispatch check:checkpoint-pause`): idle 13.3 ms p50 from the stop to `cont` returned, the slowest 14.8, QEMU's downtime 6 ms, nothing left at the stop, total 465 ms. Writer 18.9 ms p50, the slowest 25.8, downtime 7 ms, total 531 ms. Both agree with the experiment's 14 and 18 ms. *Found on the way:* on the laptop, with its disk busy and its swap full, the writer's pause reached 0.1-8.7 s in 4 and 6 of two runs' 10 saves, with at most 85 MiB left at the stop. QEMU's downtime was longer than the stop to `GuestRunning` (8.68 s against 5.81 s), so QEMU stopped the guest long before the host heard of it at `pre-switchover`. That is #426, and it is why the bound holds the larger of the two. *Status:* in place. - -**11-21 · machine · a per-disk IO limit, the first actuator (#395, this change).** A runner hosts about 20 workspaces, and spin has to hold back the one that saturates the shared disk, per disk and while it runs, without the guest learning of it. The prototype said every disk place sits behind a throttle node, so a limit would be one `qom-set` on its group. *Checked* in `machine/spec.go`: every place's node is a throttle filter, but all of them are in one group, `places`, and a group shares its limit among its members, so a limit there would hold all of a machine's disks together. A disk attached while the machine runs has no filter at all. A group per place would have changed the command line every machine boots with. *Built:* `QEMU.SetDiskLimit(serial, DiskLimit)` and `QEMU.DiskLimit(serial)`, where `DiskLimit` is bytes and requests a second, read and write, and its zero value is no limit. The command is `block_set_io_throttle`, sent to the backend of the disk's device, whose group is the device's alone and which a bind never replaces. It reaches a place and a hot-plugged disk alike, and is read back from `query-block`. `verify qemu`'s schema check covers both, and refused a misnamed field in each when one was tried. Bursts are left out: QEMU already lets a tenth of a second's worth through at once. The probe reports a held disk as `Limited{DiskReadBytes…}`, its serial in `Device`, from one `query-blockstats` a second, and only while a disk is held through Start's monitor. *Measured* (task boot:disk-limit, laptop KVM, v20261121.01 with this checkout's spin-machine, spin's shape with two disks beside the root, 3 runs): 8 MiB/s held 32 MiB of the guest's direct reads to 3.776-3.777 s, 50 writes a second held 150 direct 4 KiB writes to 2.881 s, and a disk attached at run time read at 8 MiB/s in 3.900-3.901 s. The other disk did the same in 2-6 ms beside each, and the held one read in 2-5 ms once cleared. `SetDiskLimit` took 1.8-5.5 ms. In task boot:pressure a 4 MiB/s limit brought a `Limited` each second with `Used` at 4.19-4.25 MB/s. *Decided:* a checkpoint carries no limit. A resumed machine reads `DiskLimit{}` and runs free until spin sets the limit again, which then holds (same lane). The limit is spin's policy for a neighbour, and a resumed machine may have other neighbours. No bench run: neither goal path sends a command it did not send before. *Status:* in place. That lane's `memlimit` phase fails on this laptop on main as well (#429). - -**11-21 · machine · what a host gives a machine: `Spec.Files`, `Spec.Overhead`, `Disk.Overhead` (this change).** spin hard-coded two facts that depend on the machine and its release. It linked a release's whole firmware directory into each QEMU's root, and it bounded each QEMU's cgroup at the guest's ceiling plus 768 MiB and at its vCPU ceiling plus 256 tasks. *Traced* (strace of a KVM and a TCG boot): QEMU opens by name its binary, the kernel, the initrd, and from the firmware directory the BIOS, `linuxboot_dma.bin` and `kvmvapic.bin`. It also opens `/dev/null` for its OFD lock probe. It reads `/proc`, `/sys`, `/dev/urandom` and `qemu.conf` only when they are there. `efi-virtio.rom` is never opened, since every NIC has `romfile=`. *Built:* `Spec.Files`, `Spec.Overhead() (Overhead{Memory, Tasks}, error)`, which reads the kernel's and the initrd's sizes, and `Disk.Overhead`, each qcow2 image's L2 cache (its whole L2 table up to 32 MiB) and four clusters of refcounts, from `read_cache_sizes`. Tasks are counted up to their most: one thread a vCPU slot, QEMU's four, a vhost worker for each device, a checkpoint's channels and their driver, QEMU's thread pool (64, and a thread it cannot start aborts QEMU) and io_uring's workers (the ring's 128 entries). Memory is 64 MiB of QEMU's own, the kernel and the initrd, 1 MiB a vCPU, 64 KiB a thread, and 1/256 of the ceiling for page tables. *Verified* (task boot:overhead, laptop, real KVM, v20261121.01): spin's shape with a NIC and a vsock started as nobody in a root holding only `Files` and `/dev/null`, in a cgroup of its own, and was taken to its ceiling. That is 16 vCPUs, 8192 MiB filled from `/dev/urandom`, and four disks attached beside its two, one of them a 64 GiB overlay the guest wrote a block of every 512 MiB, while the guest read, wrote and trimmed every disk. It was then checkpointed. Beyond the guest it held 31 MiB and 9 tasks at boot, 73 MiB and 27 tasks at the ceiling, and 79 MiB and 34 tasks (pids.peak) through the checkpoint. Of the 73 MiB, 27 were page tables, 16 the bzImage and 8 the big disk's L2 cache. `Overhead` for it, disks included, is 153 MiB and 223 tasks. *Found on the way:* the cgroup's `anon` is not QEMU's memory beyond the guest. A huge page the guest gave back in part stays charged until the kernel splits it, and it read 160 MiB above `smaps` just after the guest freed 1.4 GiB. The lane counts QEMU's own from `smaps`. In 2 of 5 runs, vCPUs plugged right after a checkpoint's `Continue` never reached the guest (#433). The lane plugs before it checkpoints. The checkpoint at the ceiling also got this laptop's QEMU OOM-killed once, by the host, with its swap full. *Not measured:* a restore and a QEMU that has run for days. spin adopts the root and the bounds through spin-stack/spin issues. *Status:* in place. - -**11-21 · boot · a contended checkpoint loop, how a qemu bump is checked for #421: `boot:finish-migrate` (#425, this change).** #424's wait for QEMU to leave `finish-migrate` was held in the tree only by a fake QEMU, and an idle host does not reach the window, so boot:record passed with the fix and without it. *Built:* `TestACheckpointIsContinuedAtOnceOnABusyHost` (`task boot:finish-migrate`), the scratch loop of #421: spin's shape plugged to 2 GiB with a guest rewriting 600 MiB of tmpfs, 300 checkpoints each continued at once, any refusal a failure. The target runs the test and QEMU under `taskset` on the host's last two CPUs, and the test keeps each of the CPUs it is given busy with a spin loop and refuses to run on more than four. It is not in CI. The qemu entry's note in versions.yaml names it beside boot:record and boot:compat, so a QEMU that reorders `migration_completion_end` and `migration_iteration_finish`, or adds a run state after `completed`, is caught at the bump. *Measured* (laptop, real KVM, v20261121.01 with this checkout's spin-machine): with `finished` made to return at once, 39 of 300 continues were refused, and 0 of 300 with it. QEMU alone pinned to the busy CPUs, the test free, refused 0 of 300 without the fix, which is why the test runs on them too. *Status:* in place. - -**11-21 · qemu, machine · a checkpoint's stop does not wait on the host's disk: `x-defer-disk-flush` (#426, lab 44958247487, 44962720682, this change).** On a busy disk, a checkpoint stopped the guest for 0.1-8.7 s on the laptop, and QEMU's downtime ran past the stop to `GuestRunning`. *Traced* (QEMU `-trace` on `runstate_set`, `vm_stop_flush_all`, `migrate_set_state` and `luring_co_submit`): from `finish-migrate` to `pre-switchover`, the time was `do_vm_stop`'s flush after the drain, one io_uring fsync of the overlay. It took 527 ms in one laptop save. On the bench, beside one host writer on `/tmp`, which is an overlayfs there, and with a guest that synced its own writes, nothing reproduced: Δ +0.9 [−2.6, +5.5] (lab 44957455283). Four writers on the instance store's ext4, with the guest writing its disk with `oflag=direct`, gave the fsync 13-79 ms and the guest's stop 42 ms p50 (lab 44958247487). *Built:* `qemu/patches/0003` adds the migration capability `x-defer-disk-flush`, and `Checkpoint` sets it. After the stop's drain, QEMU's own flushes write to the page cache only, and the guest's next flush forces them. The first version ended the deferral when the switchover ended, and the fsync came back in `cont`, since activating a qcow2 node closes and reopens it. The guest's stop to `GuestRunning` went from 19.6 to 50.3 ms p50 (lab 44958247487). The deferral now lasts until the VM runs (`vm_prepare_start`) or QEMU closes the disks (`bdrv_close_all`). *Measured* (bench, nested KVM, v20261121.01 with QEMU from parts run 44961949665, spin's shape plugged to 2 GiB, the busy-disk guest, 20 pairs interleaved on one guest, branch `exp-defer-ab`): the guest stopped at least 40.0 ms p50 (93.0 slowest) without the capability and 18.0 (28.8) with it, −22.0 [−29.2, −15.8]. QEMU's downtime went from 40 to 7 ms, −33 [−40, −27]. On QEMU's clock, `finish-migrate` to `running` read 8-20 ms against 20-95. `boot:checkpoint-pause` gains the busy-disk guest on the scratch disk, and read idle 13.9, writer 17.3 and busy disk 19.1 ms p50 (lab 44962720691). record and rollback pass on the patched QEMU (lab 44962720561, 44962720776). restore-first, with the spin-machine held at the release's and the QEMU binary as the only change: login −0.1 [−2.3, +2.4] evicted, −3.2 [−4.7, −0.5] cached (lab 44963610565). Main's spin-machine against the release's read +2.2 [+0.5, +4.0] evicted with the release's QEMU (lab 44963610916). That is #438, and it is why the run with both changes read +2.8 (lab 44962720850). *Contract:* a checkpoint's disk is in the page cache when `Checkpoint` returns, as its state is. A caller that keeps the sealed layer syncs it with the state after `Continue` (spin-stack/spin#1514). *Not fixed:* the laptop's other waits, 1.6-1.9 s in the drain with nothing to flush and 0.7-1.6 s for the last RAM, with its swap full (#437). *Status:* in place. - -**11-21 · machine · a QEMU without `x-defer-disk-flush` checkpoints as before (compat 44964906186, this change).** Compat on main 607797b failed for every release from v20261119.02 to v20261121.01 with `migrate-set-capabilities: GenericError: Parameter 'capability' does not accept value 'x-defer-disk-flush'`. #435 set the capability on every checkpoint, and only the QEMU `qemu/patches` builds has it. Compat checkpoints each release's QEMU with this checkout's spin-machine. spin does the same when a runner's machine library is upgraded while machines from an earlier release run, and none of those could have been checkpointed. *Fixed:* `Checkpoint` asks `query-migrate-capabilities` first and sets `x-defer-disk-flush` only when the QEMU lists it. That costs one round trip before the migration starts, with the guest running, and is on neither goal number's clock. A QEMU without it checkpoints as before #435, with the stop's flush on the host's disk. `qmpdef.Enum` still names the capability, so `verify qemu` fails a pinned QEMU that lost the patch. *Reproduced* (laptop, a tree of v20261121.01 with this checkout's spin-machine, boot:record's tests): main's `Checkpoint` failed `TestACheckpointedMachineIsHeldThenContinued` with compat's error, and this change passed all four of boot:record's tests. *Status:* in place. - -**11-21 · boot, machine · a workspace checkpointed and continued grows: `boot:cpu-plug` (#433, this change).** The overhead lane had seen vCPUs plugged right after a checkpoint's `Continue` never reach the guest in 2 of 5 runs, and plugged before its checkpoint since. *Traced* (a miss of the lane in #433's order, its states under `/var/tmp` on ext4, the laptop's disk busy and its swap full, QEMU `-trace` on `cpuhp_acpi_*`, `acpi_gpe_*` and `monitor_qmp_cmd_in_band`): QEMU received no command for 73 s after `cont`. The guest gave up after its 60 s, with `gpe02` at 0 events and no status bit and `sci` at 0, so QEMU had raised nothing. The `device_add`s came after, and the guest took all 15 insert events within 0.4 s. What held the plug was the lane's own helper, which closed the state between `Continue` and the plug. ext4 writes back a file QEMU truncated on its first close, and that close took 0.6 ms to 75 s across 9 checkpoints in the same lane. Nothing was lost in QEMU's hotplug or in the guest's GPE handling. *Ruled out* (laptop, real KVM, v20261121.01 with this checkout's spin-machine, states on tmpfs, so every close is free): 0 misses in 200 guests each way after a checkpoint, after a plain stop and cont, and with no pause. Also 0 in 100 each way after a checkpoint and a stop on two CPUs a spin loop keeps busy, 30 checkpoints with 1400 MiB of the guest filled there, 10 each way at 30% and at 5% of one CPU, 100 checkpoints with #417's close in the save's path again, and 100 each way in a guest whose PID 1 is a shell. The lane in #433's order missed 0 of 50. *Built:* `TestAWorkspaceCheckpointedAndContinuedGrows` (`task boot:cpu-plug`). spin's shape is booted to systemd at 2048 MiB and checkpointed and continued, then given 16 vCPUs, 8192 MiB and four disks at once. The guest must have all of them within 20 s, in 10 guests, and the state is closed once it has. compat.yml runs it, since a QEMU or kernel that lost a hotplug after a migration would leave a workspace at its size, and lab.yml's `check:cpu-plug` runs it on the bench. *Measured:* 10 guests grew in 0.31-0.71 s with the state on tmpfs. With it on ext4 written back at 10 MB/s while the guest grew (a scope's `IOWriteBandwidthMax`), 5 grew in 0.31-1.18 s. `Checkpoint`'s comment now says that the close or sync after `Continue` can take as long as the disk needs, and that a caller must not hold the next command behind it. The lane's comment that blamed the checkpoint is gone. *Status:* in place. - -**11-21 · qemu, machine, lab · a disk's counters without its backing chain: `x-flat` and the `usage` probe (#402, labs 44973302743, 44973302685, 44973726633, this change).** The question was whether a runner polling `Process.Usage` across ~20 machines, and the watch's read of a held disk each second, slow the machines. #402 said `query-blockstats` cost ~6 ms p50 "because every reply carries all 16 hotplug slots", and that one took 536 ms under host steal. *Explained* (laptop, spin's shape, the command timed beside query-status with QEMU's main thread's `schedstat` across each call). The hotplug targets are not in the reply, since an empty SCSI target has no block backend. What is in it is every image of each disk's backing chain, twice under a place's throttle filter (`bdrv_query_bds_stats` recurses into `parent` and `backing`). The reply was 12.6 KiB for a root of an overlay over the base plus a raw home. Each image added ~3.6 KiB and ~70 µs of the main loop, which also runs the disks' I/O: 0.37 ms of main loop at depth 1, 0.73 at 8 and 2.5 ms (124 KiB) at 32. Every seal of a workspace's disk adds an image. The 6 ms is a deep chain or a loaded host, not the slots. *The 536 ms is not the command.* Each call over 50 ms in the pressure probe's lane, sampled every 0.5 ms, had QEMU stalled in the host. At `memory.high` the main thread was in D state in its cgroup's reclaim (`reclaim_high` → swap writeout → `wbt_wait`) or a swap-in, for 170-195 ms, and query-status was as slow. In the memory and OOM phases it was in `mmap` waiting for the mmap lock while the vCPU faulted, 52-284 ms. Under `cpu.max` the monitor's thread was throttled for 80 ms. Two busy loops on QEMU's core cost a call 4-6 ms at most. A first run that traced QEMU to a file on ext4 caught its threads in the trace's own `writev`, so a stall measured with tracing to a busy disk can be the trace. *Built:* `qemu/patches/0004` adds `query-blockstats`' member `x-flat`, which leaves out `parent` and `backing`. `QEMU.DiskUsage`, Usage's QMP half and what the watch reads, asks with it. A QEMU without it (every release up to v20261121.01) refuses the member, so it is asked once and then only without it. The `usage` probe times DiskUsage on a running machine, quiet and pinned to one host CPU beside two busy loops, at a `depth`. *Measured* (bench, nested, spin's shape, v20261122.01 with QEMU from parts run 44972755256, 20 machines each × 200 calls): DiskUsage's main-loop time went from 293 to 96 µs p50, −197 [−202, −181], and its round trip from 573 to 390, −183 [−190, −158] (lab 44973302743). At depth 32 it went from 2991 to 94 µs, −2898 [−2917, −2895], and the round trip from 3377 to 391 (lab 44973302685). Against main's own parts build without 0004, depth 1 read −183 [−203, −176] µs, with query-status +8.1 [−55.5, +39.1] µs, within noise (lab 44973726633). So the +43 µs query-status read against the release is the build, not the patch. *Not explained:* pinned beside two busy loops, DiskUsage's p50 sat at 3.07 ms in every flat run against 2.2 at depth 1 and 4.3 at depth 32 without x-flat, and the slowest call did not change at depth 1. The 3 ms is about one scheduler slice on these hosts (#442). *Not built:* asking only for the held disks. With x-flat, each device costs ~20 µs of main loop (laptop, 2 against 11 places), so the ceiling is ~20 µs a second at spin's shape with one disk held. *Goal numbers:* untouched. DiskUsage has two callers, `Usage`, which spin calls when it chooses, and the watch, which asks only while a disk is held. Neither runs on a boot or a restore. 0004 changes only that command's handler and its HMP caller. boot:record passes on the patched QEMU (lab 44973302762, and on the laptop), and so does boot:pressure on the laptop. *Status:* in place. - -**11-21 · machine, spin-machine · a restore reads its state ahead before QEMU answers (lab 44976494418, this change).** restore-first's evicted login read 16 ms more than the cached one (111 against 95.2, main's spin-machine on v20261122.01's parts, 30 restores each). That gap is the disk. `Resume` started the read-ahead (lab 44809512339), but `spin-machine restore` calls Resume only after its dial, and the dial waits for QEMU's first answer, ~19.5 ms after its exec (`transport`, lab 44912471522). So the read began when QEMU was ready to load and never overlapped QEMU's start. `machine.ReadAhead` is the read-ahead with Resume's rule (a full load of a mapped-ram state), and `restore` calls it once the state is open, before the dial. Resume still calls it for callers that do not, and the kernel skips the pages a first call already asked for. *Measured* (bench, nested, spin's shape and login, 30 a side interleaved, lab 44976494418): evicted login 111 → 101, −9.3 [−12.2, −7.3], and `running` −8.1 [−9.4, −6.5]. The cached row read −0.2 [−2.2, +1.5], as it should with nothing left to read. The cold login read −7.5 [−12.8, +0.0], within noise, and no cold boot runs this code. *What limits it now:* the evicted row is 6 ms over the cached one. The read starts ~5 ms after QEMU's exec, once boot has bound the socket and `restore` has started, and a sequential reader takes ~60 ms for the state's 179 MiB (`read`, the same run). *Status:* in place. spin's runner, once it resumes through `machine.QEMU.Resume`, calls ReadAhead before `machine.Start`. - -**11-22 · boot · a checkpoint's stop on a host short of memory (#437, lab 44971162018, 44971787197, 44972838681, 44973775066, 44975130836, this change).** #437 guessed that the laptop's slowest saves, 1.6-1.9 s in the drain and 0.7-1.6 s for the last RAM, were QEMU's memory read back from a full swap. *Traced on the laptop* (QEMU `-trace` with wall-clock timestamps, each thread's `/proc` state, `wchan` and major faults every 2 ms): QEMU had nothing in swap and the host swapped in 167 pages in 11 minutes. The waits were a disk 60-80% full in `/proc/pressure/io`: guest writes in flight in `jbd2_log_wait_commit` and `rq_qos_wait`, which the drain waited for, and major faults on QEMU's own binary, evicted by reclaim (1.9 M file refaults) and read back from the disk that held the state, the overlay, the swap and the busy writers. A run without the busy writers, the disk still saturated by other work, waited 1.5 s once in the caller before `cont`. *Runners* have no swap (only spin's control plane gets a swap file, and it is never a runner) and give each machine's group `memory.swap.max` 0. *On the bench*, no swap and QEMU's binary on a disk apart from the state: with the host's memory taken but 1 GiB, the busy disk's dirty pages got the test killed. With 4 GiB left, the writer read 23.0 ms p50 (43.5 slowest) and with the busy disk 26.1 (44.4), against 18.5 beside the busy disk alone. QEMU took no major fault while the host reclaimed 26 M pages. `bpftrace` on `sched_switch` named the two slowest of 40 saves (139 and 188 ms): `balance_dirty_pages`, on a guest write in the drain and on one multifd channel's write of the last RAM, the other seven channels behind that file's `i_rwsem`. *Tried:* `direct-io` on the save's channels, with an `O_DIRECT` descriptor added to the state's set. Beside the busy disk it never converged, each pass ~2.5 s and ~520 MiB left, and was cancelled after 10 min. Rejected. `downtime-limit` 15: −6.0 [−11.9, −1.1] in 20 pairs short of memory, then −2.5 [−7.5, +3.0] in 25, −1.5 [−6.0, +2.8] with the writer, −0.2 [−0.5, +0.3] idle. Rejected. *Built:* `boot:checkpoint-pause`'s fourth guest is the busy-disk guest on a host whose available memory is taken but 4 GiB (`shortOfMemory`), measured and not held to the bound: on compat's kvm host, 118 GiB of it taken, the stop read 56.2 ms p50 against 25.2 on the bench (compat 44976542939, lab 44976542360). *Status:* the test is in place. A runner does not reach #437's seconds. Its stop on a host short of memory is the dirty limit's (#444). - -**11-22 · lab · a tree's spin-machine from any commit, and #438 bisected (lab 44976271054, this change).** #438 read restore-first's evicted login +2.2 ms [+0.5, +4.0] with main's spin-machine against v20261121.01's, and asked which commit moved it. A tree could hold only this checkout's spin-machine or a release's, so `--spin-machine commit:SHA` now builds one from any commit, fetched alone from origin as a release's is. *Measured* (bench, nested, spin's shape and login, v20261122.01's parts, 30 restores each, eight spin-machines interleaved): against v20261121.01's, main's read evicted login −0.1 [−2.7, +4.6] and `running` +0.6 [−2.3, +3.5]. Of the five commits between, only 8d04bd4's `running` excluded 0, +4.5 [+0.1, +7.9], and main contains it. `listening` read −4.2 from eb70cb8 on, because `machine.Start` binds the monitor's socket before QEMU exists, so `listening` no longer marks QEMU's start. That instance was noisy: its cached restores were as slow as its evicted ones. *Not reproduced.* The difference was on the evicted row only, the disk's, and the read-ahead before the dial, asked for from four goroutines, leaves the evicted row nothing to wait on (#446, #447). *Status:* the lever in place. #438 and #416 answered in their comments. - -**11-22 · lab · a probe's login is not preceded by a connection spin does not make (labs 44977850524, 44978246896, this change).** `Key.LoggedIn` polled `VsockAccepts(cid, 22)` until something accepted, then logged in. On spin's path (`login=spin`), that connection reached the forwarder, which opened one to 127.0.0.1:22, and sshd forked and exec'd `sshd-session` for it. The probe then closed it and logged in at once, so the guest's one vCPU ran that session beside the login being timed. spin's runner opens the user's connection once, through its supervisor, and asks nothing first (spin-stack/spin's `internal/runner/forward/forward.go`). LoggedIn now logs in until a login is done, with VsockAccepts' 50 ms connect timeout on the login's own connect, because a connect to a context id that does not exist yet waits 2 s. *Measured* as two rows of one tree, so one run compares the two probes (bench, nested, spin's shape and login, v20261122.01 with main's spin-machine, 40 each, lab 44978246896): restored login −4.1 [−6.0, −2.2], `running` −0.0 [−1.0, +0.9], the cold login before the save −3.6 [−7.2, +0.8], within noise. Only the restored login changed, in lab 44977850524 too: −3.6 [−7.3, −1.7] at 30. The number moves because the probe stops adding work, not because the machine changed, as with #341. LoggedIn is restore-first's, prestart's, restore-together's and density's. `ssh-first` keeps its own poll, because it times `accepts` with it, so its first login still carries the session (#450). *Status:* in place. - -**11-22 · image · ssh.service starts without `sshd -t` (lab 44977044826, this change).** Where PID 1 to sshd accepting goes, read from the guest after the first login (a `chain` probe on branch `exp/chain`, lab 44976328180, 10 boots, v20261122.01, spin's shape): PID 1 starts at 84.6 ms on the guest's clock, the first jobs dispatch at 139.3, sysinit.target at 280.5, basic.target 285.6 and the forwarder 286.6. The CPU used to the first login: the kernel's own 106 ms, PID 1 66, udevd 46, ssh.service 45 (both logins' sessions in it), journald 20, logind 16, the bus 11. One vCPU and no idle time, so the login waits for every exec before it. Ubuntu's ssh.service runs `sshd -t` as ExecStartPre: without it, the cold first login −3.2 [−7.2, −0.8] and sshd accepting −2.4 [−6.4, −1.1], 60 boots each interleaved, spin's shape and login. The same run took four other execs and settings out, one arm each, and none moved the login: systemd-udev-load-credentials masked −2.1 [−6.3, +0.3]; systemd-user-sessions' ExecStart emptied, its ExecStop kept, −0.6 [−5.2, +1.5]; sshd-socket-generator masked +0.8 [−4.0, +4.7]; and `DefaultMemoryAccounting=no` +4.1 [+0.8, +7.1], worse, with sshd accepting +6.2 [+2.2, +8.0], not explained. So an exec pair costs the login ~3 ms here, not the ~6 a getty's echo's 10 ms of CPU suggested. *Status:* `sshd -t` dropped at start (`ssh.service.d/20-no-config-test.conf`, asserted by build.sh, in the lab's lane edit); the restore unchanged (restore-first in the description). - -**11-22 · image · what a restored login waits on, and sshd's sleeps bounded (lab 44980029214, #457).** With the disk gone from the evicted restore, the login after `running` is restore-first's largest phase (~35 ms). A connection that timed each write and read of the login (laptop, v20261122.01, one restore at a time) split a 32 ms restored login into 4.6 ms to the server's banner, ~5 ms of key exchange, 14.5 ms from the signed `userauth` request to `USERAUTH_SUCCESS`, and ~4.7 ms for the channel, `exec` and exit. sshd at `LogLevel DEBUG3` said where the 14.5 ms went: "elapsed 0.903ms, delaying 6.180ms" after the key query and "elapsed 1.468ms, delaying 5.615ms" after the signed request. Both are `ensure_minimum_time_since` in OpenSSH 10.2's `auth2.c`, which waits until 5 ms plus 0-4.2 ms have passed since a userauth request arrived. It runs while `authctxt->authenticated` is 0, and `userauth_finish` sets that flag only after it, so the request that succeeds sleeps too. The query sleeps after sshd has already answered `PK_OK`, before it reads the signed request. spin's users meet the query from both clients: `golang.org/x/crypto/ssh` always asks first, and OpenSSH's `ssh` does for a key whose public half it holds. *Bound* (an `LD_PRELOAD` shim in ssh.service whose `nanosleep` returns at once, `--edit nosleep` on branch `exp-nosleep`, not for merge; bench, nested, spin's shape and login, #447's spin-machine on v20261122.01, 30 each, interleaved): restored login −13.4 [−15.2, −10.5] evicted and −13.5 [−15.6, −12.4] cached, `running` +0.7 [−0.8, +1.5], the cold login before the save −3.2 [−13.7, +2.7], within noise. The cold login hides the sleep behind the boot work its vCPU still has. A laptop check that the shim took: sshd and `sshd-session` mapped it, and the signed request's turn fell from ~14 to 2.9 ms. The shim first went in through the edit's `Files`, which the manifest keeps as JSON, and arrived 136 bytes longer and was ignored; it goes in by `Setup` in base64. *Status:* open (#457). The candidate is a patch that skips the sleep for a request answered with `PK_OK` or that succeeds, which tells the client nothing it does not know, and keeps it for failures. It needs openssh rebuilt from Ubuntu's source, as image/systemd does for systemd. - -**11-22 · ci, qmpdef, machine · compat in minutes, and its QMP half in go test (compat 44978948650, 44979352669, lab 44978556859, this change).** A compat run on #443's branch took ~10 minutes (run 44974499826): `boot:checkpoint-pause` 311 s, building QEMU and the kernel 239 s (QEMU's cache missed), the releases' checkpoints resumed 109 s, the rest ~40 s. It ran only on main after a merge, so #435, which sent `x-defer-disk-flush` to every QEMU, was found after it merged. *Moved:* `boot:checkpoint-pause` is a bound, not compatibility. It runs in release.yml's `pause` job on a bench host once a release is published, and the qemu entry's bump note names it. Its run there (lab 44978556859, v20261122.01) held idle 23.0, writing 16.8 and beside a busy disk 17.9 ms p50. *Built:* compat runs on every pull request beside CI. A `changed` job decides whether the change reaches the machine, QEMU or the kernel. A part it does not reach is not built: QEMU is main's published one (`fetch qemu`, 10 s) and the kernel the release's. A `compat` job at the end reports on every change, so a ruleset can require it as it requires `parts`. `changed` now compares from the merge base, so a dispatched branch is not charged with what main gained after it forked. *Built:* `go test` holds the machine package to every supported release's `query-qmp-schema` (`internal/qmpdef/testdata/released`, recorded from each tarball's `qemu-system-x86_64` by `spin-machine-dev releases schema`, which report.yml runs on each release). `CheckSupported` holds what the package sends unconditionally to every release. A value or member only newer QEMUs have is `qmpdef.Probed` or tagged `qmpdef:"probed"`. `TestTheMachineDrivesEverySupportedQEMU` drives `Checkpoint` and `DiskUsage` against a fake QEMU that refuses what each release's schema refuses, in QEMU's words. *Proved:* with #439's fix reverted, that test failed for v20261119.02 to v20261121.01 with `Parameter 'capability' does not accept value 'x-defer-disk-flush'`, compat 44964906186's error, in ~2 s. v20261122.01 and the pinned QEMU have the capability and passed. With DiskUsage's fallback removed it failed on all seven releases, since only the pinned QEMU has `x-flat`. *Measured:* compat dispatched on a change that reaches neither part took 4m02s wall, its KVM job 3m03s, of which resuming the seven releases' checkpoints was 103 s and fetching QEMU 10 s (44979352669). On this branch, which touches `internal/build` and so builds both parts from a warm cache, it took 3m57s (44978948650). *Status:* in place. - -**11-22 · machine · the read-ahead asks from four goroutines (lab 44976924478, this change).** With the read-ahead before the dial, restore-first's evicted login was still 6 ms over the cached one. The read-ahead was one goroutine making a `posix_fadvise(WILLNEED)` per 128 KiB piece, 1432 of them for the state's 179 MiB. Each call allocates its pages and submits their read before it returns, on a nested host. Four goroutines now ask, each for every fourth piece of each extent. *Measured* (bench, nested, spin's shape and login, 30 a side interleaved, against the read-ahead before the dial, lab 44976924478): evicted login 102 → 96.2, −6.2 [−9.1, −4.3], `running` −6.1 [−7.2, −4.8]. The cached row read −0.5 [−1.6, +1.9]. The evicted row is now level with the cached one (96.2 against 96.3), so the one goroutine asking was the limit and not the disk, and the restore has nothing left to win from reading. A test now holds a 64 KiB hole between two extents: a goroutine's last stride can end past it, inside the next extent, and without the reset to the extent's end over a third of that extent went unread. *Status:* in place. - -**11-22 · image/lab · udev after basic.target, and the no-systemd floor again (labs 44977226981, 44977605109, 44978034052, 44978079694, 44978927041).** In the `chain` probe's timeline sysinit.target waited for udevd's READY, at 280 ms against ssh.service's 237: udevd runs at the lowest weight while the boot runs, so its start came after every early unit, and basic.target and spin's forwarder after it. Copies of systemd-udevd.service and systemd-udev-trigger.service without `Before=sysinit.target`: cold first login −46.3 [−49.4, −39.8] (60 boots each), basic.target 286 → 242 ms on the guest's clock, udevd ready after the login at 342. Restored, ~30% of restores take ~530 instead of ~112 ms (p95 539-547), and one run read restored into prestarted +317. A journal dumped from the slow ones (branch `exp/restore-diag`): the guest resumes at 0.430 s, and the next login is accepted at 0.889 with nothing logged between, 0.04 s idle in the guest's whole uptime. It is the forwarder-early arm's tail and likely the coldplug arm's +463.7: a guest saved before the boot's deferred work is done (#452). The same change at udev's normal weight gains nothing (+0.7 [−5.0, +6.5]), so the gain is the weight and the order together. The serial getty at the lowest weight +2.7 [−4.3, +7.9], four unused varlink sockets masked −0.8 [−4.8, +4.3]. *The floor:* on v20261122.01, no systemd before sshd, the lane's first login 404 → 250 ms, −153.9 [−162.5, −151.2], sshd accepting 242 → 197 (20 boots). *Status:* udev after basic.target open, blocked by #452; the getty and sockets rejected. - -**11-22 · kernel · vmlinux BTF parsed on first use moves the parse, not the login (labs 44982285400, 44982285406).** kernel/Dockerfile says the first kfunc registration of the boot parses the 4.6 MB of vmlinux BTF, today xfrm's, and that only `DEBUG_INFO_BTF=n` removes it. A patch (branch `exp/btf-first-use`) keeps vmlinux's kfunc sets, destructors and struct_ops registered before the parse on a list, and the first `bpf_get_btf_vmlinux()` parses and registers them, in order, before any other caller gets the BTF; a struct_ops init that registers a kfunc set in turn (io_uring's) registers it at once. A program calling kfuncs of the common set loaded and ran on it. The kernel to "Freeing" −7.2 [−8.6, −6.2], inet_init 6.85 → 0.14 ms (10 boots), but the cold first login −1.5 [−3.1, +1.6] (60 boots): journald's `DeviceAllow=` and `IPAddressDeny=` load cgroup BPF programs at its start, and `bpf_check()` asks for vmlinux BTF for every program, so the parse lands in journald's start, before the login, on the same vCPU. *Status:* not carried. A verifier that asks for BTF only when a program needs it would let the parse leave the boot. - -**11-22 · image · the host key is Ed25519 alone (lab 44979726719, this change).** spin-machine-sshd-keygen made an Ed25519 and an ECDSA key, each with its own ssh-keygen, before ssh.service starts, on the one vCPU. Ed25519 alone: the cold first login −5.0 [−8.3, −1.8], sshd accepting −4.4 [−6.9, −1.9], 60 boots each interleaved, spin's shape and login. Every client since OpenSSH 6.5 takes Ed25519; one that accepts only ECDSA host keys no longer gets in. The same run took `pam_selinux` and `pam_mail` out of sshd's PAM stack, −1.9 [−4.9, +2.8], not separable. *Status:* Ed25519 alone; the restore unchanged (in the description). - -**11-22 · machine, boot · a resume takes its disks before the load (labs 44984233276, 44984233299, 44984162863, #459, this change).** A fast load in compat completed with no RESUME, and its guest never ran. QEMU's stderr said `Failed to get "write" lock` on the overlay. QEMU 11.2.0-rc0 adds a held machine's nodes inactive. Both run BHs, the full load's and the fast one's, activate them with `migration_block_activate(NULL)`. When that fails they skip `vm_start` and tell the monitor nothing, and the run state stays `inmigrate`. `Resume` returned nil for that, in a full load too. The lock came from the boot tests: `rootDisk` never closed its files, and QEMU's lock lives on the description the test's `*os.File` shares. So the lock outlived the killed "in full" machine until a garbage collection closed the file. `Resume` now sends `blockdev-set-active` before `migrate-incoming`, so QEMU's refusal is its error, before a byte of the state is read. `rootDisk` closes its files when the test ends. *Measured.* With `GOGC=off` on a laptop (KVM, userfaultfd on), main missed 10 of 10 fresh-process runs of the events test and the fix passed 50 of 50. On the bench (nested, v20261122.01, 100 fresh-process runs each), main missed 3 with #459's events and stderr, and the fix missed 0. restore-first, fix against main (bench, spin's shape and login, 30 a side interleaved, `fast=true`, lab 44984162863): evicted login −0.3 [−2.4, +4.8], `running` +0.2 [−1.6, +4.9], cached login −0.6 [−4.8, +1.7], all within noise. *Status:* in place. `boot:record`'s "a disk another machine holds" holds it on real KVM. - -**11-22 · image · sshd delays a failed userauth and not a login (labs 44983986606, 44983986575, #457, this change).** The image installs Ubuntu's openssh 1:10.2p1-2ubuntu3.8 rebuilt from its source package (`image/openssh`, versions.yaml `openssh-source`) with `userauth-delay-failures.patch`: `input_userauth_request` skips `ensure_minimum_time_since` for a request that authenticated, or for a public key query sshd answered with `PK_OK`, and keeps it for every other request but `none`. Ubuntu's package changes nothing on that path. It carries d43ba60 (CVE-2026-60001), whose keyboard-interactive and GSSAPI follow-ups delay only a failure, so the patch tests the method (`m == &method_pubkey`) and not `postponed` alone: those methods' first requests set `postponed` and keep their delay. The packages are `+spin1` and held, as systemd's. *Measured* (bench, nested, spin's shape and login, 30 a side interleaved, v20261122.01 against itself with this checkout's OpenSSH, `lab tree --openssh`): restored login 93.2 → 79.6, −13.6 [−14.9, −9.8] evicted and −13.6 [−16.2, −11.4] cached, `running` −0.3 [−1.9, +3.1] (lab 44983986606); the cold first login 467 → 457, −9.4 [−15.8, −2.6], sshd accepting −3.4 [−8.2, +0.6], accept to login −6.0 [−10.1, −4.8], the second login −10.9 [−12.3, −9.0] (lab 44983986575). The restore matches the `LD_PRELOAD` bound (−13.4). The cold login, which the bound read as within noise at −3.2 [−13.7, +2.7], moved too. *Checked* (`boot:sshd-delay`, laptop, 10 logins): the signed request of a login took 16.8 ms on the release's sshd and 1.9 ms on this image's; every refused key and unknown user still took 5.8-9.1 ms. The query's own turn shows no delay on either, because `PK_OK` goes out before it: the query's delay holds up the signed request. *Found on the way:* `debugfs cat | grep -q` on a binary fails under `pipefail` (debugfs takes SIGPIPE when grep stops at the match), so build.sh dumps sshd-auth to a file before it asks. *Status:* in place. The success half is upstream's intent and should be offered to OpenSSH (#457). - -**11-22 · machine · GuestRunning is QEMU running the resumed guest (labs 44987275584, 44987275543, #465, this change).** A fast load says `postcopy-active` in `qemu_loadvm_run_fast_snapshot_load` right after it schedules the run BH, and the BH starts the guest later, on QEMU's main loop (QEMU 11.2.0-rc0). `Resume` returned and told `GuestRunning` at `postcopy-active`, so #459's guest, which never ran, was told running at 6.80 ms. `Resume` now arms a wait on `RESUME` before `migrate-incoming` and returns, telling `GuestRunning`, once it arrives, in a full load too. A full load that leaves the machine neither running nor paused is now an error, where `Resume` returned nil. *Checked* (`boot:record` on the bench, lab 44987275584): the events test now asks QEMU's run state from inside the `GuestRunning` callback and finds it running, in full and fast. The fast load told `GuestRunning` at 8.77 ms and `StateLoaded` at 672 ms. *Measured* (bench, nested, spin's shape and login, v20261122.01, `fast=true`, 30 a side interleaved, against main's spin-machine, lab 44987275543): fast `running` −0.4 [−1.5, +1.3] and fast login −0.6 [−13.8, +22.0], both within noise. The cached row's login read −0.5 [−4.4, +4.3]. The evicted row's login read −2.7 [−5.1, −0.8] with its `running` −0.0 [−3.1, +2.7]. A full load's path changed only by a wait that has already matched, so that row is taken as noise until another run repeats it. *Status:* in place. `Resume` now returns when QEMU runs the guest, not when the load is merely handed over. - -**11-22 · lab · ssh-first logs in over the connection it timed (lab 44987441326, #450, this change).** `ssh-first` polled `VsockAccepts(cid, 22)` to time `accepts`, closed that connection, and logged in on a new one. On spin's path (`login=spin`) the closed connection had reached the forwarder, which opened one to 127.0.0.1:22, so sshd forked and exec'd `sshd-session` for it on the guest's one vCPU beside the first login timed. spin's runner opens the user's connection once. The probe now keeps the first connection accepted and runs the first login over it (`Key.LoginOn`); `accepts` is still that connect's return. If that login fails, the probe logs it and logs in again as before. `VsockAccepts` had no caller left and is gone. *Measured* as two rows of one tree, so one run compares the two probes (bench, nested, spin's shape and login, v20261122.01 with main's spin-machine, 40 each interleaved, lab 44987441326, branch `exp-ssh-first-rows`, not for merge): accept to login 69.6 → 65.3, −4.3 [−5.4, −3.0]; first login 463 → 458, −4.4 [−9.1, +0.3], within noise at 40, because `accepts` itself spreads ±4 ms; sshd accepting +1.8 [−3.7, +4.4]; the second login −0.6 [−2.0, +1.3]. The console prompt read −6.2 [−12.3, −2.2]: the echo getty runs after sshd accepts, on the same vCPU as the extra session. The size matches #451's −4.1 on the restored login. The number moves because the probe stops adding work, not because the machine changed. *Status:* in place. Compare a release measured before it only within one run, as the ladder does. - -**11-22 · CI · refresh.yml proposes the openssh source when Ubuntu moves it (#463, this change).** The archive serves only the openssh source resolute publishes now, so image/openssh stopped building the day Ubuntu moved it, and nothing moved the pin. `spin-machine-dev refresh openssh` is `versions refresh -propose -label openssh openssh-source`, and refresh.yml's `systemd` job is now `sources`, one matrix job each for systemd and openssh. The patches are checked where the build already checks them: the proposing pull request changes `openssh-source`, so parts.yml's `changed` builds the image, and `image/openssh/Dockerfile` applies every patch with `--fuzz=0`. *Checked.* With the pin set back to 10.2p1-2ubuntu3.7, `versions refresh openssh-source` committed 10.2p1-2ubuntu3.8 with the repository's pin, 5f83862e…. A moved `openssh-source` makes `changed` answer `build=true` for the image. The patch applies with `--fuzz=0` to the pinned source as `dpkg-source -x` lays it out. With one of its context lines in auth2.c changed, `--fuzz=0` refuses it (`Hunk #1 FAILED at 360`), where patch's default fuzz would have applied it. *Status:* in place. - -**11-22 · image · every login gets its user manager again (labs 44987167474, 44987167549, #462, this change).** `boot:logind` failed from v20261120.03 on: `systemctl --user` found no manager. Sessions have been of class `user-early-light` since 11-13, and logind starts no manager for one (`SESSION_CLASS_WANTS_SERVICE_MANAGER`, systemd v259.9). spin's linger had been the only thing that started `user@1000`, and e807038 (11-20, "spin does not linger") took it away. Root, the user spin logs in as, never had a manager on that path (inferred from the same code; not checked on a release). *Bisected* on the laptop, KVM, `boot:logind` against each release: v20261120.02 passes; v20261120.03, .04, v20261121.01 and v20261122.01 fail. e807038 is the only image commit between .02 and .03. v20261122.01 passes with `/var/lib/systemd/linger/spin` written back into the test's root. `lab tree --edit nolinger` did not reproduce it, because `boot:logind` boots its own raw copy of the base and never applies a tree's edits. *The fix.* `user-runtime-dir@`'s `20-manager.conf` wants `user@%i`. logind starts that unit for every session and waits for it alone, and the manager starts after it, so the login does not wait for the manager. *Measured* (bench, nested, spin's shape and login, 20 a side interleaved against v20261122.01, the drop-in and the class put into the overlay by experiment edits on branch exp/user-manager-462, 5ba7507): the drop-in first login +2.6 [−4.0, +8.7], restored login +0.8 [−1.5, +4.5] evicted and +1.0 [−1.1, +5.8] cached, cold login in the restore run +3.7 [−1.7, +10.5], all within noise. Accept to login +5.1 [+2.8, +6.5] and the second login +15.8 [+14.2, +16.6]: the manager runs while the second login does. Class `user-early`, which holds the login for its manager, cost the first login +36.2 [+32.0, +45.7], so it was rejected. *Checked:* `boot:logind` passes with the drop-in. With the console `su` login taken out of the check, the first SSH login's own `systemctl --user` still fails 3 of 3 with the drop-in, and passes 2 of 2 with class `user-early`. A command that needs the user bus at once in the first login can arrive before the manager. *Status:* in place. The manager's own cost is what would let a login wait for it (#467). - -**11-22 · qemu, image · a restored guest's TSC, and udev after basic.target (labs 44983495254, 44983967863, 44984395014, 44986512574, 44987412184, 44987412171, 44987412210, 44987584707, #452, this change).** The ~450 ms that blocked udev after basic.target and spin's forwarder early was not guest work. Sampled on the bench (branch `exp/452-diag`), a slow restore's vCPU thread ran ~17 ms after the resume and then sat in `kvm_vcpu_halt` for 281-450 ms, neither running nor waiting, and the guest's /proc/stat was missing that time. Traced with the host's kvm and vsock events, the guest answered the login's packets until it halted, and woke on its first local timer interrupt, with no TSC-deadline write before it: the slow login ended 528-555 ms after QEMU's exec however long the load took. kprobes on `kvm_synchronize_tsc` showed why. QEMU writes each vCPU's TSC before the load, zero after the vCPU is made and one at the reset, and KVM, having had a TSC from userspace, takes the migration's TSC within a second of it for a sync and keeps the offset (kernel bf328e22e472's case, undone). The guest's TSC counts from the new vCPU's creation, so its saved TSC deadline is met only after the saved uptime, ~0.5 s. A guest saved with its tick running (udev still at work) had that deadline a tick ahead and reprogrammed none of its later timers. One saved idle armed far ahead and reprogrammed, so the release's restores never showed it. The coldplug arm's restored +463.7 (lab 44818953987) was the same. QEMU 0005 writes an incoming machine's TSC only from the migration: the writes became the creation's and the checkpoint's, unmatched, and 16 of 16 restores read 84-94 ms (lab 44987412184). *Measured,* spin's shape, 30 a side against the release: udev after basic.target with 0005 cold −48.6 [−51.7, −42.6], restored −2.0 [−8.0, +4.7] with p95 114 against 114 evicted and 126 against 128 cached; without 0005 the same edit's restored p95 is 539-546 (lab 44987412171). In `prestart`, cold −44.7 [−53.4, −39.4], restored into prestarted −1.3 [−4.1, +3.6] with p95 98.8 against 101, and without 0005 413 (lab 44987412210). 0005 alone moves neither number (cold −3.0 [−5.8, +0.1], restored −1.9 [−7.6, +2.0]). spin's forwarder early with 0005: cold −60.4 [−63.3, −52.9], restored +3.3 [+1.0, +7.4], p95 104 against 101 (lab 44987584707), so it is spin's to take. The image now carries copies of systemd-udevd.service and systemd-udev-trigger.service without `Before=sysinit.target`, and image/build.sh checks them. *A first 0005 skipped only the zero:* the reset's one still set KVM's flag, and the tails stayed (labs 44986055383, 44986006042). - -**11-22 · qemu, qboot, kernel · every carried patch has a test that fails without it, and three are measured alone (labs 44993254745, 44993790452, 44993011539, 44993011448, #472, #481, #478).** A patch dropped at a bump, or rebased into applying and doing nothing, built and booted, and nothing said so: `patch --fuzz=0` refuses only a patch that no longer applies. *Built:* `verify args` asks the TCG QEMU what 0001-0004 do with no guest (`TestEachQEMUPatchDoesItsJob`): 163 flat views from QEMU's start to its first answer at spin's shape, a disk beyond `max_target` refused, a save's stop submitting one io_uring flush without `x-defer-disk-flush` and none with it, and `query-blockstats` without `parent` or `backing` under `x-flat`. `boot:patches`, which compat runs beside boot:record, asks a guest of spin's shape what only it sees: its SCSI host refuses a scan of target 16 (0002), the firmware enabled the MTRRs (qboot's `mtrr.patch`), and a guest restored 650 ms ahead of its new vCPU's TSC goes no more than 200 ms without a line (0005). On v20261122.01, before 0005, it went 625 ms (lab 44993011539); on v20261122.02, 12 ms (lab 44993011448). `kernel/Dockerfile` reads each kernel patch's effect in the vmlinux it built (#478). *Measured alone* (bench, spin's shape, `prestart`, against main's QEMU from parts run 44989641652): taking 0001 back read restored +11.7 [+0.9, +19.3] and cold +0.2 [−8.7, +7.1] (20 a side, lab 44993254745), so it earns on the restore. `pam.patch` read cold +3.9 [−3.4, +8.0] and `no-pci-walk.patch` +5.2 [−1.7, +9.2] (40 a side, lab 44993790452). Both are inside the noise with upper bounds over +5 ms, which rule 5 keeps. *Status:* every patch kept. - -**11-22 · kernel, boot · the host counts the port I/O exits 0004 and 0010 save (labs 45017602084, 45018204750, 45018204645, 45018410483, 45018410313, 45018410890, #486, this change).** The vmlinux check (#478) sees 0004 and 0010 compiled in, not earning. 0004 needs `raw_pci_ext_ops`, set from the ACPI MCFG table, and 0010 needs KVM's CPUID leaf, so a kernel that set up MMCONFIG after enumeration, or a machine without MCFG, would pass it. `boot:patches` now cold-boots spin's shape to `/bin/sh`, reads KVM's `io_exits` and `mmio_exits` for every vCPU through QEMU's `query-stats`, and holds the median of 3 boots' `io_exits` at or under 1,025 (`TestPCIConfigurationCostsNoPortExits`). *Calibrated* on the bench, 20 boots each, v20261122.02 with its own kernel and with kernels built without each patch (parts runs 45017420814, 45017423344, branches `exp/486-no0004` and `exp/486-no0010`, not for merge): the release 955-974, median 958, mmio 2,142; without 0010 1,075-1,097, median 1,094; without 0004 3,477-3,499, median 3,496, mmio 881. 0004 saves 2,520 port exits, not the issue's estimated 1,300: 1,261 configuration accesses move to ECAM, and mmio_exits falls by the same 1,261. 0010 saves ~120, clear of a spread of ~25, so both are guarded. *Checked:* the release passes (974/974/980). The guard fails without 0004 (median 3,481) and without 0010 (median 1,097). *Status:* in place, run by compat.yml with every change's kernel. - -**11-22 · qemu · 0003 says the same in fewer lines (#488, this change).** `x-defer-disk-flush`'s patch was 369 lines, most of them a `defer_flush` argument carried through `migration_stop_vm`, a second `vm_stop_force_state` and the stop's helpers. Now `do_vm_stop` and `vm_stop_force_state`'s stopped branch start the deferral themselves, after the drain, when the run state is `finish-migrate` and `migrate_defer_disk_flush()` (public in `include/migration/misc.h`) holds: 249 lines, 71 added and 3 removed in QEMU against 107 and 22 before. Postcopy's and CPR's stops are `finish-migrate` too, so the accessor is false with `postcopy-ram` or a CPR mode; the machine sets neither on a save, so what it does is unchanged. *Checked* on the rebuilt QEMU (parts run 45017732016): `verify args`' 0003 subtest, one flush without the capability and none with it; compat (run 45017731970); `boot:checkpoint-pause` on the bench, busy-disk guest p50 stopped 20.6 ms, 22.1 short of memory (lab 45018667678). *Status:* in place. - -**11-22 · CI · the coverage floor counts what CI can run (#410, this change).** `task test`'s floor counted every statement, and a function marked `mutate-lane:` runs only in a lane with root and KVM. Each probe the lab gained pulled the total down however well its testable half was tested: #406 passed at 79.96%, which `go tool cover -func` rounded to 80.0 before the comparison. `internal/coverfloor` reads coverage.out, leaves out each function whose doc comment carries the marker, as go-tools' mutate does, and compares the exact percentage. *Measured* locally on `140ebbb` with CI's conditions (no release tree, no root): 80.48% before it, 80.65% of 9298 statements with internal/coverfloor's own, and 93.36% of the 7697 left without the lane's 1601. The floor moves from 80 to 93, just under it, so it ratchets. *Status:* in place. - -**11-22 · lab · every release's record carries its no-systemd floor (this change).** AGENTS.md and docs/measuring.md (rule 8) ask for the bounds each release, the no-systemd floor first, and report.yml measured only the goal's numbers and the diagnostics: the floor was last measured by hand, on v20261122.01 (lab 44978079694). `releases measure` now boots the release beside its floor after the ladder, `ssh-first` with `login=lane` over the release and the release with `--edit floor --append init=/usr/local/sbin/spin-floor`, 20 boots each, interleaved, as the hand-made runs did. The record keeps both first logins as `floor-lane` and `floor`, and docs/releases.md tables them under "Bounds" once a record has them. Only the release a record is made for is measured beside its floor: the one it is against has none, and no Δ is read of a bound. It is the one bound docs/boot-time.md lists as each release's. *Checked* by report.yml on this branch against v20261122.02 (run 45018301368, record not proposed): first login by the lane 406.8 / 420.2, no systemd before sshd 240.5 / 245.5 (p50 / p95, 20 boots each, bench, spin's shape), beside the ladder's cold 420.0. *Status:* in place. - -**11-22 · kernel, qemu · every carried patch is git format-patch output (#487, this change).** Three hygiene items found while writing #478, none of which changes what a patch does. Kernel 0003 left `eval_map_work` and its `INIT_WORK` behind after `trace_eval_init()` came to call the copy directly, and its allocation-failure branch did what the success path did: the copy (now `trace_eval_defer()`) runs once, first, and `trace_init_wq` stays for `tracerfs_init_work`. Subjects said `[PATCH 7/11]` and the like after 0006, 0009 and 0011 were deleted; they say `[PATCH]`. Kernel 0007, 0008, 0010 and QEMU 0002, 0004 and 0005 had no `diff --git` lines (#488 had just remade QEMU 0003); all thirteen were remade with `git format-patch -N` from git trees of the pinned tarballs. *Checked* on the laptop, no build: each set, applied with `patch -p1 --forward --fuzz=0` as the builds do, gives the tree the series' commits do; the old and new kernel sets differ only in 0003's trace.c; every changelog is unchanged; checkpatch --strict reads the kernel patches clean but for 0002's citation of a commit the tarball has no history for. `gates/patches_test.go` holds both directories to the format. CI rebuilt the kernel and QEMU, and the vmlinux check still finds each patch. *Status:* in place. - -**11-22 · lab · the floor's gap is a Δ with its interval (#495, this change).** The record kept the floor as two p50/p95 pairs, and the gap a reader wants, what systemd costs at most, was their difference with no interval, so it could not be read by the one acceptance rule. A record now keeps `bounds.floor`, the floor's Δp50 against the release's lane login from the same run, drawn by `DeltaP50`, the bootstrap every release's Δ uses, and docs/releases.md shows it in "Bounds" beside the two pairs. A bound is still never read against the release before it. *Checked* on the floor's samples from report.yml run 45018301368 (v20261122.02, bench, spin's shape, 20 boots each), kept as `internal/lab/testdata/floor-45018301368.json`: −166.3 [−174.7, −160.3]. The floor keeps its own lane-login arm. Its sshd does not serve spin's path, which is spin's forwarder before sshd, and the floor has no systemd to run it. *Status:* in place. - -**11-22 · CI · the coverage floor is go-tools' coverfloor (go-tools #131, v20261122.02, #496, this change).** `internal/coverfloor` (#490) copied go-tools mutate's rule for lane code, which every spin-stack repository's `task test` should read the same way. go-tools' `coverfloor` reads it through mutate's own `LaneFunctions`, and it refuses a marker that names no test, as mutate does. `task test` runs it by name from go-tools' release, and the copy is deleted. *Checked:* both tools printed the same line on main's profile (93.38% of what CI runs, 80.66% with the 1606 lane statements). The same release copies no ignored directory into mutate's copies (go-tools #132, #129) and stops a run whose importer test fails unmutated (go-tools #133, #130): the `_output` guard in `task test` stays, for a plain `go test`, with its comment saying so. *Status:* in place. - -**11-22 · qemu · 0003 has no postcopy clause (#501, this change).** `migrate_defer_disk_flush()` was false with `postcopy-ram`, and no test could ask it: a save to a file cannot run with `postcopy-ram`, because the source opens a return path at connect and waits for the destination's SHUT at completion (11.2.0-rc0), so holding it needed a second QEMU as a destination. No caller can reach it either. The machine turns on `x-defer-disk-flush` only in `Checkpoint`, which also turns `postcopy-ram` off and migrates to `file:`. `postcopy-ram` is turned on only by `Resume`, on a destination, for a fast load, and a destination's stop is not a switchover's. spin moves a workspace by checkpoint, upload and resume (`moveFor`, spin#1487), with no live migration. The clause also guarded nothing that precopy's stop doesn't share. A deferred flush is safe when the migration's reader shares this host's page cache, which is what the capability says, and that holds or fails the same way whichever phase stops the VM. So the clause is gone, and postcopy's stop defers as precopy's does. CPR's exclusion stays, because cpr-reboot's stop can precede a host reboot that loses the page cache, and #499's subtest holds it. The patch adds 70 lines where it added 71, and every branch it carries is asked by `verify args`. *Checked:* the series applies with `patch --fuzz=0` to the pinned tarball, and `migration/options.c` and `qapi/migration.json` match the edited files, which `scripts/qapi-gen.py` reads without error. On the rebuilt QEMU (parts run 45030863541), `verify args`' 0003 subtest passes, and so does compat (run 45030863623). `boot:checkpoint-pause` passes on the bench with the busy-disk guest's p50 stopped at 19.7 ms, 29.5 when short of memory (lab 45031602785). What a checkpoint does is unchanged, since it never sets `postcopy-ram`. *Status:* in place. - -**11-22 · image · the first login waits for its user manager, which root starts in the boot (labs 45030778365, 45031248191, 45031644179, 45031644114, 45031687433, 45032247920, 45032247623, #467, this change).** Since #462 a login's manager started beside it, and the first login's own `systemctl --user` could arrive before it. On spin's login (root, bench, v20261122.03) it failed 10 of 10 (lab 45032247920, `ssh-first` with the first login's command `systemctl --user list-units`, archive tag archive/exp-user-manager-467). *Where the manager's time goes:* a diagnostic read root's manager's timestamps after the logins (`systemctl show` of `user@0` and the manager's own Generators/UnitsLoad timestamps). With class `user-early` the manager took ~48 ms from `user@0` starting to ready: ~11 PAM and exec, ~2.6 the manager's start, ~9 the XDG autostart and environment.d generators, ~2 unit load, ~8 building the first transaction (its lazy unit loads, a debug log showed), and ~15 sockets.target, which waits for dbus.socket's and ssh-agent.socket's `ExecStartPost=systemctl --user set-environment`. The user units are default.target, basic.target, sockets.target (dbus.socket, ssh-agent.socket, systemd-ask-password.socket), timers.target and paths.target with nothing in them, and app.slice. *Cuts* (bench, nested, spin's shape and login, 20 a side, against class `user-early`, lab 45030778365): the sockets' environment from `/etc/environment.d` and their ExecStartPost taken away −17.1 [−27.0, −10.7]; the XDG generator masked −4.8 [−11.2, +1.3]; both generators, a bound, −8.4 [−15.8, −1.0]; the PAM stack down to `pam_permit` and `pam_systemd`, a bound, −3.5 [−11.4, +2.5]. With the environment cut and the XDG mask, `user-early` still cost +29.8 [+17.2, +42.2] (lab 45031248191): what is left is systemd --user's own start. *Root lingering* moves that start into the boot, where the first login finds it done or nearly. Decided at 40 a side (lab 45031644179): `user-early`, the environment cut and root lingering, first login +4.7 [−0.2, +12.2], within noise; sshd accepting +5.6 [+1.1, +10.1]; the second login −16.7 [−17.7, −16.3]. Without the environment cut, +19.6 [+15.9, +25.6]. Restored login −10.8 [−15.9, −6.6] evicted and −12.3 [−15.1, −5.5] cached, 20 a side (lab 45031644114). The likely reason is that root's manager no longer stops 10 s after the cold login's session ends (`UserStopDelaySec`) and starts again beside the restored login (inferred, not measured). *Left out:* the XDG mask, which moved neither goal number. *The lane's login as spin* waits for spin's own manager: first login +29.7 [+22.8, +42.1], and shadowing Ubuntu's `user@` barrier on `systemd-user-sessions` changed nothing (+30.6, lab 45031687433). The lane is no goal number, and the no-systemd floor's Δ in the next release's record is read against it. *Changed:* class `user-early`, root's linger file, `environment.d/10-user-sockets.conf` and the two sockets' `10-env.conf`; `20-manager.conf` deleted, since logind starts the manager of every session of class `user-early` itself. `boot:logind` runs its SSH logins before the console `su`, so the first SSH login's `systemctl --user` is the first login's. `lab`'s lane edit carries the same. *Checked:* the first login's `systemctl --user` passed 10 of 10 on spin's login and on the lane's with these edits, the manager-wants drop-in removed (labs 45032247920, 45032247623). *Status:* in place. - -**11-22 · lab, report · a boot chart of every release and of any tree (labs 45035203882, 45036503632, 45037354657, this change).** A number said how long a boot took, and nothing showed what ran in it. The `bootchart` edit puts systemd-bootchart (Ubuntu's 235-2build1, pinned in versions.yaml) into a tree's overlays as PID 1, sampling at 200 Hz. The `bootchart` probe stops it with the first login and keeps its chart and `systemd-analyze plot` beside `result.json`. `releases measure` draws each release once, and its record links both charts from docs/releases.md. *Cost* (bench, spin's shape, 20 a side, v20261122.03, lab 45036503632): first login +10.4 [+4.5, +16.8], console prompt +15.7 [+12.3, +19.7], QEMU RSS +4.0 MiB. It is a diagnostic and never in the image. *Fixed on the way:* the sampler is named `init`, not systemd-bootchart (lab 45035203425 found none); the stop command's sudo and its forks drew themselves ~0.1 s past the login (labs 45036002014, 45036494125); 235 names processes from `/proc/PID/sched` as "9" on this kernel and reads cgroup v1, so it names them by command line and draws no cgroup. *What v20261122.03's chart shows* (lab 45037354657, 3 boots): PID 1 at 82 ms of the kernel's clock and the login at 320. From about 100 to 140 ms the vCPU is nearly idle while the disk reads ~230 MB/s, so systemd's first 40 ms wait on the image. From about 190 ms to the login the one vCPU is busy and every process waits to run. udevd (21.5 ms), journald (18.6) and logind (14.8) use the most CPU. In the plot, systemd-udevd.service activates for 189 ms and systemd-udev-trigger.service for 127. These are leads, and the log's 2.1 is why a chart's bar is not a saving. *Status:* in place. - -**11-22 · machine, lab · the machine loads a state fast above 1.5 GiB of data, and no caller chooses (labs 45034868686, 45035462371, 45035462478, 45034881876, 45034881433, 45034881366, 45035029887, 45035048486, #470, this change).** `LoadOptions.Fast` was the caller's choice, and spin offered it as a host policy, `fast_load`, off by default, whose comment cited 293 against 152 ms from before mapped-ram and multifd (lab 44585840498). A fast load reached the first login at ~400 ms against ~95 for a full one at today's state (lab 44987275543). *The crossover:* `restore-first` gained `touched=MIB`, which writes that many MiB of non-zero bytes into a tmpfs in the guest after its cold login and before its save. Bench, nested, spin's shape and login, plugged to 2048 MiB up to 1.5 GiB touched, then to 4096 and 8192, the state evicted, 20 a side interleaved, first login p50/p95 in full against fast: 179 MiB of data 95/105 against 489/563, +394 [+388, +420]; 825 MiB 258/310 against 431/446, +173 [+149, +195]; 1.2 GiB 374/510 against 476/534, +103 [+88, +120]; 1.7 GiB 570/763 against 441/498, −129 [−167, −76]; 3.7 GiB 1410/1804 against 451/518, −959 [−1008, −911]; 7.3 GiB 3152/3658 against 538/581, −2615 [−2642, −2589]. A full load costs the disk's read of the data, ~0.4 ms a MiB; a fast load's login barely moves. *Where a fast load's time goes* (branch `exp-470-blocktime`, `postcopy-blocktime` on, lab 45035029887): at 179 MiB ~2,500 faults, mean 69 µs, most 64-128 µs, blocked the vCPU 45 ms of the ~400 the login adds. With the state read ahead each fault took 5.5 µs and blocktime 3 ms, and the login was still 325 ms (−168 against no read-ahead, +234 over a full load). The postcopy lasted 0.8 s at 179 MiB and 2.4 s at 3.7 GiB: QEMU's eager thread places every 4 KiB page of the RAM blocks at their ceilings, 8 GiB, one ioctl each. That this is what slows the guest is inferred, not measured (#519). Postcopy's preempt channel is a second socket from a source, for pages queued behind the precopy stream, and a file load has neither. *Read-ahead during a fast load* (lab 45035048486, 10 a side, 3.7 GiB): faults 78 against 85 µs, login 436 against 458, p95 713 against 490, so it is not carried. *Changed:* `LoadOptions.Fast` and `spin-machine restore --fast` are gone. `Resume` loads fast a mapped-ram state with more than `machine.fastAbove` (1536 MiB) of data on a host that grants QEMU a userfaultfd (`/dev/userfaultfd` open to every user, spin's grant, or `vm.unprivileged_userfaultfd=1`), and in full otherwise. The read-ahead and the channels follow the same choice. `restore-first` lost its `fast` row; a bench runner grants the userfaultfd, so `touched` over 1.5 GiB measures the fast load. `boot:record`'s events test fills 1.6 GiB of a 2 GiB guest for the fast load's events. spin's `fast_load` is spin-stack/spin#1570. *Status:* in place. - -**11-22 · image · six unmeasured deviations measured, two reverted, and boot:workspace (labs 45034963004, 45036254377, #508, #517, this change).** The inventory (#508) and docs/image.md (#517) left six deviations with no measurement in spin's shape on spin's login. Each was taken back to what Ubuntu ships by a `lab` edit, one arm each, interleaved against v20261122.03 with `--edit lane`, 20 a side, 1 of 16 vCPUs, 128 MiB, `prestart` (lab 45034963004). Taking back, Δp50 cold: `nsswitch.conf` +0.8 [−8.4, +5.2]; the volatile journal +6.1 [+2.3, +15.8]; docker and containerd by socket +13.9 [+11.4, +18.2], restored +55.7 [+12.0, +73.9]; the manager's timeouts +0.3 [−5.2, +3.3]; logind, the bus and the user units early +16.5 [+9.8, +20.4]; the host keys from the first dispatch −0.8 [−10.5, +3.5]. *Kept:* the journal, docker (a deferred row, which says the first `docker` command waits for the daemons), and the lane's logind units, now measured in spin's shape. *Reverted:* `nsswitch.conf` and `fast-boot.conf`, which earned nothing; their edits went with them, and so did `carry-logging`, which edited `fast-boot.conf`. The host keys stay pending #515. `boot:workspace` checks what a workspace expects and asserts what the image gives up; on v20261122.03 (lab 45036254377) it found tracefs empty under `lockdown=confidentiality`, where docs/image.md said it mounted by hand, and the first `docker` command waiting 0.47 s on two vCPUs. It runs in release.yml's bench job on the release's own image, beside `boot:logind`. *Opened:* #509-#515. *Status:* in place. - -**11-22 · lab · the boot chart from spin-stack's systemd-bootchart (labs 45042034749, 45042509602, 45043434713, #525).** Ubuntu's 235 named processes "9", read cgroup v1 and so labelled none with its unit, and filtered out 62 of the processes that ran. The `bootchart` edit now compiles spin-stack/systemd-bootchart at the commit versions.yaml pins, in a container on the runner that makes the tree (`internal/lab/bootchart.Dockerfile`), with `ControlGroup=yes` and `Cmdline=no`, and the probe keeps the fork's JSON beside the chart. *What v20261122.03's chart shows at 78dc08c* (lab 45043434713, bench, spin's shape, 3 boots): CPU by unit p50 init.scope 134 ms (PID 1 118 to 123 ms, and the sampler, named `bootchart`, ~10 ms), systemd-udevd.service 25, systemd-journald.service 19, systemd-logind.service 15, the root cgroup's kernel threads 15, session-1.scope 13, ssh.service 11, dbus-broker.service 10. systemd-udevd waits ~120 ms to run and systemd-udev-trigger ~110. The sampler says it used ~10 ms of CPU, ~0.2 ms a sample. `first_login` 433 ms p50, `chart_end` 330. Leads, not savings. *Status:* in place. - -**11-22 · lab · the boot chart without the things a reader had to guess at (lab 45060814905, spin-stack/systemd-bootchart#9, #528).** The charts at 78dc08c (lab 45043434713) named one executor "9", gave idle kernel threads no cgroup in one boot of three (so "/" counted 15 processes there and ~50 in the others), showed "systemd-user-sessions.service (deleted)" as a unit of its own, and drew the header and top tables overlapping on a page ~340 px taller than its chart. The fork at 096d61a names a process whose comm is digits by its exe link's basename, says "/" for a process the kernel lists in no cgroup (before systemd mounts one), cuts " (deleted)", gives its font sizes a unit (CSS ignored them, so browsers drew every label at 16px), and sizes the page from what it draws. *What lab 45060814905 shows* (bench, spin's shape, v20261122.05, 3 boots): no process without a cgroup, "/" at 51 processes in each boot, no name of digits and no " (deleted)", and each page 40 px below its last row. The executor and the removed cgroup did not recur in these boots, so the fork's `--proc` tests are what show those two fixed. A name in parentheses such as "(systemd-user-)" is a child systemd forked, seen once before it exec'd: that is what it was then. *Status:* in place. - -**11-22 · lab · the boot chart's first sample, wait graph and legend (lab 45064083873, spin-stack/systemd-bootchart#10, #534).** The write graph in lab 45060814905 had the read graph's shape from 85 to 215 ms, in a boot whose tables said it wrote 0.0-0.1 MB. It read the right counter, `pgpgout`. As PID 1 the sampler starts before /proc is mounted, and its first samples held zeros. The first sample that read /proc then differed from zero by everything since the kernel started: 21 MB read, 124 KB written and 79 ms of CPU in one 5 ms interval. The IO graphs' 250 ms average spread that jump into a ramp, and the CPU and pressure graphs began with a full bar. The fork at 3125dea gives the samples before /proc the first counters it reads. It also drops the "CPU wait" graph, which summed every task's run delay, so on one vCPU it sat at its ceiling and read like a boot bound by IO (upstream #13). CPU pressure now sits under CPU utilization. The process graph's title says what its colours and dashed lines are (upstream #39), and the header's "Graph data" and "Sampler" lines are drawn at 12px instead of 8px. `--proc` tests hold three upstream reports that the fork already got right: a "(systemctl)" name kept whole (#44), no nameless process without /proc/PID/sched (#34), and a short-lived `@`/`:` template instance drawn (#40). Upstream #38's leaks are cppcheck not modelling `_cleanup_fclose_`. *What lab 45064083873 shows* (bench, spin's shape, v20261122.05, 3 boots, the fork's branch at 1f00a0f, whose tree 3125dea merged unchanged): `pgpgout` is 124 KB in every sample of every boot, and each write graph is empty. No chart has a wait graph, and each carries the legend and the 12px header lines. The read graph still starts ~20 ms before the first read, from its 250 ms average (#538). *Status:* in place. - -**11-22 · lab · a ledger of the boot to the first login, from a scheduler trace (labs 45062548343, 45062836688, 45062836494, 45063070048, #533, this change).** The boot chart samples every 5 ms, sees only processes and draws nothing of the login's ~65 ms after sshd's accept. The `ledger` probe records the scheduler's tracepoints from the kernel's start and cuts the kernel's clock into windows where the boot and the login change hands, each with its CPU by unit and its idle. The host's clock meets the kernel's through markers the guest writes on request, to ±0.15 ms. *The premise that broke:* the release kernel forces lockdown at confidentiality, which takes tracefs away (lab 45061089609), so the ledger runs on a kernel built from branch `ledger-533-kernel` with lockdown forced to none (parts run 45061289985), and no release gets a ledger until #536 decides how. *Cost* in spin's shape, 20 a side (lab 45063070048): first login +3.0 [−2.4, +15.9], within noise; console prompt +12.1 [+7.1, +17.6]; the kernel alone −1.0 [−9.5, +4.9]. *What six boots of v20261122.05 show* (labs 45062548343, 45062836688, bench, spin's shape): the kernel to PID 1's exec 83 ms, 72 of it in PID 1 before its exec, which is why the boot chart's init.scope (118-123 ms) is twice the ledger's 59 from PID 1's exec on. From PID 1 to the login's sshd-session, 171 ms: PID 1 55, idle 18, journald 18, unattributed (generators and executors) 17, logind 15. Between 110 and 151 ms, the stretch #521 read as the vCPU nearly idle on the disk, PID 1 runs 26 to 30 ms and the vCPU idles 7 to 13 while tasks wait on the disk. The login's 65 ms from sshd-session's exec to true's exit has no idle in it: sshd 20 ms, user@0.service 17, udevd 9, PID 1 4, journald 3. Root's manager (linger) starts as the connection arrives, and its 17 ms of CPU land inside the login's windows (#527). *Opened:* #536, #537. *Status:* in place. - -**11-22 · machine · a failed resume says whether the checkpoint is to blame, and a failed load does not (#516, this change).** spin decides from `Resume`'s error whether to drop a suspended workspace's memory, and only `*Refusal` was typed. *Read in QEMU 11.2.0-rc0's source:* `MIGRATION` carries the status alone, and every failure of a load ends at `process_incoming_migration_co`'s `fail:` label, its reason on stderr before QEMU exits: a section QEMU rejects, a file that ends early and a failed read on the host (both `-EIO` from `qemu_fill_buffer`), and userfaultfd refused to a fast load. So no new type was made for a failed load, and the cases `Resume` can pin on the checkpoint fold into `*Refusal`: a format QEMU does not read (part `format`) and a `Saved.Added` that does not parse (part `added`). A stream checkpoint asked to load on several channels is the caller's options, not the checkpoint, so it stays a plain error. `boot:record`'s truncated state asserts that it is not a `Refusal`. *Opened:* #546. *Status:* in place. - -**11-22 · image · root's manager without the XDG autostart generator (labs 45062836688, 45070208762, 45070150688, 45070973943, 45071003631, 45071003608, #527, this change).** v20261122.04's first login was +6.8 [+0.1, +13.6] over .03, and the cause is root's manager, which #467 starts in the boot and the first login waits for. That is correctness and stays. *What the manager does* (the ledger, lab 45062836688, v20261122.05, 3 boots, CPU before the login's end, p50): `user@0` 17.5 ms in all; systemd-executor and the PAM stack of `systemd-user` 4.6-5.0, of it `unix_chkpwd` 1.1; the manager from its exec to its generators 2.6; the environment.d generator 2.0; the XDG autostart generator 1.6; loading units 4.4; the first transaction to `Startup finished` 1.4. The rest of its 17-18 ms in the ledger runs after the login. The vCPU has no idle from ~155 ms to the login's end, so a millisecond of CPU cut there is a millisecond of the login's. A workspace needs the environment.d generator (it reads `10-user-sockets.conf`, the bus's address for user services, and `/etc/environment`), the sockets, and the PAM stack's account check, limits and audit uid. It does not need the XDG generator: a workspace has no graphical session. *Arms* (bench, spin's shape and login, against v20261122.06, 100 a side, interleaved, lab 45070150688): the XDG generator masked, first login −3.8 [−6.2, −0.7], accept to login −6.1 [−9.0, −0.3]; every cut above together, a bound, −9.6 [−13.3, −6.7]; no manager for root (`user-early-light`, no linger), a bound, −17.3 [−19.2, −12.4]. The two bounds match the ledger's CPU for what they remove, ~10 and ~17.5 ms, so the ledger's CPU is the login's time here. The ledger of the arms (lab 45070208762, 3 boots each) shows `user@0`'s CPU at 17.0-18.1 on the release, 15.5-15.7 with the XDG mask and 9.4-10.9 for the floor's cuts, so each edit removed what it named. The XDG arm's −3.8 is about twice the generator's 1.6 ms of CPU. Its disk wait went too: `user@0`'s disk time 11.9-16.2 against 8.8-10.6. The login waits for the manager to finish, so that wait is on its path (inferred from the two ledgers). The same mask measured −4.8 [−11.2, +1.3] at 20 a side in #467 (lab 45030778365), when the manager started inside the login, and was left out. Restored login −1.7 [−4.4, +2.2] evicted and −2.5 [−5.1, +1.9] cached, in noise (lab 45070973943, 20 a side). `boot:logind` and `boot:workspace` passed on the arm (labs 45071003631, 45071003608). *Changed:* optimize-systemd.sh masks `/etc/systemd/user-generators/systemd-xdg-autostart-generator`, and image/build.sh refuses a user generator's mask that masks nothing, as it does a system generator's. *Left:* what remains of #527 is function, and the cost of the correctness #467 bought. *Status:* in place. - -**11-22 · docs · spin's early login, each number against its own run's release (labs 44805051310, 44807457606, #363).** docs/boot-time.md set −59.4 from one run beside "the image's half alone −17.4" from another in one cell, and gave "−51 more" in a second cell, a difference between two arms rather than either against its release. They are two runs on two hosts, both against v20261120.03, 20 boots a side, spin's shape and login. Lab 44805051310 (spin-machine at 90a6543): `login-early` (ssh.socket, ssh.service, sshd-keygen and the probe's forwarder without default dependencies, logind and the broker without PrivateTmp) −10.8 [−16.3, −5.2], with `udev-startup` as well −59.4 [−65.9, −56.2]. Lab 44807457606 (at fbc7517): `--edit lane`, the image's half without the forwarder, −17.4 [−25.0, −8.5]; with `forwarder-early` as well −68.5 [−78.0, −61.8]. *Changed:* each cell names its run's arms beside their numbers, and no delta is taken between runs. - -**11-22 · lab · the boot's dependency view, and what fills the stretch before the first job (labs 45070438471, 45070718529, 45071125219, 45071549627, 45071102677, #521, #553, #554).** The bootchart probe now keeps `systemd-analyze critical-chain` of the login's units, the login user's manager's chain, and `systemd-analyze dot --order` among the chain's units, drawn by graphviz (docs/measuring.md, "Boot charts"). *The stretch from ~109 to ~146 ms* (debug boots with `systemd.log_level=debug systemd.log_target=kmsg systemd.log_ratelimit_kmsg=0`; without the last, systemd's own kmsg rate limit cut PID 1's lines at 118 ms): PID 1 loads every unit `multi-user.target` reaches, ~36 ms in those slowed boots, with 56 lookups of mount units that do not exist, and then computes a transaction of 79 jobs in ~0.4 ms. `UnitsLoadFinishTimestamp` is taken before that loading, so the plot's empty stretch is the loading. *dev-vda.device:* no unit queues a job for it, and nothing depends on it. It is `tentative` from PID 1's catchup (root is mounted from it) until udevd announces it, and the plot draws tentative as activating. *The chain to the login* on v20261122.06: the forwarder that stands for spin's supervisor waits for `basic.target`, 28-38 ms after `ssh.service` is active. Taken off it (`--edit forwarder-early`), it was active ~33 ms sooner, and the goal numbers did not move: cold +4.2 [+0.0, +11.0], restored −0.0 [−2.3, +2.3] (`prestart`, 20 a side). The login waits for systemd-logind next (#553). *Status:* the view in place. The forwarder row moved to "Measured and rejected". The release copy is open (#554). - -**11-22 · release/lab · each release's ledger, on a traceable kernel published beside it (parts run 45071066129, lab 45073394754, #536, #558, this change).** The ledger (#533) needs tracefs, which the release kernel's lockdown at confidentiality takes away, so it ran only on demand, on a kernel from a scratch branch kept as a run artifact that expires (`run:45061289985`). *Decided:* option 1 of #536 at release cadence. release.yml's `traceable` job builds the release's kernel source and config with `KERNEL_LOCKDOWN=none`. `release traceable-kernel` holds its config to the release kernel's, lockdown swapped and every other option equal. The job signs the bzImage and publishes it on the release as `…lab-only-traceable.bzImage`: in no tarball, in no SOURCES, in nothing spin boots. Options 2 (a `lockdown=` parameter) and 3 (on demand only) were not taken: 2 trades spin's compile-time guarantee for a command-line one, and 3 left no ledger per release. `lab tree --kernel traceable:TAG` checks the signature, `releases measure` takes one ledger of each release on that kernel beside its boot chart, and the record keeps it as `docs/releases/TAG-ledger.txt`. *Measured:* built as the `traceable` job builds it, the kernel passed the config check against the release kernel of the same job (parts run 45071066129). The ledger on it, with v20261122.06 and drawRelease's tree, gave 3 of 3 ledgers: 0 breaks, 0 events dropped, residue 0.6 ms p50 and first login 427 ms p50, in spin's shape (lab 45073394754). That release's record read 414.4 cold in the same shape, so the +13 is within the ledger's own ~16 ms. *Cost:* one cold kernel compile per release, 10 min after the release kernel's, in a job of its own so that pause and wake do not wait for it. report waits for it. A change that breaks the traceable build is first seen at release time (#558). *Status:* in place. The first release built with it is the first with a ledger. - -**11-22 · lab · the CPU weight while the boot runs, on user@0's chain and on two units off the login's chain (labs 45082870346, 45083184310, 45083106264, 45083184131, #553).** The cold login does not wait for logind on v20261122.07. In its ledger (lab 45082187351, 3 boots), logind is active within 1-13 ms of `basic.target`, before or after it. The login's session opens 2-4 ms after it is authenticated, and the session waits 0-5.6 ms for root's manager (`user-early`). The login waits for the forwarder's chain (journald → tmpfiles → `sysinit.target` → `basic.target`) and for the key exchange on a vCPU that idled 14 ms of the 185 from PID 1 to the connection (boot 2). The two arms were lab edits (`logind-weight`, `offpath-weight`), on the bench, spin's shape and login, interleaved against v20261122.07. *logind, `user-runtime-dir@` and `user@` at `StartupCPUWeight=1000`:* first login −9.2 [−16.1, −0.3] at 30 a side in a screening run of three arms (lab 45082870346). The run fixed in advance to decide it, the arm alone at 40 a side, read −3.6 [−10.3, +0.6] (lab 45083184310). Accept to login was −7.7 [−14.0, −4.0] and sshd accepting +8.8 [−1.1, +13.3]. In its ledgers (lab 45083106264), logind is active ~9 ms sooner and `sysinit.target` ~18 ms later (p50 of 3). The weight moves the vCPU from the forwarder's chain to the manager's, and the login needs both. Restored, in noise: −1.2 to +0.1 (lab 45083184131, 20 a side). *`spin-machine-sshd-keygen` and `systemd-udev-load-credentials` at `StartupCPUWeight=1`:* sshd accepting +22.6 [+15.9, +33.5], first login +3.4 [−3.2, +14.6]. ssh.service waits for the keygen, which finished 45-70 ms later (lab 45083106264), and the forwarder waits for ssh.service. The keygen is on spin's path, not off it. Both together +6.0 [+0.5, +15.1]. Under cgroup v2, a weight is shared with the unit's siblings: `user@0` competes in `user-0.slice`, and `user.slice` competes with `system.slice` and `init.scope`. `StartupCPUWeight=` holds until the boot's jobs are done, and on spin's path the getty's wait for `dev-ttyS0` keeps them running past the login. *Decided:* neither is kept, and both rows are in "Measured and rejected". On one busy vCPU, a weight only changes which chain waits. What the login needs before it is the CPU it takes. *Status:* the edits are removed. - -**11-22 · machine · what a guest sends on the pressure port is bounded in time (#559, spin-stack/spin#1597, this change).** spin's security review, adopting the probe, found the guest's bytes bounded in size (128-byte lines) and count (one connection per CID) but not in time, which spin's I7 asks for: a guest's root writing `stall memory 1 1 1` in a loop kept a host goroutine busy on the runner's CPU, a dial-and-drop loop left one goroutine and timer per connection waiting `answerWait` with one `GuestLost` each, and `hello oom=0` then `oom 18446744073709551615`, again on each connection, reset the base and wrapped the reported kills. *Changed:* each watch paces its guest's lines (64 at once, 16 a second) and connections (4 at once, 1 a second) with a token bucket, sized from the sender: a Stall at most once a 1 s window for each of three resources, an OOM line only in an OOM storm, and a dial 1 s after an end. A guest over the line pace is cut off with `ErrGuestTooFast` rather than having lines dropped and counted: the counters are totals, so its next hello and Stall lose nothing, and the end needs no new field to say what happened. A connection over the accept pace is closed and the one held stays. One `GuestLost` waits per watch, and later ends give it their error. A count or `Total` below the last heard is ignored, and `internal/pressure` saturates microseconds past a `time.Duration`. *Measured:* nothing; no guest's path changes, since the sender starts 10 s after boot. *Status:* in place. - -**11-22 · machine · CPUID leaf 2 with QEMU's cache descriptors (#565, labs 45082640147, 45082640186, 45083473855, 45083473790, 45083754801, this change).** *Why:* nesting costs ~50 ms of the cold first login, and #565 profiles a boot's exits by reason on both hosts with the new `exits` probe. Both hosts make the same ~10,400 exits, and nested ones cost more. CPUID was the most frequent: 3805 exits, 3549 of them below the guest kernel's half. Every process glibc starts asks for its cache sizes 12 times (glibc 2.42, `dl-cacheinfo.h`, `handle_intel`), and QEMU's leaf 2 answered 0xFF ("see leaf 4"), so each query walked leaf 4's subleaves, 1797 exits. *Changed:* `-cpu` carries `x-consistent-cache=off`, so leaf 2 holds QEMU's descriptors for the same caches leaf 4 describes (`env->cache_info`), and glibc reads them there. (Not under `host`: leaf 2 described `legacy_intel_cpuid2_cache_info`, a 2 MiB 8-way L2 against leaf 4's 4 MiB 16-way, corrected 11-23, #586.) *Measured* (bench, nested, spin's shape, against v20261122.06 with spin-machine `exp/cpuid2-descriptors` at ee005ce): CPUID exits 3727 → 2176, every exit −1541 [−1695, −1380] (3 a side). First login −10.3 [−14.2, −4.0] at 40 a side, a second login −1.1 [−1.6, −0.7]. The restored login +1.0 [−3.9, +4.4] evicted and −0.4 [−4.6, +1.6] cached, both within noise, at 30 a side. That is ~6.7 µs an exit removed, against 1.94 µs in the nested L1, so the two L0 trips around an exit cost ~4.7 µs (inferred). *The record:* `machine.CPU` reads feature bits, and `x-consistent-cache` is a switch, so the record does not move. A guest moved across the change reads the same cache sizes from either leaf. *Opened:* #566 (the MMIO accesses), #567 (HZ), #568 (memory's first touch). *Status:* in place. - -**11-22 · image/lab · no host key made when spin hands over its own (labs 45086250796, 45085877480, 45085877238, 45085886063, 45086216266, #515, spin-stack/spin#1650, #573).** spin already makes, pins and hands over the workspace's host key. vminitd makes an Ed25519 key, the launch claim carries its public half, the control plane connects with it fixed, and before it execs systemd vminitd writes it to `/run/spin/ssh/ssh_host_ed25519_key` with a drop-in naming it sshd's only `HostKey`. The image's `spin-machine-sshd-keygen` still ran on ssh.service's path, 6.2 ms of CPU (ledger, v20261122.07), for a key nothing loads. So the brief's plan (a systemd credential through fw_cfg, a Spec field and a kernel option to read it, spin making the key on the host) was not needed. *Changed:* the unit carries `ConditionPathExists=!/run/spin/ssh/ssh_host_ed25519_key`, read back by build.sh. `ssh.service.wants/spin-machine-sshd-keygen.service`, a symlink checked in since `2df3dbf` that #515 could not trace, wanted the unit a second time and is gone. The sysinit want stays for the lane. The lab's `--edit spin-handoff` stands in for vminitd's handoff: a fresh key per boot, made on the host, and a shell as PID 1 that places it and execs systemd. *Measured:* on the bench, spin's shape and login, against v20261122.07, both arms with the handoff. At 60 a side the first login read −6.8 [−11.8, +0.2] (lab 45085877480), under the ~6 ms ceiling's noise, so the run that decided it took 120 a side: first login −6.9 [−9.6, −2.4], sshd accepting −6.8 [−10.4, −1.8]. In the same run, the ssh.service want taken away read −1.6 [−3.7, +4.3], which rule 5 deletes (lab 45086250796). Restored, 20 a side: restored login −0.6 [−3.1, +4.7], cold −9.0 [−16.3, +2.8], within noise (lab 45085877238). `boot:logind` and `boot:workspace` passed on the arm (labs 45085886063, 45086216266). *Opened:* #575, because `login=spin` does not hand over a key, so its probes still pay the keygen. spin-stack/spin#1650 records `HostKeyPath` as the image's contract. *Status:* in place. The arms' edits (`keygen`, `keygen-unwanted`) are removed. - -**11-23 · lab · `login=spin` hands over spin's host key (labs 45088516505, 45088516571, 45088516492, #575, this change).** Since #573 the image's host-key generation steps aside when spin's handoff has placed spin's key, and spin's vminitd always does. `login=spin` did not, so every probe on spin's path paid the keygen spin's own path skips, ~7 ms (#515's −6.9). *Decided* (the maintainer, #575's first option): the handoff is part of `login=spin`. Its overlay carries the drop-in naming `/run/spin/ssh/ssh_host_ed25519_key` sshd's only `HostKey` and a fresh key per boot, made on the host, and every boot on spin's path runs a shell as PID 1 that places the key and execs systemd (`Key.Init`). The `spin-handoff` edit is gone, and a tree's own `--append init=` still comes after the handoff's. *The stand-in's cost:* the shell runs three execs (two mounts and a `mkdir`) and writes the key with builtins. The ledger gives it a window of its own, `handoff`: 6.3, 7.3 and 7.9 ms from its exec to systemd's in three boots (lab 45088516505, bench, spin's shape, v20261123.01 on its traceable kernel). Of the 7.3, 3.3 ms was idle on cold reads of the shell, `mount` and their libraries, 2.7 the mounts and the `mkdir`, and 1.1 the shell. systemd mounts `/proc` and `/run` itself when no one has, so part of that is work moved, not added. vminitd does more before systemd on spin's path, and the lab measures none of it. *What moves:* a release that skips the keygen now reads it on spin's path. v20261123.01 does not carry #573 yet, so the first release that does will read ~7 ms against the one before it, from the image, not from the probe. Every probe ran with the handoff: ssh-first on v20261122.07 and v20261123.01, 20 a side, first login 430 and 416 (lab 45088516571), restore-first on v20261123.01, restored 82.3 evicted (lab 45088516492). *Status:* in place. - -**11-23 · image · systemd's first patch: drop-in candidate names derived once (labs 45090299768, 45090326943, 45091690423, #574, this change).** #574's second experiment. PID 1 spends most of its loading in `unit_file_find_dirs()`, once for every unit name or alias, lookup directory (~12) and drop-in suffix (4), and each call worked out the unit's candidate names again: the name, its template, its "-" prefixes. Upstream's #42858 (Eric Curtin, merged 2026-07-25, in v262) works them out once per name, `manager_enumerate()` 45.35 → 38.81 ms in its author's container (50 runs, ~270 units). Yocto backported it to 259.5, with an unrelated `CONF_FILES_WARN` change beside it, so the backport here is upstream's commit with one removed line's context moved to 259's `set_get()`. *Measured* (bench, spin's shape and login, v20261123.01, each arm systemd rebuilt on the runner, against a control rebuilt with a comment and no code changed, so both install their packages the same way): first login −6.5 [−9.9, −1.3] at 100 a side, sshd accepting −6.1 [−10.0, −1.1] (lab 45090299768). PID 1's CPU from its exec to the login's sshd-session, 55.1-57.8 ms on the control and 48.1-53.4 with the patch, 5 ledgers each (lab 45090326943). Restored, 20 a side: −0.9 [−4.3, +3.0] evicted, −1.4 [−5.0, +2.1] cached, within noise (lab 45091690423). *Changed:* image/systemd carries its first patch, applied without fuzz after Ubuntu's, as image/openssh does; the Dockerfile fails when it does not apply or its function is not in the source; the release ships it under `usr/share/spin-stack/systemd/` and names it in SOURCES, NOTICE and the SBOM's pedigree. A bump to 262 drops it. *In the same run:* #574's third experiment, no unit made for a `RequiresMountsFor=` prefix with no unit file, read −1.0 [−4.3, +3.9], and PID 1's CPU did not move: rejected, in "Measured and rejected", with the patch and an upstream draft kept in #580. *Status:* in place. - -**11-23 · lab · a probe saves once the guest's boot has finished (lab 45095349849, #578, this change).** Every probe that restores took its checkpoint right after the cold login, while the boot's last jobs still ran, and each restore of that state ran them beside the login it timed. *Decided* (the owner, #578): spin checkpoints an empty workspace, a project's workspace or a prebuild long after its boot, never mid-boot, and restore-first measures that. `bootFinished` now waits, over SSH as the probe's user, for `systemctl is-system-running --wait`, then for `multi-user.target` active with no job queued, then for the user manager's own `is-system-running --wait`. The middle step is there because the manager calls its start finished when its queue first empties, which a `Type=idle` unit starting the rest of the boot (#581) finds. docs/measuring.md, "When a checkpoint is taken", is the definition. restore-first, prestart, restore-together, run-delay and transport wait for it. restore-first records it as `finished`. *Measured* as three rows of one tree, so one run compares the probes (bench, nested, spin's shape and login, v20261123.01 with its own spin-machine, 40 each interleaved, lab 45095349849, branch `exp-save-rows`, not for merge): saved finished against saved at the login, restored login 83.8 → 79.0, −4.9 [−7.3, −3.8], `running` +0.3 [−0.6, +1.4], the state +4.5 MiB [+4.3, +4.9], save −13.5 [−15.2, −12.2]. The boot finished 85.6 ms after the login it used to be saved at. A further 3 s settle moved neither the state (−0.0 [−0.4, +0.3]) nor the restored login (+0.4 [−0.6, +1.3]), so the probe waits for nothing after finished. *What moves:* the restore rows step down ~5 ms at this change, from the probe and not the machine, as with #451. The ladder boots every release with the probe of the run, so a ladder stays comparable within itself. Compare a restore measured before this change only within one run. *Status:* in place. - -**11-23 · image · the first login's target (labs 45089584735, 45089584596, 45090246240, 45090246267, 45091658603, 45091658388, 45098372930, 45098372897, 45098372904, 45098373025, #574, #578, spin-stack/spin#1653, this change).** #574's first experiment. On one vCPU every unit started before the first login is on its clock, so the boot's default target becomes `spin-machine-login.target`, which wants only the login's units (ssh, its keygen, the vsock socket, journald, logind and its Varlink socket, the bus, `/tmp`, spin's supervisor by name), each without default dependencies, and `spin-machine-boot-rest.service` starts `multi-user.target` once the boot's first jobs are done (`Type=idle`). Every unit still runs. *Bound* (the rest 3 s later, the forwarder off `basic.target`): −55.5 [−63.0, −51.6] at 20 a side (lab 45089584596); in its ledgers PID 1's CPU before the login 55 → 38 ms, and udevd, its trigger, tmpfiles, sysctl and user-sessions gone from before the login (lab 45089584735). *Triggers,* the supervisor early, 20 a side (lab 45090246267): idle −59.2, a 2 s timer −66.5, sshd's PAM stack −52.0 with accept to login +15.3; the same PAM trigger with the supervisor as spin orders it −20.8. Idle is kept: it is systemd's own "after the boot's jobs", and the timer's 2 s is arbitrary. *Found:* logind's Varlink socket has to be in the target, since systemd refuses to start a socket whose service runs; without it `boot:logind` failed (lab 45090950033). `lab check` now boots a tree's edits, made in an image of its own: before, a check booted the tree's base image and ignored them. *Carried form,* against v20261123.01, 40 a side (lab 45091658603): cold −17.7 [−26.2, −11.7], accept to login −11.8; with the supervisor off `basic.target` −42.6 [−50.2, −38.4]. Restored, 20 a side (lab 45091658388): +3.1 [+0.9, +5.4] evicted, +2.2 [−1.6, +5.4] cached; an earlier run read +8.1 and +4.6 (lab 45090776228). `boot:workspace` and `boot:logind` pass (labs 45091658629, 45091658828). *Decided* on v20261123.02, with the probe that saves once the boot has finished (the entry above), bench, nested, spin's shape and login, 40 a side, branch `exp-581-finished` (this change and that probe), tagged `archive/exp-581-finished`. ssh-first (lab 45098372930): first login −21.5 [−26.4, −15.5], sshd accepting −10.0 [−16.2, −3.7], accept to login −10.7 [−12.9, −8.2], second login +0.0 [−0.8, +0.6], QEMU's RSS −1.9 MiB. restore-first (lab 45098372897): restored login +1.1 [−6.0, +5.2] evicted, +2.2 [−10.6, +12.9] cached, both within noise; the state and the save within noise; `finished` +35.2 ms, since the rest of the boot runs after the login. The earlier run's restored +3.1 was the probe saving while the rest of the boot still ran (#578). `boot:workspace` and `boot:logind` pass on it (labs 45098372904, 45098373025). *The console prompt* +15.5 [+11.5, +19.0]: the serial getty is in `multi-user.target` and now follows the login. It does not count against the change: nothing a workspace does waits for the getty, and no goal number moves with it. *spin's supervisor off `basic.target`* (the same run, the probe's forwarder with `forwarder-early`'s drop-in): first login −45.3 [−50.2, −39.4], sshd accepting −66.3, but accept to login +21.0 and the second login +43.7 [+41.1, +46.1]. The first login then comes before the boot's first jobs are done, and `Type=idle` starts the rest exactly when the second login comes, so its cost moves from the first login to the second. Restored within noise (evicted +0.4). That half is spin's to decide (spin-stack/spin#1653); on a release with this target, `--edit forwarder-early` reruns it. *Removed:* the lab's `login-target` and `login-target-spin-early` edits, which put this checkout's target into a release that lacked it; the open row for unit loading at boot, which this answers. *Status:* in place. - -**11-23 · lab · each MMIO exit put on the guest code that made it (labs 45098316459, 45098579511, 45098880914, 45098879979, #566, this change).** `exits` now keys the MMIO and port exits by `guest_rip` and names each one's function through the guest's own kallsyms. A tree booting the traceable kernel with `ftrace=` keeps the guest's trace, so the accessors' callers come with stacks. The trace does not move the counts: 3,104-3,129 EPT_MISCONFIG exits with it and without it. *Found* (bench, nested, spin's shape, v20261123.01): IOAPIC 625, ~576 of them in `apic_intr_mode_init`, where the 24-pin table is read four times and written twice (#590). ECAM 1,078 exits: enumeration 469 accesses, virtio-pci's capability walk 258, `pci_save_state` at add 128, ACPI AML 65, MSI-X enable 64 (#591). virtio's BARs: ~527 emulated at device setup and ~205 MSI-X table writes. About 650 ioeventfd notifications, ~500-650 of them the root disk's requests and ~95 vsock resets to the probe's dials (#592). Port I/O: `rtc_cmos_read` 106, ACPI's ports 137, serial 83, firmware and decompressor 277. *Measured and rejected:* a 1 MiB readahead on the root disk (`opt_io_size=524288`) left the notifications as they were (895 → 927) and the first login at +1.4 [−2.7, +8.0], 40 a side. *Status:* the probe's change is in place. Every lever left is a kernel patch of ~1-3 ms, each in its issue. - -**11-23 · machine · the record holds the vCPU's properties that shape CPUID (#569, CI run 45099128633, this change).** *Why:* #565's `x-consistent-cache=off` changed CPUID leaf 2, and the record did not move: `machine.CPU` read feature bits only, so a checkpoint taken on one side of the change resumed on the other without a refusal. *Read* (QEMU 11.2.0-rc0's `target/i386/cpu.c`, `host-cpu.c`, `kvm/kvm-cpu.c`, 2026-11-22): the vCPU's properties that shape CPUID without being a feature bit, and of those, the ones `-cpu` sets or the host model takes from the host. #565's claim that a guest reads the same caches from either leaf does not hold under `host`. `legacy-cache` is on there, so with the switch off leaf 2 describes `legacy_intel_cpuid2_cache_info` (L2 2 MiB 8-way) while leaf 4 describes `legacy_intel_cache_info` (L2 4 MiB 16-way). glibc reads a 2 MiB L2 since v20261123.01 (#586). *Changed:* `CPU.Properties` holds `cpuidProperties`, read off the vCPU in the qom-list-get `CPU` already made: `x-consistent-cache`, `l3-cache`, `legacy-cache`, `host-cache-info`, `family`, `model`, `stepping`, `model-id`, `level`, `xlevel`, `phys-bits`, `guest-phys-bits` and `pmu`. `CanResume` refuses each difference as `cpu `, and refuses a property only one side has. `TestTheRecordHoldsWhatTheCPUIsGiven` fails a `-cpu` option that is neither a feature, a feature filter (`migratable`, `enforce`) nor held. *Compatibility:* a record written before this change holds no property, and is refused by each, `cpu x-consistent-cache: checkpoint none, here false` among them. The record names no release, and v20261122.07 (switch on) and v20261123.01 (off) run the same QEMU, 11.2.0-rc0, so nothing in an old record says which side of the switch it was taken on. Reading it as either value would let the other side's checkpoints through. Every checkpoint saved by a released spin-machine boots cold once. `boot:compat` saves each release's checkpoint with this tree's spin-machine, so it reads each release's own switch. With this change alone, v20261123.02 and v20261123.01 resumed and v20261122.07 was the first it refused, `cpu x-consistent-cache: checkpoint true, here false` (CI run 45099128633). The entry below rides in the same record change, and moves the first refused release to the newest. *Opened:* #586 (leaves 2 and 4 disagree under host), #587 (`Unshared` ignores the properties), #588 (leaf 0xA is the host's PMU and nothing holds it). *Status:* in place. - -**11-23 · lab · `login=spin`'s forwarder is `spin-supervisor.service` (release run 45100012702, labs 45103075446, 45103442674, 45103464996, #598, this change).** The release run's ladder read v20261123.03, the first release with the login's target (#581), about +50 ms worse cold than v20261123.02: first login ~446 against ~396, sshd accepting ~402 against ~340, the restore unmoved (release run 45100012702, its record in #598). The lab had measured #581 at −21.5 [−26.4, −15.5] (lab 45098372930). *Found:* the edit that measured #581 linked the probe's forwarder into the new target, "as spin's would", and was removed with #581's merge. The target wants spin's supervisor by its name, `spin-supervisor.service`, which spin's vminitd links into `/run/systemd/system` before systemd starts (spin-stack/spin's `internal/guest/vminit/handoff`). `login=spin`'s stand-in was `spin-lab-forward.service`, wanted by `multi-user.target` alone, so on .03 it started only once `spin-machine-boot-rest.service` queued the rest of the boot. Bootchart of .03 on main's probe (lab 45103075446, bench, spin's shape, 1 boot): the forwarder active at 221 ms of PID 1's clock, `ssh.service` at 78, nothing on its chain between them. The ladder measured the stand-in's wiring, not the machine. *Changed:* the stand-in is installed as `spin-supervisor.service`, with spin's unit's default dependencies and `WantedBy=multi-user.target`, and `TestTheImageStartsLoginSpinsSupervisorWithTheLogin` fails when the image's login target does not want the unit `login=spin` installs. With it, the forwarder was active at 160 ms, behind `sysinit.target` as spin's unit is (lab 45103464996, 1 boot). *Measured again* through `releases measure v20261123.03` on this change (report run 45103442674, bench, nested, spin's shape and login, 20 a side): first login −17.8 [−27.9, −8.1], sshd accepting −9.5, accept to login −10.0, second login −0.7 within noise, restored login +0.4 [−1.4, +2.6] within noise; the console prompt +20.4, the serial getty following the login as #581 says. *The record:* #598 carries the stand-in's reading. `releases propose` does not propose a release twice, so once this is on main #598 is closed, its branch deleted, and report.yml dispatched on main with `versions=v20261123.03 record=true`. *Status:* in place. - -**11-23 · machine, qemu · leaf 2 describes the caches leaf 4 does (#586, labs 45100482399, 45101932202, 45101932224, 45101932173, 45101932449, 45101932412, 45101932286, #594, this change).** *Why:* #565 claimed that with `x-consistent-cache=off` leaves 2 and 4 describe the same caches. *Seen in a guest* (bench, nested, spin's shape, v20261123.02, lab 45100482399): leaf 2 EDX 0x2c307d, ECX 0x4d, so glibc read a 2 MiB 8-way L2 (descriptor 0x7D) while leaf 4 and the guest's kernel said 4 MiB 16-way. L1 and L3 agreed, and so did every threshold glibc derives (`shared_cache_size` 16 MiB, `non_temporal_threshold` 8 MiB, the same before #570), because QEMU's legacy L3 is inclusive and glibc adds the L2 to the shared size only for a non-inclusive one. What moved is `sysconf(_SC_LEVEL2_CACHE_*)`. The host's caches (Xeon 6975P-C, read on the runner) are L2 2 MiB 16-way, L3 480 MiB: neither leaf is the host's, and neither was before #570. *Options read and run:* `legacy-cache=off` is refused under `host` (`CPU model 'host' doesn't support legacy-cache=off`), since only a named model has a cache model of its own. `host-cache-info=on` passes the host's leaf 2 through, 0x00feff01, whose 0xFF sends glibc round leaf 4 again: CPUID exits 2371 → 4087, every exit +1693 [+1657, +1825] (lab 45101932224). No option keeps the descriptors and makes them agree. *Changed:* `qemu/patches/0006` (#594) adds `x-legacy-cpuid2-cache`, default on as QEMU is; off, leaf 2 encodes `env->cache_info` (0x2C, 0x30, 0x49, 0x4D). `-cpu` sets it off and `cpuidProperties` holds it, in the same record change as #569. *Measured* (bench, nested, spin's shape, against v20261123.03, whose leaves disagree, with ctl = #569's spin-machine on the patched QEMU): leaf 2 EDX 0x2c3049, ECX 0x4d, and glibc's L2 4194304/16, the kernel's 4194304/16, its thresholds unchanged (labs 45101932202, 45101932412). CPUID exits 2371 → 2406-2449, leaf 2 and leaf 4 still 12 and 4 a process: two more processes in the fix's boots, not a dearer one (inferred); every exit +13 [−143, +96] (3 a side). First login +0.6 [−6.1, +5.5] against the release, +0.4 [−7.5, +5.8] for ctl, 40 a side (lab 45101932173). Restored login evicted −2.1 [−6.1, +5.2], cached −1.7 [−4.3, +1.7], 30 a side (lab 45101932449). *Compatibility:* no release's QEMU has the switch, so the record refuses every release's checkpoints by it; #569 already refused every checkpoint a released spin-machine wrote, so spin's checkpoints boot cold once. `boot:compat` refuses v20261123.03, the newest release, first: `cpu x-legacy-cpuid2-cache: checkpoint none, here false (same)` (CI run 45104443218). *Status:* in place. - -**11-23 · release · a regressed release is withdrawn, never deleted (#595, spin-stack/go-tools#139, spin-stack/ship-it#45, this change).** Releases come several times a day, and report.yml measures each one once it is published. Until now nothing stopped a consumer from adopting one that measured slower. *Decided:* a withdrawal marks the release and deletes nothing. The release becomes a GitHub prerelease titled "(withdrawn)", with the reason and the issue at the top of its notes. Its record gets `withdrawn`, the page names it, and the newest release not withdrawn becomes GitHub's latest (`releases withdraw`/`restore`, `withdraw.yml`, run only by a person). Assets, `SOURCES`, signatures, provenance, the record and its charts stay, and compat goes on resuming the release's checkpoints, because a withdrawal says nobody should adopt it, not that it does not resume. The next release is measured against the newest release not withdrawn, and its `against` says which. *The rule* (docs/releasing.md, "Withdrawing a release"): either goal number's Δp50 against the release before it, with its interval wholly above 0, or a failed functional check, unless docs/log.md accepts the cost, as #505 did for v20261122.04's +6.8. At 20 boots a side about 1 in 40 flags of each number is noise, so report.yml's `releases flag` opens an issue with the Δs and the commits between the two releases, and a person decides. A prerelease is what the consumers already skip, read 2026-11-23. go-tools' `github-release` track reads GitHub's `/releases/latest`, which is never a prerelease. ship-it's release list leaves prereleases out. Here, `LatestRelease` and the notes' "what changed since" leave them out too. go-tools#139 is the pin already on a release that was then withdrawn, which `versions check` reads as behind an older release. ship-it#45 is spin's proposal, opened at publish, before the withdrawal. #595 is the `pause` job's functional checks, which open no issue yet. - -**11-23 · image · the inventory's blind spot was mkosi (#518, image build on #517, this change).** #518 asked the inventory to tell a path a package ships from one it only lists, because `/etc/systemd/system-generators/systemd-gpt-auto-generator` is in `systemd.list` and an image built without `optimize-systemd.sh`'s link to it had none. *Read* (2026-11-23): Ubuntu's `debian/rules` makes that link with `dh_link`, and `systemd_259.9-0ubuntu0.1_amd64.deb` carries it (`dpkg-deb -c`), so the package ships it and a `.list` holds only what the package's data does. mkosi 27.1's `installer/apt.py` unlinks it after every install, to turn gpt-auto on in mkosi's own images. The image's link puts back Ubuntu's mask, so the inventory is right not to list it, and it did see the deletion, as `deleted /etc/systemd/system-generators/`. Comparing against md5sums would have done harm: md5sums lists no symlinks, so every link a package ships would read as added. *Changed:* docs/image.md's inventory note and generator row say so; nothing in `image/`. *Status:* #518 closed without a change to the inventory. - -**11-23 · kernel · `CONFIG_HZ_250` removes 587 exits and no time from the login (#567, parts run 45110306519, labs 45111418504, 45111452844, this change).** *Why:* #565's profile counted 1043 TSC-deadline writes and 827 preemption-timer exits at HZ=1000, and #567 inferred ~3.5 ms from ~500 of them at ~7 µs a nested exit. Firecracker's x86_64 guest configs and Cloud Hypervisor's `ch_defconfig` build at 250, with no number published for it. *Measured* (bench, nested, spin's shape and login, v20261123.04 against the same release with a kernel built at `HZ_250`, branch `exp/567-hz250`): every exit −587 [−608, −445] at 3 a side, of them MSR writes 1018 → 755, preemption-timer exits 691 → 482, HLT 332 → 298 and external interrupts 396 → 360; the host's KVM handled them in −0.6 [−8.1, +7.3] ms less. The first login −0.6 [−5.9, +3.1], sshd accepting −1.4 [−7.7, +3.2] and the console prompt +4.7 [+0.4, +7.8] at 60 a side. *Why the inference missed:* a tick's MSR write and its preemption-timer exit take 1.0-1.5 µs each in the L1, against ~10 µs for an MMIO exit and ~18 for a port exit in the same profile, so ~7 µs an exit is the price of an exit handed to QEMU, not of every exit. *Status:* rejected; `HZ_1000` stays. Archived as tag `archive/exp-567-hz250`. - -**11-23 · image · Docker's packages pinned (#511, #609, Parts run 45111218531).** `install-dev-tools.sh` installed Docker's packages at whatever Docker's repository served that day and fetched its signing key with no hash. *Changed:* each `.deb` in Docker's resolute pool is a `download` in `versions.yaml`, by version and SHA-256, handed in as build arguments with no default and checked before apt installs it. There are six, not the five #511 named, because `docker-ce-rootless-extras` came in unpinned as docker-ce's recommend. The pins are v20261123.04's versions, and each SHA-256 is the one in Docker's `Packages` index, whose `InRelease` verifies against Docker's key. The build no longer reads Docker's repository. The key and the apt source a workspace's `apt upgrade` uses are files in `rootfs/`, the key unchanged from what Docker serves (fingerprint `9DC858229FC7DD38854AE2D88D81803C0EBFCD88`, no expiry). It is not a `versions.yaml` entry, because a `download` needs a version in its URL and the key's has none. *Proved:* one changed character in docker-compose-plugin's pin stops the image build at `sha256sum: WARNING: 1 computed checksum did NOT match` (Parts run 45111218531, branch archived as `archive/511-wrong-pin`). *Status:* in place. - -**11-23 · image · containerd's config is containerd.io's own (#510, labs 45111391250, 45111705358, 45112037022, this change).** The image replaced containerd.io's `/etc/containerd/config.toml`, which disables CRI, with one that enabled it, a v3 schema with the v2 plugin name, with no consumer named since `2afac47`. dockerd does not use CRI. *Decided* by the owner (#510, option b): containerd.io's file. *Measured* with an overlay edit that wrote the package's setting over the image's (bench, nested, spin's shape and login, against v20261123.04, 20 a side): first login −4.9 [−12.2, +1.6], sshd accepting −5.0 [−12.1, +1.2], both within noise (lab 45111391250). Restored login: evicted −0.6 [−2.1, +1.5], cached −0.5 [−2.1, +0.9], both within noise (lab 45112037022). Neither number can see the file, because containerd starts at a workspace's first docker command (inferred). `boot:workspace` passed on that tree, with docker running a container (lab 45111705358). *Changed:* the image's file is deleted. A workspace that wants CRI, for crictl or a kubelet, writes its own config. *Status:* in place; the experiment branch is archived as `archive/510-containerd`. - -**11-23 · image · docker.socket is Docker's own, 0660 and group docker (#509, labs 45111147182, 45111147449, 45111146715, 45111146865, 45111146854, 45111146735, 45111708456, this change).** *Why:* the image carried its own `docker.socket` since the first commit (`2afac47`), with no recorded reason, at `SocketMode=0666`, `SocketGroup=root`. Any local uid reached dockerd, which is root on the guest: a service's DynamicUser, `nobody`, a sandboxed command running as another uid. Docker's own unit is 0660, group docker, and `spin` is in docker. *Changed:* the image's unit and `optimize-systemd.sh`'s link to it are deleted, so the link docker-ce's postinst made to its own unit stands. `boot:workspace` asserts the socket is `660 root:docker`, that `spin` runs a container through the group, and that uid 65534 with no groups is refused. On v20261123.04 as released the two new checks fail (`666 root:root`, the refusal not refused; lab 45111708456) and with the change they pass (lab 45111146854). *Measured* (bench, nested, spin's shape and login, against v20261123.04, the change as an overlay edit, 20 a side): first login +1.7 [−5.3, +10.0], sshd accepting +1.5 (lab 45111147182); restored login +0.4 [−0.6, +1.3] evicted, +0.3 [−0.3, +0.8] cached (lab 45111147449). Both within noise, so it goes in on function. *Second arm, rejected:* the image's `containerd.socket` out of the boot transaction, against Docker's socket alone: first login +7.4 [−4.7, +15.3] (lab 45111146715), prestart within noise in every row (lab 45111146865). Both sockets start in `sockets.target`, after the first login since #581, so there was nothing on the clock to take. `boot:workspace` passed on that arm too (lab 45111146735). Prior art: upstream containerd binds its own socket and its unit has none; SUSE carried a `containerd.socket` from a 2016 socket-activation patchset never merged upstream. In "Measured and rejected". The experiment edits lived on `exp-509`, tagged `archive/exp-509`. *Status:* in place. - -**11-23 · lab · the ledger splits the span before the kernel's clock (lab 45110630795, #537, #611, this change).** The ledger had one span from the moment before QEMU is exec'd to the kernel's 0, ~20 ms longer than `boot:firmware-stages`' 73.7 ms, and docs/measuring.md read the 20 ms as spin-machine's start and the held start, inferred. Now the host watches spin-machine's children for QEMU's exec (a bracket of ±0.11 to 0.14 ms), and the kernel's "kvm-clock: using sched offset" line puts the guest's first instruction at the kernel's 0 less it. *Six boots of v20261123.04 on its traceable kernel* (bench, spin's shape): spin-machine to QEMU's exec 2.1 ms, QEMU's exec to the guest's first instruction 49.4, the guest's first instruction to the kernel's clock 47.4 (63.2 on the run's first boot: its ~15 ms more are all in that part). *The premise that broke:* the 20 ms are not before QEMU. They are after its exec, on a machine that firmware-stages does not boot (#611). *Status:* in place. - -**11-23 · lab · the boot chart's IO graphs draw each 5 ms on one scale (spin-stack/systemd-bootchart#11, labs 45110751133, 45113479570, #538, this change).** The fork averaged 250 ms around each IO bar and scaled each graph to its own peak. A 5 ms read burst came out as a plateau over the whole chart, and the boot's one 164 KB write filled the write graph for 150 ms. The three boots of lab 45110751133 were replayed through `--proc` and drawn both ways. Unsmoothed on one scale, the ~8 MB burst at the chart's start, the later read bursts and the write each appear where they happened and at their sizes against one another. The other drawing shows none of that, so the fork now draws this one. Lab 45113479570 is the pinned fork's chart of v20261123.04, three boots. *Status:* in place. - -**11-23 · kernel · the IOAPIC's table read once takes 384 exits and no time the login can show (#590, parts run 45111505269, labs 45113437048, 45114405201, 45115330128, #627, this change).** *Why:* #565's profile put 576 IOAPIC MMIO exits in `apic_intr_mode_init`: the 24 redirection entries read four times and written twice (the x2APIC path's save and restore, the ExtINT search, `clear_IO_APIC`'s read, mask and verify). *Built:* a patch (branch `exp/590-ioapic-once`) that reads each entry once for the ExtINT search and the clear, skips the clear's write and verify for an entry already masked and clear, and has `enable_IR_x2apic` restore only when `mask_ioapic_entries` masked something. Every entry is still read, so a kexec'd kernel or other firmware is handled as before. The last 96 reads, reusing the save's copy, were left: the copy goes stale when remapping masks entries. *Measured* (bench, nested, spin's shape and login, against v20261123.04): IOAPIC accesses 589 → 205 (`native_io_apic_read` 397 → 205, `__ioapic_write_entry` and `ioapic_mask_entry` 96 → 0), every exit −322 [−394, −222], the host's KVM handled them in −3.1 [−6.2, −1.1] ms less (3 a side). The first login −4.5 [−7.8, +0.4] at 60 a side and −2.0 [−4.3, +0.6] at 120, both within noise. They are KVM's in-kernel IOAPIC, ~11 µs each in the L1, so ~384 of them are 4-6 ms at most (inferred), and the 120-boot interval reaches −4.3. The five exit patches of #590-#592 together, a bound, read −7.4 [−12.1, −2.8] at 60 a side; #627 asks whether they are one change. *Status:* rejected. Archived as tag `archive/exp-590-ioapic-once`. - -**11-23 · kernel · two levers on the boot's ECAM reads remove what they claim and no time the login shows (#591, parts runs 45111902862, 45111905648, labs 45113437048, 45114405201, 45115330128, #627, this change).** *Why:* since 0004 every configuration read is an MMIO exit, and #591 counted the reads by caller. *(a)* `pci_bus_add_device()` saves every device's state at its add (upstream a2f1e22390ac, v6.19, for error recovery), 16 reads for each of 8 functions. A patch (branch `exp/591a-no-save-state`) keeps the save only where something can restore it without the driver's own save: AER (and DPC and EDR, which need it), EEH, s390, Xen's pcifront, and a root-bus device whose host bridge sets `reset_root_port`. CONFIG_PCIEAER alone was not a safe gate, because the same commit took out `pci_restore_state()`'s refusal of a state never saved, and those mechanisms call drivers' error handlers without AER. *(b)* `vp_modern_probe()` walked the vendor capabilities once for each of four types; a patch (branch `exp/591b-virtio-caps-once`) walks them once and keeps the first usable one of each type, as before. *Measured* (bench, nested, spin's shape and login, against v20261123.04): (a) MMIO exits −128 exactly, the host's handling −3.3 [−6.2, −2.1] ms; (b) −114 exactly, both at 3 a side and both the counts the source gave. The first login at 60 a side: (a) −4.3 [−6.8, +0.5], within noise; (b) −5.8 [−8.2, −0.6], outside it, but 114 exits at ~15 µs each (10 in the L1 and ~4.7 for the L0's trips) are ~1.7 ms, a third of that. A run of 120 a side, made because both arms straddled the noise, read (a) −1.3 [−3.5, +1.3] and (b) +0.9 [−1.8, +2.7]. The larger run decides, and it was chosen after the first was read, which this entry says. *Status:* both rejected. With #590 and #592's patches, as a bound, −7.4 [−12.1, −2.8] (#627). Lever 3, BAR sizing from the firmware, was not tried: it needs a new reason over the rejected configuration-space snapshot (11-13). Archived as tags `archive/exp-591a-no-save-state` and `archive/exp-591b-virtio-caps-once`. - -**11-23 · kernel · virtio-pci's queue selection and MSI-X rewrites: exits removed, no time on the login, and spin's dialer filed (#592, parts runs 45111690155, 45111693255, 45113393915, labs 45113437048, 45114428660, 45114405201, 45115330128, spin-stack/spin#1661, #627, this change).** *Lever 1:* every `vp_modern_*` queue accessor writes `queue_select` first, so setting up 13 queues wrote it 91 times. The same patch as 0011 (deleted with two others in a group arm, #345), here alone (branch `exp/592-l1-queue-select`), writes it 23 times. The MSI-X vector read-back after writing a queue's vector stays: virtio 1.2 §4.1.5.1.2 says a device refuses a vector by reading back NO_VECTOR and the driver must check, and `vp_find_vqs` falls back to shared vectors on it. *Lever 2:* each MSI-X message was written at activation and again by x86's `msi_set_affinity` before startup (`IRQCHIP_AFFINITY_PRE_STARTUP`, ff363f480e59), with the same vector and destination. A patch (branch `exp/592-l2-msix-once`) returns without the write when neither changed; a skip in `__pci_write_msi_msg` would have broken the restore of MSI state after resume. *Measured* (bench, nested, spin's shape and login, against v20261123.04, 3 a side for exits): lever 1 MMIO exits −68, lever 2 −56 (14 messages of 4 accesses, not the 19 inferred). The first login: lever 1 −2.8 [−6.6, +3.4] at 60 a side and +0.6 [−1.8, +2.3] at 120; lever 2 −0.1 [−3.1, +4.5] at 60. *The bound:* #590's, #591's and these patches in one kernel (branch `exp/batch2-bound`, 0017 refreshed to apply after 0016): every exit −838, MMIO −366, the host's handling −5.2 [−11.2, +1.2] ms (lab 45114428660); first login −7.4 [−12.1, −2.8] and sshd accepting −10.5 [−14.9, −4.1] at 60 a side (lab 45114405201); the restored login +0.0 [−5.4, +4.9] evicted (lab 45115341056). A bound is not a candidate; #627 asks whether the five are one change. *Lever 3:* spin's runner redials vminitd's RPC port every ≤2 ms until it listens (spin-stack/spin `internal/runner/qemu/guest_rpc.go`, `connectVsockRPC`), so spin's path pays refused-dial resets as the probe's dial did; how many is spin's to count (spin-stack/spin#1661). *Status:* levers 1 and 2 rejected. Archived as tags `archive/exp-592-l1-queue-select`, `archive/exp-592-l2-msix-once` and `archive/exp-batch2-bound`. - -**11-23 · machine · what SetMemory down and one vCPU cost (labs 45113957566, 45117940800, #549, this change).** `boot:actuators` boots spin's shape to systemd at 2048 MiB and times each actuator until the guest shows it, 10 times each. Its first reading counted the 128 MiB memory blocks online, and 19 of 20 unplugs to 1024 MiB stood at 1536 MiB for the whole 2 minutes. virtio-mem's own log said QEMU had all 1024 MiB back. The driver takes back its smaller blocks from inside a memory block, and the block stays online until all of it is gone. So the check now reads MemTotal. *Bench, spin's shape:* SetMemory 2048 → 1024 MiB 21.2 ms idle and 53.7 with 1180 MiB of page cache; back up 9.1; a vCPU added 13.2 and removed 14.8. docs/machine.md's actuators table has them. *Status:* in place. - -**11-23 · image · tzdata, e2fsprogs and fuse3 are installed (#512, labs 45112622373, 45112622091, 45112622071, 45113946185, image jobs on #616 and #625, this change).** *Decided* (the owner, #512, option b): the three a workspace cannot work around from inside, a zone loaded by name, a disk attached to a running workspace formatted and checked, and FUSE, which the kernel has. python3, lsb-release and the smaller tools stay out. *Changed:* `image/mkosi.conf` names them; `deviations.py` counts `/etc/localtime`, tzdata's postinst link to `Etc/UTC`, as a file a maintainer script writes on every Ubuntu, so the inventory is unchanged at 118 lines. `boot:workspace` loads `Europe/Madrid` by name, asserts the default zone is still UTC, finds `fusermount3` and `/dev/fuse`, and formats, mounts, writes and fscks an empty disk the host attaches while the guest runs; all pass with the packages in an overlay of v20261123.04 (lab 45112622373). *Measured* (bench, nested, spin's shape and login, the packages installed into the release's overlay by its own apt, branch `exp-512`, tagged `archive/exp-512`): first login −2.9 [−9.7, +3.6], sshd accepting −3.4 [−8.6, +4.0], 20 a side (lab 45112622091). Restored, 20 a side: evicted −0.3 [−1.8, +1.1], cached +1.8 [+0.3, +2.9], all of it in `running`, before any guest code (lab 45112622071); at 60 a side evicted −0.9 [−3.9, +2.0], cached +0.3 [−10.4, +12.5], within noise (lab 45113946185). The boot finishes +9.8 ms later and the state is +0.8 MiB, from `e2scrub_reap.service` in `multi-user.target` after the login; the console prompt +8.5. None is a goal number. *Size:* 217 → 224 packages, the tree +5.1 MiB (987408 → 992672 KiB), the qcow2 1013587968 → 1019158528 bytes (+5.3 MiB). *Status:* in place. - -**11-23 · kernel · vmlinux BTF is parsed when a program first needs it, not before the login (#460, parts runs 45112032746, 45116894547, labs 45113437048, 45114405201, 45115330128, 45115341056, 45118194310, this change).** *Why:* 0012, parsing vmlinux BTF on first use instead of at the first kfunc registration (11-22, archived as `archive/exp-btf-first-use`), took 7 ms out of the kernel and put it into journald's start, because `bpf_check()` asked for the BTF for every program, journald's cgroup device and skb programs (`DeviceAllow=`, `IPAddressDeny=`) among them. *Changed:* 0012 as measured, and 0013, which has the verifier ask for the BTF only where a kernel type first enters a program: a program with its own BTF or a BTF-typed attach point, the first kfunc call, a vmlinux BTF id in ld_imm64, a map pointer access, a helper argument or return typed by vmlinux BTF, `bpf_find_vma()`'s callback, and `bpf_snprintf_btf()` / `bpf_seq_printf_btf()`. Prior art: Jay Wang's bpf-next series of 2026-09-23 (LWN 1096093, not merged) chose the same points; the eager fetch came with 8580ac9404f6 (2019). *Reviewed* (an independent read of both patches, every `btf_vmlinux` reader in kernel/bpf): two bugs found and fixed before the patch was carried. The printf-BTF helpers read the BTF as the program runs, in atomic or NMI context, and with no trigger at load they could have started the parse there; they now ask for it at load. A parse that failed for memory in whichever task asked first (an unprivileged bpffs mount's `delegate_*` options can choose that task) latched the error for the whole boot; it is now tried again by the next user, and only a malformed BTF is final. vmlinux BTF now has no object id until it is parsed. *Measured* (bench, nested, spin's shape and login, against v20261123.04): no exit moves (3 a side, lab 45113437048). The first login −10.0 [−12.7, −3.3] at 60 a side and −6.3 [−9.1, −4.6] at 120 before the fixes; the kernel carried −6.4 [−9.4, −1.0] at 60, sshd accepting −6.7 [−9.5, −2.2]. Restored −1.0 [−6.0, +4.2] evicted and +1.7 [−9.1, +10.2] cached, 30 a side, the state 1.3 MiB smaller (the BTF is not in it). The build asserts both (kernel/README.md). *Status:* in place; reaches the goal number with the next release. - -**11-23 · image · the update stamps written at build, the five units of `ConditionNeedsUpdate` unmasked (#513, labs 45120950183, 45120950314, 45120950141, this change).** The image had no `/etc/.updated` or `/var/.updated`, so `ldconfig`, `systemd-sysusers`, `systemd-hwdb-update`, `systemd-journal-catalog-update` and `systemd-update-done` were masked: without the stamps they rebuild the caches in every boot (+260 ms, laptop, 11-21). *Changed:* `image/build.sh` writes both stamps last, with `/usr`'s mtime and `TIMESTAMP_NSEC=`, as `systemd-update-done` does, and fails an image whose stamps' mtime is not `/usr`'s; the five masks are gone from optimize-systemd.sh; `boot:workspace` asserts each unit checked its condition and skipped. `/usr`'s mtime in the release is 0 (`SOURCE_DATE_EPOCH`), which first failed the arm's setup through `expr`'s exit status on a result of 0. *Measured* (bench, nested, spin's shape and login, against v20261123.04 with the stamps and the unmasks in its overlay, branch `exp-batch3`): first login −0.3 [−6.8, +4.5], sshd accepting −1.3 [−7.7, +1.1], 20 a side (lab 45120950183); restored +0.2 [−2.1, +0.9] evicted, −1.3 [−4.5, −0.4] cached, cold login +1.2 [−2.6, +7.3] (lab 45120950314); `boot:workspace` on the overlay: the five units' conditions false and no unit failed (lab 45120950141, whose other failures are #509's and #512's checks, which v20261123.04 predates). The overlay measures the stamps and unmasks as files of the overlay, not of the base, which only changes where their few blocks are read from. *Status:* in place, a functional change: a `/usr` change made later is applied at the next boot. - -**11-23 · image · the pressure sender started by the boot's rest, its timer deleted (#401, labs 45120950183, 45120950314, 45120692382, 45120950141, this change).** The sender waited for a timer 10 s after the boot because, ordered after `multi-user.target` alone, it started beside the first login and cost it 2.6-3.3 ms (11-21). Since #581, `multi-user.target` is started by `spin-machine-boot-rest.service` once the first login's units are up, the first of #401's arms. *Changed:* `spin-machine-pressure.service` is `WantedBy=multi-user.target`, enabled by optimize-systemd.sh; `spin-machine-pressure.timer` is deleted; build.sh checks the want and refuses the timer; the lab's `pressure` edit makes the same want; `boot:workspace` asserts the sender runs. *Measured* (bench, nested, spin's shape and login, against v20261123.04 with the change in its overlay, branch `exp-batch3`): first login −0.8 [−7.8, +4.8], sshd accepting −0.2 [−9.1, +3.6], 20 a side (lab 45120950183); restored −0.8 [−2.9, +2.1] evicted, −0.4 [−3.6, +0.8] cached, the state +2.1 MiB because the sender is running at the save (lab 45120950314). In 5 ledgers it started at 0.37-0.38 s on the kernel's clock, after the login's end at ~0.29 s (lab 45120692382); in `boot:workspace` on two vCPUs at 0.29 s (lab 45120950141). *Status:* in place. A guest's first ~0.4 s go unreported, not its first 10 s. - -**11-23 · machine · `Unshared` refuses a pool whose CPUs differ in what taking features away leaves as it is (#587, this change).** *Why:* `Unshared` compared only the vendor and the model, so a pool whose hosts differ in stepping or physical address bits got a `CPUWithout` as if it made them share one CPU, and every cross-host resume was then refused by `CanResume`. *Read* (QEMU 11.2.0-rc0's `target/i386/cpu.c`, `host-cpu.c`, `kvm/kvm-cpu.c`, 2026-11-23): under `host`, `family`, `model`, `stepping` and `model-id` are the host's (`host_cpu_instance_init`), `phys-bits` and `guest-phys-bits` the host's and KVM's whenever `lm` is on, `pmu` is set by `kvm_cpu_max_instance_init`, and the cache switches by the machine type and `-cpu`. No feature taken away moves any of them. `level` and `xlevel` can move: `kvm_cpu_max_instance_init` starts the minimum leaves at KVM's, and `x86_cpu_expand_features` raises them for each feature word that is on (AVX10 to 0x24, APX to 0x29, SVM to 0x8000000A). Two hosts' levels can then agree or differ either way once `CPUWithout` is applied, and the record does not hold KVM's own leaf to say which. *Changed:* `Unshared` refuses, naming each, a pool whose hosts differ in any property but `level` and `xlevel`, and leaves those two to the records of the machines started with `CPUWithout`. *Status:* in place; spin-stack/spin#1417 told. - -**11-23 · machine · a state of another length than its checkpoint wrote is refused before QEMU reads it (#546, CI run 45111149822, this change).** *Why:* a failed load says only that it failed. QEMU 11.2.0-rc0 ends every failure at `process_incoming_migration_co`'s `fail:` label, and `qemu_fill_buffer` reports a file that ends early and a host's failed read both as `-EIO` (read 2026-11-22). So spin kept a truncated state's memory and retried it forever. *Changed:* `Checkpoint` records the state file's length in `Saved.Length`. `Resume` fstats the file it is handed after `CanResume` and returns a `*Refusal` (part `state length`) before QEMU is asked anything. It costs one `fstat`. It does not catch bytes changed in place, which stay a plain error. `boot:record`'s "a truncated state" now wants that refusal and the state never read. *Compatibility:* the field is new and optional. A `Saved` without it, every checkpoint a released spin-machine wrote, resumes without the check, and the machine's record (`Saved.From`) does not move. In CI run 45111149822, `boot:record` refused a real state cut to half its length, `state length: checkpoint 8597660207, here 4298830103 (same)`, with the state never read. `boot:compat` resumed v20261123.04 and refused v20261123.03 first, by `cpu x-legacy-cpuid2-cache` as before (#586), so this change refuses no release main did not. *Status:* in place. - -**11-23 · lab · a workspace's memory at boot beats the same memory plugged during it (#561, labs 45110554589, 45111507862, 45110570912, 45110562994, 45110580480, spin-stack/spin#1660, this change).** spin boots 128 MiB and plugs 2048 through virtio-mem right after the start. #561's lead (−15 nested, −8 metal) came from separate runs, so a tree now takes probe options of its own (`--opt` in a tree spec), and the two shapes ran as two trees of one interleaved run: `plug` (the release, `memory=128 plugged=2048`) and `start` (`memory=2048 plugged=0`), v20261123.04, 1 of 16 vCPUs, ceilings kept, spin's login. *Cold first login:* nested −2.5 [−7.3, +2.0] at 40 a side (lab 45110554589), within noise, then −5.5 [−10.9, −0.7] at 80 a side (lab 45111507862); metal −7.0 [−11.4, −3.4] at 40 (lab 45110570912). sshd accepting −8.3 nested and −7.6 metal, accept to login and the second login unmoved. *Restore* (nested, 20 a side, lab 45110562994): the state −17.6 MiB [−17.8, −17.3], `running` −2.4 [−3.5, −0.8], the restored login −2.5 [−3.7, −1.0] evicted and −2.2 cached. QEMU's RSS at the cold login −26 MiB. *Where it goes* (ledger, traceable kernel, 3 boots each, lab 45110580480): plugged, `kworker/0:1` runs ~7.8-8.0 ms of the vCPU in the kernel's window before PID 1, inferred to be the onlining of the plugged blocks; at boot it runs 0.3 ms, the kernel's own setup (`swapper/0`) takes ~4.5 ms more for the larger memory map, and PID 1 comes 3.4 [−5.9, −2.1] ms sooner. The rest of the cold gain is after PID 1 and the ledger does not pin it at 3 boots. *Decided:* a gain on both goal numbers, and the boot shape is spin's: spin-stack/spin#1660 proposes `canonicalMemory` at the workspace's least, 2048 MiB, with virtio-mem kept for growth to 8 GiB (invariant 3). Base RAM is in the machine's record, so checkpoints from before the change boot cold once. The probes keep spin's shape until spin changes it. *Status:* the tree option is in place; #561 closes here and the decision is spin's. - -**11-23 · lab · where a cold boot's EPT violations land (#568, lab 45111606645, this change).** #565 counted 172 EPT violations in a cold boot at ~115 µs each nested and asked whether prefaulting the base memory in a QEMU started ahead would take them off the path. `exits` now keeps a histogram of `kvm_page_fault` by guest-physical address in 128 MiB buckets. *Found* (bench, nested, spin's shape and login, v20261123.04, 3 boots, the same in each): 171 violations, 18.9 ms of the L1's time. 52 in the base (0-128 MiB) and 6 in the bucket above it, 48-51 in the memory virtio-mem plugs (QEMU puts its device memory at 4 GiB when there is no RAM above 4 GiB), 39 in the PCIe ECAM at 0xB0000000, 9 in 0xF8000000-0xFFFFFFFF (IOAPIC, local APIC, flash) and 17 in the 64-bit BARs at 12 GiB. The MMIO ones are inferred from the addresses: KVM's first fault on an MMIO page installs the misconfigured entry that every later access exits through. *Decided:* closed as off the goal's clock. Prefaulting the base could win only the base's ~58 faults, ~6 ms at most, and only in `prestart`, because `ssh-first` starts before QEMU's exec and a prefault there is on its path. The plugged faults cannot be prefaulted without zeroing all that is plugged. With the memory at boot (#561) they become base faults, and the split is the same question. *Status:* the histogram is kept in `exits`. - -**11-23 · lab · a guest that drops its page cache before its save does not make a smaller state (#276, lab 45110967817, branch archived as `archive/drop-caches-276`).** #276's last idea: most of a restored state might be the guest's clean page cache, so a guest asked to drop it right before spin's save would leave less for the restore to load. *Measured* with a `restore-first` option on the experiment's branch, a tree each: `drop=0` ran `sync; echo 1 > /proc/sys/vm/drop_caches` as root after the boot had finished and saved at once, `drop=3` waited 3 s first, which leaves free page reporting its 2 s delay (bench, nested, spin's shape and login, v20261123.04, 20 a side). The state read 183 MiB on all three trees: −0.1 [−0.4, +0.3] at once, −0.0 [−0.3, +0.4] after 3 s. `running` did not move, −0.9 [−2.0, +0.9]. The restored login was worse, +4.7 [+3.5, +7.3] evicted at once, +5.6 [+4.6, +7.6] after 3 s, +6.5 and +6.4 cached. *The instrument saw the drop:* the restored login is the side that moved, as a guest whose cache was emptied must read the login's files from its disk again (inferred: the probe does not read the guest's cache). *Why the state does not shrink* (inferred, not measured): a save writes every page that is not zeros, and a freed page keeps its bytes until something gives it back to the host. Free page reporting gives back only free blocks of `page_reporting_order` (2 MiB here), and a page cache freed 4 KiB at a time beside the boot's live pages leaves few whole ones, even after 3 s. Waiting 3 s with no drop had moved nothing either (docs/measuring.md, "When a checkpoint is taken"). *Decided:* rejected, with its row in docs/boot-time.md. Nothing is asked of spin before a checkpoint. #276's three ideas are answered, and the restore stands at 78-80 ms, under the goal. - -**11-23 · lab · a guest's synced writes on a saturated host disk do not stall QMP on the bench (#391, labs 45111443524, 45112573850, probe archived as `archive/qmp-stall-391`).** On a laptop with a 97% full disk, query-status reached 175-950 ms beside small synced writes, and #402 did not reproduce that case. A `stall` probe on the experiment's branch booted spin's shape, logged in, started a row's load, and timed 200 query-status round trips 100 ms apart, sampling QEMU's main thread and its monitor's I/O thread (`stat` and `wchan`) every 0.5 ms across each, with both kernel stacks taken past 20 ms. The rows: the guest's 4 KiB `dd oflag=dsync` writes (fio's `--bs=4k --fsync=1`; the image has no fio); four host streams of 1 MiB O_DIRECT writes on the scratch NVMe the overlay is on; both; and the guest's writes beside four buffered host streams flushed each GiB, so that dirty-page throttling and writeback are in play. *Measured* (bench, nested, spin's shape and login, v20261123.04, 3 boots a row, two runs): the slowest round trip of all 2,400 was 1.2 ms, and none passed 20 ms. p50 0.24-0.37 ms with the guest writing alone, 0.41-0.56 with the host disk busy. *The load was real:* the disk read 99-100% busy from its io_ticks in every busy row, and the guest's writes fell from 113,700-118,400 a row to 2,700-3,100 beside O_DIRECT and 1,500-2,100 beside buffered writes. QEMU's disks are `aio=io_uring` on the main loop's ring, so a slow write waits in the kernel and not in the main thread. *Decided:* the case does not stall QMP on the host kind the goal is measured on, so no `iothread=` arm was measured and the probe was removed with its question. The laptop's stalls stand as #402 explained them: the main thread blocked in the host, in cgroup reclaim at `memory.high`, waiting for the mmap lock under reclaim, or with QEMU's cgroup throttled by `cpu.max`. - -**11-23 · lab · density on metal, and a CPU-bound crowd on the bench (#563 section 2, labs 45110655407, 45110663095, 45110670764, 45110678888, 45110688511, this change).** #273 measured an idle crowd on the bench up to 16. #563 asks what a metal host carries, for spin's metal-or-nested cost model, and needs no new code: `density` as it stands, spin's shape and login, v20261123.04. *Bench, nested, 16 CPUs, `load=cpu`, 10 a row:* the first login read 387/417 empty, 378/431 beside 4 busy workspaces, 441/450 beside 8, 1015/1215 beside 16, 941/1196 beside 24. *Metal, c8i.metal-48xl, 192 CPUs:* `load=cpu`, 337/447 empty, 331/488 at 16, 335/344 at 32, 336/341 at 48 (10 a row), and in a second run 342/363 empty, 327/366 at 64, 466/486 at 96 (8 a row; a crowd of 96 took 83 s to boot, past what 10 rows fit in bench-metal's 60 minutes). `load=idle`: 345/368, 336/343, 329/341, 334/352 at 0-48, and 342/356, 328/350, 331/340 at 0, 64 and 96. *Read* by #563's line, a p95 within 25% of the empty host's in the same run: nested, up to 8 busy workspaces of 16 CPUs; metal, up to 64 busy of 192, not 96, and every idle crowd measured. The rows of one host are two runs, so a row compares only with the empty row of its own run. The empty metal row's 447 p95 in the first run is one slow boot of ten. *Not measured:* busy crowds between 64 and 96, and workspaces of more than one vCPU. *Status:* rows in docs/boot-time.md ("The bench fleet is nested, not metal"). Section 1 of #563 (the I/O tax) needs new probes and equal storage on both hosts, and stays open in #563. - -**11-23 · systemd · the executors' sandbox, a bound: −14 ms (#574 experiment 4, labs 45120692382, 45121038332, #637, #638, this change).** Read first, a release ledger (v20261123.04, spin's shape and login, 5 boots): before the first login the executors spend journald 6.0 ms, logind 10.3 and `user@0` 2.8, p50, beside the units' own binaries. *The bound:* one drop-in each for journald, logind and `user@` emptying `SystemCallFilter=`, `SystemCallArchitectures=`, `SystemCallErrorNumber=`, `RestrictAddressFamilies=`, `RestrictNamespaces=`, `RestrictRealtime=`, `RestrictSUIDSGID=`, `MemoryDenyWriteExecute=`, `LockPersonality=` and every `Protect*=`; `PrivateTmp=`, `IPAddressDeny=` and `DeviceAllow=` kept. udevd was left out: it starts after the first login since #581. *Measured* (bench, nested, 60 a side, branch `exp-batch3`): first login 374 → 360, −14.1 [−18.5, −11.5]; sshd accepting −13.2 [−16.0, −10.9]; accept to login −2.1 [−3.1, −0.1]. *Status:* a bound, not carried. #637 splits it into the seccomp and namespace halves and proposes one seccomp filter per unit in systemd. #574 closed with its five experiments: #579 in (−6.5), #580 rejected, #581 in (−21.5), #460 in (the kernel's), this bound to #637. The runner-up, the dynamic linker's share, is #638. - -**11-23 · image · the volatile journal holds 8 MB, not 4 (#514, labs 45121159504, 45121159741, 45121159883, 45120692139, this change).** *Found:* `/run` is a tmpfs of 20% of the RAM at its mount, and the guest mounts it at 128 MiB, before spin sizes it to 2 GiB: 19 MiB in spin's shape, whatever the guest grows to. Ubuntu's default cap, 10% of `/run`, would be ~2 MB there. *Measured* (bench, nested, spin's shape: 1 vCPU, 128 MiB sized to 2048 right after the start, a guest running `docker build --no-cache` of 20 `RUN` steps for 10 minutes, branch `exp-batch3`'s `boot:exp-journal`): the journal grows ~0.4 MB a minute, mostly systemd's and dockerd's lines for each build step. At 4 MB the oldest entry was the kernel's first line for 8 minutes, then the boot's first 90 s were gone by the end (lab 45121159741). At 8 MB the whole journal was kept, 3.6 MB used (lab 45121159883). A first try at 16 MB was left: it is 84% of `/run`, near journald's 15% keep-free. The first login, 8 MB against 4 MB in v20261123.04's overlay: −2.2 [−12.1, +6.4], 20 a side (lab 45121159504), and 16 MB −0.2 [−5.6, +9.1] (lab 45120950183). *Status:* in place; a busy workspace keeps ~15-20 minutes. - -**11-23 · image · the dynamic linker's share of PID 1, journald, logind and `user@0` is ~1 ms (labs 45180400607, 45180856158, #638, this change).** #574's runner-up: the four map and relocate `libsystemd-shared` (PID 1 and `user@0` also `libsystemd-core`), and nobody had measured ld.so's share before porting to v262's multicall build (#42304) or a static one (#42820). *Instrument* (branch `exp-ldso`, tagged `archive/exp-ldso`, its `ldso` edit): `LD_DEBUG=statistics` for PID 1 from spin's handoff, which execs it (`systemd.setenv=` does not reach PID 1), and for journald, logind and `user@0` from a drop-in each. PID 1 and journald report on `/dev/kmsg` with `printk.devkmsg=on`, logind and `user@0` on their stderr, the journal: the first run had logind's on `/dev/kmsg` too, its `DevicePolicy=` refused the executor the open, and logind failed at STDERR (lab 45180400607, discarded). glibc 2.43 counts in TSC cycles, 2700 MHz in every boot. *Measured* (bench, nested, spin's shape and login, v20261123.05 on its traceable kernel, the ledger with and without the edit, 8 a side, lab 45180856158), ld.so's total start-up, p50 [range]: PID 1 0.48 [0.46, 0.56] ms, of it loading objects 0.32 and relocation 0.08; journald 0.20 [0.14, 0.31]; logind 0.20 [0.11, 0.31]; `user@0` 0.21 [0.15, 0.36]. Relocations: PID 1 and `user@0` 2,522 symbol (911 from cache) and 16,589 relative; journald 1,157 and 10,518; logind 1,238 and 11,297. Objects at start, from the release's image (`ldd`): 7 for PID 1 and `user@0` (the binary, libsystemd-core, libsystemd-shared, libc, libm, libcrypt, ld.so), 6 for journald and logind, all `BIND_NOW`. The four come to ~1.1 ms, under #638's ~5 ms, so no build was made. *The instrument:* against the ledger alone in the same run, first login +3.4 [−23.0, +11.9], PID 1's CPU −1.1 [−5.1, +0.6], unattributed +0.3 [−0.1, +1.1]; each ld.so total is well inside the trace's wall time from the process's exec to its first sleep. It does not see the kernel's execve before ld.so runs, nor the libraries' pages faulted in later by `main`, which a static build would partly pay too (not measured). `user@0`'s environment generator inherits the variable and reports 0.13 ms more. *Inferred:* the multicall build would not reach even that: it keeps libsystemd-core and libsystemd-shared dynamic, leaves journald and logind alone and makes the executor, static here, dynamic. *Status:* measured and rejected; #638 closed. - -**11-23 · qemu · a bzImage mapped, not read into QEMU's heap (#646, labs 45182382388, 45182382864, 45183618987, this change).** `x86_load_linux` read the whole 16.7 MB bzImage into a buffer that only fw_cfg reads, 6.2-6.9 ms of QEMU's init traced (labs 45177818419, 45177817516, #611), and qboot copies the same bytes again by fw_cfg DMA. `qemu/patches/0007` maps the file read-only (`g_mapped_file_new_from_fd`), as upstream has mapped the initrd since 4.2; a kernel with a dtb appended keeps its buffer. The setup header QEMU patches is already a copy of its own, so nothing writes to the mapping. The QEMU build asserts that a held TCG machine's maps name a stub bzImage given to it; the published QEMU fails that check. *Prior art* is in docs/boot-time.md's row: Garzarella's 2019 series mapped the ELF kernel and the initrd but not the bzImage. *Measured* (bench, nested, spin's shape and login, v20261123.05 against the same release with the patched QEMU, parts run 45180746171, 40 a side, interleaved): first login 380 → 367, −13.4 [−16.9, −7.3], sshd accepting −13.3 [−18.7, −7.5], the console prompt −10.6 [−14.2, −6.3]; QEMU's anonymous RSS −15.9 MiB and its file RSS +16.1, total unmoved (lab 45182382388). Restored, 40 a side: login −9.3 [−11.2, −6.1] evicted and −7.7 [−8.9, −5.1] cached, `running` −8.8 and −7.9, the state unmoved (lab 45182382864): a restore starts QEMU, which loads the kernel into fw_cfg there too. The gain is twice the traced read; what else the anonymous buffer cost nested (its page faults, presumably) was not measured. *A lead, not a decision:* an uncompressed payload (#326's kernel patch, renumbered, branch `exp/646-uncompressed`, parts run 45180892535) against LZ4, both on the patched QEMU: first login −4.0 [−7.9, +0.3], within noise at 40, QEMU's RSS +32 MiB (lab 45183618987). The mapping removes the "+6-7 in QEMU's start" half of #326's rejection; whether the rest is a gain needs more boots, which is #645's. *Status:* in place; the record does not move, as the kernel reaches the guest through fw_cfg. - -**11-23 · systemd · the executors' sandbox costs its system call allow-list, not its number of filters (labs 45228294512, 45229454155, 45231419187, 45235103665, 45235485857, 45238003981, 45239372741, #637, #673, #686, this change).** #637 split #574's bound and asked for one seccomp filter per unit. *The split* (bench, nested, spin's shape and login, v20261123.06, 60 a side, branch `exp/637-split`, tag `archive/exp-637`): the seccomp settings emptied in journald, logind and `user@` read first login −12.0 [−21.8, −2.1], sshd accepting −13.8 [−19.4, −4.9]; the namespace ones (`ProtectSystem=`, `ProtectHome=`, `ProtectControlGroups=`, `ProtectKernelTunables=`, `ProtectProc=`) +0.3 [−9.4, +7.2] (lab 45228294512). *Fewer filters:* the executor applies `SystemCallArchitectures=` after seven other settings, so each of those loads a filter for i386 and x32 too, which the architecture filter then kills; the kernel has neither ABI. Applied first, journald carries 8 filters, not 17, and logind 13, not 26. `boot:seccomp` (on the tag) runs a probe as each unit's `ExecStartPost=`, with the unit's sandbox, over 3435 calls: every native number with zero arguments and no capabilities, each x32 number, and the calls the settings decide by argument; the table was the release's (labs 45235103665, 45235485857). First login −0.4 [−6.1, +2.7] against systemd rebuilt with a comment only (lab 45231419187). *Where it goes:* an instrument patch timing the executor's steps (thread CPU, one boot, 2 vCPUs): journald's executor 6.7-7.2 ms, `SystemCallFilter=@system-service` 3.7-4.0 of it, its `seccomp_load()` 1.1-1.2; the other seccomp settings ~0.6 together (labs 45238003981, 45239372741). So one filter per unit would reach about the 0.6 ms (inferred). *Found on the way:* the lab's packages edit gave `/usr` the package's mtime, newer than the image's update stamps (#513), so every `--systemd` tree ran ldconfig, sysusers, the hwdb and the catalog before the login: both arms ~658 ms (lab 45229454155); fixed in #673. *Status:* rejected, #637 closed; building the allow-list once is #686. - -**11-23 · machine, qemu · QEMU's start and the held start's QMP, split and rejected (#647, #649, labs 45177818419, 45230790902, 45231358105, #669, this change).** #611's split left two cold phases without an owner. *#649, the held start's 14 commands, 6.1 ms on bench:* QEMU waited 4.5 ms p50 for the client, 0.9 of it busy with the probe's plug monitor (the memory spin sizes right after the start), so spin-machine's own share is ~3.6 ms, ~0.28 ms a round trip (24 boots, lab 45177818419). The candidate sent the bind ahead of its answers (`qmp.Send`): the run state with the places, every serial at once, each image's two nodes together, the reopen with the placeholder's delete, 13 round trips to 9; add-fd still holds the connection until its answer and `cont` waits for the bind. *Measured* (bench, nested, spin's shape and login, v20261123.06's parts, spin-machine main at f273377 against the candidate at c966407, 60 a side): first login −1.7 [−5.6, +2.6], sshd accepting −2.4 [−5.5, +2.8] (lab 45230790902); restored login −0.3 [−3.8, +3.7] evicted, +0.9 [−10.6, +7.5] cached (lab 45231358105). Rejected: the four round trips it removes are ~1.1 ms (inferred), and even all of spin-machine's 3.6 ms is under what 60 boots a side resolve. The code is on `archive/exp-649-held-start`. *#647, QEMU's exec to its first trace event, 9.7 ms on bench:* the release's QEMU is static-pie on musl, so there is no dynamic loader and `LD_DEBUG` has nothing to report; musl relocates its 59,700 relative relocations itself. The split, on the laptop as a lead (exec to the first `flatview_new`, 40 starts a row, 4.7-5.4 ms p50): a trivial static-pie binary 0.23, QEMU's `-version` 2.0, `-sandbox` −0.7 to −0.9, the rest option parsing, trace and main-loop start and the machine object. perf on an unstripped build of the same Dockerfile: relocation 7% of `-version`, page faults ~15%, nothing else over 2%. No candidate's ceiling is over ~2 ms on bench (inferred at ~2× the laptop): a seccomp filter compiled at build time (Firecracker's seccompiler), a non-PIE binary (which gives up ASLR), DT_RELR. None was built. The allocator, musl's mallocng, is ~2.3 of the 17 ms of CPU QEMU's main thread spends from exec to held, a lead across QEMU's whole start, opened as #669. *Status:* rejected, both. - -**11-23 · kernel, qemu, machine · the kernel entered as its vmlinux through PVH, moving itself to a random base (#645, parts runs 45192017068, 45216245888, labs 45213668842, 45213683698, 45219768990, 45219785493, 45219801969, 45221660056, 45225297602, parts run 45222305257, #660, this change).** *Why:* a bzImage's decompressor spent ~21 ms (bench) on a copy, LZ4 and parse_elf before the kernel's clock, and it was the only thing that randomized the kernel; PVH skipped it and left the kernel at its linked address (11-19). *The bound first*, a vmlinux through PVH with no KASLR at all, against the same build as a bzImage: first login −18.9 [−22.8, −12.4], restored −3.6 [−5.1, −2.1] evicted, at 40 a side. *Two paths with KASLR kept:* QEMU applying the relocations (Holmes et al., EuroSys '22; Firecracker's design) or the kernel applying its own (Hou Wenlong's RFC, 2026-01-26). The kernel's own was chosen: no relocation format for QEMU to parse, nothing on QEMU's command line, the decompressor's entropy code (#645, issuecomment-7106937337). *Carried:* the RFC as kernel 0014-0018, made checkpatch --strict clean with each change noted in its header; 0019, which sets `KASLR_FLAG` once the kernel moved (without it `RANDOMIZE_MEMORY` left the regions where they were: the lowest vmalloc address ffffc90000000000 and the direct map ffff888000000000 at every one of 10 boots, lab 45225297602; with it, 10 distinct bases of each, lab 45221660056); 0020, because the RFC reads RDRAND from CPUID leaf 1's EDX and the TSC from its ECX, the wrong way round, so its virtual base was drawn from the i8254 and a hash of `boot_params` alone, on a guest that has `rdrand` and `tsc` and no `ds_cpl` (lab 45225297602); QEMU 0008, a random physical base from `XEN_ELFNOTE_PHYS32_RELOC`. The relocation table needs 0xc7000 bytes of the 1 MiB reserved: a 512 KiB reserve failed the link naming that size (parts run 45222305257). The machine boots a release's vmlinux when it carries both Xen notes and its bzImage otherwise, so a release from v20261119.02 to v20261123.06 boots as it did. *Measured* (bench, spin's shape and login, against v20261123.06, 60 a side, the kernel without 0020): first login 368 → 352, −16.8 [−20.9, −13.0], sshd accepting −16.7 [−20.2, −12.7], QEMU's RSS −13.8 MiB (lab 45219785493); restored −4.4 [−17.5, −2.0] evicted, −4.3 [−14.0, +10.2] cached, the state −31.9 MiB, the save −14.6 (lab 45219801969). *Status:* kept. What the bzImage, `KERNEL_LZ4` and QEMU 0007 still serve is #660. - -**11-23 · release · v20261123.07 holds #645's cold gain; its record's 20 a side did not see it (labs 45252584128, 45219785493, release run 45241645340, #694).** *Why:* the record read the cold first login at −3.5 [−12.9, +2.9], within noise, against #645's −16.8 [−20.9, −13.0], and spin was about to be told what the bump gains. *Ruled out* (read from the artefacts): the lab arm and the release boot the same machine. QEMU (`f271a946…`), qboot, `pvh.bin` and `linuxboot_dma.bin` are byte-identical, `spin-machine args` prints one command line but for paths, and both vmlinux files are stripped, 40,165,128 bytes, with the same two LOAD segments and the same config; the release's adds 0020. QEMU's RSS moves the same in both (anonymous −34.0 MiB, file +19.9/+20.1). *Measured* (bench, nested, spin's shape and login, both releases as published, each with its own spin-machine, 60 a side, interleaved): first login 378 → 359, −18.6 [−23.6, −14.0], sshd accepting −15.3 [−21.2, −12.6], the console prompt −18.7 [−24.0, −12.8] (lab 45252584128). The record's run disagreed with itself: its `restore-first` cold boot, the same boot at 40 a side, read −14.2 [−19.9, −8.6]; its 20 `.07` boots sat at a p50 of 370 where the lab's sit at 352-359, and 20 a side drawn from lab 45219785493's samples reach −3.5 in 5 of 100,000 draws. *Status:* the gain stands at ~−17 to −19 ms cold. How many boots the record takes is #694. - -**11-23 · lab · the ledger's kernel_zero on the kernel's sched clock (#644, labs 45229897350, 45230233764, this change).** The ledger's `kernel_zero` landed 19.5 ms (bench) and 12.6 ms (metal) after a port write at the sched clock's 0 (#611). *Found:* the ledger took CLOCK_MONOTONIC's 0, the trace's clock, for the kernel's. CLOCK_MONOTONIC runs on jiffies from timekeeping_init until the switch to kvm-clock and loses the ticks it misses. The kernel prints both clocks at one tick at late_initcall ("sched_clock: Marking stable"), and their difference was the whole error in all 24 boots of labs 45177818419 and 45177817516, to within 0.15 ms. *Changed:* the ledger moves the trace and the journal forward by that lag (`monotonic_lag`, 18-25 ms nested, 11-14 metal) and refuses a journal without the line. *Checked:* with the marker kernel, `kernel_zero` lands 0.03 to 0.14 ms before QEMU's trace stamps the marker, 10 boots on bench and 10 on metal (spin's shape, v20261123.04). *What moved*, recomputed from the runs' kept journals: docs/measuring.md's split of lab 45110630795, `kernel_zero` 97-114 → 77-95 and `qemu_start` 49.4 → 29.3 (`before_qemu` and `guest_to_zero` do not move); QEMU's exec to the kernel's clock untraced on the workspace's machine is 73.4 ms on bench and 68.7 on metal (labs 45177818419, 45177817516), against firmware-stages' 73.7; PID 1 in #561's ledgers −3.4 → −4.0 ms; the pressure sender's start 0.37-0.38 → 0.39-0.40 s (docs/image.md). #611's comment is corrected. No cold-budget row used the ledger's anchor. Two of its rows use clocks with errors of their own, now noted beside them: firmware-stages' anchor is ~2.8 ms late on bench (#665), and dmesg's clock reads the kernel 13-15 ms short from late_initcall on (#666). *Status:* in place. - -**11-23 · qemu · the vmlinux copied into guest RAM beside QEMU's main loop (#698, labs 45257214350, 45260098299, 45260694485, parts run 45257975711, this change).** *Why:* since #645 QEMU loads the vmlinux through `load_elf`. #698 asked whether it read the 40 MB file into ROM blobs at start, as `x86_load_linux` read a bzImage before 0007. It does not: `load_elf` has mapped the file since QEMU 4.2 (816b9fe450, Garzarella, 2019), and the blobs point into the mapping. What it does is copy the 37.4 MB of segments into guest RAM at the machine's first reset, on the main thread, before the main loop answers the monitor. *The phase,* a probe that traces QEMU's reset (`romcopy`, branch `exp/698-romcopy`, never merged): 9.1 ms p50, p95 9.3, 20 boots, bench, spin's shape (lab 45257214350); the ledger read the vmlinux's QEMU start +8.4 against a bzImage's (lab 45260129735, #697). On a laptop half the copy is faulting in the destination's huge pages and half the copy, and a `pread` into guest RAM was no faster than the mapping's `memcpy`, so no cheaper copy was built. *Carried:* QEMU 0009 copies the segments 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; a machine made for an incoming migration copies nothing at reset, as before. *Measured* (bench, spin's shape and login, v20261123.07 against the same release with 0009's QEMU, interleaved): first login 351 → 342, −8.6 [−11.0, −4.0], sshd accepting −9.1 [−12.4, −5.9], the console prompt −7.7 [−11.4, −5.5], QEMU's RSS unmoved, 60 a side (lab 45260098299); restored −0.1 [−1.1, +0.7] evicted, −0.3 [−2.1, +0.9] cached, the state unmoved, the same run's cold login −6.9 [−12.9, −0.8], 40 a side (lab 45260694485). The gain is the whole traced copy. The record does not move: the patch adds no device, property or RAM block, and `boot:record` passed on the patched tree (lab 45261567066). A stub ELF whose notes have `p_align` 0 kills QEMU 11.2 with SIGFPE in `load_elf`, found while writing the build check (#705, not affected). *Status:* kept. - -**11-23 · qemu · QEMU 0007 deleted: no release from v20261123.07 boots a bzImage (#660, parts run 45256311661, labs 45258887660, 45258106255, this change).** 0007 mapped a bzImage given to `-kernel` instead of reading it into QEMU's heap (#646, the 11-23 entry above). Since #645 the machine enters a release's vmlinux through PVH (`machine.OpenRelease` picks it by its two Xen notes), and QEMU's ELF loader maps that file without 0007. A release from .06 or before boots its bzImage with the QEMU it shipped, which carries 0007; only a lab tree of a new QEMU with an old release's kernel pays the read again. *Measured* (bench, nested, spin's shape and login, v20261123.07 against the same release with QEMU built without 0007, 40 a side, interleaved): first login +3.6 [−3.3, +7.8], sshd accepting −1.6 [−6.7, +5.6], QEMU's RSS +0.3 [−1.6, +2.1] MiB, its file RSS +0.2 [+0.2, +0.3], a different binary's pages (inferred) (lab 45258887660); restored login −0.4 [−1.5, +0.9] evicted, −0.1 [−0.9, +0.9] cached, the state unmoved (lab 45258106255). Neither number moves, as #660 expected: 0007 touched nothing on the PVH path. The QEMU build's check of the mapping goes with it. *Status:* deleted. The bzImage and `CONFIG_KERNEL_LZ4` stay until spin's `hack/machine/place.go` stops requiring `kernel/bzImage` (spin-stack/spin#1689). - -**11-23 · lab · the traceable kernel is a vmlinux entered through PVH, as the release's (#697, lab 45260129735, this change).** *Why:* since #645 the release boots its vmlinux through PVH, and its traceable kernel was still a bzImage, so v20261123.07's published ledger read firmware, entry and setup at 47.1 ms against .06's 45.0, where the release had dropped its decompressor. *Changed:* `release traceable-kernel` publishes a self-randomizing vmlinux, checked as the release's, and no bzImage; `traceable:TAG` places whichever the release published; the ledger records `pvh` and names the window by it. *Proof* (bench, spin's shape, v20261123.07, 10 boots a tree, interleaved, the old traceable bzImage against the new traceable vmlinux): firmware, entry and setup 44.3 → 19.4, −24.9 [−25.8, −23.4]; QEMU's start and held start 41.9 → 50.3, +8.4, the vmlinux's load (#698); the kernel's 0 −16.8 [−18.2, −15.1]; first login −21.6 [−32.9, −11.0]. *Status:* in place. - -**11-23 · kernel · the boot's device-setup exits as one change: kernel 0021-0025 (#627, parts run 45256426877, labs 45260781177, 45261629539, this change).** *Why:* five patches each removed the VM exits their changelogs counted (#590, #591, #592), and none moved the first login alone; as a bound the five read −7.4 [−12.1, −2.8] at 60 a side (lab 45114405201). #627 asked whether "the boot's MMIO exits in device setup" is one change and, if so, for one arm at 120 a side, the set chosen before the run. *Changed:* the bound's five, from `archive/exp-batch2-bound`, as 0021-0025 after #645's 0014-0020; they apply to 7.3.6 with no fuzz. The build asserts each on its vmlinux (kernel/README.md); checkpatch `--strict` and sparse pass. 0022 keeps the risk #627 named: upstream a2f1e22390ac took out `pci_restore_state()`'s refusal of a state never saved, so its gate (AER, EEH, s390, Xen pcifront, `reset_root_port`) has to grow by hand with whatever calls error handlers next; it stayed in the set because the set was fixed before the run. *Measured* (bench, nested, spin's shape and login, against v20261123.07, interleaved): first login −9.4 [−14.2, −5.7], sshd accepting −9.5 [−14.4, −5.5], console prompt −10.4 [−14.2, −7.8], second login +0.3 [−0.1, +0.6], QEMU RSS −1.7 MiB [−1.8, −0.1], 120 a side (lab 45260781177). `restore-first`, 60 a side (lab 45261629539): restored login −0.4 [−2.0, +1.7] evicted and +0.2 [−6.6, +7.3] cached, the state +0.0 MiB [−0.1, +0.2], all within noise; its cold row −11.8 [−18.5, −3.2] evicted. The same set against v20261123.06 had read −9.2 [−12.2, −6.0] (lab 45231943664), before 7.3.6 and #645. *Status:* in place; reaches the goal number with the next release. - -**11-23 · kernel, release · the release is its vmlinux alone: no bzImage, no `KERNEL_LZ4`, no kernel 0018 (#660, lab 45262046768, spin-stack/spin#1689, this change).** *Why:* since #645 (v20261123.07) the machine boots a release's vmlinux through PVH, and the bzImage beside it was booted by nothing: spin's `hack/machine/place.go` still asked for it, and its runner reads the vmlinux and `pvh.bin`. The maintainer decided not to wait for spin. *Done:* `kernel/Dockerfile` makes `vmlinux` instead of `all`; `CONFIG_KERNEL_LZ4` and the builder's `lz4` go, and the compression mode is Kconfig's default (gzip), which compresses nothing shipped; kernel 0018, the RFC's change to the decompressor, is deleted, as nothing compiles `arch/x86/boot/compressed/` any more, and with it sparse's rebuild of the bzImage to check that file; CodeQL's kernel analysis builds `vmlinux` for the relocs tool where it built the bzImage. The release packs, hashes (SBOM) and describes (SOURCES) `kernel/vmlinux` alone, and `verify kernel` reads no setup header. `machine.OpenRelease` still boots the bzImage of a release from v20261119.02 to v20261123.06: the lab (`--from release:TAG`) and compat open them. Compat stopped at the first release with no bzImage, which every release from this one on is, and now stops at the first `OpenRelease` refuses. *Measured* (bench, nested, spin's shape and login, 20 a side, interleaved): the boot path is unchanged, first login −4.3 [−14.4, +7.4] at 20 a side, within noise, sshd accepting −5.3 [−11.1, +7.0], QEMU's RSS −1.7 MiB (the arm's kernel is also 7.3.6, main's, against .07's 7.3.5). *Left:* spin's place.go must stop requiring `kernel/bzImage` before it takes a release from this one on (spin-stack/spin#1689). - -## 2. Rework cycles - -Each cycle: the sequence, what each step measured, and the lesson. - -### 2.1 udev: masked, unmasked, then argued over for weeks -1. Initial import: udev masked "to save boot time" (`8aee03a`). The serial getty could not start, so a debug init was written to work around it (`5e7d60e`, `8aee03a`, `24c8a06`). -2. 09-10 `4cbd229`: masking buys nothing (826 vs 829). The first harness had left `systemd-udev-trigger` masked and read "udev changes nothing". -3. 09-10 `722d468`: unmasked. `b5f361f`: the harness's udev row was itself a no-op. -4. 09-10 `064c4f4`: unmasking udev quietly enabled the serial getty that the console unit existed to avoid. This was left open as "a decision". -5. 09-26 `adc52cd`/`e2f6b8f`: udev's 46 ms "overlaps" the boot; removing devices, rules or VT gives 0. -6. 11-12 `3c8da99`: the memory half of the hot-add rule, added 09-10, raced the kernel and was removed. - -**Lesson:** an optimisation imported without its measurement survived 3 days and cost a debug init, a console unit and a harness. Measure before inheriting a mask, and make a variant fail when its edit matches nothing (`e2f6b8f` added that check). - -### 2.2 logind: out of the boot, then back in -1. 09-10 `6aba37b`: logind 63 ms on the chain, worth 24 ms to the console prompt (laptop). -2. 09-12 `bb6bb89` (#5): logind is started at the first login through the seats directory, worth 24 ms (249 vs 273). Two dead ends were recorded, and `boot:logind` was written to hold it. -3. 11-12 #240: back in the boot, with spin lingering. First SSH login 570 → 510 (lab 43308825692). The comment says the 09-12 change "moved logind, dbus-broker and user@1000.service into the first login instead, which is what a workspace waits for." -4. 11-13: the side effect, console prompt +77 ms, was fixed with getty Type=simple (#241), and that fix was removed the same day (#249). -5. #240's notes: the `SPIN_LOGIND_NO_SEATS=1` control "was written to fail, and on this image … it passes". `10-seats.conf` may now be unnecessary. Not settled. - -**Lesson:** the 09-12 decision optimised the console prompt, a metric nobody waits for, and paid for it in the first login, which was not measured until 11-12. Name the metric that matters before optimising. The first SSH login probe arrived two months after the change it would have rejected. - -### 2.3 Serial getty Type=idle / Type=simple -1. 09-10 `80f984b`: removing Type=idle was within noise against agetty's `sleep(1)`. -2. 09-10 `064c4f4`: Type=idle worth 25 ms (291/344 vs 266/283), read as "systemd's job queue draining". -3. 09-26 `b9707e3`/`7b08e5a`: Type=idle was eliminated as the cause of the 340 ms console-swap cost. -4. 11-13 #241: Type=simple shipped, 346/358 vs 423/441, after linger made the idle hold 91.8 ms. -5. 11-13 #249: removed, since the console prompt is not a workspace metric. - -**Lesson:** the value of this setting depends on what else is in the boot transaction. It was re-measured each time something upstream changed (linger), and its worth turns on a metric (the console prompt) that does not matter (#249). Decide which metrics count before shipping fixes for the others. - -### 2.4 SSH host key generation (moved 5 times) -1. 09-07 `8aee03a`: ssh fails five times per boot; "SSH keys are identity and belong wherever the rest of a VM's identity comes from" (not fixed). -2. 09-07 `2df3dbf`: generated per boot, hung off ssh.service. Hanging it off ssh.socket made an ordering cycle. -3. 09-24 `a01c847`: RSA dropped (309 ms in blame). -4. 11-12 #240 `28823fb`: `sshd@` must wait for the keys. Before this, SSH over vsock "worked not at all"; nothing had tested vsock SSH since the socket path changed. -5. 11-12 lab 43312419007: keygen wanted by multi-user.target, 518 vs 514. Nothing gained, because default dependencies kept it after basic.target. Not shipped. -6. 11-13 #247 → #248: wanted by sysinit.target with `DefaultDependencies=no`, 489 → 468 (lab 43483372488). Consumer consequence: a checkpoint taken after boot always carries host keys, so the restorer must re-key (`image/README.md`). - -**Lesson:** the per-connection vsock path ran without host keys until a probe logged in over it. A functional probe of the real login path (`boot:ssh-first`) should come before timing work on it. Step 5 failed for a reason (`DefaultDependencies`) that reading the unit's ordering would have shown. - -### 2.5 Save/restore and templates in the CLI; restore measurement; mapped-ram (proposed twice) -1. 09-07 `656d55b`: save/resume added; reverted the same day as lifecycle (`b882171`). -2. 09-26 `20e14d9`/`ab4844c`: TEMPLATES.md, template restore 24 ms, `drop-cache=off`. -3. 09-28 `c202568`: `save --template`/`restore`, plus `boot:restore`. -4. 09-30 #51: templates removed upstream (spin #194). `boot:restore` deleted, two days after it was written. -5. 11-13 #242: restore measured again, and mapped-ram proposed with `--channels`. Its numbers (lab 43364516874) were contaminated by leaked VMs. -6. 11-13 #246: mapped-ram in the contract. The fleet shows no win (385 vs 386); closed. - -**Lesson:** the product's path (template restore, then checkpoint resume) changed outside this repository, and probes were built and deleted around it within days. Restore of a checkpoint was not measured at all between 09-30 and 11-13. The mapped-ram decision had a fleet result and was reopened with a new reason: on 11-19 `machine.VM` writes every checkpoint in mapped-ram (`FormatMappedRAM`), and on 11-20 multifd channels on it took the restore under 100 ms (#320). A restore with more RAM is still unmeasured (#242's checklist). - -### 2.6 Fingerprint: what it hashes (rewritten ~8 times) -1. Binaries plus shape (09-07). -2. Plus device topology, `b476f6d`. -3. Topology corrected to exclude disks and NICs, `b882171`. -4. NIC count and MTU back in, `6599829`/`2b46d78`. -5. Root ports, then virtio-scsi, in. -6. Firmware by content in, `f2f4da0`. -7. Templates removed, `a9d6083`. -8. One hash, `c5baaa7`. -9. **Contract, not binaries**, `fa3041c` (10-13), after the QEMU 11.1.2 bump stranded every checkpoint (`f0ec1e0`). -10. **No hash at all** (11-21): a record read from the running QEMU, compared part by part (`QEMU.Target`, `CanResume`). - -Each step moved every fingerprint. Comments that said "a QEMU or kernel bump strands checkpoints" survived until `e452afc` (11-12). The verdict tool was blind to `machine/` changes until #98. - -**Lesson:** a prediction of the machine has to be kept honest by a test of its own (boot:roms) and still cannot say what differs. Since 11-21 the record is asked of QEMU, and a refusal names each difference. Check claims about which checkpoints resume against `CanResume`, boot:record and boot:compat, not against older comments. - -### 2.7 Console unit (spin-machine-console.service) -Sequence: created 09-07 (`24c8a06`); made redundant by udev 09-10 (`064c4f4`); measured 340 ms worse as a swap; TERM=dumb fixed it, 09-26 (`7b08e5a`); "viable", but the exposure question was left open; deleted 11-12 (`3a7864d`). - -**Lesson:** two months of a unit nothing enabled. Delete as soon as nothing references a unit. - -### 2.8 Debug init and diagnostic initrds -`cmd/spin-machine-init` was created 09-07 and deleted 09-10 (`8eeb01c`). Diagnostic initrds came back as `boot/probeinit` (09-29, `a81b6b5`), now allowed by CLAUDE.md as isolated diagnostics. - -**Lesson:** the rule ("no init in a release") was clarified rather than broken. AGENTS.md no longer carries that rule. Its "Experiments" section keeps diagnostic initrds apart from release outputs. - -### 2.9 Probes added then deleted (short-lived) -- `boot:matrix` (09-10 → 09-10) -- `kernel/minimal` + `boot:floor` (09-26 → 09-30) -- `boot:kernel-pages` (09-30 → 09-30) -- `boot:memory-unplug` (09-30 → 09-30) -- cache bench (09-11 → 09-30) -- `boot:restore` (09-28 → 09-30) -- `boot:unitload` (09-26 → 10-01) -- `boot:memory-policy` (09-28 → 10-01) -- page-cache sub-probes (09-30 → 10-01) -- bench rows (09-10 … → 10-01) -- console-swap variants (09-26 → 09-30) -- `boot:exits`, `boot:mmio`, `boot:jobs` (11-12 → 11-13, #249) -- `boot:bench`, `boot:trace`, `boot:userspace`, `boot:systemd`, `boot:ssh-load` (→ 11-13, #250) - -This is the cycle AGENTS.md asks for ("Remove an experiment once its question is answered"). The cost is that the answers live only in commit messages and comments. - -**Lesson:** this log, or `docs/memory-and-disk.md`-style records, is where an answered probe's result should land. Before writing a probe, check docs/boot-time.md's "Measured and rejected" and the row comments in `internal/lab/sshfirst.go`. - -### 2.10 /tmp and tmpfiles; erofs; BPF_LSM; chrony -- **/tmp:** masked by the imported optimizer; unmasked 09-26 (`f36ae13`, noise); capped at a quarter 09-28. -- **erofs:** removed from the kernel 09-26 (`5a3d509`); the build assertion relaxed 09-30 (#66) for the pmem/DAX experiment, which was rejected (#63, #65). -- **BPF_LSM:** off 09-07 ("a boundary inside the boundary"); on 10-01 (`1400f6a`), and the stale note was fixed 10-05 (`ebe2a6e`). -- **chrony:** added 09-07, removed 09-10. - -**Lesson:** the imported scripts carried decisions without numbers. Each has been re-decided one at a time. - -### 2.11 CI cache and runners (rebuilt ~5 times) -- gha cache that stored nothing (`c767cd5`, 09-15); -- Blacksmith (09-20); -- the builder's silent fallback (`aa157cf`/`1ef95d1`, 09-26); -- export from main only (`bdec6cc`); -- GitHub runners for builds plus the bench/kvm fleets (10-24); -- the gha cache unreadable on the fleet, so a registry cache (`1666cb5`, 11-12). - -Also the reusable builder, added and reverted on 10-13. - -**Lesson:** each move was taken without checking that the cache was actually hit. A cache-hit assertion would have caught `c767cd5` and `1666cb5` on day one. - -### 2.12 apk locks broke three times -`6e7ba47` (11-03), `8d495c5` (11-09), release run 43157106109 / `ec2c7fb` (11-12); fixed by a daily refresh (`c6c29b5`), which then compiled QEMU cold twice every move. It was fixed structurally on 11-20 by pinning builder images instead of packages. - -**Lesson:** a mirror that serves only the newest build cannot be pinned. Pin something that keeps its contents, such as an image, and move it when the move is wanted. diff --git a/docs/log/2026-09-07-2afac47-219b98a.md b/docs/log/2026-09-07-2afac47-219b98a.md new file mode 100644 index 00000000..30854475 --- /dev/null +++ b/docs/log/2026-09-07-2afac47-219b98a.md @@ -0,0 +1,7 @@ +--- +date: "2026-09-07" +order: 10 +area: all +title: '`2afac47`, `219b98a`' +--- +The repository is created from spinbox's and storage's QEMU, kernel and image (image ported to mkosi, ext4 in a read-only qcow2). qemu-nbd dropped, Taskfile split per part, `task shell` added. *Why:* they were one machine, duplicated across repositories. *Result:* "boots as one machine … in 151 ms" (`2afac47`, consumer's initrd). *Status:* in place. diff --git a/docs/log/2026-09-07-2df3dbf.md b/docs/log/2026-09-07-2df3dbf.md new file mode 100644 index 00000000..510acb56 --- /dev/null +++ b/docs/log/2026-09-07-2df3dbf.md @@ -0,0 +1,14 @@ +--- +date: "2026-09-07" +order: 60 +area: image/kernel +title: '`2df3dbf`' +--- +Changes: +- root password removed; +- SSH host keys generated per boot (unit hung off ssh.service); +- chrony via `/dev/ptp0`; +- BPF_JIT and BTF on, at +21.4 ms of kernel boot and 5.0 MB (5 runs each way; also `kernel/README.md`); +- `-no-reboot`. + +BPF_LSM was left off. *Status:* BPF on and in place; chrony removed 09-10; BPF_LSM turned on 10-01 (`1400f6a`); the keys moved 3 more times (§2). diff --git a/docs/log/2026-09-07-31a57e7.md b/docs/log/2026-09-07-31a57e7.md new file mode 100644 index 00000000..a786d5b6 --- /dev/null +++ b/docs/log/2026-09-07-31a57e7.md @@ -0,0 +1,7 @@ +--- +date: "2026-09-07" +order: 50 +area: qemu +title: '`31a57e7`' +--- +QEMU is linked statically against musl. *Measured:* process start to QMP quit, 44 ms glibc vs 43 ms musl over 5 runs. Not measured: a long-running guest under load (musl allocator, thread stack). *Status:* in place; the load question is still open. diff --git a/docs/log/2026-09-07-58d404e.md b/docs/log/2026-09-07-58d404e.md new file mode 100644 index 00000000..c1e1e8ad --- /dev/null +++ b/docs/log/2026-09-07-58d404e.md @@ -0,0 +1,7 @@ +--- +date: "2026-09-07" +order: 90 +area: machine +title: '`58d404e`' +--- +`tsc=reliable` restored; it had been lost in the move from spinbox. Not measured. In place. diff --git a/docs/log/2026-09-07-5e7d60e-8aee03a-24c8a06.md b/docs/log/2026-09-07-5e7d60e-8aee03a-24c8a06.md new file mode 100644 index 00000000..c8781b7d --- /dev/null +++ b/docs/log/2026-09-07-5e7d60e-8aee03a-24c8a06.md @@ -0,0 +1,7 @@ +--- +date: "2026-09-07" +order: 40 +area: tooling +title: '`5e7d60e`, `8aee03a`, `24c8a06`' +--- +`cmd/spin-machine-init` is a debug initramfs, and `spin-machine-console.service` is shipped but not enabled. *Why:* systemd gave no serial login, because the image masked udev, so `dev-ttyS0.device` never appeared. *Status:* the init was deleted `8eeb01c` (09-10) and the console unit deleted `3a7864d` (11-12). See §2. diff --git a/docs/log/2026-09-07-5e7d60e-b476f6d-57e827a-b882171-17d844f-02709d7.md b/docs/log/2026-09-07-5e7d60e-b476f6d-57e827a-b882171-17d844f-02709d7.md new file mode 100644 index 00000000..1375a97d --- /dev/null +++ b/docs/log/2026-09-07-5e7d60e-b476f6d-57e827a-b882171-17d844f-02709d7.md @@ -0,0 +1,14 @@ +--- +date: "2026-09-07" +order: 20 +area: machine/fingerprint +title: '`5e7d60e`, `b476f6d`, `57e827a`, `b882171`, `17d844f`, `02709d7`' +--- +`machine/` defines the slot map, the shape and the cmdline. `Fingerprint` hashes QEMU, the kernel and the initrd by content, plus the shape. Same day: +- the device topology goes into the hash (`b476f6d`); +- the host CPU goes back in under `-cpu host` (`57e827a`); +- the topology is corrected to leave out disks and NICs (`b882171`: templates have neither); +- the encoding is made length-prefixed (`17d844f`); +- an identity split is added for memoising (`02709d7`). + +*Status:* superseded. See the fingerprint cycle in §2. diff --git a/docs/log/2026-09-07-656d55b-b882171.md b/docs/log/2026-09-07-656d55b-b882171.md new file mode 100644 index 00000000..995295fd --- /dev/null +++ b/docs/log/2026-09-07-656d55b-b882171.md @@ -0,0 +1,8 @@ +--- +date: "2026-09-07" +order: 30 +area: machine +title: '`656d55b` → `b882171`' +prs: [51] +--- +`spin-machine save` and `boot --incoming file:` are added, then reverted the same day as "lifecycle" that belongs to the consumer. Kept: `Spec.CPU` with `enforce=on`. Measured: a state saved with Broadwell-v4 resumes on Broadwell-v4 and Skylake-Client-v4, and Nehalem refuses (`656d55b`, now in `docs/migration.md`). *Status:* save/restore came back as checkpoint commands (`c202568`, 09-28; kept after #51). diff --git a/docs/log/2026-09-07-8b7391a.md b/docs/log/2026-09-07-8b7391a.md new file mode 100644 index 00000000..27a36130 --- /dev/null +++ b/docs/log/2026-09-07-8b7391a.md @@ -0,0 +1,12 @@ +--- +date: "2026-09-07" +order: 70 +area: qemu/machine +title: '`8b7391a`' +--- +aio=io_uring, discard=unmap, vhost=on requested, qom_cast_debug off. *Rejected:* +- `cache=none`: the shared base must stay in the host page cache, and O_DIRECT fails on tmpfs; +- `--enable-virtfs`; +- four configure flags that do not exist in 11.1.1. + +*Status:* in place. diff --git a/docs/log/2026-09-07-b476f6d-ee34d31.md b/docs/log/2026-09-07-b476f6d-ee34d31.md new file mode 100644 index 00000000..fa215a3c --- /dev/null +++ b/docs/log/2026-09-07-b476f6d-ee34d31.md @@ -0,0 +1,7 @@ +--- +date: "2026-09-07" +order: 80 +area: machine/kernel +title: '`b476f6d`, `ee34d31`' +--- +virtio-balloon with free-page-reporting. *Measured:* "costs nothing measurable", 158.9-162.5 ms with vs 157.9-171.6 without, noise ~14 ms. virtio-mem replaces DIMM slots, with `memhp_default_state=online` required: without it a request for 2048 then 3072 MiB plugged 1024 and stopped. Measured 0→2048→3072→512→2 MiB. *Status:* in place. diff --git a/docs/log/2026-09-08-fa1803f.md b/docs/log/2026-09-08-fa1803f.md new file mode 100644 index 00000000..99add51f --- /dev/null +++ b/docs/log/2026-09-08-fa1803f.md @@ -0,0 +1,7 @@ +--- +date: "2026-09-08" +order: 10 +area: machine +title: '`fa1803f`' +--- +ICH9 `sata=off`, `smbus=off`. *Measured:* 400 boots per variant, kernel to init: 62.3 baseline, 61.3 sata=off, 61.7 smbus=off, 60.6 both; an earlier 150-boot series agrees. *Measured and rejected:* `usb=off` 63.0 vs 62.9; `vmport=off` 62.6; `smm=off` 62.3; `i8042=off` 62.5. *Status:* in place. diff --git a/docs/log/2026-09-08-fe332b4.md b/docs/log/2026-09-08-fe332b4.md new file mode 100644 index 00000000..3741ea57 --- /dev/null +++ b/docs/log/2026-09-08-fe332b4.md @@ -0,0 +1,8 @@ +--- +date: "2026-09-08" +order: 20 +area: CI +title: '`fe332b4` (#4)' +prs: [4] +--- +`task verify:args` starts 9 Specs under the TCG binary with `-S` and requires a QMP answer. *Why:* nothing checked that QEMU accepts the command line. In place (it became `TestQEMUAcceptsEveryArgument`). diff --git a/docs/log/2026-09-09-76aacf9-7cafdf6-6599829-2b46d78-354c8a6.md b/docs/log/2026-09-09-76aacf9-7cafdf6-6599829-2b46d78-354c8a6.md new file mode 100644 index 00000000..3fb6ad9a --- /dev/null +++ b/docs/log/2026-09-09-76aacf9-7cafdf6-6599829-2b46d78-354c8a6.md @@ -0,0 +1,13 @@ +--- +date: "2026-09-09" +order: 20 +area: machine +title: '`76aacf9`, `7cafdf6`, `6599829`, `2b46d78`, `354c8a6`' +--- +Changes: +- PCIe root ports for hotplug: no measured change to boot or restore; +- a NIC through a root port via `netdev_add fd=`; +- NIC count and `host_mtu` go into the fingerprint, while MAC and fd stay out; +- a second QMP monitor. + +*Status:* root ports were replaced by virtio-scsi on 09-29 (`2b19096`); NIC hotplug was dropped then; MTU and NIC in the fingerprint were superseded by `Spec.Contract` (`fa3041c`). diff --git a/docs/log/2026-09-09-9ca453a.md b/docs/log/2026-09-09-9ca453a.md new file mode 100644 index 00000000..13c6383d --- /dev/null +++ b/docs/log/2026-09-09-9ca453a.md @@ -0,0 +1,7 @@ +--- +date: "2026-09-09" +order: 10 +area: kernel cmdline +title: '`9ca453a`' +--- +`nohz=off` removed. *Measured:* a forced tick is 1.7% of a core per idle vCPU. Boot 821-853 ms vs 843-846; restore 113-221 vs 124-216 (template era). In place. diff --git a/docs/log/2026-09-10-4cbd229-bab6f16-c2c4c6a-722d468-b5f361f.md b/docs/log/2026-09-10-4cbd229-bab6f16-c2c4c6a-722d468-b5f361f.md new file mode 100644 index 00000000..45dd35b0 --- /dev/null +++ b/docs/log/2026-09-10-4cbd229-bab6f16-c2c4c6a-722d468-b5f361f.md @@ -0,0 +1,7 @@ +--- +date: "2026-09-10" +order: 10 +area: boot probes/image +title: '`4cbd229`, `bab6f16`, `c2c4c6a`, `722d468`, `b5f361f`' +--- +`task boot:matrix` (shell). *Found:* masking udev buys nothing (826 vs 829 ms), and masking it costs a 10 s `dev-ttyS0.device` timeout with no login. udev was unmasked (`722d468`) and `40-spin-hotadd.rules` added for CPU and memory. Two stalls of 334 ms waiting on the console (XTGETTCAP and a terminal reset) are fixed by `TERM=dumb` on the kernel cmdline: 687→19 ms, and the whole boot 855→163-207 ms (`b5f361f`). The harness itself was contaminated: `unmask_udev` had become a no-op, so the first udev rows (826/829) were wrong (`b5f361f`). *Status:* udev on and TERM=dumb in place. The memory half of the hot-add rule was removed 11-12 (`3c8da99`). diff --git a/docs/log/2026-09-10-6aba37b-064c4f4-c7bab94-c7af4d3-08c56e1.md b/docs/log/2026-09-10-6aba37b-064c4f4-c7bab94-c7af4d3-08c56e1.md new file mode 100644 index 00000000..435a9716 --- /dev/null +++ b/docs/log/2026-09-10-6aba37b-064c4f4-c7bab94-c7af4d3-08c56e1.md @@ -0,0 +1,14 @@ +--- +date: "2026-09-10" +order: 50 +area: image +title: '`6aba37b`, `064c4f4`, `c7bab94`, `c7af4d3`, `08c56e1`' +--- +Changes and measurements: +- logind 63 ms on the chain, worth 24 ms; chrony worth 10 (15 boots, laptop); +- Type=idle on the getty measured at 25 ms (291/344 vs 266/283); +- `disable-udev-settle.rules` deleted as wrong; +- chrony deleted: 248/322 vs 261/288; "a restore is invisible from the inside", and correcting the clock belongs to whoever restores; +- blame figures that summed to ~380 ms out of a 175 ms userspace are kept only as history. + +*Status:* chrony removed and in place. diff --git a/docs/log/2026-09-10-80f984b.md b/docs/log/2026-09-10-80f984b.md new file mode 100644 index 00000000..a7f20a69 --- /dev/null +++ b/docs/log/2026-09-10-80f984b.md @@ -0,0 +1,14 @@ +--- +date: "2026-09-10" +order: 30 +area: boot probes +title: '`80f984b`' +prs: [250] +--- +The boot bench is ported to Go and the shell harness deleted. *Found:* +- `systemd.mask=` on the cmdline does nothing (debug-generator masked), so every earlier row that used it measured nothing; +- agetty has an unconditional `sleep(1)`; +- the shell harness throttled the console (it read 1424 ms where the guest said 190); +- a Percentile bug. + +*Measured (15 boots, laptop):* as shipped 1256/1276; without agetty 253/320; 512 MiB 1241/1261; 1 vCPU 1309/1326; udev masked: 15 of 15 boots never reached a login. Superseded by `boot:bench`; `boot:bench` was deleted in #250. diff --git a/docs/log/2026-09-10-8eeb01c.md b/docs/log/2026-09-10-8eeb01c.md new file mode 100644 index 00000000..fc1027f5 --- /dev/null +++ b/docs/log/2026-09-10-8eeb01c.md @@ -0,0 +1,7 @@ +--- +date: "2026-09-10" +order: 20 +area: tooling +title: '`8eeb01c`' +--- +Debug initramfs deleted. "this repository does not ship an init". With udev on, the serial getty works: 204 ms to a login prompt. In place. diff --git a/docs/log/2026-09-10-b151186.md b/docs/log/2026-09-10-b151186.md new file mode 100644 index 00000000..26d3411f --- /dev/null +++ b/docs/log/2026-09-10-b151186.md @@ -0,0 +1,7 @@ +--- +date: "2026-09-10" +order: 60 +area: qemu +title: '`b151186`' +--- +The device list is turned into an allowlist (`--without-default-devices`): 363→225 instantiable types and a 23.7→8.7 MB binary. MICROVM rejected ("no ACPI CPU hotplug"). Boot unchanged (240/274 vs 245/265, laptop). In place. diff --git a/docs/log/2026-09-10-c03ed89-1a8e25c-a31d7b2-f32d527-64d2901-e285dec.md b/docs/log/2026-09-10-c03ed89-1a8e25c-a31d7b2-f32d527-64d2901-e285dec.md new file mode 100644 index 00000000..2f4a68f9 --- /dev/null +++ b/docs/log/2026-09-10-c03ed89-1a8e25c-a31d7b2-f32d527-64d2901-e285dec.md @@ -0,0 +1,17 @@ +--- +date: "2026-09-10" +order: 40 +area: kernel +title: '`c03ed89`, `1a8e25c`, `a31d7b2`, `f32d527`, `64d2901`, `e285dec`' +--- +A kernel-phase investigation. Results, each recorded in `kernel/Dockerfile`: +- initcall_debug with a console attached measures the console (103.9 vs 42.8 ms); +- the 8250 trim is worth 154 µs; +- a modular kernel buys 0.57 ms and was rejected; +- acpi_bus_scan scales with the vCPU ceiling: maxcpus=16 +5 ms and maxcpus=64 +9 ms of kernel (63.0/68.1/72.1 ms), recorded at `Spec.MaxCPUs`; +- four ACPI cmdline parameters are worth 0 (69.9 vs 68.6); +- ksm_init and kcompactd_init are worth 0; +- `event_trace_enable_again`'s 6 ms is the profiler; +- inet_init's 9 ms is BTF's first parse, not XFRM. + +*Status:* rejected (docs/boot-time.md, "Measured and rejected"). diff --git a/docs/log/2026-09-10-c049a21-8eef89d-a0efd65.md b/docs/log/2026-09-10-c049a21-8eef89d-a0efd65.md new file mode 100644 index 00000000..e157267e --- /dev/null +++ b/docs/log/2026-09-10-c049a21-8eef89d-a0efd65.md @@ -0,0 +1,7 @@ +--- +date: "2026-09-10" +order: 70 +area: boot probes +title: '`c049a21`, `8eef89d`, `a0efd65`' +--- +QEMU's startup split: 1.4 ms launcher, ~27 ms exec to first instruction, ~7 ms guest to first console byte. The QMP greeting is not a checkpoint: it comes before the board is built, so the real QMP reply is at 18-20 ms, not 8. Cold-start cost is the host zeroing pages (18.8%) plus rom_reset; a restore pays neither (09-26). Not acted on. diff --git a/docs/log/2026-09-11-21a830c.md b/docs/log/2026-09-11-21a830c.md new file mode 100644 index 00000000..5e5ad705 --- /dev/null +++ b/docs/log/2026-09-11-21a830c.md @@ -0,0 +1,8 @@ +--- +date: "2026-09-11" +order: 10 +area: machine +title: '`21a830c`' +prs: [48, 94] +--- +`Disk.DirectOverBacking`, with a cache-modes bench of 16 VMs. Writes were inconclusive: the disk was 94% full and times moved tenfold. `mincore` reports every page resident for a file the caller does not own. *Status:* the field is now in `machine/vm.go`; the bench was deleted in #48; `Disk.Cache` was removed in #94. diff --git a/docs/log/2026-09-11-ec008b0.md b/docs/log/2026-09-11-ec008b0.md new file mode 100644 index 00000000..83b9eb1b --- /dev/null +++ b/docs/log/2026-09-11-ec008b0.md @@ -0,0 +1,7 @@ +--- +date: "2026-09-11" +order: 20 +area: image +title: '`ec008b0`' +--- +sshd `TrustedUserCAKeys` (the CA file is written by the consumer). #101 (10-03): without the CA nothing logs in. In place. diff --git a/docs/log/2026-09-12-9177475.md b/docs/log/2026-09-12-9177475.md new file mode 100644 index 00000000..7052ecf2 --- /dev/null +++ b/docs/log/2026-09-12-9177475.md @@ -0,0 +1,7 @@ +--- +date: "2026-09-12" +order: 10 +area: machine +title: '`9177475`' +--- +`Spec.Accel` (tcg). TCG guest to PID 1 in 6.5 s vs 33 ms under KVM. In place. diff --git a/docs/log/2026-09-12-bb6bb89.md b/docs/log/2026-09-12-bb6bb89.md new file mode 100644 index 00000000..199fc65c --- /dev/null +++ b/docs/log/2026-09-12-bb6bb89.md @@ -0,0 +1,8 @@ +--- +date: "2026-09-12" +order: 20 +area: image +title: '`bb6bb89` (#5)' +prs: [5, 240] +--- +logind out of the boot transaction. The first login starts it through the varlink socket and a `/run/systemd/seats` drop-in (`10-seats.conf`). *Measured:* 249/287 vs 273/297, 25 boots, two runs (laptop). `boot:logind` holds sessions. *Status:* **reversed 11-12** (#240). See §2. diff --git a/docs/log/2026-09-14-9335335-fe7d4ab-891e2f7-b5908ee.md b/docs/log/2026-09-14-9335335-fe7d4ab-891e2f7-b5908ee.md new file mode 100644 index 00000000..8f1ece37 --- /dev/null +++ b/docs/log/2026-09-14-9335335-fe7d4ab-891e2f7-b5908ee.md @@ -0,0 +1,13 @@ +--- +date: "2026-09-14" +order: 10 +area: image +title: '`9335335`, `fe7d4ab`, `891e2f7`, `b5908ee`' +--- +Changes: +- the image is sized in two passes: 974 MiB with 132 free, was 1163 with 317; +- e2fsprogs 1.47.4 is built static and pinned; +- `-m 0` for reserved blocks; +- a 64 MiB journal. + +Bug: `891e2f7` (shipped in v20260914.01) made a 4.08 GiB filesystem, because `-b` read the size as a block count. Fixed in `b5908ee`. In place. diff --git a/docs/log/2026-09-14-b9d1985.md b/docs/log/2026-09-14-b9d1985.md new file mode 100644 index 00000000..8d5c5007 --- /dev/null +++ b/docs/log/2026-09-14-b9d1985.md @@ -0,0 +1,7 @@ +--- +date: "2026-09-14" +order: 20 +area: kernel +title: '`b9d1985`' +--- +A trixie toolchain and a reproducible vmlinux. *Why:* v20260914.01 and .02 had different kernels from the same source. bookworm's pahole 1.24 encoded `.BTF` in parallel, in a non-deterministic order, and the banner carried the build date. Two `--no-cache` builds now give the same vmlinux. Usable 503/575 vs 509/547 with gcc 12 (laptop, 20 boots). In place. diff --git a/docs/log/2026-09-15-c767cd5.md b/docs/log/2026-09-15-c767cd5.md new file mode 100644 index 00000000..a161c99f --- /dev/null +++ b/docs/log/2026-09-15-c767cd5.md @@ -0,0 +1,7 @@ +--- +date: "2026-09-15" +order: 10 +area: CI +title: '`c767cd5`' +--- +The BuildKit `type=gha` cache had never stored anything: the runtime token does not reach `run:` steps, and every build shared one scope. Fixed with named scopes. Superseded by the registry cache (`1666cb5`, 11-12). diff --git a/docs/log/2026-09-18-da17b34-f023b56-5d4a01c-4947281.md b/docs/log/2026-09-18-da17b34-f023b56-5d4a01c-4947281.md new file mode 100644 index 00000000..ffd29b71 --- /dev/null +++ b/docs/log/2026-09-18-da17b34-f023b56-5d4a01c-4947281.md @@ -0,0 +1,7 @@ +--- +date: "2026-09-18" +order: 10 +area: machine +title: '`da17b34`, `f023b56`, `5d4a01c`, `4947281`' +--- +A restore opens its template read-only. Disks can be given as a chain of descriptors (`-add-fd`), and so can the console, `/dev/kvm`, vhost-vsock and vhost-net. In place, apart from the template parts. diff --git a/docs/log/2026-09-20-f63aa38.md b/docs/log/2026-09-20-f63aa38.md new file mode 100644 index 00000000..54b56c4d --- /dev/null +++ b/docs/log/2026-09-20-f63aa38.md @@ -0,0 +1,8 @@ +--- +date: "2026-09-20" +order: 10 +area: CI +title: '`f63aa38` (#10)' +prs: [10] +--- +Workflows move to Blacksmith. Superseded 10-24 (`f29e59d`). diff --git a/docs/log/2026-09-21-3d10256-56f6fea.md b/docs/log/2026-09-21-3d10256-56f6fea.md new file mode 100644 index 00000000..4ac86b3f --- /dev/null +++ b/docs/log/2026-09-21-3d10256-56f6fea.md @@ -0,0 +1,7 @@ +--- +date: "2026-09-21" +order: 10 +area: machine +title: '`3d10256`, `56f6fea`' +--- +`FingerprintCache` added. *Status:* removed `2d9b7e3` (09-29), with no caller; the identity split went in `c5baaa7` (10-01). diff --git a/docs/log/2026-09-24-35df9cf.md b/docs/log/2026-09-24-35df9cf.md new file mode 100644 index 00000000..b655c7a3 --- /dev/null +++ b/docs/log/2026-09-24-35df9cf.md @@ -0,0 +1,7 @@ +--- +date: "2026-09-24" +order: 10 +area: machine +title: '`35df9cf`' +--- +No VMX/SVM in the guest. Measured with 3 hot-added cores: vmx=1,0,0,0 plus a warning before, vmx=0 on all after. Fingerprint moved. In place. diff --git a/docs/log/2026-09-24-a01c847.md b/docs/log/2026-09-24-a01c847.md new file mode 100644 index 00000000..fc48891b --- /dev/null +++ b/docs/log/2026-09-24-a01c847.md @@ -0,0 +1,7 @@ +--- +date: "2026-09-24" +order: 20 +area: image +title: '`a01c847`' +--- +Host keys made without RSA. RSA was 309 ms in blame in a guest, and on the host 141 ms vs 6 (ECDSA) and 5 (Ed25519). In place. diff --git a/docs/log/2026-09-26-5221690-c6e48de-adc52cd-e2f6b8f-b9707e3-7b08e5a.md b/docs/log/2026-09-26-5221690-c6e48de-adc52cd-e2f6b8f-b9707e3-7b08e5a.md new file mode 100644 index 00000000..af25d559 --- /dev/null +++ b/docs/log/2026-09-26-5221690-c6e48de-adc52cd-e2f6b8f-b9707e3-7b08e5a.md @@ -0,0 +1,16 @@ +--- +date: "2026-09-26" +order: 40 +area: boot probes +title: '`5221690`, `c6e48de`, `adc52cd`, `e2f6b8f`, `b9707e3`, `7b08e5a`' +prs: [90, 250] +--- +Probes added: `boot:initcalls`, `boot:userspace`, `boot:systemd`. Findings: +- p50 98.2 ms kernel to "Freeing", of which 54.5 ms is 680 initcalls; +- udev coldplugs 266 devices, 64 of them `ttyN`; +- `CONFIG_VT=n` was predicted at 5-12 ms and measured at 0 (228/237 vs 228/246); +- 19 udev rule files masked: 0; +- device-count boot parameters: 0; +- the console-unit swap measured 340 ms worse, and the cause was finally found to be a 334 ms XTGETTCAP timeout, fixed with `TERM=dumb` on that unit (221/233 vs 558/572). + +*Status:* findings recorded. The rows were deleted in `3f669ef` and #90. `boot:userspace` and `boot:systemd` were deleted in #250. diff --git a/docs/log/2026-09-26-8063bcd.md b/docs/log/2026-09-26-8063bcd.md new file mode 100644 index 00000000..8b5ec7bb --- /dev/null +++ b/docs/log/2026-09-26-8063bcd.md @@ -0,0 +1,7 @@ +--- +date: "2026-09-26" +order: 20 +area: machine +title: '`8063bcd`' +--- +discard=unmap on the format node of a chain. Before this, fstrim freed nothing and deleted data stayed readable. Not measured. In place. diff --git a/docs/log/2026-09-26-9fab3f1-ad05544-9b5f0dd.md b/docs/log/2026-09-26-9fab3f1-ad05544-9b5f0dd.md new file mode 100644 index 00000000..8c074b38 --- /dev/null +++ b/docs/log/2026-09-26-9fab3f1-ad05544-9b5f0dd.md @@ -0,0 +1,8 @@ +--- +date: "2026-09-26" +order: 60 +area: image +title: '`9fab3f1`, `ad05544`, `9b5f0dd`' +prs: [88, 352] +--- +Unit-file count does not matter: 300 extra units gave 236 vs 246. Unit loading costs 26 ms per `systemd --test`, not the 212 the debug log suggested. Masking the tpm2 and factory-reset generators is worth 1.0 ms of that 26. An empty `/etc/machine-id` skips the preset pass. *Status:* the masks are in place, except the tpm2 generator's, deleted 11-20 (#352). `boot:unitload` was deleted in #88. diff --git a/docs/log/2026-09-26-aa157cf-1ef95d1.md b/docs/log/2026-09-26-aa157cf-1ef95d1.md new file mode 100644 index 00000000..ee5c8a78 --- /dev/null +++ b/docs/log/2026-09-26-aa157cf-1ef95d1.md @@ -0,0 +1,7 @@ +--- +date: "2026-09-26" +order: 80 +area: CI +title: '`aa157cf`, `1ef95d1`' +--- +The Blacksmith builder v2 required a `cache-key` and silently fell back to a local builder without it. Fixed with `nofallback`. Superseded 10-24. diff --git a/docs/log/2026-09-26-ab4844c.md b/docs/log/2026-09-26-ab4844c.md new file mode 100644 index 00000000..ae747436 --- /dev/null +++ b/docs/log/2026-09-26-ab4844c.md @@ -0,0 +1,7 @@ +--- +date: "2026-09-26" +order: 70 +area: machine +title: '`ab4844c`' +--- +`drop-cache=off` on chain images: a restore had been issuing `POSIX_FADV_DONTNEED` on the shared base. Restore exec-to-running 29 ms with an overlay vs 24 without disks; `cont` 8.9→2.8 ms; a cold cache has been measured at 251 ms. In place. diff --git a/docs/log/2026-09-26-dae6a14-5a3d509-cda04b1-9b5f0dd.md b/docs/log/2026-09-26-dae6a14-5a3d509-cda04b1-9b5f0dd.md new file mode 100644 index 00000000..02691087 --- /dev/null +++ b/docs/log/2026-09-26-dae6a14-5a3d509-cda04b1-9b5f0dd.md @@ -0,0 +1,8 @@ +--- +date: "2026-09-26" +order: 50 +area: kernel +title: '`dae6a14`, `5a3d509`, `cda04b1`, `9b5f0dd`' +prs: [48] +--- +A floor kernel (tinyconfig + PVH): release 97.95 vs floor 52.33 ms, so the config costs 45.6 ms (BTF, ACPI, ftrace). lz4 instead of gzip for an initrd: 6.4 ms. erofs removed (100.46 vs 102.22, noise). KSM and THP off: -0.50 ms, rejected. `CONFIG_VT` off as dead config. The 2.09 ms quoted for it was withdrawn (0.31 ms over 40 boots on an idle host). *Status:* erofs and VT off are in place. The floor probe and `kernel/minimal` were deleted in #48 (09-30). diff --git a/docs/log/2026-09-26-e4f456f.md b/docs/log/2026-09-26-e4f456f.md new file mode 100644 index 00000000..7702217d --- /dev/null +++ b/docs/log/2026-09-26-e4f456f.md @@ -0,0 +1,8 @@ +--- +date: "2026-09-26" +order: 30 +area: firmware/qboot +title: '`e4f456f` (#12)' +prs: [12] +--- +The qboot experiment: `write-pointer.patch` (vmgenid needs WRITE_POINTER), built in a pinned container. The compiler moves the number: 6.32 ms saved with GCC 15.2 vs 3.86 with GCC 14.2 (`qemu/qboot/README.md`). Not adopted yet, because firmware was not in the fingerprint. *Status:* adopted 09-29 (`f2f4da0`). diff --git a/docs/log/2026-09-26-f36ae13.md b/docs/log/2026-09-26-f36ae13.md new file mode 100644 index 00000000..041aa244 --- /dev/null +++ b/docs/log/2026-09-26-f36ae13.md @@ -0,0 +1,7 @@ +--- +date: "2026-09-26" +order: 10 +area: image +title: '`f36ae13`' +--- +`/tmp` is a tmpfs again and tmpfiles-setup is unmasked. The imported optimizer had masked both. 223/230 vs 220/232, within noise. In place; `/tmp` was capped at a quarter of memory in `47aa681`. diff --git a/docs/log/2026-09-27-0b1f470-51c1fe9-2f03d09-e7e52db.md b/docs/log/2026-09-27-0b1f470-51c1fe9-2f03d09-e7e52db.md new file mode 100644 index 00000000..134305e8 --- /dev/null +++ b/docs/log/2026-09-27-0b1f470-51c1fe9-2f03d09-e7e52db.md @@ -0,0 +1,7 @@ +--- +date: "2026-09-27" +order: 20 +area: tooling +title: '`0b1f470`, `51c1fe9`, `2f03d09`, `e7e52db`' +--- +`boot` with no disk uses `-snapshot`. Added: attach/detach, and the rule that checks go through the CLI. boot now execs QEMU, and the QMP handshake has a 5 s deadline. Validation was hardened, and the fingerprint moved again (`-accel` became its own argument). In place. diff --git a/docs/log/2026-09-27-7ec3601-2f5a7b0.md b/docs/log/2026-09-27-7ec3601-2f5a7b0.md new file mode 100644 index 00000000..41fc2e37 --- /dev/null +++ b/docs/log/2026-09-27-7ec3601-2f5a7b0.md @@ -0,0 +1,7 @@ +--- +date: "2026-09-27" +order: 10 +area: machine +title: '`7ec3601`, `2f5a7b0`' +--- +ACPI PCI hotplug is turned off and the guest's pciehp used instead. *Why:* device_del never completed, and spin's lane waited 30 s. Fingerprint moved. *Status:* superseded by virtio-scsi (09-29). diff --git a/docs/log/2026-09-28-2fd0fff-430d2b3.md b/docs/log/2026-09-28-2fd0fff-430d2b3.md new file mode 100644 index 00000000..47a27ec9 --- /dev/null +++ b/docs/log/2026-09-28-2fd0fff-430d2b3.md @@ -0,0 +1,7 @@ +--- +date: "2026-09-28" +order: 30 +area: kernel +title: '`2fd0fff`, `430d2b3`' +--- +7.2.8 with PSI; then MGLRU, PARAVIRT_SPINLOCKS, PARAVIRT_TIME_ACCOUNTING, fq_codel and hung-task detectors. 322 vs 333 ms usable (15 boots). ZRAM rejected. In place. diff --git a/docs/log/2026-09-28-30b717b-a8e2737.md b/docs/log/2026-09-28-30b717b-a8e2737.md new file mode 100644 index 00000000..852ddd7d --- /dev/null +++ b/docs/log/2026-09-28-30b717b-a8e2737.md @@ -0,0 +1,7 @@ +--- +date: "2026-09-28" +order: 20 +area: tooling +title: '`30b717b`, `a8e2737`' +--- +Every pin goes into `versions.yaml` with a gate test; the versions tool moved to go-tools. In place. diff --git a/docs/log/2026-09-28-5332e97-3bef421-e6a0a1b-6b0f338.md b/docs/log/2026-09-28-5332e97-3bef421-e6a0a1b-6b0f338.md new file mode 100644 index 00000000..bd1d1133 --- /dev/null +++ b/docs/log/2026-09-28-5332e97-3bef421-e6a0a1b-6b0f338.md @@ -0,0 +1,7 @@ +--- +date: "2026-09-28" +order: 50 +area: CI +title: '`5332e97`, `3bef421`, `e6a0a1b`, `6b0f338`' +--- +Actions pinned by commit, actionlint, the race detector, `task mutate`, a coverage floor. The floor was set at 85% against a local 85.7%. CI measures 84.7%, so it broke main and was lowered to 80% (`e6a0a1b`). In place. diff --git a/docs/log/2026-09-28-c202568.md b/docs/log/2026-09-28-c202568.md new file mode 100644 index 00000000..df4b85b4 --- /dev/null +++ b/docs/log/2026-09-28-c202568.md @@ -0,0 +1,8 @@ +--- +date: "2026-09-28" +order: 10 +area: machine/CLI +title: '`c202568`' +prs: [51] +--- +`save --template` and `restore` added, plus `boot:restore`: restore ~20 ms; first request 14 ms warm, 33 cold, 31 after a reclaim. *Status:* the template parts were removed 09-30 (#51); restore was not measured again until 11-13. diff --git a/docs/log/2026-09-28-f7cd1ab-47aa681-337c08d.md b/docs/log/2026-09-28-f7cd1ab-47aa681-337c08d.md new file mode 100644 index 00000000..09241fbb --- /dev/null +++ b/docs/log/2026-09-28-f7cd1ab-47aa681-337c08d.md @@ -0,0 +1,8 @@ +--- +date: "2026-09-28" +order: 40 +area: boot probes/image +title: '`f7cd1ab`, `47aa681`, `337c08d`' +prs: [88, 250] +--- +`boot:ssh-load`: CPU load does not slow a login, and 16 MiB available doubles one to ~210-310 ms. CPUWeight/IOWeight/MemoryLow on ssh.service changed nothing and are not shipped. MGLRU `min_ttl_ms=1000` and `/tmp` at a quarter of memory. **The sources disagree** on min_ttl_ms: `47aa681` says worst login 1369-7106 ms without vs 94-128 with; `kernel/Dockerfile:192-194` says 611-1785 vs 105-106. *Status:* in place; `boot:memory-policy` was deleted in #88, and `boot:ssh-load` was deleted in #250. diff --git a/docs/log/2026-09-29-349dacb-20fd702-3e26963.md b/docs/log/2026-09-29-349dacb-20fd702-3e26963.md new file mode 100644 index 00000000..998c4cc7 --- /dev/null +++ b/docs/log/2026-09-29-349dacb-20fd702-3e26963.md @@ -0,0 +1,10 @@ +--- +date: "2026-09-29" +days: 09-29/30 +order: 30 +area: kernel +title: '`349dacb` (#33), `20fd702`, `3e26963` (#40)' +prs: [33, 40] +runs: [36651858261] +--- +Four local patches: 0001 objtool writes NOPs, -7.0 ms; 0002 skips the weak-function scan, 11.9 ms; 0003 rewrites the eval maps on first use, -9.0 ms; 0004 PCI config through ECAM, -4.5 ms. Kernel boot 109.4 → 73.7 ms (lab runner, workspace shape, 15-20 boots). The whole report boots on it (run 36651858261). Fingerprint moved. In place. diff --git a/docs/log/2026-09-29-43fb03b-2b19096.md b/docs/log/2026-09-29-43fb03b-2b19096.md new file mode 100644 index 00000000..ba3bc946 --- /dev/null +++ b/docs/log/2026-09-29-43fb03b-2b19096.md @@ -0,0 +1,8 @@ +--- +date: "2026-09-29" +order: 10 +area: machine/qemu +title: '`43fb03b` (#24), `2b19096` (#25)' +prs: [24, 25] +--- +Hotplugged disks go on virtio-scsi instead of PCIe root ports. *Measured 2026-09-29, 4 ports vs 1 controller:* boot -31 ms; attach 135 → 1.5 ms; detach 6.1 s → 0.7 ms. NIC hotplug dropped. In place. diff --git a/docs/log/2026-09-29-a503db7-e9e0c8e-de9b7db.md b/docs/log/2026-09-29-a503db7-e9e0c8e-de9b7db.md new file mode 100644 index 00000000..c937fba1 --- /dev/null +++ b/docs/log/2026-09-29-a503db7-e9e0c8e-de9b7db.md @@ -0,0 +1,14 @@ +--- +date: "2026-09-29" +order: 20 +area: boot probes/CI +title: '`a503db7` (#23), `e9e0c8e`, `de9b7db` (#29)' +prs: [23, 29] +--- +A report feature matrix (96 rows) published with every release, and `lab.yml` on the self-hosted KVM runner. *Why:* a laptop read 61 vs 105 ms minutes apart. Fixed along the way: +- the lab went green having measured nothing (a skip) (`8d8e97b`); +- a concurrency group cancelled queued experiments (`a3ba5a6`); +- two runners both took nbd0 (`b21e100`); +- an NBD device was mounted before it had a size (`8946f67`). + +In place, with the lab on the bench fleet since 10-24. diff --git a/docs/log/2026-09-29-ae6ab48-f2f4da0.md b/docs/log/2026-09-29-ae6ab48-f2f4da0.md new file mode 100644 index 00000000..6bcff015 --- /dev/null +++ b/docs/log/2026-09-29-ae6ab48-f2f4da0.md @@ -0,0 +1,9 @@ +--- +date: "2026-09-29" +order: 40 +area: firmware +title: '`ae6ab48` (#37), `f2f4da0` (#39)' +prs: [37, 39] +runs: [36650049960, 36650559189] +--- +qboot becomes the default BIOS and the firmware goes into the fingerprint. SeaBIOS 121.89 vs qboot 114.76 ms p50, 7.14 ms saved (lab runner, run 36650049960); 106 rows boot (run 36650559189). In place; the firmware *contents* were later dropped from the fingerprint and only its size kept (`fa3041c`). diff --git a/docs/log/2026-09-30-57-62-64-67-74-77-78-83.md b/docs/log/2026-09-30-57-62-64-67-74-77-78-83.md new file mode 100644 index 00000000..489898f4 --- /dev/null +++ b/docs/log/2026-09-30-57-62-64-67-74-77-78-83.md @@ -0,0 +1,9 @@ +--- +date: "2026-09-30" +days: 09-30/10-01 +order: 50 +area: boot probes (memory/disk) +title: '#57-#62, #64, #67-#74, #77, #78, #83, #84, #89' +prs: [57, 62, 74, 89] +--- +The page-cache lab on construct (AMD Ryzen 9 5900X, Spin OS metal), recorded in `docs/memory-and-disk.md`. Kept as defaults: writeback overlay; hourly fstrim; discard accounting; qboot MTRRs; `page_reporting_order` stays 9. Rejected: docs/boot-time.md, "Measured and rejected". Sub-probes deleted in #89. `caches` and `reclaim` remained until c3c0fd1 (11-19). diff --git a/docs/log/2026-09-30-6f65249-f10383b.md b/docs/log/2026-09-30-6f65249-f10383b.md new file mode 100644 index 00000000..63126783 --- /dev/null +++ b/docs/log/2026-09-30-6f65249-f10383b.md @@ -0,0 +1,9 @@ +--- +date: "2026-09-30" +order: 10 +area: qemu/firmware +title: '`6f65249` (#42), `f10383b` (#43)' +prs: [42, 43] +runs: [36662499370] +--- +qboot writes the PAM registers in 3 writes instead of 7, at ~0.5 ms each. QEMU patch 0001 wraps device creation in one memory transaction (438 flat-view rebuilds). The first version also wrapped board init and the guest printed nothing (lab run 36662499370). In place. diff --git a/docs/log/2026-09-30-98c3589.md b/docs/log/2026-09-30-98c3589.md new file mode 100644 index 00000000..2a535049 --- /dev/null +++ b/docs/log/2026-09-30-98c3589.md @@ -0,0 +1,8 @@ +--- +date: "2026-09-30" +order: 20 +area: kernel +title: '`98c3589` (#47)' +prs: [47] +--- +7.3-rc5, 1.2 ms slower than 7.2.8 (30 boots). Superseded by 7.3 (10-26) and then 7.3.x. diff --git a/docs/log/2026-09-30-a9d6083.md b/docs/log/2026-09-30-a9d6083.md new file mode 100644 index 00000000..a5d2d4b7 --- /dev/null +++ b/docs/log/2026-09-30-a9d6083.md @@ -0,0 +1,8 @@ +--- +date: "2026-09-30" +order: 40 +area: machine +title: '`a9d6083` (#51)' +prs: [51] +--- +**Templates removed** (spin #194). `Memory.File`, `x-ignore-shared`, `save/restore --template`, `boot:restore` and `docs/templates.md` all go. The fingerprint now means "a checkpoint resumes only onto a machine with the same fingerprint". Fingerprint moved. In place. diff --git a/docs/log/2026-09-30-f2c47f7.md b/docs/log/2026-09-30-f2c47f7.md new file mode 100644 index 00000000..0057b94a --- /dev/null +++ b/docs/log/2026-09-30-f2c47f7.md @@ -0,0 +1,8 @@ +--- +date: "2026-09-30" +order: 30 +area: boot probes +title: '`f2c47f7` (#48)' +prs: [44, 46, 48] +--- +Probes deleted with their conclusions kept: `boot:floor` and `kernel/minimal`, `boot:kernel-pages` (#44, added the same day), `boot:memory-unplug` (#46, same day), `cache_bench`, the report's disk axis (96 → 32 rows), the console-swap rows, and the SeaBIOS timing. See §2. diff --git a/docs/log/2026-10-01-1400f6a.md b/docs/log/2026-10-01-1400f6a.md new file mode 100644 index 00000000..6b925dcf --- /dev/null +++ b/docs/log/2026-10-01-1400f6a.md @@ -0,0 +1,8 @@ +--- +date: "2026-10-01" +order: 40 +area: kernel +title: '`1400f6a` (#80)' +prs: [80, 240] +--- +Lockdown at confidentiality plus the BPF LSM; no `/dev/mem` or `/proc/kcore`. "No cost that can be told from noise." *Side effect, found later:* SPIN_GRAPH and SPIN_CPU_SHARE silently traced nothing until #240 (11-13). In place. diff --git a/docs/log/2026-10-01-2cd98f0.md b/docs/log/2026-10-01-2cd98f0.md new file mode 100644 index 00000000..e643ddb2 --- /dev/null +++ b/docs/log/2026-10-01-2cd98f0.md @@ -0,0 +1,8 @@ +--- +date: "2026-10-01" +order: 50 +area: CI/release +title: '`2cd98f0` (#81)' +prs: [81, 303] +--- +Release notes say what changed, and the report boots each row 20 times, KVM only. *Why:* at 3 boots a row every KVM row read 5-11% slower between two releases that 20 alternated boots put within 5 ms. Also: `v20261001.01` shipped a `qboot.bin` without `mtrr.patch` in the tarball, because hack/release named the patches one by one. In place. The report's 20 boots a row went with the feature matrix 11-19 (#303). diff --git a/docs/log/2026-10-01-4511798.md b/docs/log/2026-10-01-4511798.md new file mode 100644 index 00000000..32041138 --- /dev/null +++ b/docs/log/2026-10-01-4511798.md @@ -0,0 +1,9 @@ +--- +date: "2026-10-01" +order: 10 +area: firmware +title: '`4511798` (#75)' +prs: [75] +runs: [36818224412, 36818721809] +--- +qboot programs the MTRRs. virtio-pmem read at 8.3 MB/s uncached-minus vs 1.1 GB/s with SeaBIOS (runs 36818224412, 36818721809). No boot cost: 103.5 vs 103.1 ms. Fingerprint moved. In place. diff --git a/docs/log/2026-10-01-5b7b1dc.md b/docs/log/2026-10-01-5b7b1dc.md new file mode 100644 index 00000000..c26f124f --- /dev/null +++ b/docs/log/2026-10-01-5b7b1dc.md @@ -0,0 +1,9 @@ +--- +date: "2026-10-01" +order: 20 +area: image +title: '`5b7b1dc` (#76)' +prs: [76] +runs: [36815822140] +--- +fstrim hourly: 657 → 21 MB on disk, 657 → 20 MB in the host's cache (run 36815822140). In place. diff --git a/docs/log/2026-10-01-88-90.md b/docs/log/2026-10-01-88-90.md new file mode 100644 index 00000000..e665203d --- /dev/null +++ b/docs/log/2026-10-01-88-90.md @@ -0,0 +1,8 @@ +--- +date: "2026-10-01" +order: 60 +area: boot probes +title: '#88, #90' +prs: [88, 250] +--- +`unitload` deleted (it compared the image with itself) and `memory-policy` deleted. Bench rows reduced to "as shipped" and "baseline", with findings left as notes. In place. The bench rows went with `boot:bench` 11-13 (#250). diff --git a/docs/log/2026-10-01-aaf2d86.md b/docs/log/2026-10-01-aaf2d86.md new file mode 100644 index 00000000..9695a177 --- /dev/null +++ b/docs/log/2026-10-01-aaf2d86.md @@ -0,0 +1,9 @@ +--- +date: "2026-10-01" +order: 30 +area: qemu +title: '`aaf2d86` (#79)' +prs: [79, 289] +runs: [36815822140, 36884702758] +--- +Upstream's virtio-blk discard accounting is carried as a patch: before it, `query-blockstats` showed 0 unmaps for 1.1 GiB trimmed (run 36815822140); with it, 10-12 operations and 1123 MB (run 36884702758). "to delete in the bump that brings it". In place. Deleted 11-19 with QEMU 11.2.0-rc0, which has it upstream (#289). diff --git a/docs/log/2026-10-01-c5baaa7-ca7b54f-94.md b/docs/log/2026-10-01-c5baaa7-ca7b54f-94.md new file mode 100644 index 00000000..3fb349b0 --- /dev/null +++ b/docs/log/2026-10-01-c5baaa7-ca7b54f-94.md @@ -0,0 +1,8 @@ +--- +date: "2026-10-01" +order: 70 +area: machine +title: '`c5baaa7` (#97), `ca7b54f` (#98), #94' +prs: [97, 98] +--- +The fingerprint becomes one hash, and `Incoming` one field. The release verdict was blind to `machine/` changes, so `fingerprint_sha256` is now recorded. `Disk.Cache` removed. In place. diff --git a/docs/log/2026-10-09-f0ec1e0.md b/docs/log/2026-10-09-f0ec1e0.md new file mode 100644 index 00000000..2df18871 --- /dev/null +++ b/docs/log/2026-10-09-f0ec1e0.md @@ -0,0 +1,8 @@ +--- +date: "2026-10-09" +order: 10 +area: qemu +title: '`f0ec1e0` (#103)' +prs: [103] +--- +QEMU 11.1.2. "A new machine: every checkpoint taken on 11.1.1 stops resuming." That stranded v20261002.01's checkpoints (v20261013.01). Led to the next entry. diff --git a/docs/log/2026-10-13-7628981-4f7d55e-8c6d1c7.md b/docs/log/2026-10-13-7628981-4f7d55e-8c6d1c7.md new file mode 100644 index 00000000..d843c12c --- /dev/null +++ b/docs/log/2026-10-13-7628981-4f7d55e-8c6d1c7.md @@ -0,0 +1,8 @@ +--- +date: "2026-10-13" +days: 10-13/14 +order: 30 +area: CI +title: '`7628981`, `4f7d55e`, `8c6d1c7`' +--- +compat runs on main and before a release, not on PRs, because the KVM runner refuses pull_request jobs. cosign is built from its pin. Docker Hub images come from mirror.gcr.io after a 429. In place. diff --git a/docs/log/2026-10-13-d692a7c-03aeb28-96a39d2-845fb5d-f033995-b207bee-302ced2-99e31f9.md b/docs/log/2026-10-13-d692a7c-03aeb28-96a39d2-845fb5d-f033995-b207bee-302ced2-99e31f9.md new file mode 100644 index 00000000..44f66b48 --- /dev/null +++ b/docs/log/2026-10-13-d692a7c-03aeb28-96a39d2-845fb5d-f033995-b207bee-302ced2-99e31f9.md @@ -0,0 +1,14 @@ +--- +date: "2026-10-13" +order: 10 +area: CI/release +title: '`d692a7c`, `03aeb28`, `96a39d2`, `845fb5d`, `f033995` (#109), `b207bee` (#110), `302ced2` (#111), `99e31f9`' +prs: [109, 110, 111, 309] +--- +Supply chain: +- signing and attestation, an SBOM, release from main only, apk locks; +- a reusable builder (#109, #110), reverted the same day (#111): it never achieved SLSA L3 and needed guards; +- an OSV scan, kept; +- attestations checked by digest, because the 338 MB tarball was over cosign's 128 MiB limit. + +In place, apart from the reusable builder. The apk locks gave way to pinned builder images 11-20 (#309). diff --git a/docs/log/2026-10-13-fa3041c.md b/docs/log/2026-10-13-fa3041c.md new file mode 100644 index 00000000..17449f81 --- /dev/null +++ b/docs/log/2026-10-13-fa3041c.md @@ -0,0 +1,8 @@ +--- +date: "2026-10-13" +order: 20 +area: machine/fingerprint +title: '`fa3041c` (#114)' +prs: [114] +--- +**The fingerprint is the machine's contract.** `MachineType=pc-q35-11.1`. It hashes: the shape; `Spec.Contract` (every device as Args writes it); the BIOS's size; and the host CPU under `-cpu host`. It no longer hashes the QEMU, kernel, initrd or pvh.bin bytes. Added `boot:roms`, `boot:compat` (a v20261002.01 checkpoint resumes on 11.1.2), and `hack/machinetype`. One break by design. In place; `fingerprint_sha256=2bd7da6b…` from v20261013.02 onward. diff --git a/docs/log/2026-10-19-7bf5429.md b/docs/log/2026-10-19-7bf5429.md new file mode 100644 index 00000000..f8dcb7f1 --- /dev/null +++ b/docs/log/2026-10-19-7bf5429.md @@ -0,0 +1,8 @@ +--- +date: "2026-10-19" +order: 20 +area: CI +title: '`7bf5429` (#197)' +prs: [197] +--- +One OSV issue per package; there had been 77 open. In place. diff --git a/docs/log/2026-10-19-fb39fd5.md b/docs/log/2026-10-19-fb39fd5.md new file mode 100644 index 00000000..a246fe17 --- /dev/null +++ b/docs/log/2026-10-19-fb39fd5.md @@ -0,0 +1,8 @@ +--- +date: "2026-10-19" +order: 10 +area: image +title: '`fb39fd5` (#210)' +prs: [210] +--- +GNU coreutils instead of uutils: 21 OSV findings against rust-coreutils 0.10.0; image 855M vs 877M. In place. diff --git a/docs/log/2026-10-24-c75f144-f29e59d-d67afc4-97a6de1.md b/docs/log/2026-10-24-c75f144-f29e59d-d67afc4-97a6de1.md new file mode 100644 index 00000000..048a9edf --- /dev/null +++ b/docs/log/2026-10-24-c75f144-f29e59d-d67afc4-97a6de1.md @@ -0,0 +1,8 @@ +--- +date: "2026-10-24" +order: 10 +area: CI +title: '`c75f144` (#214), `f29e59d` (#215), `d67afc4`, `97a6de1`' +prs: [214, 215] +--- +Every workflow step is one task. Builds move to GitHub's runners. **Report and lab move to the bench fleet** (one instance type) and compat to the kvm fleet. A fix: vhost-vsock permissions were reset by udev after `modprobe` (`97a6de1`). In place. The first report on the fleet (v20261026.01) compared a Ryzen 9 5900X with a Xeon 6975P-C, and its notes say so (docs/measuring.md, "Avoid the pitfalls"). diff --git a/docs/log/2026-10-26-1c12413-0bb00ce-fc1079c.md b/docs/log/2026-10-26-1c12413-0bb00ce-fc1079c.md new file mode 100644 index 00000000..042cf981 --- /dev/null +++ b/docs/log/2026-10-26-1c12413-0bb00ce-fc1079c.md @@ -0,0 +1,8 @@ +--- +date: "2026-10-26" +days: 10-26/29 +order: 10 +area: kernel +title: '`1c12413`, `0bb00ce`, `fc1079c`' +--- +Kernel 7.3; the apk locks moved; the kernel now tracks mainline. Superseded: refresh.yml now proposes the newest stable release of the 7.3 series (`spin-machine-dev refresh kernel`). diff --git a/docs/log/2026-11-03-7c37270-b4b67c3-6e7ba47.md b/docs/log/2026-11-03-7c37270-b4b67c3-6e7ba47.md new file mode 100644 index 00000000..aca80ccd --- /dev/null +++ b/docs/log/2026-11-03-7c37270-b4b67c3-6e7ba47.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-03" +order: 10 +area: qemu/kernel +title: '`7c37270`, `b4b67c3`, `6e7ba47`' +prs: [266, 289] +--- +QEMU 11.1.3, kernel 7.3.1. The apk lock broke because Alpine's mirror dropped python3 3.14.8. In place. Superseded by QEMU 11.2.0-rc0 11-19 (#289) and kernel 7.3.5 11-17 (#266). diff --git a/docs/log/2026-11-09-00db122-0ce27ad-8d495c5.md b/docs/log/2026-11-09-00db122-0ce27ad-8d495c5.md new file mode 100644 index 00000000..8ff680a6 --- /dev/null +++ b/docs/log/2026-11-09-00db122-0ce27ad-8d495c5.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-09" +order: 10 +area: kernel/CI +title: '`00db122` (#223), `0ce27ad` (#224), `8d495c5` (#225)' +prs: [223, 224, 225, 266] +--- +Kernel 7.3.3, with the config named by series and a daily proposal job. A kernel CVE judge: of 18221 CVEs against 7.3.1, 9 apply with a fix later in 7.3 and 1 has no fix. The apk lock broke again (zlib 1.4). In place; the kernel is 7.3.5 since 11-17 (#266). diff --git a/docs/log/2026-11-09-ed4ad86-e1d40ad-6e25bb3.md b/docs/log/2026-11-09-ed4ad86-e1d40ad-6e25bb3.md new file mode 100644 index 00000000..f04d7f7b --- /dev/null +++ b/docs/log/2026-11-09-ed4ad86-e1d40ad-6e25bb3.md @@ -0,0 +1,7 @@ +--- +date: "2026-11-09" +order: 20 +area: tooling +title: '`ed4ad86`, `e1d40ad`, `6e25bb3`' +--- +Retries and tokens for GitHub downloads after 504s. Task and go-tools as released binaries (455 → 81 modules). In place. diff --git a/docs/log/2026-11-11-cce320f.md b/docs/log/2026-11-11-cce320f.md new file mode 100644 index 00000000..a37fa0f5 --- /dev/null +++ b/docs/log/2026-11-11-cce320f.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-11" +order: 10 +area: kernel +title: '`cce320f` (#229)' +prs: [229, 266] +--- +7.3.4. In place. Superseded by 7.3.5 11-17 (#266). diff --git a/docs/log/2026-11-12-02c58b9.md b/docs/log/2026-11-12-02c58b9.md new file mode 100644 index 00000000..00dab4f6 --- /dev/null +++ b/docs/log/2026-11-12-02c58b9.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-12" +order: 20 +area: image +title: '`02c58b9` (#235)' +prs: [235] +--- +bubblewrap, socat and ripgrep for agent sandboxes. In place. diff --git a/docs/log/2026-11-12-240.md b/docs/log/2026-11-12-240.md new file mode 100644 index 00000000..142074b2 --- /dev/null +++ b/docs/log/2026-11-12-240.md @@ -0,0 +1,24 @@ +--- +date: "2026-11-12" +days: 11-12/13 +order: 50 +area: image/kernel/boot probes +title: '#240 (`bc41f44`, `a8df865`, `28823fb`, `8fb1dd9`, `e5b8003`)' +prs: [240, 249, 255] +runs: [43303190733, 43308825692, 43312419007, 43321809471, 43327612594] +--- + +- Kernel patch 0005, each PCI capability list walked once: kernel 95.1 → 88.9 ms; ECAM accesses 1,032 → 680 (lab 43327612594). +- **logind back in the boot, and spin lingers:** first SSH login 570/626 → 510/525 (lab 43308825692, 10 boots). +- MOTD and pam_motd off: -7 ms per login, -12 on the first. +- `sshd@` waits for the host keys. Before this, SSH over vsock "worked not at all". +- New probes: `boot:waits`, `boot:jobs` (+ jobwatch, godbus), `boot:ssh-first` (+ vsockproxy), `boot:exits`, `boot:mmio`. + +Measured and not shipped: +- the getty without BindsTo: 342 vs 345 (lab 43303190733); +- keygen in the boot: 518 vs 514 (lab 43312419007); +- virtio-rng removed: -13.6 ms to the prompt (lab 43321809471), not done because it would move the fingerprint; +- `pci=noearly`: the guest does not boot; +- PID 1 spends ~25 ms in the BPF verifier. + +*Side effect:* v20261113.01's console prompt came 21-25% later (release notes). *Status:* patch 0005 and the exits/mmio/jobs probes were deleted in #249 (11-13). 0005 came back the same day (#255) and is in place. diff --git a/docs/log/2026-11-12-3c8da99.md b/docs/log/2026-11-12-3c8da99.md new file mode 100644 index 00000000..0bb87bdc --- /dev/null +++ b/docs/log/2026-11-12-3c8da99.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-12" +order: 40 +area: image +title: '`3c8da99` (#238)' +issues: [230] +prs: [238] +--- +The hot-add rule onlines CPUs only. udev's memory "online" write raced the kernel's `memhp_default_state=online` and logged EINVAL for every block. Closes #230. In place. diff --git a/docs/log/2026-11-12-c6c29b5-ec2c7fb-1666cb5.md b/docs/log/2026-11-12-c6c29b5-ec2c7fb-1666cb5.md new file mode 100644 index 00000000..65727b0f --- /dev/null +++ b/docs/log/2026-11-12-c6c29b5-ec2c7fb-1666cb5.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-12" +order: 30 +area: CI +title: '`c6c29b5` (#236), `ec2c7fb` (#237), `1666cb5` (#239)' +prs: [236, 237, 239, 309] +runs: [43157106109] +--- +A daily apk-lock refresh PR. *Why:* the lock broke three times (`6e7ba47`, `8d495c5`, release run 43157106109). The BuildKit cache moved to ghcr: on the fleet the gha cache read a store nobody wrote, so compat compiled cold on every run and failed on main 4 times from 11-09; both release attempts on 11-12 failed. In place. The daily apk-lock refresh was replaced by pinned builder images 11-20 (#309). diff --git a/docs/log/2026-11-12-e452afc-3a7864d.md b/docs/log/2026-11-12-e452afc-3a7864d.md new file mode 100644 index 00000000..25b7abca --- /dev/null +++ b/docs/log/2026-11-12-e452afc-3a7864d.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-12" +order: 10 +area: docs/image +title: '`e452afc` (#232), `3a7864d`' +prs: [232] +--- +A comment sweep: several comments still said a QEMU or kernel bump strands checkpoints, which has been false since `fa3041c`. Dead code deleted: `spin-machine-console.service`, the modprobe blacklist, and the getty@tty2-6 masks. In place. diff --git a/docs/log/2026-11-13-242-246.md b/docs/log/2026-11-13-242-246.md new file mode 100644 index 00000000..df0d133e --- /dev/null +++ b/docs/log/2026-11-13-242-246.md @@ -0,0 +1,13 @@ +--- +date: "2026-11-13" +order: 20 +area: boot probes/machine +title: '#242, #246 (both closed)' +prs: [242, 246] +runs: [43364516874, 43482829958, 43483852339] +--- +Restore measured, and a **mapped-ram** checkpoint layout proposed twice: +- #242 (draft): `--channels`; mapped-ram ×4 restore-to-login 394/410 vs stream 877/1888 (lab 43364516874). Those numbers were later declared contaminated by restored VMs leaking between repetitions. +- #246: mapped-ram put in `Spec.Contract`, which would move the fingerprint, plus `boot:score`. On the fleet, with every cold boot run before every restore: restore login 385/400 mapped-ram vs 386/399 stream (lab 43483852339); also lab 43482829958, 373/402 vs 376/416. Closed: "does not earn moving the fingerprint". A laptop lead of 188/358 vs 412/732 was called "a lead, not a finding". + +*Status:* rejected; #242 and #246 closed. diff --git a/docs/log/2026-11-13-249-250.md b/docs/log/2026-11-13-249-250.md new file mode 100644 index 00000000..31238974 --- /dev/null +++ b/docs/log/2026-11-13-249-250.md @@ -0,0 +1,13 @@ +--- +date: "2026-11-13" +order: 50 +area: boot probes +title: '#249, #250' +prs: [249] +--- +Removed: +- kernel patch 0005 ("6 ms of a ~470 ms first SSH login, for a local patch carried across every kernel bump"); +- the getty Type=simple drop-in ("nothing a workspace does waits for that prompt"); +- `boot:exits`, `boot:mmio`, `boot:jobs`/jobwatch/godbus. + +#250 also removes `boot:bench`, `boot:trace`, `boot:userspace`, `boot:systemd` and `boot:ssh-load`, keeping "a gate …, the release's report, the metric a workspace waits for (ssh-first), and one tool per layer". diff --git a/docs/log/2026-11-13-251-252-254.md b/docs/log/2026-11-13-251-252-254.md new file mode 100644 index 00000000..810698c8 --- /dev/null +++ b/docs/log/2026-11-13-251-252-254.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-13" +order: 60 +area: goal +title: '#251, #252, #254' +prs: [251] +--- +The goal is written down: a cold boot to the first SSH login in under 100 ms (AGENTS.md), with restore as the second number. The rules that held exploration back are removed (no init in a release, the fingerprint as an event to avoid, one default per experiment, the bench fleet alone deciding); hotplug and dynamic memory become an invariant that is never traded for boot time. diff --git a/docs/log/2026-11-13-255.md b/docs/log/2026-11-13-255.md new file mode 100644 index 00000000..a959c07f --- /dev/null +++ b/docs/log/2026-11-13-255.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-13" +order: 90 +area: kernel +title: '#255 (this change)' +prs: [255, 345, 352, 356] +runs: [43495583323, 43499868986, 43501992969, 43505126131, 43506390106, 43507472288] +--- +Where the kernel's ~100 ms goes on the bench fleet (boot:initcalls lab 43495583323): initcalls 52 (acpi_init 12, of which `acpi_pci_root_create`, bus 0's enumeration, 11.2 traced on a kernel without forced lockdown, lab 43499868986; inet_init 7.9, which is vmlinux BTF's first parse; the virtio probes ~17), before the first initcall ~15-20 (SPIN_EARLY, lab 43507472288; ~4 of it the probe's own 18 MB log buffer), SMP ~4, the root mount ~6. Kept: patch 0005 back, 0006 (BTF parsed in the background from a core_initcall), `CONFIG_DEFERRED_STRUCT_PAGE_INIT=y`: kernel 96.3 → 87.1 ms (lab 43505126131), first login 466 → 456 as built and 223 → 214 at the floor (lab 43501992969). `driver_async_probe` for rng, balloon and vsock on the command line: 214 → 209 at the floor (lab 43506390106). *Status:* 0005 in place; `driver_async_probe` deleted 11-20 (#352), 0006 11-20 (#345), `DEFERRED_STRUCT_PAGE_INIT` 11-21 (#356). diff --git a/docs/log/2026-11-13-3e8075f.md b/docs/log/2026-11-13-3e8075f.md new file mode 100644 index 00000000..bd08a70a --- /dev/null +++ b/docs/log/2026-11-13-3e8075f.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-13" +order: 40 +area: image +title: '`3e8075f` (#247 → #248)' +prs: [247] +runs: [43483372488] +--- +SSH host keys are made from the boot's first dispatch (wanted by sysinit.target, `DefaultDependencies=no`). First login 489/506 → 468/494; accept to login 177 → 154 (lab 43483372488). Rejected in the same run: masking two generators (489), and masking 11 always-failing units (484). Not released. Released in v20261113.03. diff --git a/docs/log/2026-11-13-43de41e.md b/docs/log/2026-11-13-43de41e.md new file mode 100644 index 00000000..b686f5ae --- /dev/null +++ b/docs/log/2026-11-13-43de41e.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-13" +order: 10 +area: image +title: '`43de41e` (#241)' +prs: [241, 249] +runs: [43361486792, 43362067503] +--- +serial-getty Type=simple. *Why:* with linger, `user@1000` runs inside the boot transaction, and Type=idle held the getty for 91.8 ms (lab 43361486792). 346/358 vs 423/441 (lab 43362067503); v20261112.01 was 344/353. Released in v20261113.02. *Status:* removed in #249 (11-13): nothing a workspace does waits for the console's prompt. diff --git a/docs/log/2026-11-13-branch-first-login-report.md b/docs/log/2026-11-13-branch-first-login-report.md new file mode 100644 index 00000000..c161772c --- /dev/null +++ b/docs/log/2026-11-13-branch-first-login-report.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-13" +order: 120 +area: boot/qemu +title: branch `first-login-report` (this change) +prs: [250] +runs: [43524334205, 43524721490] +--- +v20261113.03's report read +11-18% on every row: the report times the serial console's prompt, and the getty drop-in removed in #250 left it Type=idle, waiting for the lane's units. The first login it does not time went from 478/500 (v20261113.02, lab 43524334205) to 381/410 ms (v20261113.03, lab 43524721490), two runs and not interleaved. The report now logs into the release over SSH too (`first_login`), and compare writes it first. The QEMU build asserts static-pie, full RELRO, an NX stack and stack canaries, which come from QEMU's and Alpine's defaults and no flag here. Measured and left out: one sshd for every connection (the vsock socket with Accept=no, an `sshd -D` from the first dispatch), first login 382/393 against 381/410 and a second 40 against 48 ms (lab 43524721490). diff --git a/docs/log/2026-11-13-branch-floor-kernel.md b/docs/log/2026-11-13-branch-floor-kernel.md new file mode 100644 index 00000000..f32416da --- /dev/null +++ b/docs/log/2026-11-13-branch-floor-kernel.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-13" +order: 70 +area: boot probes +title: branch `floor-kernel` (experiment) +runs: [43492686353, 43493135230, 43494513791] +--- +The floor without systemd: PID 1 a script that mounts what sshd needs, makes an Ed25519 key and has socat hand vsock connections to `sshd -i`. First login 467 → 220 ms (lab 43492686353), 506 → 240 (lab 43493135230); guest uptime puts init at ~90 ms of kernel and the keys 10-20 ms later. What is left at the floor: QEMU and firmware ~44 ms (boot:firmware-stages, lab 43494513791: QEMU's own start 35.9, qboot ~8.5, of QEMU's start 7.9 copying vmlinux), kernel ~80-90, init ~20, the login ~44. `/proc/uptime` starts partway into the kernel, so it hides ~35 ms that an earlier reading charged to QEMU. diff --git a/docs/log/2026-11-13-branches-kernel-snapshot-qemu-snapshot.md b/docs/log/2026-11-13-branches-kernel-snapshot-qemu-snapshot.md new file mode 100644 index 00000000..aa5bea13 --- /dev/null +++ b/docs/log/2026-11-13-branches-kernel-snapshot-qemu-snapshot.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-13" +order: 110 +area: kernel/qemu +title: branches `kernel-snapshot`, `qemu-snapshot` (rejected) +runs: [43514550646, 43514884598] +--- +QEMU publishes bus 0's configuration space over fw_cfg after the firmware (etc/spin/pci-config) and the kernel answers boot-time configuration reads from it until each dword is written. It works (`PCI: configuration space of 5 devices on bus 0`) and is worth -14 ms against the same kernel without it (lab 43514550646), but only 2-3 ms against 0005, which already removes most repeated reads: 209/217 against 211/222 (lab 43514884598). Not worth a QEMU patch and a 250-line kernel patch. diff --git a/docs/log/2026-11-13-d895543-5e0cc2f.md b/docs/log/2026-11-13-d895543-5e0cc2f.md new file mode 100644 index 00000000..c6c4a4e3 --- /dev/null +++ b/docs/log/2026-11-13-d895543-5e0cc2f.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-13" +order: 30 +area: image +title: '`d895543` (#245), `5e0cc2f`' +prs: [245] +runs: [43463472762, 43479854381] +--- +sshd offers only `mlkem768x25519-sha256`. ML-KEM costs the same as curve25519: first login 461 for both; a second login 40 vs 39; OpenSSH 9.6 with sntrup761 took 489 first and 104 for a second (lab 43479854381, also 43463472762). `boot:ssh-first` logs in with x/crypto/ssh, and vsockproxy is removed. *Status:* merged 18:30Z. #245's own body said "Do not merge before the clients move": open-remote-ssh#8 merged at 18:57Z, and spin-stack/spin#1206 (the spin CLI refusing OpenSSH < 9.9) merged after its CI and KVM lanes passed. Not yet released. Released in v20261113.03. diff --git a/docs/log/2026-11-13-spin-stack-ci-14-15-spin-machine-253.md b/docs/log/2026-11-13-spin-stack-ci-14-15-spin-machine-253.md new file mode 100644 index 00000000..a3c695fe --- /dev/null +++ b/docs/log/2026-11-13-spin-stack-ci-14-15-spin-machine-253.md @@ -0,0 +1,7 @@ +--- +date: "2026-11-13" +order: 80 +area: CI +title: 'spin-stack/ci#14, #15, spin-machine#253' +--- +A `bench-metal` fleet (c8i.metal-48xl, then r7i.metal-24xl behind it) and lab.yml's `host` input. It has not run: metal spot scored 1-3 of 10 for placement and failed `UnfulfillableCapacity` in every zone; on-demand failed `VcpuLimitExceeded` at a quota of 96 vCPU. An increase to 288 was requested the same day (case open). *Status:* the fleet first ran 11-19 (spin-stack/ci#20; below). diff --git a/docs/log/2026-11-13-the-first-logins-lane.md b/docs/log/2026-11-13-the-first-logins-lane.md new file mode 100644 index 00000000..6558a2f3 --- /dev/null +++ b/docs/log/2026-11-13-the-first-logins-lane.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-13" +order: 100 +area: image +title: the first login's lane (this change) +runs: [43518915618] +--- +Where systemd's ~250 ms over the floor went, on the bench fleet: ~60 before sshd accepts (sysinit, udev, journald), ~105 in pam_systemd, and ~65 in a handshake competing for the CPU. logind answers a session of class `user` only once the user's manager has started, and orders its scope after `systemd-user-sessions` (systemd v259.9 source, `logind-session.c`). The vsock socket, `sshd@`, dbus, logind, `user-runtime-dir@` and `user@` without default dependencies, no `/run/nologin` at boot (pam_nologin refused the lane's first login: "Access denied for user spin by PAM account configuration"), sessions of class `user-early-light`, and udev's coldplug filtered to block, net, virtio, misc, input, rtc, ptp and ttyS0: first login 478 → 402 ms (lab 43518915618). Measured and left out: priority (`CPUWeight`, `Nice`) on the lane, −2 ms over the filter and a slower second login (63 vs 45 ms). diff --git a/docs/log/2026-11-13-udevs-coldplug-keeps-cpu.md b/docs/log/2026-11-13-udevs-coldplug-keeps-cpu.md new file mode 100644 index 00000000..6678d4ad --- /dev/null +++ b/docs/log/2026-11-13-udevs-coldplug-keeps-cpu.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-13" +order: 130 +area: image +title: udev's coldplug keeps cpu (this change) +runs: [43527839765] +--- +The coldplug filtered in `630fa2c` left out cpu, and a core attached before systemd starts is onlined by that replay reaching `40-spin-hotadd.rules` and by nothing else. spin gives a workspace its cores while its own init is PID 1, so with v20261113.03 every workspace came up with one core whatever it was sized to (spin's kvm run 43527839765, four tests "still waiting for the guest to have its floor's two cores"). `task boot:hotadd` attaches a core before systemd and reads `online` after: `0` on v20261113.03's image, `0-1` with cpu in the filter. What cpu costs the first login was not measured; it is one device per core. diff --git a/docs/log/2026-11-19-a-place-is-a-filter-node.md b/docs/log/2026-11-19-a-place-is-a-filter-node.md new file mode 100644 index 00000000..5a9da24d --- /dev/null +++ b/docs/log/2026-11-19-a-place-is-a-filter-node.md @@ -0,0 +1,7 @@ +--- +date: "2026-11-19" +order: 100 +area: machine +title: a place is a filter node (this change, functional) +--- +A place's node was raw over the bound disk's top image. spin's storage compacts a chain by rewriting a bound image's backing file (`change-backing-file`), which QEMU takes only on a root node whose chain, followed by backing and filter links, contains the image: on the root it answered "'slot0' and image file are not in the same chain", on the image "Need a root block node" (QEMU 11.2.0-rc0). A place is now a `throttle` node in a group with no limits: a filter, so the chain is seen through it, and pass-through. copy-on-read, compress and preallocate are filters too, and each changes what is written. Checked on QEMU 11.2.0-rc0: bind by `blockdev-reopen`, then `change-backing-file` through the place, then a seal under an overlay. The fingerprint does not move (`-object` is not in `Contract`). Its cost per I/O is the bench's to say. diff --git a/docs/log/2026-11-19-boot-restore-first.md b/docs/log/2026-11-19-boot-restore-first.md new file mode 100644 index 00000000..18ae5334 --- /dev/null +++ b/docs/log/2026-11-19-boot-restore-first.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-19" +order: 20 +area: boot +title: '`boot:restore-first` (this change)' +prs: [246] +runs: [44533227886, 44535167653] +--- +The goal's second number had had no probe in the tree since #246 closed. Every row of `boot:ssh-first` is booted cold, logged into and saved, then restored with its state evicted from the page cache (checked with mincore) and logged into again. Every cold boot runs before every restore. On the bench fleet a restore reaches the first login at 841/913 ms, ~790 of it before the guest runs, reading the state from the runner's gp3 volume (44533227886). #246 read 386 ms on 11-13. What moved is not known. On a c8i.metal-48xl it is 905/942 (44535167653), so the restore is the host's disk, not the virtualization. diff --git a/docs/log/2026-11-19-branch-kernel-floor-patches-0007-0011-and-a.md b/docs/log/2026-11-19-branch-kernel-floor-patches-0007-0011-and-a.md new file mode 100644 index 00000000..085be90b --- /dev/null +++ b/docs/log/2026-11-19-branch-kernel-floor-patches-0007-0011-and-a.md @@ -0,0 +1,18 @@ +--- +date: "2026-11-19" +order: 110 +area: kernel +title: branch `kernel-floor`, patches 0007-0011 and a config trim (this change) +prs: [291, 345] +runs: [44563496308, 44563512999, 44587603255] +--- +The kernel was 78.0 ms nested against 45.0 on metal, same CPU (boot:initcalls, labs 44563496308, 44563512999). Five of its gaps, each a patch: +- 0007, ORC's lookup table by one merge pass instead of 59,650 binary searches: 3.5 ms on both hosts. Every block checked against the binary search, 0 differ. +- 0008, init's 1,989 ftrace records freed with one memmove: 2.6 ms on both hosts. +- 0009, the boot CPU polls for an AP by `local_clock()` while booting: 4.1 ms nested, under 1.4 on metal. +- 0010, no early-quirks PCI scan under KVM: 2.1 ms nested. pci=noearly also defers MMCONFIG; this skips only the scan. +- 0011, virtio-pci's `queue_select` written only when the queue changes: 84 → 22 writes. + +Config: `X86_MSR`, `X86_CPUID` off (nothing in the image or spin opens `/dev/cpu`); `BLK_DEV_LOOP_MIN_COUNT=0` and `SERIAL_8250_RUNTIME_UARTS=1` (from `kernel-trim`). *Measured:* only on a laptop, not nested, 10 boots each interleaved, a lead: the ORC gap 4.59 → 0.93 and 4.45 → 0.72, the WAET gap 0.44 → 0.07 and 0.32 → 0.06, the ftrace gap 2.7 → under 1.1 ms. 0009 and 0011 cannot move there: the AP never waits and exits are cheap. The kernel's total read 61.5 → 55.7 in one run and 53.0 → 54.3 in the other on a host building QEMU at the time: noise. Not yet measured on the bench fleet or against the first login. + +Bench, nested, workspace shape (2026-11-19, lab 44587603255, 20 boots each): kernel start to "Freeing" 96.4 → 86.6 ms (−9.8), in initcalls 61.7 → 58.7, outside them 35.1 → 27.8, where ORC and ftrace are. `virtio_pci_driver_init` 8.57 → 8.59: 0011 does not show even nested. *Status:* merged 11-19 (#291); 0009 and 0011 deleted 11-20 (#345); 0007, 0008, 0010 and the config trim in place. diff --git a/docs/log/2026-11-19-nested-against-metal.md b/docs/log/2026-11-19-nested-against-metal.md new file mode 100644 index 00000000..fdb40ae8 --- /dev/null +++ b/docs/log/2026-11-19-nested-against-metal.md @@ -0,0 +1,12 @@ +--- +date: "2026-11-19" +order: 30 +area: lab +title: nested against metal +runs: [44534028478, 44535156851, 44535161371, 44537498507] +--- +`bench-metal` ran for the first time (spin-stack/ci#20 keeps it to c8i.metal-48xl, on-demand when spot has none; spin-machine#272 caps the job at 60 minutes). The same CPU (Xeon 6975P-C) on both, p50: +- first login: 378-392 ms nested (two runs) against 332 metal (44537498507), so **nesting costs ~50-60 ms**; +- `boot:firmware-stages`: QEMU start 30.5 against 28.1, the PCI walk 5.00 against 2.22 (173 exits, ~29 against 13 µs each), kernel and init 108.7 against 69.5 (44535161371, 44535156851). + +An r7i.metal-24xl (Sapphire Rapids, slower per core) read 296 ms (44534028478), faster than the c8i.metal. Unexplained. Repeat it before quoting it. Every bench-fleet number in this log and in docs/boot-time.md is nested. diff --git a/docs/log/2026-11-19-one-rule-for-where-a-checkpoint-resumes-canresume.md b/docs/log/2026-11-19-one-rule-for-where-a-checkpoint-resumes-canresume.md new file mode 100644 index 00000000..b0b4c3b5 --- /dev/null +++ b/docs/log/2026-11-19-one-rule-for-where-a-checkpoint-resumes-canresume.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-19" +order: 90 +area: machine +title: 'one rule for where a checkpoint resumes: `CanResume(Saved, Target)` (this change, functional)' +prs: [293] +--- +After #293 a checkpoint recorded its format and CPU, but the machine it was of was still spin's `machine_identity` string, and nothing recorded the QEMU that wrote it: QEMU loads what an older QEMU of the same machine type wrote and promises nothing the other way, so during a rolling update a checkpoint from an updated host could be placed on one not yet updated with an identical fingerprint (spin-stack/spin#1348). `Saved` now carries `Fingerprint` and `VMM` ("qemu 11.1.90"), a machine says what it resumes (`VM.Target`: formats, fingerprint, VMM, CPU), and `CanResume` is the one rule a placement and `Resume` both ask: the format read, the same fingerprint, the same VMM at the writer's version or newer, the CPU shown again. `Args` names the machine by its fingerprint (`-name guest=spin-machine:`, read back with `query-name`), which the guest does not see and `Contract` does not hash. Records from before a field was kept are not checked on it. diff --git a/docs/log/2026-11-19-one-surface-for-spin-machine-vm-every-machine.md b/docs/log/2026-11-19-one-surface-for-spin-machine-vm-every-machine.md new file mode 100644 index 00000000..8b26ce93 --- /dev/null +++ b/docs/log/2026-11-19-one-surface-for-spin-machine-vm-every-machine.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-19" +order: 80 +area: machine +title: 'one surface for spin: `machine.VM`, every machine started held (this change)' +prs: [293] +runs: [44573266140] +--- +spin built a `Spec`, exec'd `Args()` and drove QMP with a client of its own, so what a checkpoint is (the migration capabilities both ends must agree on), how a disk reaches a device, and the `-S` before a CPU plug lived in spin. Now `machine.VM` (QEMU's: `machine.Attach`) is that conversation: `Boot`, `Resume` with `Load{Fast}`, `Loaded`, `Checkpoint` with a seal at pre-switchover, `Continue`, `AttachDisk`/`DetachDisk`, `SetCPUs`, `SetMemory`, `CPU`. An interface on purpose, so another VMM can be put behind it and compared. Every machine starts held, `-S` or `-incoming defer` (`Spec.Restore`): under `-incoming defer`, `cont` leaves QEMU in `inmigrate` (11.2.0-rc0), so one QEMU cannot wait for both. A disk is bound to its place (`Spec.Disks`, a raw node over an empty `null-co`) by serial, `blockdev-reopen` onto the chain handed over `add-fd`: the device's serial and read-only-ness are fixed at realize, and QEMU 11.2 has no `blockdev-replace`, so the raw node stays and a seal targets `machine.TopNode`. The prestart prototype measured it on the bench fleet: cold first login 313→291, restore 170→153 ms (lab 44573266140). Checkpoints are written in mapped-ram (`FormatMappedRAM`, recorded in `Saved`); a stream checkpoint from before still loads, in full (`boot:compat`). The host CPU's model name left the fingerprint: a checkpoint records the CPU its guest was shown and `CanResume` checks it (spin#1348). Fast load needs userfaultfd for QEMU's user and was not run here: an unprivileged QEMU refuses postcopy ("Userfaultfd not available"). *Status:* PR, measured on the bench fleet with `boot:restore-first` (`SPIN_RESTORE_FAST=1`) and `boot:prestart`. Merged 11-19 (#293). diff --git a/docs/log/2026-11-19-systemd-from-ubuntus-source-package-stage1.md b/docs/log/2026-11-19-systemd-from-ubuntus-source-package-stage1.md new file mode 100644 index 00000000..06cd6e7e --- /dev/null +++ b/docs/log/2026-11-19-systemd-from-ubuntus-source-package-stage1.md @@ -0,0 +1,17 @@ +--- +date: "2026-11-19" +order: 10 +area: image +title: systemd from Ubuntu's source package, stage1 (this change) +issues: [261] +prs: [240] +runs: [44531842773, 44533227886, 44537549305, 44538877783] +--- +The image installs Ubuntu's own systemd 259.9-0ubuntu0.1, rebuilt from its .dsc (versions.yaml `systemd-source`) by `image/systemd/Dockerfile`. The build uses Debian's `stage1` build profile (no BPF framework, audit, AppArmor, SELinux, OpenSSL, TPM2, homed, cryptsetup…) and links systemd-executor, udevd, systemctl and journalctl statically against libsystemd-shared. The packages are versioned `+spin1` and held. *Why:* PID 1 spent ~25 ms in the BPF verifier on socket-bind at every boot (#240, "measured, nothing done"), and restrict-fs failed to load under lockdown on every boot (#261). *Measured:* +- `boot:ssh-first` on the bench fleet, 20 boots of each, interleaved, first login p50 against the archive's systemd: + - stage1: −47 (lab 44531842773), −38 (44537549305) and −47 ms (44538877783); + - static over stage1: −10 and −1 ms, within noise. Accept to login was −7 ms in both runs. +- `boot:waits` on a laptop: PID 1's setup before the generators goes from 25.8 to 5.6 ms. +- `boot:restore-first` (new, below): unchanged. The guest's part, from running to login, is ~50 ms with either systemd (44533227886). + +*Left out:* masking `systemd-udev-load-credentials` (−8, −6 ms) and `-Db_lto=true` (Ubuntu already builds with `-flto=auto`); see docs/boot-time.md, "Measured and rejected". The patch that would make restrict-fs load under lockdown, reading `s_magic` through BTF, loaded in this guest. It is for systemd upstream and is not needed here. *Cost:* a rebuild whenever Ubuntu publishes a systemd. The archive serves only the current source, so the build fails the day it moves, and `refresh:systemd` proposes the move. diff --git a/docs/log/2026-11-19-the-kernel-is-entered-as-a-bzimage.md b/docs/log/2026-11-19-the-kernel-is-entered-as-a-bzimage.md new file mode 100644 index 00000000..60bbfc67 --- /dev/null +++ b/docs/log/2026-11-19-the-kernel-is-entered-as-a-bzimage.md @@ -0,0 +1,10 @@ +--- +date: "2026-11-19" +order: 70 +area: kernel/qemu/machine +title: 'the kernel is entered as a bzImage (this change, functional: security)' +runs: [44577696958, 44583379559] +--- +KASLR was inactive under PVH. The PVH entry into `vmlinux` skips `arch/x86/boot/compressed`, where KASLR picks the random base and sets `KASLR_FLAG`, so `CONFIG_RANDOMIZE_BASE` and `RANDOMIZE_MEMORY` did nothing: every PVH boot had `_text` at `ffffffff81000000`. The machine now boots `kernel/bzImage` (LZ4, as the config already had: x86 has no `KERNEL_UNCOMPRESSED`), which qboot loads from fw_cfg itself (`boot_from_fwcfg`); `linuxboot_dma.bin`, the ROM QEMU adds for a bzImage and SeaBIOS runs, ships again. `vmlinux` and `pvh.bin` stay, for `--kernel vmlinux`, debugging and BTF. A tree without a bzImage (every release before this one) still boots its `vmlinux`, which boot:compat needs. Two builds, the second on a fresh BuildKit with no cache, gave the same bzImage (`ff9f0ec6…`) and vmlinux (`ff53d597…`). *Checked:* `boot:lockdown` now requires `_text` present and not `ffffffff81000000`, and no `nokaslr`; it fails on the PVH tree. Three bzImage boots: `_text` `ffffffffb5c00000`, `ffffffffa2a00000`, `ffffffff90800000`, the physical base moving too (`/proc/iomem`); the PVH `vmlinux`, three times `ffffffff81000000`. The fingerprint does not move (`2bd7da6b…` either way) and `boot:roms` passes: on q35 an option ROM is a fw_cfg file, not a RAM block. *Cost on a laptop (i9-13900HK), a lead only that the bench fleet decides:* `boot:firmware-stages` REPS=5, QEMU exec to the diagnostic init 105.6 vs 83.6 ms p50 summed (qboot copying the bzImage 2.3 ms; the rest the decompressor and the kernel after it); kernel start to init over 10 boots 34-92 ms, p50 ~51, against 34-37 for PVH, so the spread is the bzImage's and not yet explained. `boot:ssh-first` alternated A/B/A/B/A/B at REPS=5: first login 500/658/603 vs 504/587/764 ms p50. The laptop's noise is larger than the difference. Kept whatever the bench fleet says: it is a security fix, and what it costs is the next thing to make cheaper. + +Bench, nested (2026-11-19): it costs nothing measurable. `boot:initcalls` in the workspace shape, kernel start to "Freeing" 94.5 → 93.9 ms (lab 44577696958): the laptop's 34-92 ms spread did not reproduce. `boot:ssh-first` against the PVH release, sshd accepts 199 → 198 ms and first login 328 → 317 (lab 44583379559, 20 each); the login gain is in accept-to-login and is main's, not the bzImage's. The LZ4 decompression and the fw_cfg load do not show. diff --git a/docs/log/2026-11-19-the-probes-become-spin-machine-dev-lab.md b/docs/log/2026-11-19-the-probes-become-spin-machine-dev-lab.md new file mode 100644 index 00000000..bcebc7cb --- /dev/null +++ b/docs/log/2026-11-19-the-probes-become-spin-machine-dev-lab.md @@ -0,0 +1,15 @@ +--- +date: "2026-11-19" +order: 120 +area: lab +title: the probes become `spin-machine-dev lab` (branch `dev-cli-lab`, this change) +runs: [44546329726, 44555905383, 44584214362, 44585268429, 44587254371, 44596065601, 44596983249] +--- +Each probe was a Go test behind a `SPIN_*` switch of its own, and took a second kernel, a second QEMU, an edit of the image or a rebuilt systemd each through another environment variable (`SPIN_KERNEL_B`, `SPIN_KERNEL_C`, `SPIN_MACHINE_OUTPUT_B`, `SPIN_APPEND_B`, `SPIN_SYSTEMD_DEBS`), laid out by lab.yml's `variant=beside|instead`. Two failures in one day came from that shape: `boot:restore-first` read no `SPIN_MACHINE_OUTPUT_B` and measured the release's QEMU under the name of 11.2's (lab 44584214362), and a Kernel run from before the bzImage failed `lab:place` with no message (lab 44587254371). Now a tree is a whole machine with a manifest naming every part's source, refused when it is not whole, and a probe is handed trees (`internal/lab`, docs/cli.md). Ported: `ssh-first`, `restore-first` (its `fast` rows an option), `prestart`, `initcalls` (totals, the initcalls of interest per tree, each tree's slowest initcalls and largest gaps). The "as this branch" row is the tree edit `lane`. Not ported, and kept as `boot:` targets `lab check` runs on any tree: `firmware-stages`, `waits`. Deleted, each question answered and its answer in this log or beside it: +- `boot:login-lane` (`boot/login_lane_test.go`): where the first login's own time goes, on the guest's clock. See the 11-19 entry above and docs/boot-time.md's cold-boot budget, lab 44555905383. +- `boot:density` (`boot/density_test.go`): one idle workspace's host memory, ~125 MiB (lab 44546329726). +- `boot:page-cache` (`boot/pagecache_test.go`): the page caches a machine has. See docs/memory-and-disk.md and docs/boot-time.md's "Measured and rejected". +- initcalls' extra passes, not ported: `SPIN_GRAPH` (function_graph under chosen functions, `boot/graph_test.go`), `SPIN_CPU_SHARE` (who had the CPU during one initcall, `boot/cpushare_test.go`), `SPIN_EARLY` (the lines before the first initcall) and `SPIN_FORMAT_CHECK` (an event's format after patch 0003). Each served one question, answered above. When another asks for one, it comes back from git (`boot/initcalls_test.go` and those two files before this change) as an option of the `initcalls` probe. +- `boot:ssh-first`, `boot:restore-first`, `boot:prestart`, `boot:initcalls` are now lab runs over `OUTPUT_DIR`, the same targets. + +Checked against the probe it replaced on the bench fleet, `lab dispatch ssh-first`, the release and the release with the lane, 20 each (lab 44596983249): sshd accepts 215/228 and 216/229, first login 349/366 and 339/353. The old probe's rows read 215/223 and 216/223, 348/360 and 335/345 (lab 44585268429). A release ships no spin-machine. The old targets' `:tools` built this checkout's into the release tree, and a tree does the same, named in its manifest (the first dispatch, 44596065601, failed on it). diff --git a/docs/log/2026-11-19-the-release-report-is-a-ladder.md b/docs/log/2026-11-19-the-release-report-is-a-ladder.md new file mode 100644 index 00000000..21ba8e4d --- /dev/null +++ b/docs/log/2026-11-19-the-release-report-is-a-ladder.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-19" +order: 130 +area: lab +title: the release report is a ladder (this change) +prs: [314] +runs: [44583379559] +--- +The report measured each release alone, through the feature matrix (eight combinations of memory, vsock and hotplug, and the image's boot variants, each timed to the serial console's prompt), and compared its report.json with the previous release's, taken on another day on another instance. For v20261119.02 it said sshd accepted 7.3% later than v20261119.01 (202.6 → 217.3 ms); the two interleaved on one host said 199 → 198 (lab 44583379559). And the goal's second number, a restore to the first login, was not in it. Now `spin-machine-dev lab ladder` boots the newest five releases on one bench host, each with the spin-machine of its own commit, interleaved: a cold boot and a restore to the first login, both into a QEMU started ahead, and save, state, the kernel and QEMU's RSS as diagnostics. report.yml runs it after each release (ladder.json beside it, the table in its notes) and weekly. A release whose spin-machine cannot run a probe is a dash with the reason. boot:compat is now `lab compat`: every release since the fingerprint last moved, fetched against its sha256 and signature, and CanResume held to QEMU's one-way promise against each one's QEMU. The feature matrix is deleted: its last answer is v20261119.02's report.json asset and the "Feature matrix" section of its notes (no row moved beyond 5%, every row 344-389 ms usable), and git has the code (boot/report.go, boot/report_test.go). *Status:* the report measures each release alone since 11-20 (#314); `lab ladder` and `lab compat` in place. diff --git a/docs/log/2026-11-19-the-root-mounts-storage-path.md b/docs/log/2026-11-19-the-root-mounts-storage-path.md new file mode 100644 index 00000000..9e828900 --- /dev/null +++ b/docs/log/2026-11-19-the-root-mounts-storage-path.md @@ -0,0 +1,13 @@ +--- +date: "2026-11-19" +order: 60 +area: image/machine +title: the root mount's storage path (branch `ext4-mount`, not yet on the fleet) +prs: [286] +--- +The kernel gap `security_initcall_late_sync` → `EXT4-fs (vda): mounted` was 6.8 ms nested and 5.0 metal (`boot:initcalls`). Three changes, from reading Linux 7.3 and the image: +- the image without `orphan_file`, a mke2fs.conf default since 1.47.0: every mount, read-only included, reads it one block at a time (`ext4_init_orphan_info`, ~73 single-block reads with no readahead). Crash correctness is the classic orphan list's; +- `lazy_itable_init=0`: `mke2fs -d` left no group `ITABLE_ZEROED`, so each overlay's first read-write mount had `ext4lazyinit` zero every inode table in the first second of the boot. After one `--init /bin/sh` boot the overlay held 16.06 MiB of zero clusters, and none with the tables zeroed at build. The thread still starts, to prefetch block bitmaps (it does not with `no_prefetch_block_bitmaps`). The image is 256 KiB smaller; +- `rootfstype=ext4`: without it the root mount tries ext3, then ext2 (`EXT4_USE_FOR_EXT2`), on the superblock before ext4. + +Laptop lead only, on a host at load ~30: the gap's p50 over three alternated rounds of `TestKernelInitcalls` (8-10 boots each) was 8.8/2.8/4.3 ms with the release, 4.1/3.2/2.9 with `rootfstype` alone, and under 2.4 (below the rows printed)/1.3/1.2 with all three. Not decided until `boot:ssh-first` and `boot:restore-first` run interleaved on the bench fleet. *Status:* merged 11-19 (#286) and in place; `rootfstype` and `^orphan_file` are still leads, not measured on the bench (docs/boot-time.md, "What the machine carries"). diff --git a/docs/log/2026-11-19-where-pid-1s-gap-between-the-unit-load.md b/docs/log/2026-11-19-where-pid-1s-gap-between-the-unit-load.md new file mode 100644 index 00000000..15cbdd49 --- /dev/null +++ b/docs/log/2026-11-19-where-pid-1s-gap-between-the-unit-load.md @@ -0,0 +1,14 @@ +--- +date: "2026-11-19" +order: 50 +area: systemd/boot +title: where PID 1's gap between the unit load and the first job goes (experiment, tooling kept) +runs: [44561762624] +--- +`image/systemd/experiments/pid1-marks.patch` makes PID 1 append its monotonic clock, its own CPU time, the units loaded and the time in `unit_load` after each step of `manager_startup` and `do_queue_default_job` to `/run/spin-pid1-marks`. `boot:waits` reads the file. `lab.yml`'s `systemd_experiment` builds the patched systemd on the runner and puts it into each overlay. Bench fleet, 10 boots (lab 44561762624), p50 ms: +- bus, varlink, coldplug, vacuum, ready: < 0.2 together; +- **loading what `default.target` reaches: 28.4 wall, 20.9 of it PID 1's CPU, 192 units** (~0.11 ms of CPU each; the rest is likely cold reads); +- building the transaction: 0.30; +- the first dispatch: 0.87. + +The gap is unit loading, not the transaction that 11-13's single debug-logged boot named. 96 of the units a boot lists are inactive, loaded because another unit names them in `After=`/`Wants=`: `initrd-*`, `plymouth-*`, `modprobe@*`, hibernate, cryptsetup's targets, `firewalld` and `auditd` named by docker. Masking does not spare a load (a masked unit is still looked up and loaded as masked), which is why masking 11 units moved nothing (docs/boot-time.md, "Measured and rejected"). diff --git a/docs/log/2026-11-19-where-the-first-logins-own-time-goes-and.md b/docs/log/2026-11-19-where-the-first-logins-own-time-goes-and.md new file mode 100644 index 00000000..2cef426a --- /dev/null +++ b/docs/log/2026-11-19-where-the-first-logins-own-time-goes-and.md @@ -0,0 +1,17 @@ +--- +date: "2026-11-19" +order: 40 +area: boot/image +title: where the first login's own time goes, and logind's socket early (this change) +runs: [44555905383, 44557162195, 44557605832, 44558035927, 44558053261] +--- +`boot:login-lane` marks the guest's journal through the first login: accept → authenticated 55.5, PAM's session → logind's new session 29.0, → scope 4.3, → command 8.4 ms (v20261119.01, lab 44555905383). Its diagnostic rows (`SPIN_LANE_DIAG`, sshd at DEBUG1 and logind at debug, lab 44557162195) say what they are: +- **Before authentication.** PID 1 starting `sshd@` takes ~11 ms, and OpenSSH 10's three execs (`sshd` → `sshd-session` → `sshd-auth`) ~12. Loading PAM's modules cold takes 8.3 ms, against 0.9 at the second login. ML-KEM is 3.5. +- **The hop to logind** is logind not running yet. Its Varlink socket kept its default dependencies, so logind waited behind `sysinit.target` and udevd, ready ~230 ms into the boot (`boot:waits TARGET=systemd-logind.service`, lab 44557605832). The first login waited ~32 ms for it, the second 1. + +The socket without default dependencies (`systemd-logind-varlink.socket.d/20-lane.conf`), 20 boots of each (labs 44558035927, 44558053261): +- the hop: 24.5/41.8 → 15.8/22.7; +- accept to login: 131/137 → 120/128; +- the first login: 332/355 → 328/337. The p50 moves little because logind starting sooner takes the CPU sshd was starting on. + +Masking `modprobe@drm`, which logind is ordered after, added nothing (327/345). What is left of the login is CPU contention on 2 vCPUs, `user@1000` (38 ms) and the host key generation (21 ms) starting in the same window, rather than waits. diff --git a/docs/log/2026-11-20-a-checkpoints-memory-moves-on-8-channels-by.md b/docs/log/2026-11-20-a-checkpoints-memory-moves-on-8-channels-by.md new file mode 100644 index 00000000..77aa3f31 --- /dev/null +++ b/docs/log/2026-11-20-a-checkpoints-memory-moves-on-8-channels-by.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-20" +order: 50 +area: machine/lab +title: a checkpoint's memory moves on 8 channels by default (this change, lab 44792429636) +runs: [44789688221, 44792429636] +--- +One restore at a time, 16 channels were best in spin's shape (92.7 against 103 at 8, lab 44789688221), but each channel is a thread of QEMU's and restores share a host. `lab` probe `restore-together` lets 1, 4 and 8 restores go at once, each from its own checkpoint into its own QEMU started ahead, evicted from the page cache. On the bench (spin's shape and login, 30 bursts, first logins pooled; the pooled interval is narrower than the truth, since restores in one burst are not independent): alone 152 / 100 / 90.2 ms at 1 / 8 / 16 channels; 4 at once 184 / 140 / 143; 8 at once 400 / 329 / 337. Against 8, 16 gains −10.1 [−12.2, −7.6] alone and loses +3.2 [+1.1, +5.8] at 4 at once (+10.9 [−4.7, +30.4] at 8). The rule set before the run picked 8: it gains on 1 at every count. `machine.DefaultChannels` is 8. A Save or Load that names a count, and `spin-machine save/restore --channels`, still choose any. A fast load or a stream state stays at one thread. The release record's restore numbers measure each release at its own default, so this release's Δ against the one before it is the change. Eight restores at once take ~330-400 ms whatever the count: what a host does with a burst is its own question. *Status:* kept. diff --git a/docs/log/2026-11-20-a-named-cpu-model-what-it-costs.md b/docs/log/2026-11-20-a-named-cpu-model-what-it-costs.md new file mode 100644 index 00000000..0095973f --- /dev/null +++ b/docs/log/2026-11-20-a-named-cpu-model-what-it-costs.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-20" +order: 10 +area: machine +title: a named CPU model, what it costs (#222) +issues: [222] +runs: [44657973748, 44664362024, 44664603720] +--- +spin-machine can show the guest a named model the fleet shares (`CanResume`, `Models`, `Baseline`, #293). The question left was its cost. The bench host is nested, and its L0 hides features the Xeon 6 has (la57, TSX, fsrm): QEMU refuses GraniteRapids-v1, SapphireRapids-v1 and Icelake-Server-v2 there ("Host doesn't support requested features", lab 44657973748, cancelled after 50 minutes of boots each waiting out its login; `lab` now refuses such a tree at its first boot). The newest model it runs, chosen on the runner (`lab tree --cpu baseline`), is Cascadelake-Server-v5. Against `-cpu host`, 20 boots each, interleaved: the cold boot's first login 327/342 → 343/353 ms (+16.4, sshd accepts +12.6; lab 44664362024); the restore's 160/170 → 161/170 evicted and 167/188 → 165/203 cached (lab 44664603720). A fleet that takes a baseline model pays ~16 ms on every cold boot for checkpoints that cross host generations. On one generation `-cpu host` with `CanResume`'s feature check is free. diff --git a/docs/log/2026-11-20-density-the-latency-half.md b/docs/log/2026-11-20-density-the-latency-half.md new file mode 100644 index 00000000..5c556a5e --- /dev/null +++ b/docs/log/2026-11-20-density-the-latency-half.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-20" +order: 20 +area: lab +title: density, the latency half (#273) +issues: [273] +runs: [44665519945, 44667235868] +--- +#278 answered the memory half (an idle workspace costs its host ~165-170 MiB). `lab` probe `density` boots the row's number of workspaces, logs into each, lets them settle 10 s, times one more's first login, and ends them all before the next measurement. On the bench (c8id.4xlarge, 16 vCPUs, 32 GiB, nested), 2 vCPU / 2 GiB workspaces, idle, 10 of each interleaved: with 0, 4, 8 and 16 already running the first login is 332/343, 328/340, 328/345 and 326/338 ms (lab 44667235868). Each of the crowd took ~625 ms to boot and log into. Idle workspaces do not move the first number up to 16 on this host. The 25% point is past that. Not measured yet: a CPU-bound crowd (`load=cpu`), more than 16, and metal. A first run left every crowd up until the experiment ended (m.Cleanup runs then) and measured a host carrying a growing pile of machines (lab 44665519945); the probe ends its crowd itself. diff --git a/docs/log/2026-11-20-each-releases-numbers-in-the-repository-measured-alone.md b/docs/log/2026-11-20-each-releases-numbers-in-the-repository-measured-alone.md new file mode 100644 index 00000000..38952643 --- /dev/null +++ b/docs/log/2026-11-20-each-releases-numbers-in-the-repository-measured-alone.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-20" +order: 80 +area: lab +title: each release's numbers in the repository, measured alone (this change) +runs: [44583379559, 44600043625, 44641240861, 44727451080] +--- +The ladder (11-19) made every release re-measure the newest five on the bench (~13 min of the `report` job), uploaded a 31 MB ladder.json as a release asset and ended the release's notes with a table: numbers no one could share or read back but by downloading the asset, and the same five releases booted again with every release. Now the `report` job measures the release alone (`spin-machine-dev releases measure`, a ladder of one), keeps its p50/p95s as `docs/releases/RELEASE.json` with its host, date and run (whose artifact keeps every sample, 90 days), writes `docs/releases.md` from every record (a Mermaid chart of each goal number release by release, the tables, where each was measured), and proposes both as a pull request as the release app. It boots one release where it booted five, and nothing goes on the release. *Why alone, not beside the release before:* every record is then read the same way, one run each, and the page says plainly what that costs: the 11-19 report said v20261119.02 accepted SSH 7.3% later than v20261119.01, and the two interleaved said they did not (labs 44583379559, 44600043625), so a Δ on the page is a lead and a decision is `lab ladder` over the two, interleaved. `releases compare A B` prints two records with each one's host and date, and that command. Past releases are `releases missing`, measured by `report.yml` dispatched with `versions` (each alone, one after another, proposed together). Seeded from the two ladder.json assets there were, taking only each one's newest release, the one that run was for: v20261120.01 (cold 327/337, restore 159/164, run 44641240861) and v20261120.02 (cold 323/329, restore 168/180, run 44727451080); the older releases inside them were measured interleaved, and are left for `releases measure`. `lab publish` and the release-notes section are deleted. diff --git a/docs/log/2026-11-20-initcalls-and-density-size-their-guests.md b/docs/log/2026-11-20-initcalls-and-density-size-their-guests.md new file mode 100644 index 00000000..4bc2cb35 --- /dev/null +++ b/docs/log/2026-11-20-initcalls-and-density-size-their-guests.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-20" +order: 130 +area: lab +title: initcalls and density size their guests (this change) +runs: [44735598126, 44800662338, 44805222647] +--- +v20261120.03's release report failed on a diagnostic: `initcalls` lost 3 of 40 boots, and the report of 63049ff 4 of 40, each `never saw "SPIN-DMESG-END" in 1m30s` with an empty console tail (report runs 44800662338, 44805222647). ssh-first and the restores lost none in either, and initcalls lost none in the 2-vCPU, 2 GiB shape (44735598126). `plugged=2048` became every probe's default, but only ssh-first, restore-first, prestart and restore-together called `Plug`: initcalls and density booted spin's shape and left it at 128 MiB, while the record said "sized to 2048 MiB". Such a guest had 6 MiB of its 72 free, and had already stalled on memory, when the dump ran (laptop, 3 boots; sized, 1.9 GiB free and no stall), so the bench's loss reads as a guest at the edge of its memory. That is a lead: the laptop lost none of 20 at 128 MiB, and the tail that would say so was empty because `readUntil` returned nothing on a timeout, which it now does not. Both probes now plug as the others do, and a test holds that every probe taking `plugged` needs `memory --to`. initcalls' numbers are now of the kernel booting while virtio-mem plugs, which is what spin's kernel does, so its record moves with this: "Freeing" read 43.1/50.2 sized against 33.6/212 unsized (laptop, 20 each, two runs apart: a lead, not a Δ). *Decided by:* 0 lost in 40+ bench boots (the dispatch on the PR). diff --git a/docs/log/2026-11-20-multifd-channels-on-the-checkpoint-the-no-systemd.md b/docs/log/2026-11-20-multifd-channels-on-the-checkpoint-the-no-systemd.md new file mode 100644 index 00000000..410866d1 --- /dev/null +++ b/docs/log/2026-11-20-multifd-channels-on-the-checkpoint-the-no-systemd.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-20" +order: 30 +area: lab/machine +title: multifd channels on the checkpoint, the no-systemd floor, and spin's shape (#320, lab 44750713447, lab 44750322384) +prs: [319, 320, 332] +runs: [44750322384, 44750713447, 44784196287, 44788801555, 44789688221] +--- +The two experiments of the methodology review, and the first runs in spin's shape (#319). *multifd:* `spin-machine save` and `restore` move a checkpoint's memory over `--channels` threads (QEMU's multifd on mapped-ram); with QEMU started ahead, in the ladder's shape, the restore's first login reads 140.9/152.0 at one channel, 140.5/178.0 at two (inside the noise), 101.5/117.4 at eight and 93.5/114.9 at sixteen, Δp50 −47.4 [−54.4, −39.4]: the first goal number under 100 ms. In spin's shape the p50 falls 149 → 114 but ~20% of restores with channels (56 of 280) stall ~400 ms between running and the login, against 5% at one, and the p95 goes 254 → 435. *Floor:* `lab tree --edit floor` boots sshd with no systemd before it, a bound only: the ladder's shape 322 → 219 (Δ −103.5 [−108.6, −100.5]), spin's 445 → 240 (Δ −204.8); sshd accepts at 173 and 189 ms with nothing before it. *Spin's shape:* the cold first login is 445 ms against 322, Δ +122.9 [+116.6, +129.8]; accept to login 214 against 114. *Later the same day:* the stall was a guest left at 128 MiB. At 128 MiB MGLRU's `min_ttl_ms` (armed by tmpfiles at boot) forbids eviction for the first second, so the guest OOM-kills sshd-session, logind and systemd units, and the client retries (lab 44784196287: kills up to 27, failed logins up to 14 a login); a second, idle ~400 ms stall in states saved with 8 channels sat inside sshd's key authentication. spin sizes every workspace to 2048 MiB right after its start (spin's `vmm.resize`), and sized so (`plugged=2048`) neither appears: no kills, every row's gap p95 under 69 ms (lab 44788801555). Restored into a QEMU started ahead, spin's shape and login: 150/156 at one channel, 103/108 at 8, 92.7/111 at 16, Δp50 −57.4 [−59.4, −54.3], and 16 against 8 −11.0 [−13.0, −7.9] (lab 44789688221). *Status:* channels kept. Restores run side by side decide the default count: 8 since 11-20 (#332). The floor edit is kept as the bound's instrument. diff --git a/docs/log/2026-11-20-qemu-yml-kernel-yml-and-image-yml-are.md b/docs/log/2026-11-20-qemu-yml-kernel-yml-and-image-yml-are.md new file mode 100644 index 00000000..b9448950 --- /dev/null +++ b/docs/log/2026-11-20-qemu-yml-kernel-yml-and-image-yml-are.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-20" +order: 70 +area: CI +title: qemu.yml, kernel.yml and image.yml are parts.yml (this change) +prs: [309] +--- +Three workflows of the same shape, each a path-filtered `changed` job and build, and none of them a required check, since a path-filtered workflow does not report on a change outside its paths: a pull request could merge with its QEMU build red (#309's was not blocking). One workflow now, with no path filter: `changed` decides for each part, the builds run when it says so, and `parts` (`spin-machine-dev needs`) fails when one that ran did not pass, which gives a ruleset one check to require. A change that reaches all three runs one `changed` where it ran three (each a billed minute). Over the 200 runs before it (gha-optimize, 2026-11-20): build p50 1m01s cached, cold 10-22 min; `changed` 20 s. In place. diff --git a/docs/log/2026-11-20-spins-login-spins-memory-and-spin-no-longer.md b/docs/log/2026-11-20-spins-login-spins-memory-and-spin-no-longer.md new file mode 100644 index 00000000..79675718 --- /dev/null +++ b/docs/log/2026-11-20-spins-login-spins-memory-and-spin-no-longer.md @@ -0,0 +1,14 @@ +--- +date: "2026-11-20" +order: 110 +area: lab/image +title: spin's login, spin's memory, and spin no longer lingers (this change) +runs: [44750713447, 44785179901, 44785565313] +--- +What spin expects of the guest's SSH server, read in spin-stack/spin at 1bd3414: sshd on 127.0.0.1:22 reached through its supervisor's vsock forwarder (a Go dialer, so TCP_NODELAY), ssh.service started by the supervisor's `systemctl reload-or-restart` when it installs the user CA and before it lets SSH through, a certificate for **root** (the CLI, the exec server and the terminal agent all log in as root), sessions in `user.slice` (spin writes its memory limits there, internal/guest/sessionmem), and a workspace sized to 2048 MiB through virtio-mem right after its start, before the guest's handoff (vmm.go, resize). The goal probes did none of it: they logged in as spin through systemd's vsock socket, an `sshd@` a connection, and left spin's shape at 128 MiB. *Found, on a laptop (leads, not nested):* +- At 128 MiB the guest's OOM killer runs through the boot and the logins: user@1000, logind, `sshd@`, `ssh.service` and session scopes killed, ssh.service hitting its start limit, logins lost and retried, in every boot of spin's shape. Sized to 2048 MiB right after its start (67-79 ms to plug) nothing is killed. Every number in spin's shape so far measured a guest spin never runs. The ~400 ms stalls between running and the login in ~20% of multifd restores (lab 44750713447) look like it. +- spin's path costs less than the lane's: accept to the first login 67-70 against 142-155 ms, a warm login 27-30 against 33-37 (6 boots each, 2048 MiB). socat as the forwarder without `nodelay` read 69 ms warm against 26 with it: Nagle against the delayed ACK, which spin's Go forwarder does not have. +- On spin's path, sessions of class `user-early-light` and nobody logged in as spin, the lingering user@1000 is a systemd --user started in every boot for nobody: without it accept to login 40 against 70 ms and the first login 294 against 316 (6 each); through `lab run`, 8 each, first login −13.1 [−33.3, +5.6], accept to login −7.1 [−28.5, −2.4], the console prompt −37.8 [−63.2, −22.4]. The lane's login as spin did not move (283 against 281). +- Measured and not kept, each a lead on spin's path: `UsePAM no` refuses root, whose password is locked, and would take the session and `user.slice` with it; pam_systemd removed, −15 ms on the first login and −5 warm, but no session, no `XDG_RUNTIME_DIR` and no `user.slice`, where spin holds a person's sessions below the machine's memory; the sshd PAM stack cut to pam_nologin, pam_unix, pam_loginuid and pam_systemd, nothing (70 against 67). Exec costs, warm: `sshd-auth` 1.7 ms a start against 0.56 for `true` (16 libraries, 7 of them Kerberos'), `sshd-session` 0.9, `sshd -t` 2.2; a rebuilt OpenSSH without GSSAPI has a ceiling of ~1-2 ms a login, under the bench's noise. + +*Changed:* `lab`'s shape options `plugged=MIB` (the guest sized right after its start, as spin does) and `login=spin` (root, through a socat forwarder to ssh.service, systemd's vsock socket masked), both off by default. The image no longer lingers spin, and `--edit nolinger` puts that into a release's overlay. *Measured on the bench* (spin's shape, `plugged=2048`, `login=spin`, 20 each, interleaved): the first cold login 532/551 → 496/514, Δp50 −36.1 [−45.8, −23.6], accept to login −26.9 [−39.8, −18.9], the console prompt −89.5 [−103.6, −73.9], QEMU's RSS −7.9 MiB (lab 44785179901); `prestart` cold −27.4 [−32.7, −19.9], prestarted −25.8 [−35.2, −15.1], both restore rows within the noise (lab 44785565313). *Status:* kept. diff --git a/docs/log/2026-11-20-the-builders-are-images-and-the-apk-locks.md b/docs/log/2026-11-20-the-builders-are-images-and-the-apk-locks.md new file mode 100644 index 00000000..5d641bc2 --- /dev/null +++ b/docs/log/2026-11-20-the-builders-are-images-and-the-apk-locks.md @@ -0,0 +1,7 @@ +--- +date: "2026-11-20" +order: 60 +area: CI +title: the builders are images, and the apk locks are gone (this change) +--- +The daily apk-lock refresh (`c6c29b5`) kept the locks buildable, at a price: Alpine's mirror serves only the newest build of each package, so a lock moved every two or three days (11-09, two on 11-12, 11-19, #308 on 11-20), and the lock is the first layer of QEMU's build, so each move compiled QEMU cold on its pull request (17-21 min) and again on main (12 min), since only main exports the cache. #308 was libxml2 r2 → r3, which nothing links. QEMU's and e2fsprogs' builders are now images, Alpine with the part's apk.list installed (`builder/Dockerfile`), published to ghcr and pinned by digest (`qemu-builder`, `e2fsprogs-builder`). An image keeps its packages after the mirror drops them, so nothing forces a move: refresh.yml makes them again weekly and proposes the ones whose packages moved, with the list of what did. The tag is a hash of the Alpine, the list and every package installed, so it never names two images. A part's build stops at its first step when the tree's apk.list is not the builder's. In place. diff --git a/docs/log/2026-11-20-the-hotplug-controller-scans-the-places-it-has.md b/docs/log/2026-11-20-the-hotplug-controller-scans-the-places-it-has.md new file mode 100644 index 00000000..9066a20f --- /dev/null +++ b/docs/log/2026-11-20-the-hotplug-controller-scans-the-places-it-has.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-20" +order: 40 +area: qemu/machine +title: the hotplug controller scans the places it has (#324, lab 44788216590) +prs: [324, 325, 326, 328] +runs: [44587603255, 44788216590] +--- +In spin's shape the 4 hotplug disks' virtio-scsi controller made the guest scan 256 targets at boot: `virtio_scsi_init` 12.1 ms (lab 44587603255), ~460 of the boot's exits (QEMU's trace, laptop). `qemu/patches/0002` gives virtio-scsi a `max_target` property (default 255, a disk plugged above it is refused, the build asserts the property), and the machine sets it to the hotplug disks less one, so the guest scans the places a disk can be attached to and no more. Every place is still scanned, unlike `scsi_mod.scan=manual` (rejected: it loses disks); 4 disks attached to a running guest all appear. On the bench, spin's shape (`plugged=2048`, `login=spin`), 20 each against the same QEMU without the property: first login 512/531 → 503/514, Δp50 −8.9 [−15.5, −0.9], sshd accepts −10.3 [−18.8, −0.2], the console prompt −12.5 [−19.0, −5.3]. The fingerprint moves for machines with hotplug disks, so their older checkpoints boot cold. In the same run `CONFIG_SCSI_SCAN_ASYNC` (#325) read −2.6 [−8.9, +6.8]: rejected. The decompressor without its VGA cursor (#328) and an uncompressed payload (#326) are in "Measured and rejected" (docs/boot-time.md). *Status:* kept. diff --git a/docs/log/2026-11-20-the-methodology-review-and-docs-boot-time-md.md b/docs/log/2026-11-20-the-methodology-review-and-docs-boot-time-md.md new file mode 100644 index 00000000..fafe5255 --- /dev/null +++ b/docs/log/2026-11-20-the-methodology-review-and-docs-boot-time-md.md @@ -0,0 +1,16 @@ +--- +date: "2026-11-20" +order: 100 +area: lab/docs +title: the methodology review, and docs/boot-time.md (this change) +runs: [44587603255, 44641240861, 44727451080] +--- +Two adversarial reviews of how boot time is measured, each finding re-run on the ladders of runs 44641240861 and 44727451080 (five releases interleaved, 20 boots each). *Found:* +- No per-phase budget existed, so nothing said whether 100 ms is reachable. Split by phase, the cold boot spends ~125-135 ms in QEMU, qboot and the kernel before PID 1 runs. The no-systemd floor (209 ms) was measured once, on 11-13, on an 87 ms kernel. +- The goal probes boot a shape and a login path spin does not: no CPU or memory ceilings, where spin boots 1 CPU and 128 MiB with ceilings of 16 and 8 GiB (the kernel 86.6 ms against 62, lab 44587603255), and an `sshd-vsock.socket` that spin turns off. +- Effects inside the noise were accepted. Two releases booting the same guest read Δp50 of the first login in [−8.7, +4.8] ms (bootstrap, n=20), yet the logind socket's −4 and `driver_async_probe`'s −5 were kept while −8 and −6 were rejected as noise. +- `docs/releases.md`'s Δ is drift between runs: v20261120.01's restore login read 158.9 and 167.0 in the two runs. +- The bzImage's cost was recorded as zero by a clock that starts after decompression: sshd accepted ~10-13 ms later from v20261119.01 to .02 while "Freeing" went 76 → 62.5. +- `restore-first`'s `read` reads the mapped-ram file's holes (2 GiB for 155 MiB of data), and its `up` times the monitor socket. + +*Decided by the maintainer:* the kernel, systemd, QEMU and qboot may all be patched without limit. systemd is a must, so a no-systemd init is only ever a bound. *Done:* `docs/boot-time.md` holds where both numbers stand, the per-phase budget, the method with one acceptance rule (a gain when the 95% interval of Δp50 excludes 0), the kept and rejected tables, the measurement pitfalls, and what is next. This log's former "Where we stand", "Measured and rejected", "Measurement pitfalls found" and "Open questions" moved there. *Next:* the probes in spin's shape (branch `lab-measure`); multifd channels on the restore and the no-systemd floor on today's kernel, both on the bench. diff --git a/docs/log/2026-11-20-the-records-chart-is-an-svg-and-the.md b/docs/log/2026-11-20-the-records-chart-is-an-svg-and-the.md new file mode 100644 index 00000000..59aa335f --- /dev/null +++ b/docs/log/2026-11-20-the-records-chart-is-an-svg-and-the.md @@ -0,0 +1,7 @@ +--- +date: "2026-11-20" +order: 90 +area: lab +title: the records' chart is an SVG, and the records a web page (this change) +--- +The page's two Mermaid `xychart-beta` blocks drew one p50 line each and could not draw a gap: a release without a number was left off that chart's axis, so the cold and the restore charts had different x axes, and neither showed the p95. `spin-machine-dev releases doc` now writes `docs/releases.svg` beside the page, from the same code (`lab.Chart`, hand-written, no dependency): both goal numbers on one axis, each a p50 line over a band to its p95, broken where a release has not the number, the 100 ms goal dashed, a tooltip on every point. One SVG is shown on GitHub's light page and its dark one, and an image cannot follow the theme, so its two colours were chosen to clear 3:1 on both (#2a78d6, #d95926; dataviz's palette checks against #ffffff and #0d1117) with text in a mid grey (3.9:1 and 4.8:1). `releases site` writes the same page as one HTML file with the chart inline, so its tooltips show, and each record beside it. `pages.yml` publishes it at https://spin-stack.github.io/spin-machine/ from every merge that changes a record. The tables are one list of rows that the Markdown and the HTML both write, so the two cannot say different things. Each release in "Where each was measured" now links its record. diff --git a/docs/log/2026-11-20-the-time-before-the-kernels-clock-gets-an.md b/docs/log/2026-11-20-the-time-before-the-kernels-clock-gets-an.md new file mode 100644 index 00000000..4f403964 --- /dev/null +++ b/docs/log/2026-11-20-the-time-before-the-kernels-clock-gets-an.md @@ -0,0 +1,7 @@ +--- +date: "2026-11-20" +order: 120 +area: boot +title: the time before the kernel's clock gets an instrument (this change) +--- +docs/measuring.md's rule 7 (then docs/boot-time.md's rule 6): the bzImage's decompression ran where no clock looked. QEMU zeroes kvm-clock as the machine goes to "running" (`kvmclock_vm_state_change`, KVM_SET_CLOCK with the 0 a machine never run has), and the kernel prints the kvm-clock it read when it made it the scheduler's clock ("kvm-clock: using sched offset of N cycles", in ns). The probe init prints that line and "Freeing" with their kmsg times, and `boot:firmware-stages` places them on QEMU's trace: after the firmware's last select, "to the kernel's clock" (the initrd's copy, the jump, the decompression and the kernel's setup until kvmclock_init), "kernel to Freeing", and "Freeing to SPIN-READY", what is left, which a wrong anchor would push below zero and the probe refuses. Its default shape is spin's (1 CPU, 128 MiB, ceilings 16 and 8 GiB, 4 hotplug disks), and `lab check` hands a second tree to it as SPIN_MACHINE_OUTPUT_B. *Checked, laptop, a lead (8 boots each interleaved):* v20261120.02 (bzImage) against v20261119.01 (PVH, no decompressor): to the kernel's clock 24.3 against 7.9 ms, kernel to Freeing 28.4 against 34.3, and Freeing to SPIN-READY 9.5 against 9.7: what moved is the phase the bzImage added, and the residual on the other side of the anchor did not. The bench reading is next. diff --git a/docs/log/2026-11-21-0006-0009-and-0011-deleted.md b/docs/log/2026-11-21-0006-0009-and-0011-deleted.md new file mode 100644 index 00000000..13c8e205 --- /dev/null +++ b/docs/log/2026-11-21-0006-0009-and-0011-deleted.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-21" +order: 100 +area: kernel +title: '0006, 0009 and 0011 deleted (labs 44818953987, 44822157367, #345)' +prs: [356] +runs: [44812044088, 44818953987, 44822157367] +--- +The kernel's half of the carry ablation that read nothing in spin's shape (docs/boot-time.md, "What the machine carries"): 0006 parses vmlinux BTF on another CPU and 0009 polls for a booting AP, and spin boots one vCPU. 0011 had never shown a time, even nested. Taken out together, against v20261120.04, the cold first login read +1.2 [−4.5, +8.3] ms at 20 boots and −2.5 [−8.4, +1.8] at 40 (sshd accepts −1.9, the console +4.2, both within noise). The arm was meant to carry `DEFERRED_STRUCT_PAGE_INIT=n` and the loop and 8250 counts back as well, and did not: the branch's commit staged the patches' removal and not the config, so the parts run (44812044088) built the three patches' removal alone and those options were measured only inside the whole stack's arm, which is kept. *Status:* the three patches deleted; the options open. `DEFERRED_STRUCT_PAGE_INIT` deleted 11-21 (#356); the loop and 8250 counts kept, #357 closed. diff --git a/docs/log/2026-11-21-a-checkpoint-and-a-resume-tell-their-phases.md b/docs/log/2026-11-21-a-checkpoint-and-a-resume-tell-their-phases.md new file mode 100644 index 00000000..5c09be0b --- /dev/null +++ b/docs/log/2026-11-21-a-checkpoint-and-a-resume-tell-their-phases.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-21" +order: 290 +area: machine +title: a checkpoint and a resume tell their phases, and a checkpoint's guest no longer waits on ext4 (labs 44932635041, 44932944601, this change) +issues: [399, 407, 415, 416] +runs: [44932635041, 44932944601] +--- +A checkpoint reported only at its end, with `Cost`. spin's snapshot showed nothing until then, and the guest stayed stopped 200-250 ms past `Cost.Paused` for no traced reason (#399). *Built* (#407): `SaveOptions.Phases` and `LoadOptions.Phases` take a func told each typed `machine.Phase` of one call. A save is `SaveStarted`, `RAMWritten` (a `query-migrate` every 100 ms while the guest runs), `GuestStopped`, `Sealed{Took}` and `SaveCompleted{Cost}`, then `GuestRunning` from `Continue` or `GuestHeld` from `Hold`. A load is `LoadStarted`, `StateLoaded{Bytes}` and `GuestRunning`, and after a fast load `Loaded` tells `StateLoaded`. The hook is per call and not per machine, because spin's timeline is per snapshot (spin-stack/spin#1481). Without `Phases`, a save and a load send the same commands as before. `spin-machine save` and `restore` print the timeline. *Observed on real QEMU* (boot:record, laptop, v20261121.01, a 128 MiB guest): a save told SaveStarted at 0, GuestStopped and Sealed at 45.4 ms, SaveCompleted at 50.2 and GuestHeld at 51.0. A load told LoadStarted at 0, StateLoaded at 35.3 and GuestRunning at 35.8. *#399 traced* (laptop ext4, spin's shape with 2 GiB plugged and 1.5 GiB of tmpfs filled, 1.6 GiB a save, 8 channels, every command and event timed): the gap fell between `remove-fd`'s answer and the next command. Each command took under a millisecond, and `cont` 2-3 ms. QEMU `ftruncate`s the state it writes, and ext4's `auto_da_alloc` writes a truncated file's dirty pages back on its last close. That last close was Checkpoint's copy of the file, closed before Checkpoint returned. Closed on a goroutine, with 16 saves an arm interleaved on one guest: `completed` to `cont`'s return fell from 238 ms p50 to 6, and the guest's stop to `cont` from 451 to 198, −252 [−4354, −33]. The caller's `fdatasync` after `Continue` rose from 3 ms to 259, so the time to a durable state did not change (−19 [−4088, +3963]). The phases also showed that the last `RAMWritten` before the stop was 0.3-0.9 GiB short of `Cost.RAM`. QEMU writes that RAM after the seal, with the guest stopped (#415). *Measured* (bench, spin's shape and login, v20261121.01's spin-machine against this branch's at cd966d5, which also carries main since the release; 20 each, interleaved): restore-first's login +2.5 [−0.2, +6.1] evicted and −2.3 [−5.0, +1.7] cached, within noise; `running` +2.3 [+1.7, +3.5] evicted and −0.1 [−1.2, +1.3] cached (#416). ssh-first's first login +0.3 [−4.9, +7.1], within noise. `StateLoaded.Bytes`, one `fstat`, came after these runs. *Status:* in place. spin takes `Phases` into its snapshot timeline, and syncs the state after `Continue` as before. diff --git a/docs/log/2026-11-21-a-checkpoint-plans-a-30-ms-pause-not.md b/docs/log/2026-11-21-a-checkpoint-plans-a-30-ms-pause-not.md new file mode 100644 index 00000000..503373af --- /dev/null +++ b/docs/log/2026-11-21-a-checkpoint-plans-a-30-ms-pause-not.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-21" +order: 310 +area: machine +title: a checkpoint plans a 30 ms pause, not QEMU's 300 (#415, lab 44940051596, this change) +issues: [415, 421] +runs: [44940051596] +--- +The phases showed a 1.6 GiB checkpoint's guest stopping with 0.3-0.9 GiB still to write, and that remainder was most of `Cost.Paused`. *Explained:* QEMU stops the guest once what is left fits in `downtime-limit` times the rate it measured over the last 100 ms. The machine never set the limit, so it was the default 300 ms. Into the page cache the rate read 30-34 Gbit/s, so the guest stopped with up to ~1.2 GB to go. An idle guest stopped part-way through QEMU's first pass, and what was written after the stop was memory QEMU had not reached yet, not memory the guest had dirtied. Mapped-ram, multifd and pause-before-switchover leave that test as it is (QEMU 11.2's `migration/migration.c`). *Measured* (bench, nested KVM, v20261121.01, spin's shape plugged to 2 GiB, 20 saves an arm interleaved on one guest, branch `exp/415-downtime`): at 30 ms QEMU's downtime fell from 192 ms to 6 for an idle guest with 1.5 GiB of tmpfs filled, −186 [−189, −184], and the save's total did not move, +4 [−2, +6]. With a writer rewriting 64 MiB of a 512 MiB set every ~100 ms it fell from 221 ms to 8, −213 [−218, −208]. The total rose 39 ms [+33, +45] for one more pass and 195 MiB more written while the guest ran. The laptop agreed, at 238 to 12 and 209 to 11. A writer rewriting 256 MiB of a 1 GiB set with no pause converged at 30 ms in all 10 saves (laptop). *Rejected:* 100 ms (60 ms of downtime with the writer, laptop); auto-converge, whose throttle never engaged in any save; `avail-switchover-bandwidth`, not run, since it only stands in for the rate in the same test. *Found on the way:* `cont` right after `Checkpoint` once failed with "Migration is not finalized yet", because QEMU sends `completed` before it moves the run state to `postmigrate`. That is #421. *Status:* in place. A checkpoint is on neither goal clock, and `Resume` reads the same file, so restore-first was not re-run. boot:record resumed a checkpoint saved at 30 ms. diff --git a/docs/log/2026-11-21-a-checkpoint-returns-once-qemu-has-left-finish.md b/docs/log/2026-11-21-a-checkpoint-returns-once-qemu-has-left-finish.md new file mode 100644 index 00000000..05b6c682 --- /dev/null +++ b/docs/log/2026-11-21-a-checkpoint-returns-once-qemu-has-left-finish.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-21" +order: 320 +area: machine +title: a checkpoint returns once QEMU has left finish-migrate (#421, this change) +issues: [421] +--- +`Continue` right after `Checkpoint` failed once in about 235 checkpoints with `cont: GenericError: Migration is not finalized yet`, and the guest stayed stopped. *Explained* (QEMU 11.2.0-rc0's `migration/migration.c`): the migration thread sets `completed`, sends `MIGRATION{completed}` and lets the BQL go in `migration_completion_end`, and moves the run state from `finish-migrate` to `postmigrate` only once it holds the BQL again, in `migration_iteration_finish`. `qmp_cont` refuses `finish-migrate` (`monitor/qmp-cmds.c`), and `runstate_set` sends no event. `blockdev-set-active` is not refused there, so a `Hold` in the window succeeded and left the machine in `finish-migrate`. *Reproduced* (laptop, real KVM, v20261121.01 with this checkout's spin-machine, spin's shape plugged to 2 GiB, a guest rewriting 600 MiB of tmpfs, Checkpoint then Continue in a loop): 0 refusals in 2000 checkpoints on an idle host. With QEMU and the test pinned to two host CPUs kept busy by two spin loops, 102 of 300 `cont`s were refused, `query-status` reading `finish-migrate` at the refusal, and with `Hold` first, 88 of 300 Holds left the machine in `finish-migrate` and 79 `cont`s were refused. *Built:* `Checkpoint` asks `query-status` after the cost's `query-migrate`, and again every millisecond while it reads `finish-migrate`, bounded by its context. Making `Continue` retry `cont` was rejected: `Hold` and `Status` would still see `finish-migrate`. *Measured:* under the same contention, 0 of 300 refused, and 0 of 300 with `Hold` first. The guest's stop to `GuestRunning`, 8 runs of 60 checkpoints an arm interleaved on the idle laptop, moved from 6.62 ms p50 to 6.82, +0.20 [+0.08, +0.33], one QMP round trip. *Status:* in place. A checkpoint is on neither goal clock. diff --git a/docs/log/2026-11-21-a-checkpoints-pause-is-held-under-50-ms.md b/docs/log/2026-11-21-a-checkpoints-pause-is-held-under-50-ms.md new file mode 100644 index 00000000..95078095 --- /dev/null +++ b/docs/log/2026-11-21-a-checkpoints-pause-is-held-under-50-ms.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-21" +order: 330 +area: boot, lab +title: 'a checkpoint''s pause is held under 50 ms: `boot:checkpoint-pause` (#423, #419, lab 44944984313, this change)' +issues: [423, 426] +runs: [44944984313] +--- +What re-measured `checkpointDowntime` lived only on `exp/415-downtime`, and `lab dispatch` took no `check:TARGET`, so that run was dispatched with `gh workflow run`. *Built:* `TestACheckpointPausesTheGuestBriefly` (`task boot:checkpoint-pause`, lab.yml's `check:checkpoint-pause`), from the experiment with its arms gone. It uses the two guests that decided 30 ms, saves each 10 times at the machine's own setting, continues and syncs after each, and logs the guest's stop to `GuestRunning`, QEMU's downtime, what was left at the stop and the total. The median of the larger of the stop and QEMU's downtime must stay under 50 ms. That is the 30 ms QEMU plans plus 20 for what it writes past the plan and for `cont`. QEMU's default read 199 and 231 ms. compat.yml runs it on every change to QEMU on main and before every release. `lab dispatch check:TARGET` now sends the check, waits, prints the last 60 lines of the `lab:ci` step from the job's log through the API, and exits 1 unless the run succeeded. *Measured* (bench, nested KVM, c8id.4xlarge, v20261121.01, spin's shape plugged to 2 GiB, 10 saves a guest, dispatched with `lab dispatch check:checkpoint-pause`): idle 13.3 ms p50 from the stop to `cont` returned, the slowest 14.8, QEMU's downtime 6 ms, nothing left at the stop, total 465 ms. Writer 18.9 ms p50, the slowest 25.8, downtime 7 ms, total 531 ms. Both agree with the experiment's 14 and 18 ms. *Found on the way:* on the laptop, with its disk busy and its swap full, the writer's pause reached 0.1-8.7 s in 4 and 6 of two runs' 10 saves, with at most 85 MiB left at the stop. QEMU's downtime was longer than the stop to `GuestRunning` (8.68 s against 5.81 s), so QEMU stopped the guest long before the host heard of it at `pre-switchover`. That is #426, and it is why the bound holds the larger of the two. *Status:* in place. diff --git a/docs/log/2026-11-21-a-checkpoints-stop-does-not-wait-on-the.md b/docs/log/2026-11-21-a-checkpoints-stop-does-not-wait-on-the.md new file mode 100644 index 00000000..5a659c5c --- /dev/null +++ b/docs/log/2026-11-21-a-checkpoints-stop-does-not-wait-on-the.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-21" +order: 370 +area: qemu, machine +title: 'a checkpoint''s stop does not wait on the host''s disk: `x-defer-disk-flush` (#426, lab 44958247487, 44962720682, this change)' +issues: [426, 437, 438] +runs: [44957455283, 44958247487, 44961949665, 44962720561, 44962720682, 44962720691, 44962720776, 44962720850, 44963610565, 44963610916] +--- +On a busy disk, a checkpoint stopped the guest for 0.1-8.7 s on the laptop, and QEMU's downtime ran past the stop to `GuestRunning`. *Traced* (QEMU `-trace` on `runstate_set`, `vm_stop_flush_all`, `migrate_set_state` and `luring_co_submit`): from `finish-migrate` to `pre-switchover`, the time was `do_vm_stop`'s flush after the drain, one io_uring fsync of the overlay. It took 527 ms in one laptop save. On the bench, beside one host writer on `/tmp`, which is an overlayfs there, and with a guest that synced its own writes, nothing reproduced: Δ +0.9 [−2.6, +5.5] (lab 44957455283). Four writers on the instance store's ext4, with the guest writing its disk with `oflag=direct`, gave the fsync 13-79 ms and the guest's stop 42 ms p50 (lab 44958247487). *Built:* `qemu/patches/0003` adds the migration capability `x-defer-disk-flush`, and `Checkpoint` sets it. After the stop's drain, QEMU's own flushes write to the page cache only, and the guest's next flush forces them. The first version ended the deferral when the switchover ended, and the fsync came back in `cont`, since activating a qcow2 node closes and reopens it. The guest's stop to `GuestRunning` went from 19.6 to 50.3 ms p50 (lab 44958247487). The deferral now lasts until the VM runs (`vm_prepare_start`) or QEMU closes the disks (`bdrv_close_all`). *Measured* (bench, nested KVM, v20261121.01 with QEMU from parts run 44961949665, spin's shape plugged to 2 GiB, the busy-disk guest, 20 pairs interleaved on one guest, branch `exp-defer-ab`): the guest stopped at least 40.0 ms p50 (93.0 slowest) without the capability and 18.0 (28.8) with it, −22.0 [−29.2, −15.8]. QEMU's downtime went from 40 to 7 ms, −33 [−40, −27]. On QEMU's clock, `finish-migrate` to `running` read 8-20 ms against 20-95. `boot:checkpoint-pause` gains the busy-disk guest on the scratch disk, and read idle 13.9, writer 17.3 and busy disk 19.1 ms p50 (lab 44962720691). record and rollback pass on the patched QEMU (lab 44962720561, 44962720776). restore-first, with the spin-machine held at the release's and the QEMU binary as the only change: login −0.1 [−2.3, +2.4] evicted, −3.2 [−4.7, −0.5] cached (lab 44963610565). Main's spin-machine against the release's read +2.2 [+0.5, +4.0] evicted with the release's QEMU (lab 44963610916). That is #438, and it is why the run with both changes read +2.8 (lab 44962720850). *Contract:* a checkpoint's disk is in the page cache when `Checkpoint` returns, as its state is. A caller that keeps the sealed layer syncs it with the state after `Continue` (spin-stack/spin#1514). *Not fixed:* the laptop's other waits, 1.6-1.9 s in the drain with nothing to flush and 0.7-1.6 s for the last RAM, with its swap full (#437). *Status:* in place. diff --git a/docs/log/2026-11-21-a-checkpoints-waits-are-its-migration-events.md b/docs/log/2026-11-21-a-checkpoints-waits-are-its-migration-events.md new file mode 100644 index 00000000..864fa48a --- /dev/null +++ b/docs/log/2026-11-21-a-checkpoints-waits-are-its-migration-events.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-21" +order: 200 +area: machine +title: a checkpoint's waits are its MIGRATION events (this change, labs 44898418357, 44898581478, 44898910862) +runs: [44898418357, 44898581478, 44898910862] +--- +Checkpoint, Resume and Loaded asked `query-migrate` every millisecond until the migration reached the state they waited for. They now turn on the `events` capability with the others they set, arm a `qmp.Expect` for `MIGRATION` before the command that moves the migration, and wait on it. `query-migrate` is asked only after a save that failed, for its reason. *What QEMU 11.2.0-rc0 sends* (`TestACheckpointIsWaitedOnByItsEvents`, in `boot:record`, laptop and bench): a save sends setup, active, `STOP`, pre-switchover, device, completed. A full load sends setup, active, `RESUME`, completed, so the guest runs before the event. A fast load sends setup, active, postcopy-device, postcopy-active, `RESUME`, completed (bench only, where the runner turns userfaultfd on), so `Resume` returns before the guest runs, as it did when it polled. Half a state sends setup, active, failed, and QEMU exits (migrate-incoming's exit-on-error) with the reason on its stderr. A `query-migrate` after that event found the connection reset, so a failed load asks nothing and says where the reason is. *Measured* on the bench, spin's shape and login, 20 each interleaved, v20261120.04 with its own spin-machine against the same tree with this branch's (which also carries the record, the module rename and the public QMP client): restore-first's first login −0.4 [−2.9, +0.8] evicted and −1.4 [−3.2, +0.8] cached, running −0.3 [−1.8, +0.7] and −0.7 [−1.7, +0.3], all within noise (lab 44898581478). ssh-first's first login +0.9 [−5.4, +5.3], sshd accepts −0.2 [−5.1, +5.2], within noise; the console prompt read +6.1 [+0.3, +9.0], a diagnostic on a path this change does not touch (a cold boot waits on no migration), left for the next release's record to confirm or not (lab 44898910862). The 23-47 µs a round trip costs more through the client (the entry above) does not show at 20 boots. *Status:* in place; nothing a checkpoint records changes. diff --git a/docs/log/2026-11-21-a-contended-checkpoint-loop-how-a-qemu-bump.md b/docs/log/2026-11-21-a-contended-checkpoint-loop-how-a-qemu-bump.md new file mode 100644 index 00000000..007a934a --- /dev/null +++ b/docs/log/2026-11-21-a-contended-checkpoint-loop-how-a-qemu-bump.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-21" +order: 360 +area: boot +title: 'a contended checkpoint loop, how a qemu bump is checked for #421: `boot:finish-migrate` (#425, this change)' +issues: [421, 425] +--- +#424's wait for QEMU to leave `finish-migrate` was held in the tree only by a fake QEMU, and an idle host does not reach the window, so boot:record passed with the fix and without it. *Built:* `TestACheckpointIsContinuedAtOnceOnABusyHost` (`task boot:finish-migrate`), the scratch loop of #421: spin's shape plugged to 2 GiB with a guest rewriting 600 MiB of tmpfs, 300 checkpoints each continued at once, any refusal a failure. The target runs the test and QEMU under `taskset` on the host's last two CPUs, and the test keeps each of the CPUs it is given busy with a spin loop and refuses to run on more than four. It is not in CI. The qemu entry's note in versions.yaml names it beside boot:record and boot:compat, so a QEMU that reorders `migration_completion_end` and `migration_iteration_finish`, or adds a run state after `completed`, is caught at the bump. *Measured* (laptop, real KVM, v20261121.01 with this checkout's spin-machine): with `finished` made to return at once, 39 of 300 continues were refused, and 0 of 300 with it. QEMU alone pinned to the busy CPUs, the test free, refused 0 of 300 without the fix, which is why the test runs on them too. *Status:* in place. diff --git a/docs/log/2026-11-21-a-disks-counters-without-its-backing-chain-x.md b/docs/log/2026-11-21-a-disks-counters-without-its-backing-chain-x.md new file mode 100644 index 00000000..03843d26 --- /dev/null +++ b/docs/log/2026-11-21-a-disks-counters-without-its-backing-chain-x.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-21" +order: 400 +area: qemu, machine, lab +title: 'a disk''s counters without its backing chain: `x-flat` and the `usage` probe (#402, labs 44973302743, 44973302685, 44973726633, this change)' +issues: [402, 442] +runs: [44972755256, 44973302685, 44973302743, 44973302762, 44973726633] +--- +The question was whether a runner polling `Process.Usage` across ~20 machines, and the watch's read of a held disk each second, slow the machines. #402 said `query-blockstats` cost ~6 ms p50 "because every reply carries all 16 hotplug slots", and that one took 536 ms under host steal. *Explained* (laptop, spin's shape, the command timed beside query-status with QEMU's main thread's `schedstat` across each call). The hotplug targets are not in the reply, since an empty SCSI target has no block backend. What is in it is every image of each disk's backing chain, twice under a place's throttle filter (`bdrv_query_bds_stats` recurses into `parent` and `backing`). The reply was 12.6 KiB for a root of an overlay over the base plus a raw home. Each image added ~3.6 KiB and ~70 µs of the main loop, which also runs the disks' I/O: 0.37 ms of main loop at depth 1, 0.73 at 8 and 2.5 ms (124 KiB) at 32. Every seal of a workspace's disk adds an image. The 6 ms is a deep chain or a loaded host, not the slots. *The 536 ms is not the command.* Each call over 50 ms in the pressure probe's lane, sampled every 0.5 ms, had QEMU stalled in the host. At `memory.high` the main thread was in D state in its cgroup's reclaim (`reclaim_high` → swap writeout → `wbt_wait`) or a swap-in, for 170-195 ms, and query-status was as slow. In the memory and OOM phases it was in `mmap` waiting for the mmap lock while the vCPU faulted, 52-284 ms. Under `cpu.max` the monitor's thread was throttled for 80 ms. Two busy loops on QEMU's core cost a call 4-6 ms at most. A first run that traced QEMU to a file on ext4 caught its threads in the trace's own `writev`, so a stall measured with tracing to a busy disk can be the trace. *Built:* `qemu/patches/0004` adds `query-blockstats`' member `x-flat`, which leaves out `parent` and `backing`. `QEMU.DiskUsage`, Usage's QMP half and what the watch reads, asks with it. A QEMU without it (every release up to v20261121.01) refuses the member, so it is asked once and then only without it. The `usage` probe times DiskUsage on a running machine, quiet and pinned to one host CPU beside two busy loops, at a `depth`. *Measured* (bench, nested, spin's shape, v20261122.01 with QEMU from parts run 44972755256, 20 machines each × 200 calls): DiskUsage's main-loop time went from 293 to 96 µs p50, −197 [−202, −181], and its round trip from 573 to 390, −183 [−190, −158] (lab 44973302743). At depth 32 it went from 2991 to 94 µs, −2898 [−2917, −2895], and the round trip from 3377 to 391 (lab 44973302685). Against main's own parts build without 0004, depth 1 read −183 [−203, −176] µs, with query-status +8.1 [−55.5, +39.1] µs, within noise (lab 44973726633). So the +43 µs query-status read against the release is the build, not the patch. *Not explained:* pinned beside two busy loops, DiskUsage's p50 sat at 3.07 ms in every flat run against 2.2 at depth 1 and 4.3 at depth 32 without x-flat, and the slowest call did not change at depth 1. The 3 ms is about one scheduler slice on these hosts (#442). *Not built:* asking only for the held disks. With x-flat, each device costs ~20 µs of main loop (laptop, 2 against 11 places), so the ceiling is ~20 µs a second at spin's shape with one disk held. *Goal numbers:* untouched. DiskUsage has two callers, `Usage`, which spin calls when it chooses, and the watch, which asks only while a disk is held. Neither runs on a boot or a restore. 0004 changes only that command's handler and its HMP caller. boot:record passes on the patched QEMU (lab 44973302762, and on the laptop), and so does boot:pressure on the laptop. *Status:* in place. diff --git a/docs/log/2026-11-21-a-hosts-record-in-one-call-and-where.md b/docs/log/2026-11-21-a-hosts-record-in-one-call-and-where.md new file mode 100644 index 00000000..b223b89b --- /dev/null +++ b/docs/log/2026-11-21-a-hosts-record-in-one-call-and-where.md @@ -0,0 +1,7 @@ +--- +date: "2026-11-21" +order: 250 +area: machine +title: a host's record in one call, and where a checkpoint's state is synced (this change) +--- +spin's runner started a held machine only to read `QEMU.Target` and kept the answer (spin-stack/spin#1416). spin also synced the state file every 100 ms while QEMU wrote it, synced it again inside the seal, and bounded a resume by the state's written blocks. *Built:* `machine.ReadTarget(ctx, Spec, StartOptions)` starts a machine of the Spec held, reads its `Target` and stops it. The caller's monitors are dropped. Each NIC is put on a hub port, so no TAP and no `/dev/vhost-net` is needed. The console writes to nothing, but the serial port is kept. *Measured* (laptop, v20261121.01, spin's shape, 2026-11-21): a machine whose NIC was on a real TAP with vhost read a record byte-identical to `ReadTarget`'s, and 25 589 bytes. One call took 72-76 ms p50 over 20 (QEMU's start 28, the record 11, its quit 37). It runs at a runner's start, off both goal clocks. boot:record now holds a machine's own checkpoint to `ReadTarget`'s record of its shape held for a checkpoint. Its first run failed with `device isa-serial: checkpoint isa-serial, here none`, because the test's Spec had no console. The record names the serial port, so the caller's Spec has to carry the console its machines have. The lab still reads a tree's record through that tree's `spin-machine target`, because the lab can drive a binary that predates `ReadTarget`. `restore` and the probes that resume into a machine they just started still ask that machine, which is the right call when there is no host constant. *Checkpoint sync, decided by measurement* (laptop ext4 NVMe, 99% full and shared; spin's shape plugged to 2 GiB, 1.5 GiB touched, 1.6 GiB written per save, mapped-ram with 8 channels; a seal that creates and syncs a file; 16 interleaved saves an arm, medians over the saves that did not stall on the disk): with the sync inside the seal, the pause's sync was 275 ms and the guest stopped 683 ms from seal to `cont`. Every 100 ms and then inside the seal gave 167 ms and 566. After `cont` gave 0 and 506. Over every save, the sync after `cont` beat the periodic arm in the pause by 183 ms [−1676, −160] and in QEMU's total by 232 [−2027, −124]. The guest's whole pause does not resolve over every save, because the stalls were seconds long and hit every arm. The sync after `cont` took 2-3 ms. QEMU syncs nothing itself (strace). The seal's file took 2-7 ms with ~830 MiB dirty, so spin's reason for the periodic sync did not reproduce on ext4. *Decided:* `Checkpoint` syncs nothing, and the caller fdatasyncs after `Continue`. The resume bound stays with the caller, because it rests on the host's slowest disk. `Resume` is unchanged, so restore-first was not re-run. Both decisions are written down in docs/memory-and-disk.md. `Cost.Paused`, QEMU's downtime, reads 200-250 ms under the caller's clock from the seal to `cont`. That gap is not yet traced. *Status:* in place. spin replaces `qemu.Target` with `ReadTarget` and moves its `fdatasync` after `Continue`/`Hold`. diff --git a/docs/log/2026-11-21-a-machine-held-at-its-cgroups-limits.md b/docs/log/2026-11-21-a-machine-held-at-its-cgroups-limits.md new file mode 100644 index 00000000..faf8cd30 --- /dev/null +++ b/docs/log/2026-11-21-a-machine-held-at-its-cgroups-limits.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-21" +order: 280 +area: machine +title: a machine held at its cgroup's limits (#403, this change) +issues: [403] +--- +spin sets `cpu.max`, `memory.high` or `memory.max`, and `io.max` on a workspace's cgroup, and the limit applied silently. A host CPU Stall could be the host squeezing the machine or spin's own `cpu.max`. *Built:* the host side of the probe reads QEMU's cgroup each second, beside its PSI triggers, and tells the watch a `Limited` each second a limit held: `cpu.max` when `nr_throttled` moved, `memory.high`, `memory.max` and its OOM kill when `memory.events` moved, and a key of `io.max` when a device's rate reached 90% of it. Each carries the limit, its device, the limit's value, what was used, how many times the kernel held the machine, and since when. The last reading is taken at QEMU's exit. `Usage` gains `CPU.Throttles` and `memory.events`' four counters. *Checked first:* cgroup v2 has no counter of what `io.max` throttled. `io.stat` gained no field on Linux 7.0 with `CONFIG_BLK_DEV_THROTTLING=y`, under an `io.max` that held `dd` for 6.4 s. *Observed on real QEMU* (task boot:pressure, laptop, v20261120.04 with this checkout's sender, one vCPU, 1 GiB). Under `cpu.max` of 0.2 CPU, one loop brought a `Limited` each second at 199,500-200,200 µs a second and 10 throttles, and a host CPU Stall each second with it. With `memory.high` 32 MiB above QEMU's memory, rereading a second disk brought 2,200-4,300 `high` events a second, `memory.current` within 0.1% of the limit. Under an `rbps` of 4 MiB/s, QEMU read at 4,188,788-4,189,940 B/s. Its cgroup's `io.pressure` total did not move in those 5 s, because io_uring leaves no QEMU thread waiting, so the rate is the one sign. No phase before the limits brought a `Limited`. *Not measured:* boot and restore. The limits are read in a watch's own goroutine, and neither goal measurement starts a watch. *Status:* in place. diff --git a/docs/log/2026-11-21-a-named-cpu-model-costs-the-cold-login.md b/docs/log/2026-11-21-a-named-cpu-model-costs-the-cold-login.md new file mode 100644 index 00000000..123a90b2 --- /dev/null +++ b/docs/log/2026-11-21-a-named-cpu-model-costs-the-cold-login.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-21" +order: 170 +area: machine/lab +title: a named CPU model costs the cold login 27 ms on the bench (lab 44855890737) +runs: [44855890737] +--- +For memories that resume on any host of a pool, `ssh-first` compared `host` with `lab tree --cpu baseline`, which is `machine.Models` plus `machine.Baseline` on the runner. The nested c8id's newest runnable model is Cascadelake-Server-v5: Nitro's L1 does not expose enough for SapphireRapids or GraniteRapids. Against `host`: first login +27.2 [+13.0, +30.8], sshd accepting +23.1 [+9.7, +28.5], warm login −0.4 within noise, QEMU's RSS unmoved. *Why:* spin runs `-cpu host`, so a memory resumes only on a host showing every saved feature (spin-stack/spin#1417). *Result:* a fleet-wide named model is rejected for now. `Baseline` stays public for spin. *Status:* open. Next is `host` minus the features a pool's hosts do not share, measured the same way. diff --git a/docs/log/2026-11-21-a-per-disk-io-limit-the-first-actuator.md b/docs/log/2026-11-21-a-per-disk-io-limit-the-first-actuator.md new file mode 100644 index 00000000..406c3423 --- /dev/null +++ b/docs/log/2026-11-21-a-per-disk-io-limit-the-first-actuator.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-21" +order: 340 +area: machine +title: a per-disk IO limit, the first actuator (#395, this change) +issues: [395, 429] +--- +A runner hosts about 20 workspaces, and spin has to hold back the one that saturates the shared disk, per disk and while it runs, without the guest learning of it. The prototype said every disk place sits behind a throttle node, so a limit would be one `qom-set` on its group. *Checked* in `machine/spec.go`: every place's node is a throttle filter, but all of them are in one group, `places`, and a group shares its limit among its members, so a limit there would hold all of a machine's disks together. A disk attached while the machine runs has no filter at all. A group per place would have changed the command line every machine boots with. *Built:* `QEMU.SetDiskLimit(serial, DiskLimit)` and `QEMU.DiskLimit(serial)`, where `DiskLimit` is bytes and requests a second, read and write, and its zero value is no limit. The command is `block_set_io_throttle`, sent to the backend of the disk's device, whose group is the device's alone and which a bind never replaces. It reaches a place and a hot-plugged disk alike, and is read back from `query-block`. `verify qemu`'s schema check covers both, and refused a misnamed field in each when one was tried. Bursts are left out: QEMU already lets a tenth of a second's worth through at once. The probe reports a held disk as `Limited{DiskReadBytes…}`, its serial in `Device`, from one `query-blockstats` a second, and only while a disk is held through Start's monitor. *Measured* (task boot:disk-limit, laptop KVM, v20261121.01 with this checkout's spin-machine, spin's shape with two disks beside the root, 3 runs): 8 MiB/s held 32 MiB of the guest's direct reads to 3.776-3.777 s, 50 writes a second held 150 direct 4 KiB writes to 2.881 s, and a disk attached at run time read at 8 MiB/s in 3.900-3.901 s. The other disk did the same in 2-6 ms beside each, and the held one read in 2-5 ms once cleared. `SetDiskLimit` took 1.8-5.5 ms. In task boot:pressure a 4 MiB/s limit brought a `Limited` each second with `Used` at 4.19-4.25 MB/s. *Decided:* a checkpoint carries no limit. A resumed machine reads `DiskLimit{}` and runs free until spin sets the limit again, which then holds (same lane). The limit is spin's policy for a neighbour, and a resumed machine may have other neighbours. No bench run: neither goal path sends a command it did not send before. *Status:* in place. That lane's `memlimit` phase fails on this laptop on main as well (#429). diff --git a/docs/log/2026-11-21-a-qemu-without-x-defer-disk-flush-checkpoints.md b/docs/log/2026-11-21-a-qemu-without-x-defer-disk-flush-checkpoints.md new file mode 100644 index 00000000..a4bf91b0 --- /dev/null +++ b/docs/log/2026-11-21-a-qemu-without-x-defer-disk-flush-checkpoints.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-21" +order: 380 +area: machine +title: a QEMU without `x-defer-disk-flush` checkpoints as before (compat 44964906186, this change) +prs: [435] +runs: [44964906186] +--- +Compat on main 607797b failed for every release from v20261119.02 to v20261121.01 with `migrate-set-capabilities: GenericError: Parameter 'capability' does not accept value 'x-defer-disk-flush'`. #435 set the capability on every checkpoint, and only the QEMU `qemu/patches` builds has it. Compat checkpoints each release's QEMU with this checkout's spin-machine. spin does the same when a runner's machine library is upgraded while machines from an earlier release run, and none of those could have been checkpointed. *Fixed:* `Checkpoint` asks `query-migrate-capabilities` first and sets `x-defer-disk-flush` only when the QEMU lists it. That costs one round trip before the migration starts, with the guest running, and is on neither goal number's clock. A QEMU without it checkpoints as before #435, with the stop's flush on the host's disk. `qmpdef.Enum` still names the capability, so `verify qemu` fails a pinned QEMU that lost the patch. *Reproduced* (laptop, a tree of v20261121.01 with this checkout's spin-machine, boot:record's tests): main's `Checkpoint` failed `TestACheckpointedMachineIsHeldThenContinued` with compat's error, and this change passed all four of boot:record's tests. *Status:* in place. diff --git a/docs/log/2026-11-21-a-record-read-from-qemu-replaces-the-fingerprint.md b/docs/log/2026-11-21-a-record-read-from-qemu-replaces-the-fingerprint.md new file mode 100644 index 00000000..ca8040cc --- /dev/null +++ b/docs/log/2026-11-21-a-record-read-from-qemu-replaces-the-fingerprint.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-21" +order: 180 +area: machine +title: a record read from QEMU replaces the fingerprint (this change) +runs: [44866054104, 44868324811, 44871809382, 44872699993] +--- +The fingerprint was a sha256 over a prediction of the machine (`Spec.Contract`, the shape, the BIOS file's size), passed to QEMU as `-name` and read back. A refusal could not say what differed. spin overwrote its probe's fingerprint with one computed from a Spec of placeholders. And the release's `fingerprint_sha256` hashed the CLI's default machine, not spin's, so v20261120.03's notes said checkpoints still resume when spin's shape had moved (`max_target`). *Measured* (laptop KVM, QEMU 11.2.0-rc0, v20261120.04, mapped-ram, the fingerprint taken out so that QEMU decides): QEMU refuses by itself fewer or more boot vCPUs, another vCPU ceiling, another virtio-mem size, a missing device, a smaller RAM or BIOS block and another machine type. It loads silently an extra device (a vsock the guest never finds), a larger BIOS block and more base RAM, because mapped-ram's `parse_ramblock` refuses only a smaller block, and a larger `max_target`, whose extra targets the guest used. A QMP dump of spin's shape: between a machine held and the same machine after a boot, a memory plug, the balloon polled, a vCPU and a disk added, only the balloon's statistics, virtio-mem's sizes, ICH9-LPC's `pm_io_base` and `gpe0_blk` and the RTC's date moved; between two machines, the MAC, the vsock's context id and vmgenid's GUID. *Result:* `QEMU.Target` reads the machine from the running QEMU (every device it was started with and every property but those, its options, its RAM blocks, the features its vCPU has on), and `CanResume` compares two records and returns a `*Refusal` naming every difference. `max_target` may grow; the CPU's features compare as one set, so a richer host is refused too. At spin's shape the record is 25.6 KB of JSON and 126 features, read in 8 round trips, 8.4 ms (boot:record). boot:record holds a machine to its own checkpoint and the silent cases to a refusal by name. boot:compat checkpoints the release before with this tree's `spin-machine save` and compares records; its local run on v20261120.04 resumed. *What it costs:* read inside `Resume`, the destination's record put its 8 round trips on the second goal number: restore-first's first login +4.3 ms [+0.2, +7.5] evicted and +8.2 [+6.2, +10.8] cached against v20261120.04 (bench, lab 44868324811). None of it could leave the clock: QEMU answers no monitor while it loads a state, and a read on a second monitor from QEMU's greeting stayed on it (laptop, +29 ms against +16 read in `Resume`), because QEMU's main loop is busy from its exec to the end of the load. The source's record is read while QEMU writes the state, where QEMU does answer, which brought `spin-machine save` from +7.0 and +10.6 ms (lab 44866054104) to within the noise (lab 44868324811). *Decided* (the maintainer, option C): the destination's record is a constant of a host, its QEMU binary, its CPU and the shape it resumes into, so `Resume` takes it from the caller (`here`), runs `CanResume` before it sends QEMU anything, and never asks QEMU. spin computes it once at runner start and holds each pool machine to it once (spin-stack/spin#1416). `spin-machine restore --target FILE` takes one as given, `spin-machine target` prints one, and the restore probes read each tree's record once before measuring, from a machine held for a checkpoint in the probe's shape. With it, against v20261120.04, whose restore reads its fingerprint record (name, version and CPU, five round trips) inside the restore (bench, spin's shape, 20 each): restore-first's first login +1.0 ms [-2.3, +4.1] evicted and -3.0 [-6.2, +0.0] cached, running +0.1 [-1.7, +1.3] and -1.4 [-2.9, -0.7] (lab 44871809382); prestart within the noise in every row, its restored login -2.5 [-4.3, +0.3] and restored into a QEMU started ahead -1.6 [-3.1, +2.1] (lab 44872699993). A checkpoint or a stored identity from before is refused, as a `vmm` difference, and boots from disk once. A newer QEMU that adds a property to a device is a refusal, which boot:compat reports at the bump. `Spec.CPUWithout` and `Unshared` are there for spin#1417's pools, not yet measured. *Status:* in place; spin follows (spin-stack/spin#1416). diff --git a/docs/log/2026-11-21-a-release-is-measured-at-its-tag-and.md b/docs/log/2026-11-21-a-release-is-measured-at-its-tag-and.md new file mode 100644 index 00000000..f5dbf413 --- /dev/null +++ b/docs/log/2026-11-21-a-release-is-measured-at-its-tag-and.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-21" +order: 70 +area: CI +title: a release is measured at its tag and recorded by main (this change) +prs: [337, 350] +--- +report.yml checked out the release's tag and ran `releases measure`, which wrote the record and the page with the tag's code, and `releases propose` put them on main (#337). v20261120.04's proposal (#350) failed main's TestTheCommittedPageIsTheRecords: #342 had changed `lab.Chart` after the tag, so the tag's page was not the one main writes from the same records, and it was fixed by hand with main's `releases doc` (75a3b24). Measuring stays at the tag, which boots each release with its own spin-machine and the tag's probes, and `releases measure` now only keeps the ladders. A second checkout of main builds its own spin-machine-dev, `releases record` (now taking every ladder.json) writes the records and the page, and `propose` runs there. Functional: no boot number moves. diff --git a/docs/log/2026-11-21-a-restore-reads-its-state-ahead-before-qemu.md b/docs/log/2026-11-21-a-restore-reads-its-state-ahead-before-qemu.md new file mode 100644 index 00000000..384a6551 --- /dev/null +++ b/docs/log/2026-11-21-a-restore-reads-its-state-ahead-before-qemu.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-21" +order: 410 +area: machine, spin-machine +title: a restore reads its state ahead before QEMU answers (lab 44976494418, this change) +runs: [44809512339, 44912471522, 44976494418] +--- +restore-first's evicted login read 16 ms more than the cached one (111 against 95.2, main's spin-machine on v20261122.01's parts, 30 restores each). That gap is the disk. `Resume` started the read-ahead (lab 44809512339), but `spin-machine restore` calls Resume only after its dial, and the dial waits for QEMU's first answer, ~19.5 ms after its exec (`transport`, lab 44912471522). So the read began when QEMU was ready to load and never overlapped QEMU's start. `machine.ReadAhead` is the read-ahead with Resume's rule (a full load of a mapped-ram state), and `restore` calls it once the state is open, before the dial. Resume still calls it for callers that do not, and the kernel skips the pages a first call already asked for. *Measured* (bench, nested, spin's shape and login, 30 a side interleaved, lab 44976494418): evicted login 111 → 101, −9.3 [−12.2, −7.3], and `running` −8.1 [−9.4, −6.5]. The cached row read −0.2 [−2.2, +1.5], as it should with nothing left to read. The cold login read −7.5 [−12.8, +0.0], within noise, and no cold boot runs this code. *What limits it now:* the evicted row is 6 ms over the cached one. The read starts ~5 ms after QEMU's exec, once boot has bound the socket and `restore` has started, and a sequential reader takes ~60 ms for the state's 179 MiB (`read`, the same run). *Status:* in place. spin's runner, once it resumes through `machine.QEMU.Resume`, calls ReadAhead before `machine.Start`. diff --git a/docs/log/2026-11-21-a-workspace-checkpointed-and-continued-grows-boot-cpu.md b/docs/log/2026-11-21-a-workspace-checkpointed-and-continued-grows-boot-cpu.md new file mode 100644 index 00000000..4be30c07 --- /dev/null +++ b/docs/log/2026-11-21-a-workspace-checkpointed-and-continued-grows-boot-cpu.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-21" +order: 390 +area: boot, machine +title: 'a workspace checkpointed and continued grows: `boot:cpu-plug` (#433, this change)' +issues: [433] +prs: [417] +--- +The overhead lane had seen vCPUs plugged right after a checkpoint's `Continue` never reach the guest in 2 of 5 runs, and plugged before its checkpoint since. *Traced* (a miss of the lane in #433's order, its states under `/var/tmp` on ext4, the laptop's disk busy and its swap full, QEMU `-trace` on `cpuhp_acpi_*`, `acpi_gpe_*` and `monitor_qmp_cmd_in_band`): QEMU received no command for 73 s after `cont`. The guest gave up after its 60 s, with `gpe02` at 0 events and no status bit and `sci` at 0, so QEMU had raised nothing. The `device_add`s came after, and the guest took all 15 insert events within 0.4 s. What held the plug was the lane's own helper, which closed the state between `Continue` and the plug. ext4 writes back a file QEMU truncated on its first close, and that close took 0.6 ms to 75 s across 9 checkpoints in the same lane. Nothing was lost in QEMU's hotplug or in the guest's GPE handling. *Ruled out* (laptop, real KVM, v20261121.01 with this checkout's spin-machine, states on tmpfs, so every close is free): 0 misses in 200 guests each way after a checkpoint, after a plain stop and cont, and with no pause. Also 0 in 100 each way after a checkpoint and a stop on two CPUs a spin loop keeps busy, 30 checkpoints with 1400 MiB of the guest filled there, 10 each way at 30% and at 5% of one CPU, 100 checkpoints with #417's close in the save's path again, and 100 each way in a guest whose PID 1 is a shell. The lane in #433's order missed 0 of 50. *Built:* `TestAWorkspaceCheckpointedAndContinuedGrows` (`task boot:cpu-plug`). spin's shape is booted to systemd at 2048 MiB and checkpointed and continued, then given 16 vCPUs, 8192 MiB and four disks at once. The guest must have all of them within 20 s, in 10 guests, and the state is closed once it has. compat.yml runs it, since a QEMU or kernel that lost a hotplug after a migration would leave a workspace at its size, and lab.yml's `check:cpu-plug` runs it on the bench. *Measured:* 10 guests grew in 0.31-0.71 s with the state on tmpfs. With it on ext4 written back at 10 MB/s while the guest grew (a scope's `IOWriteBandwidthMax`), 5 grew in 0.31-1.18 s. `Checkpoint`'s comment now says that the close or sync after `Continue` can take as long as the disk needs, and that a caller must not hold the next command behind it. The lane's comment that blamed the checkpoint is gone. *Status:* in place. diff --git a/docs/log/2026-11-21-deferred-struct-page-init-deleted-the-loop-and.md b/docs/log/2026-11-21-deferred-struct-page-init-deleted-the-loop-and.md new file mode 100644 index 00000000..2e1a51d7 --- /dev/null +++ b/docs/log/2026-11-21-deferred-struct-page-init-deleted-the-loop-and.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-21" +order: 120 +area: kernel +title: '`DEFERRED_STRUCT_PAGE_INIT` deleted, the loop and 8250 counts kept (lab 44839538785, #356, #357)' +prs: [345] +runs: [43495583323, 44839538785] +--- +The three options #345's arm meant to measure and did not, one arm each against main's kernel (d255113), prestart in spin's shape, 40 boots a side, v20261120.04's QEMU and image. `DEFERRED_STRUCT_PAGE_INIT` off, upstream's default: cold first login −2.5 [−9.3, +3.8] ms, restored +1.1 [−6.4, +7.9], into a QEMU started ahead −4.0 [−13.0, +13.3]. It was kept on 11-13 for a memmap of 5.2 ms at 2 GiB at boot (lab 43495583323). spin boots 128 MiB, which the kernel does not defer, and plugs the rest through virtio-mem, which it never defers. A boot option does not run in a restored guest, so the restored row's upper bound over +5 says the run's noise, not the option. Upstream's 8 loop devices and 4 runtime ports: cold +5.3 [−3.2, +15.0], restored +1.7 [−6.7, +12.7]: within noise, but the cold bound does not rule out the 2-4 ms the initcalls and udev's coldplug of 8 more block devices would cost, so the counts stay. *Status:* the deferred page init deleted; the counts kept. diff --git a/docs/log/2026-11-21-every-doc-checked-against-the-tree-and-spins.md b/docs/log/2026-11-21-every-doc-checked-against-the-tree-and-spins.md new file mode 100644 index 00000000..f96a9cd7 --- /dev/null +++ b/docs/log/2026-11-21-every-doc-checked-against-the-tree-and-spins.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-21" +order: 160 +area: docs +title: every doc checked against the tree and spin's main (this change) +runs: [44847770977, 44848049631] +--- +A pass over every document for claims the code no longer bears out: names, defaults, files, spin's policy (read at spin's d4f62bd), and *Status* lines. Numbers that only a run can settle are listed in docs/boot-time.md's open experiments, not changed. Two were measured: TCG reaches the first login in 7604 ms against KVM's 455, ~17 times, where the docs said fifty (`ssh-first`, lab 44848049631, 5 boots each). QEMU's mapped files are 6.6 MiB resident on v20261120.04 against the ~42 MB of 11-14, because the bzImage is read into QEMU's memory where the vmlinux was mapped (`ssh-first`'s new `qemu_rss_anon`, `qemu_rss_file` and `qemu_rss_shmem`, lab 44847770977). *Status:* in place. diff --git a/docs/log/2026-11-21-pid-1s-quiet-logging-and-the-printk-sysctl.md b/docs/log/2026-11-21-pid-1s-quiet-logging-and-the-printk-sysctl.md new file mode 100644 index 00000000..67352558 --- /dev/null +++ b/docs/log/2026-11-21-pid-1s-quiet-logging-and-the-printk-sysctl.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-21" +order: 110 +area: image +title: 'PID 1''s quiet logging and the printk sysctl deleted (labs 44818953987, 44822157367, #354)' +runs: [44818953987, 44822157367] +--- +optimize-systemd.sh set the manager's `LogLevel=err`, `LogTarget=journal`, `ShowStatus=no` and `StatusUnitFormat=name`, and wrote `kernel.printk = 3 3 3 3`, for a quiet, fast boot, never measured. Taken back together (`lab` edit `carry-logging`) against v20261120.04 in spin's shape, the cold first login read +2.4 [−2.3, +7.8] ms at 20 boots and −1.8 [−7.7, +3.2] at 40; accept to login +1.7 [+0.2, +3.2], the second login +1.8 within noise. The console is quiet through the command line's `quiet loglevel=3` either way. The timeouts in fast-boot.conf stay. The `carry-*` edits stay too, as the tool to run the ablation again (docs/boot-time.md). *Status:* deleted. diff --git a/docs/log/2026-11-21-restores-in-a-burst.md b/docs/log/2026-11-21-restores-in-a-burst.md new file mode 100644 index 00000000..43532986 --- /dev/null +++ b/docs/log/2026-11-21-restores-in-a-burst.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-21" +order: 30 +area: lab +title: restores in a burst (lab 44792429636) +runs: [44792429636] +--- +Beside picking 8 channels (above), `restore-together` showed that 8 restores let go at once take ~330-400 ms each to the first login at any channel count, against ~100 alone and ~140 four at once. Not explained (docs/boot-time.md, "Open experiments"). diff --git a/docs/log/2026-11-21-spins-login-path-starts-from-the-boots-first.md b/docs/log/2026-11-21-spins-login-path-starts-from-the-boots-first.md new file mode 100644 index 00000000..e14c289c --- /dev/null +++ b/docs/log/2026-11-21-spins-login-path-starts-from-the-boots-first.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-21" +order: 40 +area: image +title: 'spin''s login path starts from the boot''s first dispatch, beside udev at the lowest weight (lab 44805051310, PR #338''s edits)' +prs: [338] +runs: [44805051310] +--- +docs/boot-time.md's "Open experiments" row, a bound on spin's path. ssh.service alone without default dependencies had still started right after basic.target: it is after Ubuntu's `sshd-keygen.service`, wanted by it and with default dependencies, whose `ConditionFirstBoot` never holds here: a job waits for its ordering before PID 1 checks its condition. logind and dbus-broker had none, but `PrivateTmp=` orders a unit after `systemd-tmpfiles-setup.service`. `lab` edits `login-early` (ssh.socket, ssh.service, sshd-keygen and the probe's forwarder without default dependencies, shutdown conflicts kept; logind and the broker with `PrivateTmp=no`) and `udev-startup` (udevd and its trigger at `StartupCPUWeight=1`). On the bench, spin's shape and login, v20261120.03, 20 boots each interleaved: `login-early` first login −10.8 [−16.3, −5.2], sshd accepts −33.6, accept to login +23.0, console prompt +18, because with the login early it ran beside udev's coldplug on the one vCPU. Both edits −59.4 [−65.9, −56.2], accepts −56.0, accept to login −4.6, second login +6.1 [+3.7, +7.9], console prompt +51.4 (the serial getty waits for dev-ttyS0, which the coldplug announces). On a laptop, sessions had their `XDG_RUNTIME_DIR`, no unit failed and poweroff stopped QEMU in ~123 ms as the release does. *Side effects:* logind and the bus share the machine's /tmp (read-only to logind under ProtectSystem=strict); the console prompt later; udev's coldplug finishes later. *Status:* the image's half kept (`image/`: the three `10-lane.conf`, `30-privatetmp.conf`, `20-startup.conf`, asserted by build.sh). spin's supervisor forwarder is spin's to order, proposed in docs/boot-time.md's "Open experiments". parts.yml keeps no image artifact, so the image is measured as the release with `--edit lane`, which now carries these drop-ins, and `--edit forwarder-early` orders the probe's forwarder as spin's supervisor would be. A laptop lead, 8 boots each: the image with the forwarder as spin orders its supervisor today (after basic.target) +21.3 [-46.1, +261.0], with it early -56.0 [-116.5, +169.8]: with udev at the lowest weight, basic.target can come later, and the image alone may cost spin until its supervisor moves. The bench decides. diff --git a/docs/log/2026-11-21-the-cold-budget-in-spins-shape-and-docs.md b/docs/log/2026-11-21-the-cold-budget-in-spins-shape-and-docs.md new file mode 100644 index 00000000..5f776e42 --- /dev/null +++ b/docs/log/2026-11-21-the-cold-budget-in-spins-shape-and-docs.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-21" +order: 130 +area: docs +title: the cold budget in spin's shape, and docs/boot-time.md (lab 44841266997, this change) +runs: [44841266997] +--- +`ssh-first` on v20261120.04 as published, spin's shape and login, 20 boots: sshd accepts 396/406, first login 465/479, accept to login 68.4, a second login 35.9. With the release's report (QEMU's exec to a guest ready ~28 by difference, "Freeing" 79.9) and `firmware-stages` (33.6 to the kernel's clock), PID 1 to sshd accepting is ~255 ms, more than half the cold boot. The budget measured before was in the ladder's shape and showed ~75-85. A QEMU started ahead removes the first ~28 ms only: firmware and the kernel run after `cont`. docs/lab.md is renamed docs/boot-time.md and reordered for the next investigation: the numbers, both budgets in spin's shape, the method with the deletion rule, one ledger of what the machine carries, the rejected ideas by part with the shape each was measured in, the open experiments with their budget entries, and the questions no run answers. *Status:* in place. diff --git a/docs/log/2026-11-21-the-machine-sends-qmp-through-the-public-client.md b/docs/log/2026-11-21-the-machine-sends-qmp-through-the-public-client.md new file mode 100644 index 00000000..e67a76a7 --- /dev/null +++ b/docs/log/2026-11-21-the-machine-sends-qmp-through-the-public-client.md @@ -0,0 +1,7 @@ +--- +date: "2026-11-21" +order: 190 +area: machine/qmp +title: the machine sends QMP through the public client, each command defined once (this change) +--- +`machine.QEMU` runs on `*qmp.Client`, and machine/qmp.go, the third QMP client after spin's two, is deleted. Every command the machine sends is a `qmpdef.Define`d value beside the code that sends it, and the block and descriptor commands spin's storage agent also sends are public in qmp/block.go. `spin-machine-dev verify qemu` holds all of them to the binary's query-qmp-schema, which refused the record's `query-kvm`: QEMU 11.2.0-rc0 deprecates it. The accelerator is read from `query-accelerators`, whose `enabled` is the accelerator's name, `kvm` or `tcg` for every machine `Spec.Args` starts, so the record's part stays `{"accel", "kvm"}` or `{"accel", "tcg"}`. The version comes from the monitor's greeting, which is query-version's answer, so a record is 7 round trips. *Measured* (laptop, v20261120.04 with QEMU 11.2.0-rc0, spin's shape, `spin-machine` built before and after): the record of a running machine and of one held for a checkpoint are byte-identical under KVM and under TCG, a checkpoint saved by the old `spin-machine` restores with the new one (`restore --target`), and boot:record passes. A round trip costs more through the client: query-memory-size-summary's p50 went from 216 to 263 µs, +47 [+44, +49], and in a second run from 136 to 159, +23 [+21, +27] (laptop under load, one held machine of spin's shape, the old and new client in turn, 6000 and 4500 each). What it pays for is the reader waking the waiting call on another thread: the same client under GOMAXPROCS=1 read 106 µs, below the old client. The record's read moved −0.4 ms [−2.6, +1.7] with one round trip fewer. A restore sends ~20 commands before QEMU loads its state, so 0.5-1 ms more on restore-first is expected (inferred, under the bench's noise at 20 boots). The query-migrate polls stay; events replace them in a change of their own, interleaved against the release on the bench, which decides both. *Status:* in place; no checkpoint is stranded. diff --git a/docs/log/2026-11-21-the-package-opens-a-disks-chain-and-the.md b/docs/log/2026-11-21-the-package-opens-a-disks-chain-and-the.md new file mode 100644 index 00000000..c00a2c52 --- /dev/null +++ b/docs/log/2026-11-21-the-package-opens-a-disks-chain-and-the.md @@ -0,0 +1,7 @@ +--- +date: "2026-11-21" +order: 240 +area: machine +title: the package opens a disk's chain, and the base only to read (this change) +--- +A `machine.Disk` took open files, and each caller read the chain itself: `cmd/spin-machine/chain.go` from the qcow2 headers, the boot tests by hand, and spin's runner through `qemu-img info --backing-chain` under Landlock, refusing an image outside the disk's own. `machine.OpenDisk(DiskPath)` now opens the top read-write unless the disk is read-only and every image below it read-only. It reads the chain from the headers and refuses a backing file that is not a regular file under the caller's `Under` (files or directories), symbolic links resolved. A writable top that is one of `Under`'s images, the shared base, is refused (rule 1). Each backing file is opened `O_PATH`, checked through its descriptor and reopened through it, so no rename falls between the check and what QEMU is handed. A FIFO is never opened to find out what it is. A chain that comes back on itself, a missing backing format, an encrypted image, an external data file, a backing name over QEMU's 1023 bytes and a header that claims more than its first cluster are refused, each naming the file. `Image.Size` carries the size the guest sees, which spin bounds QEMU's writes by. `spin-machine --disk` takes the release's base as `Under` unless `--disk-under` names others, and `lab compat` names the previous release's. *Header parser vs qemu-img, measured* (laptop under load, one chain of overlay, overlay and the release's base): `qemu-img info -U --backing-chain` 3.4 ms p50 over 50 runs, `OpenDisk` 0.045-0.050 ms, the reader it replaces 0.015 ms. *Landlock:* not needed in process. It confined qemu-img's C parser to the images it was given. This reader executes nothing, opens nothing before checking it, and bounds every read by the first cluster (at most 2 MiB). *Goal numbers:* not run on the bench. The 0.03 ms the checks add to a boot's or a restore's disk open is under the ±7-9 ms a 20-boot interval resolves. boot:record passes on a tree of v20261121.01 with this spin-machine, its root disk now opened by `OpenDisk`. *Status:* in place. spin adopts it in place of `backingChain`, passing its disk's images other than the top as `Under`. diff --git a/docs/log/2026-11-21-the-package-starts-and-ends-the-qemu-it.md b/docs/log/2026-11-21-the-package-starts-and-ends-the-qemu-it.md new file mode 100644 index 00000000..ecf54612 --- /dev/null +++ b/docs/log/2026-11-21-the-package-starts-and-ends-the-qemu-it.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-21" +order: 230 +area: machine +title: the package starts and ends the QEMU it defines (labs 44912292706, 44912896763, 44914490616, 44914952228, this change) +runs: [44912292706, 44912896763, 44914490616, 44914952228] +--- +Every caller assembled one QEMU's life itself: exec it, wait for the monitor's socket, dial, `qmp.New`, `Attach`, keep its output, kill and reap. In this tree there were ~7 such wrappers and ~8 dial loops, with poll intervals of 1, 5 and 20 ms, socket waits from 5 s to unbounded and handshake timeouts from 5 s to 2 min, and spin's runner had its own. `machine.Start(ctx, Spec, StartOptions)` now returns a `*machine.Process`: the `*machine.QEMU` its own monitor drives, with the process under it. Start opens and hands QEMU every descriptor the Spec implies (each monitor's socket, bound by Start, `/dev/kvm`, `/dev/vhost-vsock`, `/dev/vhost-net` per NIC, a `file:` console), so QEMU opens no path. The caller keeps its TAPs and disks, and shapes the process (uid, chroot, namespaces, cgroup) through `StartOptions.Cmd`, which runs after the opens. Readiness is Start's own monitor, bound and connected before QEMU exists and answered by QEMU's main loop once the machine is made. Nothing is polled. `Exit` holds the wait status, the last `SHUTDOWN`, the console's panic line when Start reads the console, and stderr's last 4 KiB. `Stop` presses the power button of a running guest, then quits, then sends SIGKILL, each step bounded. A monitor silent for 1 s (a QEMU loading a state) is killed. `machine.Dial` replaces the dial loops for a second monitor. `spin-machine boot` starts QEMU through Start and waits beside it, with Pdeathsig, instead of exec'ing it with a `_bind` helper. *Observed on real QEMU* (laptop, KVM and TCG, v20261121.01's QEMU): a held machine stopped is quit, `exit status 0` with SHUTDOWN host-qmp-quit. Killed, it reads `signal: killed` with no SHUTDOWN. A refused device fails the start at once with QEMU's line (`Property 'virtio-balloon-pci.no-such-property' not found`). `poweroff -f`, `Shutdown` under systemd and a panic end as guest-shutdown, guest-shutdown and guest-reset, exit status 0 (boot:record). *Measured* on the bench, spin's shape and login, v20261121.01 with its own spin-machine against the same tree with this branch's: ssh-first's first login +0.5 [−5.2, +8.3] at 20 boots (lab 44912292706) and −2.9 [−7.0, +5.0] at 40 (lab 44914952228), sshd accepting −3.5 [−6.8, +3.1], within noise. restore-first at 20 read the cached login +3.6 [+1.5, +4.5] (lab 44912896763), and at 40 +0.4 [−1.7, +3.1] evicted and +0.7 [−2.1, +3.1] cached, running +2.2 [−0.1, +5.2] and +0.4 [−1.1, +2.9], within noise (lab 44914490616). The cached cold login inside that run read +4.9 [+1.8, +9.5], where ssh-first's 40 cold logins read −2.9, so it is read as the probe's noise and left for the next release to confirm or not. *Why no gain:* the dial polls were never on the clock. A client polling the socket found it long before QEMU could answer, because QEMU makes the socket early in its start and answers only once the machine is made (the `transport` entry above: spin-machine's first command waits 17 ms on QEMU). *Status:* in place. spin follows, in place of its runner's own start, handover and shutdown. diff --git a/docs/log/2026-11-21-the-pressure-probe.md b/docs/log/2026-11-21-the-pressure-probe.md new file mode 100644 index 00000000..44237106 --- /dev/null +++ b/docs/log/2026-11-21-the-pressure-probe.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-21" +order: 260 +area: machine/image +title: the pressure probe (labs 44921602512, 44921841077, 44923048262, 44924252325, 44924755505, 44926664003, 44926917170, this change) +issues: [391, 394, 395, 396] +runs: [44921602512, 44921841077, 44923048262, 44924252325, 44924755505, 44926664003, 44926917170] +--- +A runner hosts ~20 workspaces. The platform has to say which of them is short of CPU, memory or IO, which one causes it, and when QMP is slow, so that an agent can later act on one machine at a time. The machine now owns both ends of a probe. In every guest, `spin-machine-pressure.timer` starts a static sender 10 s after the boot. It runs at Nice 19, on the idle scheduler and IO class, as root, out of the OOM killer's way. It arms PSI triggers (150 ms in 1 s) on the guest's CPU, memory and IO, watches its OOM kills, and writes a line to host vsock port 1032 each time one fires. On the host, `machine.ListenPressure` routes each connection by the CID the kernel names. `StartOptions.Pressure` adds the same triggers on QEMU's cgroup, and times every QMP command against what that command took before. `Process.Usage` reads the counters that say who causes a stall: the cgroup, `query-blockstats`, and the balloon's OOM kills and allocation stalls. A prototype settled the shape first. Guest PSI is blind to the host taking a vCPU, and a fast OOM killed before any trigger fired. Host cgroup PSI tells the two apart, but a trigger with a window under 2 s is root's alone. No QMP event carries pressure, and a QEMU loading a state answers no command, so the timing follows the migration's events. *Observed on real QEMU* (task boot:pressure, laptop, v20261121.01, one vCPU, 1 GiB, QEMU pinned to one core, several runs). Three loops brought guest CPU stalls each second and no host ones. One loop with two host hogs on its core brought host CPU stalls each second, and `query-blockstats` took 536 ms against a 14 ms baseline, a `SlowCommand`. Two readers of the disk, 4 KiB at a time, brought guest IO stalls; 1 MiB reads from one reader stalled the guest only now and then. A working set reread through what a 700 MiB tmpfs left brought guest memory stalls. A stream read once did not, because clean cache is reclaimed without a stall. A 3000 MiB allocation brought `OOMKill{1}`. The lane found two bugs. The sender spun at ~0.8 s of the guest's CPU a second, because a kernfs file polls as changed until it is read again. And the OOM killer took the sender in the very OOM it was there to report. *Measured* on the bench, spin's shape and login, v20261121.01 against the same release with the sender put into its overlays (`--edit pressure`), interleaved. Ordered after multi-user.target, the sender started beside the first login. The first login read +0.5 [−2.6, +6.7] at 20 boots (lab 44921602512) and +2.5 [−2.1, +7.6] at 40 (lab 44924252325). With `Type=idle` it read +6.1 [+2.3, +10.0] (lab 44924755505), because the boot's jobs are done just before the login arrives. sshd accepting to the login read +2.6, +3.3 and +2.9 in those three runs, each excluding 0. Started by the timer, the first login read −0.5 [−3.6, +2.9] and accept-to-login −0.5 [−1.8, +0.9] (lab 44926664003, 40 boots). The restored login read +0.2 [−3.0, +2.7] evicted and +1.4 [−3.8, +4.7] cached at 20 (lab 44921841077), and +0.3 [−2.5, +3.2] and +1.1 [−3.6, +4.7] at 40 (lab 44923048262), with the sender running in the checkpoint. With the timer it read +1.8 [−2.0, +5.2] evicted and +0.9 [−2.5, +3.4] cached at 40 boots, the sender not yet started when the state was saved (lab 44926917170). *Status:* in place. A guest's first 10 s go unreported. spin follows with one listener and a watch per Start. Its guest supervisor's `POST /v2/memory-pressure` on port 1027 is then deleted in favour of `Stall{Guest, MemoryPressure}`. The actuators are #395 and #396, and the open questions #391-#394. diff --git a/docs/log/2026-11-21-the-probes-boot-size-and-log-in-as.md b/docs/log/2026-11-21-the-probes-boot-size-and-log-in-as.md new file mode 100644 index 00000000..4978c15b --- /dev/null +++ b/docs/log/2026-11-21-the-probes-boot-size-and-log-in-as.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-21" +order: 10 +area: lab +title: the probes boot, size and log in as spin does, unless asked (this change) +runs: [44750322384, 44784196287, 44785179901] +--- +#319 made spin's shape the probes' default, but left the guest at 128 MiB and logged in by the lane, and both made numbers spin never sees: at 128 MiB the guest OOM-kills its way through the boot (lab 44784196287), and on spin's path the cold first login read 532 ms where the lane's read 445 (labs 44785179901, 44750322384). `plugged` is now 2048 and `login` spin unless a run says otherwise; `plugged=0 login=lane` with the old shape options is the shape before. The release records measure what the probes measure, so the first record after this one is the first in spin's shape, and its pair's Δ (`against`) is measured in the same shape. The `floor` edit's sshd serves the lane, so a floor run passes `login=lane`. diff --git a/docs/log/2026-11-21-the-probes-boot-spins-16-controller-targets.md b/docs/log/2026-11-21-the-probes-boot-spins-16-controller-targets.md new file mode 100644 index 00000000..1334a371 --- /dev/null +++ b/docs/log/2026-11-21-the-probes-boot-spins-16-controller-targets.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-21" +order: 150 +area: lab +title: the probes boot spin's 16 controller targets (lab 44847364468, this change) +runs: [44847364468] +--- +spin's c0ffbc0 (2026-11-20) gave the hotplug controller 16 targets, 4 for disks attached at run time and the rest for the extensions a workspace boots with, where the probes booted 4. `ssh-first` on v20261120.04, 20 boots each, interleaved: first login −3.8 [−11.1, +4.5], sshd accepting −2.3 [−6.3, +2.4], within noise. *Why:* the probes measure spin's shape. *Result:* `hotplug-disks` defaults to 16, and the budget's rows taken with 4 stand. *Status:* in place. diff --git a/docs/log/2026-11-21-the-pvh-boot-path-deleted.md b/docs/log/2026-11-21-the-pvh-boot-path-deleted.md new file mode 100644 index 00000000..5a0041c4 --- /dev/null +++ b/docs/log/2026-11-21-the-pvh-boot-path-deleted.md @@ -0,0 +1,7 @@ +--- +date: "2026-11-21" +order: 140 +area: machine/kernel/qemu +title: the PVH boot path deleted (this change) +--- +Since v20261119.02 the machine boots a bzImage through qboot and fw_cfg, and PVH stayed only as a fallback: `machine.OpenRelease` booted a release's vmlinux through `pvh.bin` when it had no bzImage, `--kernel` took a vmlinux, and machine's QEMU tests loaded an ELF stub through `pvh.bin`. Nothing called any of it. `OpenRelease` now requires `kernel/bzImage` and `linuxboot_dma.bin` and names the missing file. `--kernel` refuses a file without the bzImage's `HdrS` header. `pvh.bin` no longer ships, and machine.env loses `pvh_sha256`. The machine's QEMU tests load a bzImage stub instead. The kernel config changes: `CONFIG_PVH` is off, so the kernel and its checksum change, and the vmlinux still ships for what reads its symbols. *What it costs:* `lab compat` stops at the first release without a bzImage, which is v20261119.01 and every release before it, so v20261119.02 is the oldest it checks. spin's Taskfile.yml:250 checks for `_output/qemu/pvh.bin` and must drop that line. The fingerprint does not move: it hashes neither the kernel nor the option ROM. *Status:* in place. diff --git a/docs/log/2026-11-21-the-restore-into-a-qemu-started-ahead-taken.md b/docs/log/2026-11-21-the-restore-into-a-qemu-started-ahead-taken.md new file mode 100644 index 00000000..a02123e1 --- /dev/null +++ b/docs/log/2026-11-21-the-restore-into-a-qemu-started-ahead-taken.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-21" +order: 50 +area: lab/machine +title: the restore into a QEMU started ahead, taken apart (laptop leads; the `split` probe, branch `restore-split-lab`, not for main) +runs: [44798669409, 44809015139, 44809512339] +--- +106/112 ms on the bench (lab 44798669409): running at 59, the login ~47 after. `lab` probe `split` runs the prestarted QEMU under its trace with host timestamps and reads the guest's journal and per-task CPU. *To running* (laptop, spin's shape, 8 channels, state evicted, 24 restores): spin-machine's exec and dial 2.1 ms, ~20 QMP round trips to migrate-incoming 6.0 (query-cpu-model-expansion 0.5 of it, each round trip ~0.25), the header 1.5-9 (the first read of a cold file), the RAM load 50.4, the device state 3.4 (~0.4 a virtio device), to running 1.1, the reply 1.5. The state is 181 MiB of data: the guest's ~117 MiB in use, the memmap of 2 GiB plugged, the kernel; settling 10 s before the save took off 3 MiB, so free page reporting has little to give. Read from the page cache the load is ~10 ms instead of 50 (running 29.6 against 78, 6 each), so the load evicted is the disk. `direct-io` (O_DIRECT for the channels) was within the noise evicted and +45 ms cached. *Running to the login* (laptop ~33 ms, guest clock from vmgenid's "crng reseeded due to virtual machine fork"): the accept probe's connection ~5 ms (socat's child, sshd forking an sshd-session that reads EOF), the connection to "Accepted publickey" ~22, the session and `true` ~4. A second login right after reads 25-29, so the restore costs the first login ~5 ms over a warm one here. The probes' logins were never closed (`Key.Run` gave Go a blocking socket, closed only once nothing read it): the checkpoint held the cold login's session, and the restore's vsock transport reset tore it down beside the login timed. Closing it: 37.1 → 34.8 ms after running, dropping the accept probe as well 31.5 (8 each). *On the bench* (spin's shape, v20261120.03, 20 each): `split` (lab 44809015139) read to running 58.7 ms, of it the RAM load 38.8, the QMP round trips 8.3, the dial 2.3, the device state 4.5; the login left open cost the first login ~5 ms (104 → 99.1), the accept probe ~4 more (95.3). `prestart` (lab 44809512339), the read-ahead against the release: restored into a QEMU started ahead 95.0/100 → 82.1/87.4, Δp50 −12.9 [−14.7, −9.8], running −11.9; restored −12.1 [−15.3, −8.9]; the cold boots within the noise. *Changed:* the probes close their logins; `machine.Resume` reads the state's data ahead from its first line. spin resumes through `machine.VM.Resume` (`internal/runner/qemu/checkpoint.go`), so it takes the read-ahead with the pin. *Status:* kept. diff --git a/docs/log/2026-11-21-the-verbs-spins-runner-drives-a-qemu-by.md b/docs/log/2026-11-21-the-verbs-spins-runner-drives-a-qemu-by.md new file mode 100644 index 00000000..05f93716 --- /dev/null +++ b/docs/log/2026-11-21-the-verbs-spins-runner-drives-a-qemu-by.md @@ -0,0 +1,7 @@ +--- +date: "2026-11-21" +order: 210 +area: machine +title: the verbs spin's runner drives a QEMU by (this change) +--- +`machine.QEMU` gains `CPUs`, `Status`, `Hold`, `Shutdown`, `Done`, `End` and `GuestMemory`. `Memory` returns `MemorySize{Now, Base, Ceiling, Block}`, and `Checkpoint` returns the save's `Cost{Paused, Total, RAM}` from one `query-migrate` after it completes. `VM` gains `CPUs` and the two new returns. The balloon gets an id, `balloon0`, so that `GuestMemory` reads it at a fixed path. It turns the guest's reports on at its first call, so no timer runs in a boot that never asks. *The record:* a held machine of spin's shape read the same 34170 bytes of record with and without the id (laptop, v20261120.04, `spin-machine target` from each build), because the record leaves every id out and names the balloon by its slot. *Shutdown, decided by observation:* spin's runner pressed ctrl-alt-del and pressed the power button only if QEMU refused the keys. QEMU takes them, and the guest never sees them: its kernel has no i8042 or AT keyboard driver. Booted to systemd, a machine sent the keys ran until it was killed (SHUTDOWN host-signal), and one whose power button was pressed powered off 0.64 s later (SHUTDOWN guest-shutdown). So `Shutdown` presses the button alone. *What `End` says* (`TestTheMachineSaysHowItEnded`, in `boot:record`): `poweroff -f` ends as {guest, guest-shutdown}, `Shutdown` under systemd as {guest, guest-shutdown}, and a panic as {guest, guest-reset}, since `panic=1` reboots and `-no-reboot` ends the reboot. No panic device exists, so `GUEST_PANICKED` is never sent. A checkpoint of a 128 MiB guest at the `/bin/sh` prompt cost a 5 ms pause, 56 ms in all and 86 MiB of RAM written. No goal path changes timing: `Boot` and `Resume` send what they sent, and the cost's round trip is on the save, before either clock. *Status:* in place; no checkpoint is refused. diff --git a/docs/log/2026-11-21-what-a-host-gives-a-machine-spec-files.md b/docs/log/2026-11-21-what-a-host-gives-a-machine-spec-files.md new file mode 100644 index 00000000..942cfb59 --- /dev/null +++ b/docs/log/2026-11-21-what-a-host-gives-a-machine-spec-files.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-21" +order: 350 +area: machine +title: 'what a host gives a machine: `Spec.Files`, `Spec.Overhead`, `Disk.Overhead` (this change)' +issues: [433] +--- +spin hard-coded two facts that depend on the machine and its release. It linked a release's whole firmware directory into each QEMU's root, and it bounded each QEMU's cgroup at the guest's ceiling plus 768 MiB and at its vCPU ceiling plus 256 tasks. *Traced* (strace of a KVM and a TCG boot): QEMU opens by name its binary, the kernel, the initrd, and from the firmware directory the BIOS, `linuxboot_dma.bin` and `kvmvapic.bin`. It also opens `/dev/null` for its OFD lock probe. It reads `/proc`, `/sys`, `/dev/urandom` and `qemu.conf` only when they are there. `efi-virtio.rom` is never opened, since every NIC has `romfile=`. *Built:* `Spec.Files`, `Spec.Overhead() (Overhead{Memory, Tasks}, error)`, which reads the kernel's and the initrd's sizes, and `Disk.Overhead`, each qcow2 image's L2 cache (its whole L2 table up to 32 MiB) and four clusters of refcounts, from `read_cache_sizes`. Tasks are counted up to their most: one thread a vCPU slot, QEMU's four, a vhost worker for each device, a checkpoint's channels and their driver, QEMU's thread pool (64, and a thread it cannot start aborts QEMU) and io_uring's workers (the ring's 128 entries). Memory is 64 MiB of QEMU's own, the kernel and the initrd, 1 MiB a vCPU, 64 KiB a thread, and 1/256 of the ceiling for page tables. *Verified* (task boot:overhead, laptop, real KVM, v20261121.01): spin's shape with a NIC and a vsock started as nobody in a root holding only `Files` and `/dev/null`, in a cgroup of its own, and was taken to its ceiling. That is 16 vCPUs, 8192 MiB filled from `/dev/urandom`, and four disks attached beside its two, one of them a 64 GiB overlay the guest wrote a block of every 512 MiB, while the guest read, wrote and trimmed every disk. It was then checkpointed. Beyond the guest it held 31 MiB and 9 tasks at boot, 73 MiB and 27 tasks at the ceiling, and 79 MiB and 34 tasks (pids.peak) through the checkpoint. Of the 73 MiB, 27 were page tables, 16 the bzImage and 8 the big disk's L2 cache. `Overhead` for it, disks included, is 153 MiB and 223 tasks. *Found on the way:* the cgroup's `anon` is not QEMU's memory beyond the guest. A huge page the guest gave back in part stays charged until the kernel splits it, and it read 160 MiB above `smaps` just after the guest freed 1.4 GiB. The lane counts QEMU's own from `smaps`. In 2 of 5 runs, vCPUs plugged right after a checkpoint's `Continue` never reached the guest (#433). The lane plugs before it checkpoints. The checkpoint at the ceiling also got this laptop's QEMU OOM-killed once, by the host, with its swap full. *Not measured:* a restore and a QEMU that has run for days. spin adopts the root and the bounds through spin-stack/spin issues. *Status:* in place. diff --git a/docs/log/2026-11-21-what-a-snapshot-keeps-boot-rollback.md b/docs/log/2026-11-21-what-a-snapshot-keeps-boot-rollback.md new file mode 100644 index 00000000..218db712 --- /dev/null +++ b/docs/log/2026-11-21-what-a-snapshot-keeps-boot-rollback.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-21" +order: 300 +area: boot +title: 'what a snapshot keeps: `boot:rollback` (#408, lab 44937567816, this change)' +issues: [408, 419] +runs: [44937567816] +--- +Nothing checked that a rollback brings back the same memory and disk, byte for byte. boot:record checked that a counter goes on after a restore, and boot:compat that a release's checkpoint resumes. *Built:* `TestARollbackBringsBackTheSameMemoryAndDisk` (`task boot:rollback`, lab.yml's `check:rollback`). It boots spin's shape plugged to 2 GiB to systemd, logs in as root over SSH through vsock, and runs the maintainer's terminal loop `while true; do date +%T.%N; sleep 0.1; done` detached, beside a Perl process that holds 4 MiB of random bytes and a counter and stamps each line with both of the guest's clocks on the serial console. Then it takes four steps. A checkpoint with memory is sealed as spin's storage seals a disk and continued in place. A rollback with memory goes onto the sealed disk after the guest changed the file and the bytes. A disk-only snapshot is `stop`, `blockdev-snapshot` and `cont`. A cold boot comes from the sealed disk. Left at 128 MiB, the guest's OOM killer took the SSH session, as the lab's Plug says. *Observed* (v20261121.01, 3 runs on the laptop and 1 on the bench, which agreed). The checkpoint stopped the guest 11-17 ms (`Cost.Paused` 11-14), inside one of the loop's sleeps, so the loop's largest step stayed at 101-105 ms. After the rollback the process had the same PID and the same bytes. The file matched from memory and again from the disk. The loop and the counter went on from their lines at the checkpoint, and the kernel reseeded its RNG (vmgenid). The cold boot had the synced file and not the later one. The loop's log, written 3 s and never synced, was not on the disk at all, because the seal is crash-consistent. The disk-only snapshot stopped the guest 7-14 ms. The guest's clocks stop with it. A stop held 1.00 s left the guest's wall clock 1.001 s further behind, and both clocks stepped 101 ms across it. The resumed guest read the checkpoint's time, 6.34 s behind 48 ms after the resume, and nothing in the machine corrected it, by the 09-10 decision. spin steps it at the supervisor's next registration, and after a snapshot continued in place nothing steps it (spin-stack/spin#1498). An SSH session open at the checkpoint did not survive the rollback. The restored sshd read `Transport endpoint is not connected` within 3 ms, its pty shell was gone at the first look, and the guest's kernel logged nothing of vhost-vsock's reset (spin-stack/spin#1483). *Status:* in place. `lab dispatch` takes no `check:TARGET` yet (#419). diff --git a/docs/log/2026-11-21-what-earned-nothing-in-spins-shape-deleted.md b/docs/log/2026-11-21-what-earned-nothing-in-spins-shape-deleted.md new file mode 100644 index 00000000..8921df19 --- /dev/null +++ b/docs/log/2026-11-21-what-earned-nothing-in-spins-shape-deleted.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-21" +order: 90 +area: machine/image +title: what earned nothing in spin's shape, deleted (lab 44818953987) +runs: [44818953987] +--- +The first decisions of the carry ablation (docs/boot-time.md, "What the machine carries"; #349). `driver_async_probe=` for rng, balloon and vsock (11-13, 2 vCPUs, inside the noise at the floor) and `rcupdate.rcu_expedited=1` (09-07, never measured) leave the command line: taken out together, on the bench in spin's shape, 20 boots each against v20261120.04, the first login read −1.4 [−4.9, +3.1] ms cold, +1.4 restored and +1.7 into a QEMU started ahead. With one vCPU an asynchronous probe has no second CPU to run beside. The command line is not in `Spec.Contract`, so the fingerprint does not move. And 16 masks in optimize-systemd.sh named units no package installs (timesyncd, pcrmachine, both tpm2-setups and the tpm2 generator of a systemd built without TPM2, boot-system-token, avahi, cups, bluetooth, smartd, both e2scrubs, both multipathds, lvm2-monitor, run-lock.mount): deleted without a run, and image/build.sh now fails a mask that shadows nothing. *Status:* in place. diff --git a/docs/log/2026-11-21-what-qmp-and-vsock-cost-the-goals-paths.md b/docs/log/2026-11-21-what-qmp-and-vsock-cost-the-goals-paths.md new file mode 100644 index 00000000..3f8fb57d --- /dev/null +++ b/docs/log/2026-11-21-what-qmp-and-vsock-cost-the-goals-paths.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-21" +order: 220 +area: lab +title: 'what QMP and vsock cost the goal''s paths: the `transport` probe (lab 44912471522, this change)' +runs: [44912471522] +--- +The question was how to make QMP faster, posed as if QMP ran over vsock, with vsock RTT tuning, CPU pinning, `halt_poll_ns`, SEQPACKET, ivshmem, virtio-serial and gRPC framing as candidates. QMP is a Unix socket between the host and QEMU. vsock is between the host and the guest, and carries spin's SSH login. So two questions: how much of each goal number is QMP, and how much is the login's vsock. `transport` boots and restores spin's shape with QEMU traced (`qmp_enter_*`, the monitor's queue and answers, the run state, host time). After the cold login it times query-status, a one-byte echo over vsock and through a forwarder hop, and a warm login's round trips. *Measured* (bench, spin's shape and login, v20261121.01, 20 boots, 0 lost): the cold boot waits on 14 commands, 6.2/6.6 ms from QEMU's main loop being free to `cont` answered, 1.3% of the traced first login's 470. Of that, 4.5 ms is QEMU waiting for spin-machine's next command, and the commands' own run is ~1.2. A restore waits on 17 commands before `migrate-incoming`, 6.7/7.6 ms (5.2 of it waiting on the client), and 2.7 ms from the guest running to the restore's last answer, of a 114 ms first login. spin-machine's start and dial are off both paths: its first command waits 17.1 ms (cold) and 19.5 (restored) for QEMU to finish making the machine. query-status takes 131/142 µs from a Go client and 18 µs inside QEMU. A vsock round trip is 47.8 µs, 57.5 through a forwarder like spin's, and a login is 10 of them: 0.6 ms of a 32.8 ms warm login. *Why not double:* each QMP round trip on the path is ~0.25-0.9 ms where the command runs in ~0.02-0.35. The rest is the client's turn in a process that has just started, on a nested host. *Decided:* no change. If QMP cost nothing, the cold number would gain at most 6.2 ms and the restore at most ~9.4. Pipelining the bind gains at most 4.5 cold and 5.2 restored, and the read-ahead overlaps the restore's half. Dropping the round trips that can go gains ~1.3 cold and ~1.9 restored. Every vsock idea is bounded by 0.6 ms a login. All of these are under the noise at 20 boots (±7-9 ms cold, ±13 restored), so none was built (docs/boot-time.md, "QMP and vsock"). The laptop agreed (i9-13900HK, under load): 14 and 17 commands, vsock 13-16 µs, 10 turns a login. *Status:* the probe is kept so the split can be taken again. diff --git a/docs/log/2026-11-21-what-we-carry-and-what-it-earns.md b/docs/log/2026-11-21-what-we-carry-and-what-it-earns.md new file mode 100644 index 00000000..9d61d637 --- /dev/null +++ b/docs/log/2026-11-21-what-we-carry-and-what-it-earns.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-21" +order: 80 +area: lab +title: what we carry, and what it earns (this change, lab 44818953987) +prs: [345, 352, 354] +runs: [44818953987] +--- +The reverse of a kept change: every boot-time modification the tree carries, with the shape and host it was kept on, in docs/boot-time.md's section of that name, grouped for removal one arm a group. Found before the bench: 15 masks and 1 disabled generator name units the image does not have (deleted, #352). The 5 masks of `ConditionNeedsUpdate` units are load-bearing, because the image has no `/etc/.updated`, and unmasked they rebuild hwdb.bin and the linker cache at every boot (first login +260 ms, QEMU's RSS +90 MiB, laptop). *Measured* (prestart, spin's shape, 20 each against v20261120.04, the removal's Δp50 of the cold first login): every kernel patch +67.5 [+62.5, +72.4]; SeaBIOS for qboot +68.5; the 16 other masks +57.5; the generators +16.7; the coldplug filter +14.9, and without it a restore +464 (a guest saved with its coldplug still running, a guess); QEMU 0001 with qboot's PAM patch +11.5 [+6.7, +20.2]; `driver_async_probe` with `rcu_expedited` −1.4 [−4.9, +3.1]; kernel 0006, 0009, 0011 and the in-doubt options +1.2 [−4.5, +8.3]; PID 1's quiet logging +2.4 [−2.3, +7.8]. In one vCPU what runs before the login is on its path, so most of what was kept on two still earns. *Status:* the command-line pair deleted (#352); A1 and the logging measured again at 40 boots, cold; the rest kept, with what it earns in the table. A1 deleted 11-20 (#345), the logging 11-20 (#354). diff --git a/docs/log/2026-11-21-where-a-burst-of-restores-waits.md b/docs/log/2026-11-21-where-a-burst-of-restores-waits.md new file mode 100644 index 00000000..ef76cb21 --- /dev/null +++ b/docs/log/2026-11-21-where-a-burst-of-restores-waits.md @@ -0,0 +1,10 @@ +--- +date: "2026-11-21" +order: 60 +area: lab +title: where a burst of restores waits (laptop leads; this change) +runs: [44792429636, 44810128678, 44817486118] +--- +Lab 44792429636's samples, read again: the eight-at-once rows read ~210 ms to the first login (running 165-177) in their first three bursts, at 1, 8 and 16 channels alike, and 285-480 in every burst after; the extra is before running (1 channel: running max 168 → 369 p50, the median login 44 ms after it both times; 8 channels 166 → 272, 46 → 67 after), one and four at once at 8 and 16 channels do not move over the run, four at once at 1 channel creeps 165 → ~190, and no restore is slower for its place in the order (each index's mean rank 2.8-4.1 of 0-7). A host whose state changed during the run, which only a burst feels. `restore-together` now records what the host counted during each burst (PSI stall time of CPU, I/O and memory; `/proc/vmstat`'s direct reclaim, compaction stalls and huge-page fallbacks, MiB read; CPU busy; memory free and cached going in) and every restore's `running`, and takes `states=cached` (the disk out of the burst) and `defrag` (the host's THP defrag policy for the burst). *Laptop, i9-13900HK, not nested, 5-6 bursts a row, leads only:* 8 at once from the disk read 590-740 ms against 107-110 alone, the disk the bound (1.4 GiB at ~2.7 GB/s, I/O PSI full ~120-260 ms a burst) with or without huge pages. From the page cache: 440-445 ms under the default `madvise`, with ~3000 compaction stalls that all failed, ~2.4 GiB scanned by direct reclaim and memory PSI full ~250 ms a burst, and 85% of 20 CPUs busy; 133 ms with huge pages off for QEMU (PR_SET_THP_DISABLE, a wrapper, Δ −307 [−437, −156]); 150 under `defrag=defer` with no compaction and memory PSI 3 ms. Alone, huge pages off cost +16.0 [+8.9, +22.6] after running (the guest on 4 KiB pages), and `defer` 74.5 → 80.3 (5 each). QEMU marks guest RAM MADV_HUGEPAGE, so under `madvise` every fault of a load that finds no free 2 MiB block compacts and reclaims before it returns: one restore finds the ~90 blocks it needs, eight need ~700 at once and fight over them, and a host that has run a while (a page cache full of states, the bench after its first ~20 GiB) has none to spare. spin restores workspaces concurrently (spin-stack/spin at 1bd3414: an actor goroutine per workspace in `internal/runner/reconcile`, a per-workspace lock in `workspace.Manager.Resume`, up to 10 commands at once in `handler`), and leaves the host's THP policy as the distribution sets it. *On the bench* (lab 44810128678, v20261120.03, spin's shape, 8 channels, 30 bursts a row, every restore one sample): under `defer` against `madvise`, 1 at once 99.6 → 99.5, Δ −0.1 [−2.0, +1.6]; 8 at once from the disk 283/384 → 239/281, Δ −44.1 [−53.2, −35.2]; from the page cache 1 at once 72.3 → 72.0, 8 at once 268/317 → 193/241, Δ −74.9 [−83.2, −64.9]. *Decided:* THP defrag `defer` is a requirement of spin's host (`/sys/kernel/mm/transparent_hugepage/defrag`; `docs/memory-and-disk.md`): it gains in a burst and costs one restore alone nothing, spin never sets the policy and Ubuntu's default is `madvise`. *Not explained:* 8 at once under `defer` still read ~190-240 against ~100 alone, and from the cache barely less than from the disk. `restore-together` now records where a burst ran on the host's CPUs: each CPU's busy time (/proc/stat) and interrupts by line (/proc/interrupts), the CPUs QEMU's running threads were on, sampled every 5 ms, and the QEMUs', the job's CPU lists and irqbalance. It records them because nothing pins QEMU (spin-machine runs it with `-sandbox resourcecontrol=deny`, spin sets only a cgroup `cpu.weight`) and one CPU taking the disk's interrupts or the threads would look like this. *Where on the host's CPUs* (lab 44817486118, v20261120.04, 20 bursts): not one CPU. In the 8-at-once rows the busiest CPU held 6-7% of the busy time (16 CPUs evenly would be 6%), CPU 0 was busy 212-270 ms a burst against the others' 221-276, the interrupts were spread (the busiest CPU 7%, an NVMe queue on top), irqbalance runs, and the job and every QEMU may run on 0-15; QEMU's threads ran on every CPU about alike. What the burst is instead: the host's CPUs 72-78% busy (CPU PSI some 84-190 ms a burst), so 8 restores of ~1 CPU-burst each on 16 CPUs are near the host's capacity, and direct reclaim of the page cache that the states fill (MemFree ~2 GiB of 32 against 28 GiB cached; pgscan_direct 408k pages under `madvise`, 48k under `defer`, with 743 allocation stalls). Here `defer` read 379/445 → 302/388 at 8 at once and 83.2 → 84.0 alone. *Next:* the host keeping memory free ahead of a burst (kswapd's watermarks, `vm.watermark_scale_factor`), and the CPU a restore costs. + +--- diff --git a/docs/log/2026-11-21-where-one-vcpus-time-goes-before-the-first.md b/docs/log/2026-11-21-where-one-vcpus-time-goes-before-the-first.md new file mode 100644 index 00000000..4e7e833a --- /dev/null +++ b/docs/log/2026-11-21-where-one-vcpus-time-goes-before-the-first.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-21" +order: 20 +area: image/lab +title: 'where one vCPU''s time goes before the first login, and what the CPU weights do (laptop leads, PR #329 closed)' +prs: [327, 329] +--- +With the guest sized to 2048 MiB (`plugged=2048`) one vCPU adds ~85 ms to the first login against two, on the lane and on spin's path alike (4 boots each). The guest spends ~225 ms of CPU to the login either way, with 0 ms idle at one vCPU: the second CPU used to run beside the login what one CPU runs before it, and no unit waits longer of its own. Up to the login, in ms of CPU at one vCPU on spin's path: PID 1 ~49, udevd with its workers, trigger and credentials ~41, the kernel and its threads ~31, the lingering user@1000 ~20 (gone since #327), `ssh.service` with its `sshd -t` ~20, journald ~13, logind ~13, the session ~9-12, dbus-broker ~7, the host-key generation ~5, getty ~3. `StartupCPUWeight=1` on udevd and its coldplug trigger took the lane's first login 285 → 240 ms (Δp50 −45.7 [−49.3, −35.8], 12 boots each) and did nothing on spin's path (308 against 307): there `ssh.service` and the forwarder wait for `basic.target`, which waits for udev, so its CPU is on the login's path whatever its weight. `children_max=2` and journald's `ReadKMsg=no` gained nothing. On spin's path the host keys `spin-machine-sshd-keygen` makes are not loaded (spin's own key comes first), ~5 ms of CPU `ssh.service` waits for: spin could mask the unit at its handoff. Not benched. The lever is the order spin starts the login in (docs/boot-time.md, "Open experiments"). diff --git a/docs/log/2026-11-21-would-a-higher-host-priority-for-qemu-cut.md b/docs/log/2026-11-21-would-a-higher-host-priority-for-qemu-cut.md new file mode 100644 index 00000000..6041d990 --- /dev/null +++ b/docs/log/2026-11-21-would-a-higher-host-priority-for-qemu-cut.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-21" +order: 270 +area: lab +title: 'would a higher host priority for QEMU cut either goal number: the `run-delay` probe (labs 44925573288, 44927312303, this change)' +runs: [44925573288, 44927312303] +--- +A weight, a nice value or a real-time class changes only who runs when two threads want one CPU. So the most any of them can win is the time QEMU's threads spend runnable and not running, and that was measured before anything was built. `run-delay` samples every QEMU thread's `/proc/PID/task/TID/schedstat` every 5 ms, from before the exec to the first login, cold and restored (evicted). It keeps an exited thread's last sample and splits the wait at the guest's first run, from QEMU's trace. Its rows are crowds of workspaces already running, as `density` boots them. *The instrument sees what it claims:* the guest's steal time, which KVM takes from the vCPU thread's run_delay, read 330-340 ms cold on the busy host against the vCPU thread's 304-331. *Idle host* (bench, spin's shape and login, v20261121.01, 20 boots, 0 lost; lab 44925573288): QEMU's threads wait 0.2/1.1 ms in all to the cold first login (467/479) and 0.1/0.2 to the restored one (115). That is the ceiling of any priority change on the host the goal is measured on, and it is under the noise by ~40×. *Busy host,* 16 workspaces each keeping its vCPU busy on the bench's 16 CPUs: the cold first login reads 1184/1490 and the restored 306/321. QEMU's threads wait 824 ms cold, summed over threads that wait at the same time (331 of it the vCPU's, 248 the main thread's, the rest vhost and io_uring workers), and 282 restored, 224 of it before the guest runs. The host's own steal read 0 in every row, so the bench's hypervisor (L0) took nothing visible at 10 ms ticks. Only the host's (L1's) wait is in reach of a priority, and that is what was measured. *The arm* (lab 44927312303, 20 boots a row, interleaved): the crowd at nice 10 against the crowd at 0. The lab runs unprivileged, and 10 steps either way is the same ratio of weights (110:1024 against 1024:9548), so this is QEMU at −10 as the scheduler sees it. The restored first login fell −79.3 [−93.5, −71.0] (316 → 238) and its wait 290 → 116 ms. The cold first login moved −104.7 [−258.3, +150.9], within noise: the vCPU's wait fell 304 → 119 ms, but the main thread's rose 208 → 289 and the vhost workers' 90 → 122. QEMU's own CPU time grows from 503 ms idle to ~605 busy, which no priority wins back. *Decided:* nothing changes in the machine. On the idle host there is nothing to win. On a busy host, restores gain clearly, and the lever, a workspace's cgroup `cpu.weight`, is spin's runner's (machine.Start's `Cmd` places QEMU in it). That is a proposal for spin ("Open experiments"), to be measured there. The lab put every QEMU in one cgroup, where each thread competes on its own. In spin each workspace is a cgroup whose weight its threads share, which may give less. SCHED_FIFO was not tried, because a weight already shows the gain and a FIFO QEMU could starve the host. *Status:* the probe is kept, so the wait can be read again on a host whose load is spin's. diff --git a/docs/log/2026-11-22-0003-has-no-postcopy-clause.md b/docs/log/2026-11-22-0003-has-no-postcopy-clause.md new file mode 100644 index 00000000..04924b33 --- /dev/null +++ b/docs/log/2026-11-22-0003-has-no-postcopy-clause.md @@ -0,0 +1,10 @@ +--- +date: "2026-11-22" +order: 260 +area: qemu +title: 0003 has no postcopy clause (#501, this change) +issues: [501] +prs: [499] +runs: [45030863541, 45030863623, 45031602785] +--- +`migrate_defer_disk_flush()` was false with `postcopy-ram`, and no test could ask it: a save to a file cannot run with `postcopy-ram`, because the source opens a return path at connect and waits for the destination's SHUT at completion (11.2.0-rc0), so holding it needed a second QEMU as a destination. No caller can reach it either. The machine turns on `x-defer-disk-flush` only in `Checkpoint`, which also turns `postcopy-ram` off and migrates to `file:`. `postcopy-ram` is turned on only by `Resume`, on a destination, for a fast load, and a destination's stop is not a switchover's. spin moves a workspace by checkpoint, upload and resume (`moveFor`, spin#1487), with no live migration. The clause also guarded nothing that precopy's stop doesn't share. A deferred flush is safe when the migration's reader shares this host's page cache, which is what the capability says, and that holds or fails the same way whichever phase stops the VM. So the clause is gone, and postcopy's stop defers as precopy's does. CPR's exclusion stays, because cpr-reboot's stop can precede a host reboot that loses the page cache, and #499's subtest holds it. The patch adds 70 lines where it added 71, and every branch it carries is asked by `verify args`. *Checked:* the series applies with `patch --fuzz=0` to the pinned tarball, and `migration/options.c` and `qapi/migration.json` match the edited files, which `scripts/qapi-gen.py` reads without error. On the rebuilt QEMU (parts run 45030863541), `verify args`' 0003 subtest passes, and so does compat (run 45030863623). `boot:checkpoint-pause` passes on the bench with the busy-disk guest's p50 stopped at 19.7 ms, 29.5 when short of memory (lab 45031602785). What a checkpoint does is unchanged, since it never sets `postcopy-ram`. *Status:* in place. diff --git a/docs/log/2026-11-22-0003-says-the-same-in-fewer-lines.md b/docs/log/2026-11-22-0003-says-the-same-in-fewer-lines.md new file mode 100644 index 00000000..76b6ac99 --- /dev/null +++ b/docs/log/2026-11-22-0003-says-the-same-in-fewer-lines.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-22" +order: 200 +area: qemu +title: 0003 says the same in fewer lines (#488, this change) +issues: [488] +runs: [45017731970, 45017732016, 45018667678] +--- +`x-defer-disk-flush`'s patch was 369 lines, most of them a `defer_flush` argument carried through `migration_stop_vm`, a second `vm_stop_force_state` and the stop's helpers. Now `do_vm_stop` and `vm_stop_force_state`'s stopped branch start the deferral themselves, after the drain, when the run state is `finish-migrate` and `migrate_defer_disk_flush()` (public in `include/migration/misc.h`) holds: 249 lines, 71 added and 3 removed in QEMU against 107 and 22 before. Postcopy's and CPR's stops are `finish-migrate` too, so the accessor is false with `postcopy-ram` or a CPR mode; the machine sets neither on a save, so what it does is unchanged. *Checked* on the rebuilt QEMU (parts run 45017732016): `verify args`' 0003 subtest, one flush without the capability and none with it; compat (run 45017731970); `boot:checkpoint-pause` on the bench, busy-disk guest p50 stopped 20.6 ms, 22.1 short of memory (lab 45018667678). *Status:* in place. diff --git a/docs/log/2026-11-22-a-boot-chart-of-every-release-and-of.md b/docs/log/2026-11-22-a-boot-chart-of-every-release-and-of.md new file mode 100644 index 00000000..21410154 --- /dev/null +++ b/docs/log/2026-11-22-a-boot-chart-of-every-release-and-of.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-22" +order: 280 +area: lab, report +title: a boot chart of every release and of any tree (labs 45035203882, 45036503632, 45037354657, this change) +runs: [45035203425, 45035203882, 45036002014, 45036494125, 45036503632, 45037354657] +--- +A number said how long a boot took, and nothing showed what ran in it. The `bootchart` edit puts systemd-bootchart (Ubuntu's 235-2build1, pinned in versions.yaml) into a tree's overlays as PID 1, sampling at 200 Hz. The `bootchart` probe stops it with the first login and keeps its chart and `systemd-analyze plot` beside `result.json`. `releases measure` draws each release once, and its record links both charts from docs/releases.md. *Cost* (bench, spin's shape, 20 a side, v20261122.03, lab 45036503632): first login +10.4 [+4.5, +16.8], console prompt +15.7 [+12.3, +19.7], QEMU RSS +4.0 MiB. It is a diagnostic and never in the image. *Fixed on the way:* the sampler is named `init`, not systemd-bootchart (lab 45035203425 found none); the stop command's sudo and its forks drew themselves ~0.1 s past the login (labs 45036002014, 45036494125); 235 names processes from `/proc/PID/sched` as "9" on this kernel and reads cgroup v1, so it names them by command line and draws no cgroup. *What v20261122.03's chart shows* (lab 45037354657, 3 boots): PID 1 at 82 ms of the kernel's clock and the login at 320. From about 100 to 140 ms the vCPU is nearly idle while the disk reads ~230 MB/s, so systemd's first 40 ms wait on the image. From about 190 ms to the login the one vCPU is busy and every process waits to run. udevd (21.5 ms), journald (18.6) and logind (14.8) use the most CPU. In the plot, systemd-udevd.service activates for 189 ms and systemd-udev-trigger.service for 127. These are leads, and the log's 2.1 is why a chart's bar is not a saving. *Status:* in place. diff --git a/docs/log/2026-11-22-a-checkpoints-stop-on-a-host-short-of.md b/docs/log/2026-11-22-a-checkpoints-stop-on-a-host-short-of.md new file mode 100644 index 00000000..6fd852e8 --- /dev/null +++ b/docs/log/2026-11-22-a-checkpoints-stop-on-a-host-short-of.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-22" +order: 10 +area: boot +title: a checkpoint's stop on a host short of memory (#437, lab 44971162018, 44971787197, 44972838681, 44973775066, 44975130836, this change) +issues: [437, 444] +runs: [44971162018, 44971787197, 44972838681, 44973775066, 44975130836, 44976542360, 44976542939] +--- +#437 guessed that the laptop's slowest saves, 1.6-1.9 s in the drain and 0.7-1.6 s for the last RAM, were QEMU's memory read back from a full swap. *Traced on the laptop* (QEMU `-trace` with wall-clock timestamps, each thread's `/proc` state, `wchan` and major faults every 2 ms): QEMU had nothing in swap and the host swapped in 167 pages in 11 minutes. The waits were a disk 60-80% full in `/proc/pressure/io`: guest writes in flight in `jbd2_log_wait_commit` and `rq_qos_wait`, which the drain waited for, and major faults on QEMU's own binary, evicted by reclaim (1.9 M file refaults) and read back from the disk that held the state, the overlay, the swap and the busy writers. A run without the busy writers, the disk still saturated by other work, waited 1.5 s once in the caller before `cont`. *Runners* have no swap (only spin's control plane gets a swap file, and it is never a runner) and give each machine's group `memory.swap.max` 0. *On the bench*, no swap and QEMU's binary on a disk apart from the state: with the host's memory taken but 1 GiB, the busy disk's dirty pages got the test killed. With 4 GiB left, the writer read 23.0 ms p50 (43.5 slowest) and with the busy disk 26.1 (44.4), against 18.5 beside the busy disk alone. QEMU took no major fault while the host reclaimed 26 M pages. `bpftrace` on `sched_switch` named the two slowest of 40 saves (139 and 188 ms): `balance_dirty_pages`, on a guest write in the drain and on one multifd channel's write of the last RAM, the other seven channels behind that file's `i_rwsem`. *Tried:* `direct-io` on the save's channels, with an `O_DIRECT` descriptor added to the state's set. Beside the busy disk it never converged, each pass ~2.5 s and ~520 MiB left, and was cancelled after 10 min. Rejected. `downtime-limit` 15: −6.0 [−11.9, −1.1] in 20 pairs short of memory, then −2.5 [−7.5, +3.0] in 25, −1.5 [−6.0, +2.8] with the writer, −0.2 [−0.5, +0.3] idle. Rejected. *Built:* `boot:checkpoint-pause`'s fourth guest is the busy-disk guest on a host whose available memory is taken but 4 GiB (`shortOfMemory`), measured and not held to the bound: on compat's kvm host, 118 GiB of it taken, the stop read 56.2 ms p50 against 25.2 on the bench (compat 44976542939, lab 44976542360). *Status:* the test is in place. A runner does not reach #437's seconds. Its stop on a host short of memory is the dirty limit's (#444). diff --git a/docs/log/2026-11-22-a-failed-resume-says-whether-the-checkpoint-is.md b/docs/log/2026-11-22-a-failed-resume-says-whether-the-checkpoint-is.md new file mode 100644 index 00000000..43b52ee4 --- /dev/null +++ b/docs/log/2026-11-22-a-failed-resume-says-whether-the-checkpoint-is.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-22" +order: 350 +area: machine +title: a failed resume says whether the checkpoint is to blame, and a failed load does not (#516, this change) +issues: [516] +--- +spin decides from `Resume`'s error whether to drop a suspended workspace's memory, and only `*Refusal` was typed. *Read in QEMU 11.2.0-rc0's source:* `MIGRATION` carries the status alone, and every failure of a load ends at `process_incoming_migration_co`'s `fail:` label, its reason on stderr before QEMU exits: a section QEMU rejects, a file that ends early and a failed read on the host (both `-EIO` from `qemu_fill_buffer`), and userfaultfd refused to a fast load. So no new type was made for a failed load, and the cases `Resume` can pin on the checkpoint fold into `*Refusal`: a format QEMU does not read (part `format`) and a `Saved.Added` that does not parse (part `added`). A stream checkpoint asked to load on several channels is the caller's options, not the checkpoint, so it stays a plain error. `boot:record`'s truncated state asserts that it is not a `Refusal`. *Opened:* #546. *Status:* in place. diff --git a/docs/log/2026-11-22-a-ledger-of-the-boot-to-the-first.md b/docs/log/2026-11-22-a-ledger-of-the-boot-to-the-first.md new file mode 100644 index 00000000..289f0c11 --- /dev/null +++ b/docs/log/2026-11-22-a-ledger-of-the-boot-to-the-first.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-22" +order: 340 +area: lab +title: 'a ledger of the boot to the first login, from a scheduler trace (labs 45062548343, 45062836688, 45062836494, 45063070048, #533, this change)' +issues: [521, 527, 536] +runs: [45061089609, 45061289985, 45062548343, 45062836494, 45062836688, 45063070048] +--- +The boot chart samples every 5 ms, sees only processes and draws nothing of the login's ~65 ms after sshd's accept. The `ledger` probe records the scheduler's tracepoints from the kernel's start and cuts the kernel's clock into windows where the boot and the login change hands, each with its CPU by unit and its idle. The host's clock meets the kernel's through markers the guest writes on request, to ±0.15 ms. *The premise that broke:* the release kernel forces lockdown at confidentiality, which takes tracefs away (lab 45061089609), so the ledger runs on a kernel built from branch `ledger-533-kernel` with lockdown forced to none (parts run 45061289985), and no release gets a ledger until #536 decides how. *Cost* in spin's shape, 20 a side (lab 45063070048): first login +3.0 [−2.4, +15.9], within noise; console prompt +12.1 [+7.1, +17.6]; the kernel alone −1.0 [−9.5, +4.9]. *What six boots of v20261122.05 show* (labs 45062548343, 45062836688, bench, spin's shape): the kernel to PID 1's exec 83 ms, 72 of it in PID 1 before its exec, which is why the boot chart's init.scope (118-123 ms) is twice the ledger's 59 from PID 1's exec on. From PID 1 to the login's sshd-session, 171 ms: PID 1 55, idle 18, journald 18, unattributed (generators and executors) 17, logind 15. Between 110 and 151 ms, the stretch #521 read as the vCPU nearly idle on the disk, PID 1 runs 26 to 30 ms and the vCPU idles 7 to 13 while tasks wait on the disk. The login's 65 ms from sshd-session's exec to true's exit has no idle in it: sshd 20 ms, user@0.service 17, udevd 9, PID 1 4, journald 3. Root's manager (linger) starts as the connection arrives, and its 17 ms of CPU land inside the login's windows (#527). *Opened:* #536, #537. *Status:* in place. diff --git a/docs/log/2026-11-22-a-probes-login-is-not-preceded-by-a.md b/docs/log/2026-11-22-a-probes-login-is-not-preceded-by-a.md new file mode 100644 index 00000000..adb1d009 --- /dev/null +++ b/docs/log/2026-11-22-a-probes-login-is-not-preceded-by-a.md @@ -0,0 +1,10 @@ +--- +date: "2026-11-22" +order: 30 +area: lab +title: a probe's login is not preceded by a connection spin does not make (labs 44977850524, 44978246896, this change) +issues: [450] +prs: [341] +runs: [44977850524, 44978246896] +--- +`Key.LoggedIn` polled `VsockAccepts(cid, 22)` until something accepted, then logged in. On spin's path (`login=spin`), that connection reached the forwarder, which opened one to 127.0.0.1:22, and sshd forked and exec'd `sshd-session` for it. The probe then closed it and logged in at once, so the guest's one vCPU ran that session beside the login being timed. spin's runner opens the user's connection once, through its supervisor, and asks nothing first (spin-stack/spin's `internal/runner/forward/forward.go`). LoggedIn now logs in until a login is done, with VsockAccepts' 50 ms connect timeout on the login's own connect, because a connect to a context id that does not exist yet waits 2 s. *Measured* as two rows of one tree, so one run compares the two probes (bench, nested, spin's shape and login, v20261122.01 with main's spin-machine, 40 each, lab 44978246896): restored login −4.1 [−6.0, −2.2], `running` −0.0 [−1.0, +0.9], the cold login before the save −3.6 [−7.2, +0.8], within noise. Only the restored login changed, in lab 44977850524 too: −3.6 [−7.3, −1.7] at 30. The number moves because the probe stops adding work, not because the machine changed, as with #341. LoggedIn is restore-first's, prestart's, restore-together's and density's. `ssh-first` keeps its own poll, because it times `accepts` with it, so its first login still carries the session (#450). *Status:* in place. diff --git a/docs/log/2026-11-22-a-restored-guests-tsc-and-udev-after-basic.md b/docs/log/2026-11-22-a-restored-guests-tsc-and-udev-after-basic.md new file mode 100644 index 00000000..c85069cc --- /dev/null +++ b/docs/log/2026-11-22-a-restored-guests-tsc-and-udev-after-basic.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-22" +order: 170 +area: qemu, image +title: 'a restored guest''s TSC, and udev after basic.target (labs 44983495254, 44983967863, 44984395014, 44986512574, 44987412184, 44987412171, 44987412210, 44987584707, #452, this change)' +runs: [44818953987, 44983495254, 44983967863, 44984395014, 44986006042, 44986055383, 44986512574, 44987412171, 44987412184, 44987412210, 44987584707] +--- +The ~450 ms that blocked udev after basic.target and spin's forwarder early was not guest work. Sampled on the bench (branch `exp/452-diag`), a slow restore's vCPU thread ran ~17 ms after the resume and then sat in `kvm_vcpu_halt` for 281-450 ms, neither running nor waiting, and the guest's /proc/stat was missing that time. Traced with the host's kvm and vsock events, the guest answered the login's packets until it halted, and woke on its first local timer interrupt, with no TSC-deadline write before it: the slow login ended 528-555 ms after QEMU's exec however long the load took. kprobes on `kvm_synchronize_tsc` showed why. QEMU writes each vCPU's TSC before the load, zero after the vCPU is made and one at the reset, and KVM, having had a TSC from userspace, takes the migration's TSC within a second of it for a sync and keeps the offset (kernel bf328e22e472's case, undone). The guest's TSC counts from the new vCPU's creation, so its saved TSC deadline is met only after the saved uptime, ~0.5 s. A guest saved with its tick running (udev still at work) had that deadline a tick ahead and reprogrammed none of its later timers. One saved idle armed far ahead and reprogrammed, so the release's restores never showed it. The coldplug arm's restored +463.7 (lab 44818953987) was the same. QEMU 0005 writes an incoming machine's TSC only from the migration: the writes became the creation's and the checkpoint's, unmatched, and 16 of 16 restores read 84-94 ms (lab 44987412184). *Measured,* spin's shape, 30 a side against the release: udev after basic.target with 0005 cold −48.6 [−51.7, −42.6], restored −2.0 [−8.0, +4.7] with p95 114 against 114 evicted and 126 against 128 cached; without 0005 the same edit's restored p95 is 539-546 (lab 44987412171). In `prestart`, cold −44.7 [−53.4, −39.4], restored into prestarted −1.3 [−4.1, +3.6] with p95 98.8 against 101, and without 0005 413 (lab 44987412210). 0005 alone moves neither number (cold −3.0 [−5.8, +0.1], restored −1.9 [−7.6, +2.0]). spin's forwarder early with 0005: cold −60.4 [−63.3, −52.9], restored +3.3 [+1.0, +7.4], p95 104 against 101 (lab 44987584707), so it is spin's to take. The image now carries copies of systemd-udevd.service and systemd-udev-trigger.service without `Before=sysinit.target`, and image/build.sh checks them. *A first 0005 skipped only the zero:* the reset's one still set KVM's flag, and the tails stayed (labs 44986055383, 44986006042). diff --git a/docs/log/2026-11-22-a-resume-takes-its-disks-before-the-load.md b/docs/log/2026-11-22-a-resume-takes-its-disks-before-the-load.md new file mode 100644 index 00000000..2c40ddc6 --- /dev/null +++ b/docs/log/2026-11-22-a-resume-takes-its-disks-before-the-load.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-22" +order: 110 +area: machine, boot +title: 'a resume takes its disks before the load (labs 44984233276, 44984233299, 44984162863, #459, this change)' +issues: [459] +runs: [44984162863, 44984233276, 44984233299] +--- +A fast load in compat completed with no RESUME, and its guest never ran. QEMU's stderr said `Failed to get "write" lock` on the overlay. QEMU 11.2.0-rc0 adds a held machine's nodes inactive. Both run BHs, the full load's and the fast one's, activate them with `migration_block_activate(NULL)`. When that fails they skip `vm_start` and tell the monitor nothing, and the run state stays `inmigrate`. `Resume` returned nil for that, in a full load too. The lock came from the boot tests: `rootDisk` never closed its files, and QEMU's lock lives on the description the test's `*os.File` shares. So the lock outlived the killed "in full" machine until a garbage collection closed the file. `Resume` now sends `blockdev-set-active` before `migrate-incoming`, so QEMU's refusal is its error, before a byte of the state is read. `rootDisk` closes its files when the test ends. *Measured.* With `GOGC=off` on a laptop (KVM, userfaultfd on), main missed 10 of 10 fresh-process runs of the events test and the fix passed 50 of 50. On the bench (nested, v20261122.01, 100 fresh-process runs each), main missed 3 with #459's events and stderr, and the fix missed 0. restore-first, fix against main (bench, spin's shape and login, 30 a side interleaved, `fast=true`, lab 44984162863): evicted login −0.3 [−2.4, +4.8], `running` +0.2 [−1.6, +4.9], cached login −0.6 [−4.8, +1.7], all within noise. *Status:* in place. `boot:record`'s "a disk another machine holds" holds it on real KVM. diff --git a/docs/log/2026-11-22-a-trees-spin-machine-from-any-commit-and.md b/docs/log/2026-11-22-a-trees-spin-machine-from-any-commit-and.md new file mode 100644 index 00000000..88b36f7a --- /dev/null +++ b/docs/log/2026-11-22-a-trees-spin-machine-from-any-commit-and.md @@ -0,0 +1,10 @@ +--- +date: "2026-11-22" +order: 20 +area: lab +title: 'a tree''s spin-machine from any commit, and #438 bisected (lab 44976271054, this change)' +issues: [416, 438] +prs: [446] +runs: [44976271054] +--- +#438 read restore-first's evicted login +2.2 ms [+0.5, +4.0] with main's spin-machine against v20261121.01's, and asked which commit moved it. A tree could hold only this checkout's spin-machine or a release's, so `--spin-machine commit:SHA` now builds one from any commit, fetched alone from origin as a release's is. *Measured* (bench, nested, spin's shape and login, v20261122.01's parts, 30 restores each, eight spin-machines interleaved): against v20261121.01's, main's read evicted login −0.1 [−2.7, +4.6] and `running` +0.6 [−2.3, +3.5]. Of the five commits between, only 8d04bd4's `running` excluded 0, +4.5 [+0.1, +7.9], and main contains it. `listening` read −4.2 from eb70cb8 on, because `machine.Start` binds the monitor's socket before QEMU exists, so `listening` no longer marks QEMU's start. That instance was noisy: its cached restores were as slow as its evicted ones. *Not reproduced.* The difference was on the evicted row only, the disk's, and the read-ahead before the dial, asked for from four goroutines, leaves the evicted row nothing to wait on (#446, #447). *Status:* the lever in place. #438 and #416 answered in their comments. diff --git a/docs/log/2026-11-22-compat-in-minutes-and-its-qmp-half-in.md b/docs/log/2026-11-22-compat-in-minutes-and-its-qmp-half-in.md new file mode 100644 index 00000000..9a5512e4 --- /dev/null +++ b/docs/log/2026-11-22-compat-in-minutes-and-its-qmp-half-in.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-22" +order: 60 +area: ci, qmpdef, machine +title: compat in minutes, and its QMP half in go test (compat 44978948650, 44979352669, lab 44978556859, this change) +prs: [435, 439, 443] +runs: [44964906186, 44974499826, 44978556859, 44978948650, 44979352669] +--- +A compat run on #443's branch took ~10 minutes (run 44974499826): `boot:checkpoint-pause` 311 s, building QEMU and the kernel 239 s (QEMU's cache missed), the releases' checkpoints resumed 109 s, the rest ~40 s. It ran only on main after a merge, so #435, which sent `x-defer-disk-flush` to every QEMU, was found after it merged. *Moved:* `boot:checkpoint-pause` is a bound, not compatibility. It runs in release.yml's `pause` job on a bench host once a release is published, and the qemu entry's bump note names it. Its run there (lab 44978556859, v20261122.01) held idle 23.0, writing 16.8 and beside a busy disk 17.9 ms p50. *Built:* compat runs on every pull request beside CI. A `changed` job decides whether the change reaches the machine, QEMU or the kernel. A part it does not reach is not built: QEMU is main's published one (`fetch qemu`, 10 s) and the kernel the release's. A `compat` job at the end reports on every change, so a ruleset can require it as it requires `parts`. `changed` now compares from the merge base, so a dispatched branch is not charged with what main gained after it forked. *Built:* `go test` holds the machine package to every supported release's `query-qmp-schema` (`internal/qmpdef/testdata/released`, recorded from each tarball's `qemu-system-x86_64` by `spin-machine-dev releases schema`, which report.yml runs on each release). `CheckSupported` holds what the package sends unconditionally to every release. A value or member only newer QEMUs have is `qmpdef.Probed` or tagged `qmpdef:"probed"`. `TestTheMachineDrivesEverySupportedQEMU` drives `Checkpoint` and `DiskUsage` against a fake QEMU that refuses what each release's schema refuses, in QEMU's words. *Proved:* with #439's fix reverted, that test failed for v20261119.02 to v20261121.01 with `Parameter 'capability' does not accept value 'x-defer-disk-flush'`, compat 44964906186's error, in ~2 s. v20261122.01 and the pinned QEMU have the capability and passed. With DiskUsage's fallback removed it failed on all seven releases, since only the pinned QEMU has `x-flat`. *Measured:* compat dispatched on a change that reaches neither part took 4m02s wall, its KVM job 3m03s, of which resuming the seven releases' checkpoints was 103 s and fetching QEMU 10 s (44979352669). On this branch, which touches `internal/build` and so builds both parts from a warm cache, it took 3m57s (44978948650). *Status:* in place. diff --git a/docs/log/2026-11-22-cpuid-leaf-2-with-qemus-cache-descriptors.md b/docs/log/2026-11-22-cpuid-leaf-2-with-qemus-cache-descriptors.md new file mode 100644 index 00000000..e356b26c --- /dev/null +++ b/docs/log/2026-11-22-cpuid-leaf-2-with-qemus-cache-descriptors.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-22" +order: 420 +area: machine +title: CPUID leaf 2 with QEMU's cache descriptors (#565, labs 45082640147, 45082640186, 45083473855, 45083473790, 45083754801, this change) +issues: [565] +runs: [45082640147, 45082640186, 45083473790, 45083473855, 45083754801] +--- +*Why:* nesting costs ~50 ms of the cold first login, and #565 profiles a boot's exits by reason on both hosts with the new `exits` probe. Both hosts make the same ~10,400 exits, and nested ones cost more. CPUID was the most frequent: 3805 exits, 3549 of them below the guest kernel's half. Every process glibc starts asks for its cache sizes 12 times (glibc 2.42, `dl-cacheinfo.h`, `handle_intel`), and QEMU's leaf 2 answered 0xFF ("see leaf 4"), so each query walked leaf 4's subleaves, 1797 exits. *Changed:* `-cpu` carries `x-consistent-cache=off`, so leaf 2 holds QEMU's descriptors for the same caches leaf 4 describes (`env->cache_info`), and glibc reads them there. (Not under `host`: leaf 2 described `legacy_intel_cpuid2_cache_info`, a 2 MiB 8-way L2 against leaf 4's 4 MiB 16-way, corrected 11-23, #586.) *Measured* (bench, nested, spin's shape, against v20261122.06 with spin-machine `exp/cpuid2-descriptors` at ee005ce): CPUID exits 3727 → 2176, every exit −1541 [−1695, −1380] (3 a side). First login −10.3 [−14.2, −4.0] at 40 a side, a second login −1.1 [−1.6, −0.7]. The restored login +1.0 [−3.9, +4.4] evicted and −0.4 [−4.6, +1.6] cached, both within noise, at 30 a side. That is ~6.7 µs an exit removed, against 1.94 µs in the nested L1, so the two L0 trips around an exit cost ~4.7 µs (inferred). *The record:* `machine.CPU` reads feature bits, and `x-consistent-cache` is a switch, so the record does not move. A guest moved across the change reads the same cache sizes from either leaf. *Opened:* #566 (the MMIO accesses), #567 (HZ), #568 (memory's first touch). *Status:* in place. diff --git a/docs/log/2026-11-22-each-releases-ledger-on-a-traceable-kernel-published.md b/docs/log/2026-11-22-each-releases-ledger-on-a-traceable-kernel-published.md new file mode 100644 index 00000000..eef2d027 --- /dev/null +++ b/docs/log/2026-11-22-each-releases-ledger-on-a-traceable-kernel-published.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-22" +order: 390 +area: release/lab +title: 'each release''s ledger, on a traceable kernel published beside it (parts run 45071066129, lab 45073394754, #536, #558, this change)' +issues: [533, 536, 558] +runs: [45061289985, 45071066129, 45073394754] +--- +The ledger (#533) needs tracefs, which the release kernel's lockdown at confidentiality takes away, so it ran only on demand, on a kernel from a scratch branch kept as a run artifact that expires (`run:45061289985`). *Decided:* option 1 of #536 at release cadence. release.yml's `traceable` job builds the release's kernel source and config with `KERNEL_LOCKDOWN=none`. `release traceable-kernel` holds its config to the release kernel's, lockdown swapped and every other option equal. The job signs the bzImage and publishes it on the release as `…lab-only-traceable.bzImage`: in no tarball, in no SOURCES, in nothing spin boots. Options 2 (a `lockdown=` parameter) and 3 (on demand only) were not taken: 2 trades spin's compile-time guarantee for a command-line one, and 3 left no ledger per release. `lab tree --kernel traceable:TAG` checks the signature, `releases measure` takes one ledger of each release on that kernel beside its boot chart, and the record keeps it as `docs/releases/TAG-ledger.txt`. *Measured:* built as the `traceable` job builds it, the kernel passed the config check against the release kernel of the same job (parts run 45071066129). The ledger on it, with v20261122.06 and drawRelease's tree, gave 3 of 3 ledgers: 0 breaks, 0 events dropped, residue 0.6 ms p50 and first login 427 ms p50, in spin's shape (lab 45073394754). That release's record read 414.4 cold in the same shape, so the +13 is within the ledger's own ~16 ms. *Cost:* one cold kernel compile per release, 10 min after the release kernel's, in a job of its own so that pause and wake do not wait for it. report waits for it. A change that breaks the traceable build is first seen at release time (#558). *Status:* in place. The first release built with it is the first with a ledger. diff --git a/docs/log/2026-11-22-every-carried-patch-has-a-test-that-fails.md b/docs/log/2026-11-22-every-carried-patch-has-a-test-that-fails.md new file mode 100644 index 00000000..e7d5f0b9 --- /dev/null +++ b/docs/log/2026-11-22-every-carried-patch-has-a-test-that-fails.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-22" +order: 180 +area: qemu, qboot, kernel +title: 'every carried patch has a test that fails without it, and three are measured alone (labs 44993254745, 44993790452, 44993011539, 44993011448, #472, #481, #478)' +prs: [478] +runs: [44989641652, 44993011448, 44993011539, 44993254745, 44993790452] +--- +A patch dropped at a bump, or rebased into applying and doing nothing, built and booted, and nothing said so: `patch --fuzz=0` refuses only a patch that no longer applies. *Built:* `verify args` asks the TCG QEMU what 0001-0004 do with no guest (`TestEachQEMUPatchDoesItsJob`): 163 flat views from QEMU's start to its first answer at spin's shape, a disk beyond `max_target` refused, a save's stop submitting one io_uring flush without `x-defer-disk-flush` and none with it, and `query-blockstats` without `parent` or `backing` under `x-flat`. `boot:patches`, which compat runs beside boot:record, asks a guest of spin's shape what only it sees: its SCSI host refuses a scan of target 16 (0002), the firmware enabled the MTRRs (qboot's `mtrr.patch`), and a guest restored 650 ms ahead of its new vCPU's TSC goes no more than 200 ms without a line (0005). On v20261122.01, before 0005, it went 625 ms (lab 44993011539); on v20261122.02, 12 ms (lab 44993011448). `kernel/Dockerfile` reads each kernel patch's effect in the vmlinux it built (#478). *Measured alone* (bench, spin's shape, `prestart`, against main's QEMU from parts run 44989641652): taking 0001 back read restored +11.7 [+0.9, +19.3] and cold +0.2 [−8.7, +7.1] (20 a side, lab 44993254745), so it earns on the restore. `pam.patch` read cold +3.9 [−3.4, +8.0] and `no-pci-walk.patch` +5.2 [−1.7, +9.2] (40 a side, lab 44993790452). Both are inside the noise with upper bounds over +5 ms, which rule 5 keeps. *Status:* every patch kept. diff --git a/docs/log/2026-11-22-every-carried-patch-is-git-format-patch-output.md b/docs/log/2026-11-22-every-carried-patch-is-git-format-patch-output.md new file mode 100644 index 00000000..9e3ed83b --- /dev/null +++ b/docs/log/2026-11-22-every-carried-patch-is-git-format-patch-output.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-22" +order: 230 +area: kernel, qemu +title: every carried patch is git format-patch output (#487, this change) +issues: [487, 488] +prs: [478] +--- +Three hygiene items found while writing #478, none of which changes what a patch does. Kernel 0003 left `eval_map_work` and its `INIT_WORK` behind after `trace_eval_init()` came to call the copy directly, and its allocation-failure branch did what the success path did: the copy (now `trace_eval_defer()`) runs once, first, and `trace_init_wq` stays for `tracerfs_init_work`. Subjects said `[PATCH 7/11]` and the like after 0006, 0009 and 0011 were deleted; they say `[PATCH]`. Kernel 0007, 0008, 0010 and QEMU 0002, 0004 and 0005 had no `diff --git` lines (#488 had just remade QEMU 0003); all thirteen were remade with `git format-patch -N` from git trees of the pinned tarballs. *Checked* on the laptop, no build: each set, applied with `patch -p1 --forward --fuzz=0` as the builds do, gives the tree the series' commits do; the old and new kernel sets differ only in 0003's trace.c; every changelog is unchanged; checkpatch --strict reads the kernel patches clean but for 0002's citation of a commit the tarball has no history for. `gates/patches_test.go` holds both directories to the format. CI rebuilt the kernel and QEMU, and the vmlinux check still finds each patch. *Status:* in place. diff --git a/docs/log/2026-11-22-every-login-gets-its-user-manager-again.md b/docs/log/2026-11-22-every-login-gets-its-user-manager-again.md new file mode 100644 index 00000000..02c1f652 --- /dev/null +++ b/docs/log/2026-11-22-every-login-gets-its-user-manager-again.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-22" +order: 160 +area: image +title: 'every login gets its user manager again (labs 44987167474, 44987167549, #462, this change)' +issues: [467] +runs: [44987167474, 44987167549] +--- +`boot:logind` failed from v20261120.03 on: `systemctl --user` found no manager. Sessions have been of class `user-early-light` since 11-13, and logind starts no manager for one (`SESSION_CLASS_WANTS_SERVICE_MANAGER`, systemd v259.9). spin's linger had been the only thing that started `user@1000`, and e807038 (11-20, "spin does not linger") took it away. Root, the user spin logs in as, never had a manager on that path (inferred from the same code; not checked on a release). *Bisected* on the laptop, KVM, `boot:logind` against each release: v20261120.02 passes; v20261120.03, .04, v20261121.01 and v20261122.01 fail. e807038 is the only image commit between .02 and .03. v20261122.01 passes with `/var/lib/systemd/linger/spin` written back into the test's root. `lab tree --edit nolinger` did not reproduce it, because `boot:logind` boots its own raw copy of the base and never applies a tree's edits. *The fix.* `user-runtime-dir@`'s `20-manager.conf` wants `user@%i`. logind starts that unit for every session and waits for it alone, and the manager starts after it, so the login does not wait for the manager. *Measured* (bench, nested, spin's shape and login, 20 a side interleaved against v20261122.01, the drop-in and the class put into the overlay by experiment edits on branch exp/user-manager-462, 5ba7507): the drop-in first login +2.6 [−4.0, +8.7], restored login +0.8 [−1.5, +4.5] evicted and +1.0 [−1.1, +5.8] cached, cold login in the restore run +3.7 [−1.7, +10.5], all within noise. Accept to login +5.1 [+2.8, +6.5] and the second login +15.8 [+14.2, +16.6]: the manager runs while the second login does. Class `user-early`, which holds the login for its manager, cost the first login +36.2 [+32.0, +45.7], so it was rejected. *Checked:* `boot:logind` passes with the drop-in. With the console `su` login taken out of the check, the first SSH login's own `systemctl --user` still fails 3 of 3 with the drop-in, and passes 2 of 2 with class `user-early`. A command that needs the user bus at once in the first login can arrive before the manager. *Status:* in place. The manager's own cost is what would let a login wait for it (#467). diff --git a/docs/log/2026-11-22-every-releases-record-carries-its-no-systemd-floor.md b/docs/log/2026-11-22-every-releases-record-carries-its-no-systemd-floor.md new file mode 100644 index 00000000..57f50905 --- /dev/null +++ b/docs/log/2026-11-22-every-releases-record-carries-its-no-systemd-floor.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-22" +order: 220 +area: lab +title: every release's record carries its no-systemd floor (this change) +runs: [44978079694, 45018301368] +--- +AGENTS.md and docs/measuring.md (rule 8) ask for the bounds each release, the no-systemd floor first, and report.yml measured only the goal's numbers and the diagnostics: the floor was last measured by hand, on v20261122.01 (lab 44978079694). `releases measure` now boots the release beside its floor after the ladder, `ssh-first` with `login=lane` over the release and the release with `--edit floor --append init=/usr/local/sbin/spin-floor`, 20 boots each, interleaved, as the hand-made runs did. The record keeps both first logins as `floor-lane` and `floor`, and docs/releases.md tables them under "Bounds" once a record has them. Only the release a record is made for is measured beside its floor: the one it is against has none, and no Δ is read of a bound. It is the one bound docs/boot-time.md lists as each release's. *Checked* by report.yml on this branch against v20261122.02 (run 45018301368, record not proposed): first login by the lane 406.8 / 420.2, no systemd before sshd 240.5 / 245.5 (p50 / p95, 20 boots each, bench, spin's shape), beside the ladder's cold 420.0. *Status:* in place. diff --git a/docs/log/2026-11-22-guestrunning-is-qemu-running-the-resumed-guest.md b/docs/log/2026-11-22-guestrunning-is-qemu-running-the-resumed-guest.md new file mode 100644 index 00000000..e9136a6a --- /dev/null +++ b/docs/log/2026-11-22-guestrunning-is-qemu-running-the-resumed-guest.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-22" +order: 130 +area: machine +title: 'GuestRunning is QEMU running the resumed guest (labs 44987275584, 44987275543, #465, this change)' +issues: [459] +runs: [44987275543, 44987275584] +--- +A fast load says `postcopy-active` in `qemu_loadvm_run_fast_snapshot_load` right after it schedules the run BH, and the BH starts the guest later, on QEMU's main loop (QEMU 11.2.0-rc0). `Resume` returned and told `GuestRunning` at `postcopy-active`, so #459's guest, which never ran, was told running at 6.80 ms. `Resume` now arms a wait on `RESUME` before `migrate-incoming` and returns, telling `GuestRunning`, once it arrives, in a full load too. A full load that leaves the machine neither running nor paused is now an error, where `Resume` returned nil. *Checked* (`boot:record` on the bench, lab 44987275584): the events test now asks QEMU's run state from inside the `GuestRunning` callback and finds it running, in full and fast. The fast load told `GuestRunning` at 8.77 ms and `StateLoaded` at 672 ms. *Measured* (bench, nested, spin's shape and login, v20261122.01, `fast=true`, 30 a side interleaved, against main's spin-machine, lab 44987275543): fast `running` −0.4 [−1.5, +1.3] and fast login −0.6 [−13.8, +22.0], both within noise. The cached row's login read −0.5 [−4.4, +4.3]. The evicted row's login read −2.7 [−5.1, −0.8] with its `running` −0.0 [−3.1, +2.7]. A full load's path changed only by a wait that has already matched, so that row is taken as noise until another run repeats it. *Status:* in place. `Resume` now returns when QEMU runs the guest, not when the load is merely handed over. diff --git a/docs/log/2026-11-22-no-host-key-made-when-spin-hands-over.md b/docs/log/2026-11-22-no-host-key-made-when-spin-hands-over.md new file mode 100644 index 00000000..3dc40fe7 --- /dev/null +++ b/docs/log/2026-11-22-no-host-key-made-when-spin-hands-over.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-22" +order: 430 +area: image/lab +title: 'no host key made when spin hands over its own (labs 45086250796, 45085877480, 45085877238, 45085886063, 45086216266, #515, spin-stack/spin#1650, #573)' +issues: [515] +runs: [45085877238, 45085877480, 45085886063, 45086216266, 45086250796] +--- +spin already makes, pins and hands over the workspace's host key. vminitd makes an Ed25519 key, the launch claim carries its public half, the control plane connects with it fixed, and before it execs systemd vminitd writes it to `/run/spin/ssh/ssh_host_ed25519_key` with a drop-in naming it sshd's only `HostKey`. The image's `spin-machine-sshd-keygen` still ran on ssh.service's path, 6.2 ms of CPU (ledger, v20261122.07), for a key nothing loads. So the brief's plan (a systemd credential through fw_cfg, a Spec field and a kernel option to read it, spin making the key on the host) was not needed. *Changed:* the unit carries `ConditionPathExists=!/run/spin/ssh/ssh_host_ed25519_key`, read back by build.sh. `ssh.service.wants/spin-machine-sshd-keygen.service`, a symlink checked in since `2df3dbf` that #515 could not trace, wanted the unit a second time and is gone. The sysinit want stays for the lane. The lab's `--edit spin-handoff` stands in for vminitd's handoff: a fresh key per boot, made on the host, and a shell as PID 1 that places it and execs systemd. *Measured:* on the bench, spin's shape and login, against v20261122.07, both arms with the handoff. At 60 a side the first login read −6.8 [−11.8, +0.2] (lab 45085877480), under the ~6 ms ceiling's noise, so the run that decided it took 120 a side: first login −6.9 [−9.6, −2.4], sshd accepting −6.8 [−10.4, −1.8]. In the same run, the ssh.service want taken away read −1.6 [−3.7, +4.3], which rule 5 deletes (lab 45086250796). Restored, 20 a side: restored login −0.6 [−3.1, +4.7], cold −9.0 [−16.3, +2.8], within noise (lab 45085877238). `boot:logind` and `boot:workspace` passed on the arm (labs 45085886063, 45086216266). *Opened:* #575, because `login=spin` does not hand over a key, so its probes still pay the keygen. spin-stack/spin#1650 records `HostKeyPath` as the image's contract. *Status:* in place. The arms' edits (`keygen`, `keygen-unwanted`) are removed. diff --git a/docs/log/2026-11-22-refresh-yml-proposes-the-openssh-source-when-ubuntu.md b/docs/log/2026-11-22-refresh-yml-proposes-the-openssh-source-when-ubuntu.md new file mode 100644 index 00000000..7d040c2a --- /dev/null +++ b/docs/log/2026-11-22-refresh-yml-proposes-the-openssh-source-when-ubuntu.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-22" +order: 150 +area: CI +title: refresh.yml proposes the openssh source when Ubuntu moves it (#463, this change) +issues: [463] +prs: [1] +--- +The archive serves only the openssh source resolute publishes now, so image/openssh stopped building the day Ubuntu moved it, and nothing moved the pin. `spin-machine-dev refresh openssh` is `versions refresh -propose -label openssh openssh-source`, and refresh.yml's `systemd` job is now `sources`, one matrix job each for systemd and openssh. The patches are checked where the build already checks them: the proposing pull request changes `openssh-source`, so parts.yml's `changed` builds the image, and `image/openssh/Dockerfile` applies every patch with `--fuzz=0`. *Checked.* With the pin set back to 10.2p1-2ubuntu3.7, `versions refresh openssh-source` committed 10.2p1-2ubuntu3.8 with the repository's pin, 5f83862e…. A moved `openssh-source` makes `changed` answer `build=true` for the image. The patch applies with `--fuzz=0` to the pinned source as `dpkg-source -x` lays it out. With one of its context lines in auth2.c changed, `--fuzz=0` refuses it (`Hunk #1 FAILED at 360`), where patch's default fuzz would have applied it. *Status:* in place. diff --git a/docs/log/2026-11-22-roots-manager-without-the-xdg-autostart-generator.md b/docs/log/2026-11-22-roots-manager-without-the-xdg-autostart-generator.md new file mode 100644 index 00000000..e0b153ab --- /dev/null +++ b/docs/log/2026-11-22-roots-manager-without-the-xdg-autostart-generator.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-22" +order: 360 +area: image +title: 'root''s manager without the XDG autostart generator (labs 45062836688, 45070208762, 45070150688, 45070973943, 45071003631, 45071003608, #527, this change)' +issues: [467, 527] +runs: [45030778365, 45062836688, 45070150688, 45070208762, 45070973943, 45071003608, 45071003631] +--- +v20261122.04's first login was +6.8 [+0.1, +13.6] over .03, and the cause is root's manager, which #467 starts in the boot and the first login waits for. That is correctness and stays. *What the manager does* (the ledger, lab 45062836688, v20261122.05, 3 boots, CPU before the login's end, p50): `user@0` 17.5 ms in all; systemd-executor and the PAM stack of `systemd-user` 4.6-5.0, of it `unix_chkpwd` 1.1; the manager from its exec to its generators 2.6; the environment.d generator 2.0; the XDG autostart generator 1.6; loading units 4.4; the first transaction to `Startup finished` 1.4. The rest of its 17-18 ms in the ledger runs after the login. The vCPU has no idle from ~155 ms to the login's end, so a millisecond of CPU cut there is a millisecond of the login's. A workspace needs the environment.d generator (it reads `10-user-sockets.conf`, the bus's address for user services, and `/etc/environment`), the sockets, and the PAM stack's account check, limits and audit uid. It does not need the XDG generator: a workspace has no graphical session. *Arms* (bench, spin's shape and login, against v20261122.06, 100 a side, interleaved, lab 45070150688): the XDG generator masked, first login −3.8 [−6.2, −0.7], accept to login −6.1 [−9.0, −0.3]; every cut above together, a bound, −9.6 [−13.3, −6.7]; no manager for root (`user-early-light`, no linger), a bound, −17.3 [−19.2, −12.4]. The two bounds match the ledger's CPU for what they remove, ~10 and ~17.5 ms, so the ledger's CPU is the login's time here. The ledger of the arms (lab 45070208762, 3 boots each) shows `user@0`'s CPU at 17.0-18.1 on the release, 15.5-15.7 with the XDG mask and 9.4-10.9 for the floor's cuts, so each edit removed what it named. The XDG arm's −3.8 is about twice the generator's 1.6 ms of CPU. Its disk wait went too: `user@0`'s disk time 11.9-16.2 against 8.8-10.6. The login waits for the manager to finish, so that wait is on its path (inferred from the two ledgers). The same mask measured −4.8 [−11.2, +1.3] at 20 a side in #467 (lab 45030778365), when the manager started inside the login, and was left out. Restored login −1.7 [−4.4, +2.2] evicted and −2.5 [−5.1, +1.9] cached, in noise (lab 45070973943, 20 a side). `boot:logind` and `boot:workspace` passed on the arm (labs 45071003631, 45071003608). *Changed:* optimize-systemd.sh masks `/etc/systemd/user-generators/systemd-xdg-autostart-generator`, and image/build.sh refuses a user generator's mask that masks nothing, as it does a system generator's. *Left:* what remains of #527 is function, and the cost of the correctness #467 bought. *Status:* in place. diff --git a/docs/log/2026-11-22-six-unmeasured-deviations-measured-two-reverted-and-boot.md b/docs/log/2026-11-22-six-unmeasured-deviations-measured-two-reverted-and-boot.md new file mode 100644 index 00000000..0bcc6bc3 --- /dev/null +++ b/docs/log/2026-11-22-six-unmeasured-deviations-measured-two-reverted-and-boot.md @@ -0,0 +1,10 @@ +--- +date: "2026-11-22" +order: 300 +area: image +title: 'six unmeasured deviations measured, two reverted, and boot:workspace (labs 45034963004, 45036254377, #508, #517, this change)' +issues: [515] +prs: [508, 517] +runs: [45034963004, 45036254377] +--- +The inventory (#508) and docs/image.md (#517) left six deviations with no measurement in spin's shape on spin's login. Each was taken back to what Ubuntu ships by a `lab` edit, one arm each, interleaved against v20261122.03 with `--edit lane`, 20 a side, 1 of 16 vCPUs, 128 MiB, `prestart` (lab 45034963004). Taking back, Δp50 cold: `nsswitch.conf` +0.8 [−8.4, +5.2]; the volatile journal +6.1 [+2.3, +15.8]; docker and containerd by socket +13.9 [+11.4, +18.2], restored +55.7 [+12.0, +73.9]; the manager's timeouts +0.3 [−5.2, +3.3]; logind, the bus and the user units early +16.5 [+9.8, +20.4]; the host keys from the first dispatch −0.8 [−10.5, +3.5]. *Kept:* the journal, docker (a deferred row, which says the first `docker` command waits for the daemons), and the lane's logind units, now measured in spin's shape. *Reverted:* `nsswitch.conf` and `fast-boot.conf`, which earned nothing; their edits went with them, and so did `carry-logging`, which edited `fast-boot.conf`. The host keys stay pending #515. `boot:workspace` checks what a workspace expects and asserts what the image gives up; on v20261122.03 (lab 45036254377) it found tracefs empty under `lockdown=confidentiality`, where docs/image.md said it mounted by hand, and the first `docker` command waiting 0.47 s on two vCPUs. It runs in release.yml's bench job on the release's own image, beside `boot:logind`. *Opened:* #509-#515. *Status:* in place. diff --git a/docs/log/2026-11-22-spins-early-login-each-number-against-its-own.md b/docs/log/2026-11-22-spins-early-login-each-number-against-its-own.md new file mode 100644 index 00000000..3ebcc425 --- /dev/null +++ b/docs/log/2026-11-22-spins-early-login-each-number-against-its-own.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-22" +order: 370 +area: docs +title: 'spin''s early login, each number against its own run''s release (labs 44805051310, 44807457606, #363)' +runs: [44805051310, 44807457606] +--- +docs/boot-time.md set −59.4 from one run beside "the image's half alone −17.4" from another in one cell, and gave "−51 more" in a second cell, a difference between two arms rather than either against its release. They are two runs on two hosts, both against v20261120.03, 20 boots a side, spin's shape and login. Lab 44805051310 (spin-machine at 90a6543): `login-early` (ssh.socket, ssh.service, sshd-keygen and the probe's forwarder without default dependencies, logind and the broker without PrivateTmp) −10.8 [−16.3, −5.2], with `udev-startup` as well −59.4 [−65.9, −56.2]. Lab 44807457606 (at fbc7517): `--edit lane`, the image's half without the forwarder, −17.4 [−25.0, −8.5]; with `forwarder-early` as well −68.5 [−78.0, −61.8]. *Changed:* each cell names its run's arms beside their numbers, and no delta is taken between runs. diff --git a/docs/log/2026-11-22-ssh-first-logs-in-over-the-connection-it.md b/docs/log/2026-11-22-ssh-first-logs-in-over-the-connection-it.md new file mode 100644 index 00000000..16d9b53f --- /dev/null +++ b/docs/log/2026-11-22-ssh-first-logs-in-over-the-connection-it.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-22" +order: 140 +area: lab +title: 'ssh-first logs in over the connection it timed (lab 44987441326, #450, this change)' +prs: [451] +runs: [44987441326] +--- +`ssh-first` polled `VsockAccepts(cid, 22)` to time `accepts`, closed that connection, and logged in on a new one. On spin's path (`login=spin`) the closed connection had reached the forwarder, which opened one to 127.0.0.1:22, so sshd forked and exec'd `sshd-session` for it on the guest's one vCPU beside the first login timed. spin's runner opens the user's connection once. The probe now keeps the first connection accepted and runs the first login over it (`Key.LoginOn`); `accepts` is still that connect's return. If that login fails, the probe logs it and logs in again as before. `VsockAccepts` had no caller left and is gone. *Measured* as two rows of one tree, so one run compares the two probes (bench, nested, spin's shape and login, v20261122.01 with main's spin-machine, 40 each interleaved, lab 44987441326, branch `exp-ssh-first-rows`, not for merge): accept to login 69.6 → 65.3, −4.3 [−5.4, −3.0]; first login 463 → 458, −4.4 [−9.1, +0.3], within noise at 40, because `accepts` itself spreads ±4 ms; sshd accepting +1.8 [−3.7, +4.4]; the second login −0.6 [−2.0, +1.3]. The console prompt read −6.2 [−12.3, −2.2]: the echo getty runs after sshd accepts, on the same vCPU as the extra session. The size matches #451's −4.1 on the restored login. The number moves because the probe stops adding work, not because the machine changed. *Status:* in place. Compare a release measured before it only within one run, as the ladder does. diff --git a/docs/log/2026-11-22-ssh-service-starts-without-sshd-t.md b/docs/log/2026-11-22-ssh-service-starts-without-sshd-t.md new file mode 100644 index 00000000..06d631a9 --- /dev/null +++ b/docs/log/2026-11-22-ssh-service-starts-without-sshd-t.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-22" +order: 40 +area: image +title: ssh.service starts without `sshd -t` (lab 44977044826, this change) +runs: [44976328180, 44977044826] +--- +Where PID 1 to sshd accepting goes, read from the guest after the first login (a `chain` probe on branch `exp/chain`, lab 44976328180, 10 boots, v20261122.01, spin's shape): PID 1 starts at 84.6 ms on the guest's clock, the first jobs dispatch at 139.3, sysinit.target at 280.5, basic.target 285.6 and the forwarder 286.6. The CPU used to the first login: the kernel's own 106 ms, PID 1 66, udevd 46, ssh.service 45 (both logins' sessions in it), journald 20, logind 16, the bus 11. One vCPU and no idle time, so the login waits for every exec before it. Ubuntu's ssh.service runs `sshd -t` as ExecStartPre: without it, the cold first login −3.2 [−7.2, −0.8] and sshd accepting −2.4 [−6.4, −1.1], 60 boots each interleaved, spin's shape and login. The same run took four other execs and settings out, one arm each, and none moved the login: systemd-udev-load-credentials masked −2.1 [−6.3, +0.3]; systemd-user-sessions' ExecStart emptied, its ExecStop kept, −0.6 [−5.2, +1.5]; sshd-socket-generator masked +0.8 [−4.0, +4.7]; and `DefaultMemoryAccounting=no` +4.1 [+0.8, +7.1], worse, with sshd accepting +6.2 [+2.2, +8.0], not explained. So an exec pair costs the login ~3 ms here, not the ~6 a getty's echo's 10 ms of CPU suggested. *Status:* `sshd -t` dropped at start (`ssh.service.d/20-no-config-test.conf`, asserted by build.sh, in the lab's lane edit); the restore unchanged (restore-first in the description). diff --git a/docs/log/2026-11-22-sshd-delays-a-failed-userauth-and-not-a.md b/docs/log/2026-11-22-sshd-delays-a-failed-userauth-and-not-a.md new file mode 100644 index 00000000..4c36e26e --- /dev/null +++ b/docs/log/2026-11-22-sshd-delays-a-failed-userauth-and-not-a.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-22" +order: 120 +area: image +title: 'sshd delays a failed userauth and not a login (labs 44983986606, 44983986575, #457, this change)' +issues: [457] +runs: [44983986575, 44983986606] +--- +The image installs Ubuntu's openssh 1:10.2p1-2ubuntu3.8 rebuilt from its source package (`image/openssh`, versions.yaml `openssh-source`) with `userauth-delay-failures.patch`: `input_userauth_request` skips `ensure_minimum_time_since` for a request that authenticated, or for a public key query sshd answered with `PK_OK`, and keeps it for every other request but `none`. Ubuntu's package changes nothing on that path. It carries d43ba60 (CVE-2026-60001), whose keyboard-interactive and GSSAPI follow-ups delay only a failure, so the patch tests the method (`m == &method_pubkey`) and not `postponed` alone: those methods' first requests set `postponed` and keep their delay. The packages are `+spin1` and held, as systemd's. *Measured* (bench, nested, spin's shape and login, 30 a side interleaved, v20261122.01 against itself with this checkout's OpenSSH, `lab tree --openssh`): restored login 93.2 → 79.6, −13.6 [−14.9, −9.8] evicted and −13.6 [−16.2, −11.4] cached, `running` −0.3 [−1.9, +3.1] (lab 44983986606); the cold first login 467 → 457, −9.4 [−15.8, −2.6], sshd accepting −3.4 [−8.2, +0.6], accept to login −6.0 [−10.1, −4.8], the second login −10.9 [−12.3, −9.0] (lab 44983986575). The restore matches the `LD_PRELOAD` bound (−13.4). The cold login, which the bound read as within noise at −3.2 [−13.7, +2.7], moved too. *Checked* (`boot:sshd-delay`, laptop, 10 logins): the signed request of a login took 16.8 ms on the release's sshd and 1.9 ms on this image's; every refused key and unknown user still took 5.8-9.1 ms. The query's own turn shows no delay on either, because `PK_OK` goes out before it: the query's delay holds up the signed request. *Found on the way:* `debugfs cat | grep -q` on a binary fails under `pipefail` (debugfs takes SIGPIPE when grep stops at the match), so build.sh dumps sshd-auth to a file before it asks. *Status:* in place. The success half is upstream's intent and should be offered to OpenSSH (#457). diff --git a/docs/log/2026-11-22-the-boot-chart-from-spin-stacks-systemd-bootchart.md b/docs/log/2026-11-22-the-boot-chart-from-spin-stacks-systemd-bootchart.md new file mode 100644 index 00000000..68785fb2 --- /dev/null +++ b/docs/log/2026-11-22-the-boot-chart-from-spin-stacks-systemd-bootchart.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-22" +order: 310 +area: lab +title: 'the boot chart from spin-stack''s systemd-bootchart (labs 45042034749, 45042509602, 45043434713, #525)' +runs: [45042034749, 45042509602, 45043434713] +--- +Ubuntu's 235 named processes "9", read cgroup v1 and so labelled none with its unit, and filtered out 62 of the processes that ran. The `bootchart` edit now compiles spin-stack/systemd-bootchart at the commit versions.yaml pins, in a container on the runner that makes the tree (`internal/lab/bootchart.Dockerfile`), with `ControlGroup=yes` and `Cmdline=no`, and the probe keeps the fork's JSON beside the chart. *What v20261122.03's chart shows at 78dc08c* (lab 45043434713, bench, spin's shape, 3 boots): CPU by unit p50 init.scope 134 ms (PID 1 118 to 123 ms, and the sampler, named `bootchart`, ~10 ms), systemd-udevd.service 25, systemd-journald.service 19, systemd-logind.service 15, the root cgroup's kernel threads 15, session-1.scope 13, ssh.service 11, dbus-broker.service 10. systemd-udevd waits ~120 ms to run and systemd-udev-trigger ~110. The sampler says it used ~10 ms of CPU, ~0.2 ms a sample. `first_login` 433 ms p50, `chart_end` 330. Leads, not savings. *Status:* in place. diff --git a/docs/log/2026-11-22-the-boot-chart-without-the-things-a-reader.md b/docs/log/2026-11-22-the-boot-chart-without-the-things-a-reader.md new file mode 100644 index 00000000..8bd5dddc --- /dev/null +++ b/docs/log/2026-11-22-the-boot-chart-without-the-things-a-reader.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-22" +order: 320 +area: lab +title: 'the boot chart without the things a reader had to guess at (lab 45060814905, spin-stack/systemd-bootchart#9, #528)' +runs: [45043434713, 45060814905] +--- +The charts at 78dc08c (lab 45043434713) named one executor "9", gave idle kernel threads no cgroup in one boot of three (so "/" counted 15 processes there and ~50 in the others), showed "systemd-user-sessions.service (deleted)" as a unit of its own, and drew the header and top tables overlapping on a page ~340 px taller than its chart. The fork at 096d61a names a process whose comm is digits by its exe link's basename, says "/" for a process the kernel lists in no cgroup (before systemd mounts one), cuts " (deleted)", gives its font sizes a unit (CSS ignored them, so browsers drew every label at 16px), and sizes the page from what it draws. *What lab 45060814905 shows* (bench, spin's shape, v20261122.05, 3 boots): no process without a cgroup, "/" at 51 processes in each boot, no name of digits and no " (deleted)", and each page 40 px below its last row. The executor and the removed cgroup did not recur in these boots, so the fork's `--proc` tests are what show those two fixed. A name in parentheses such as "(systemd-user-)" is a child systemd forked, seen once before it exec'd: that is what it was then. *Status:* in place. diff --git a/docs/log/2026-11-22-the-boot-charts-first-sample-wait-graph-and.md b/docs/log/2026-11-22-the-boot-charts-first-sample-wait-graph-and.md new file mode 100644 index 00000000..81edfd5c --- /dev/null +++ b/docs/log/2026-11-22-the-boot-charts-first-sample-wait-graph-and.md @@ -0,0 +1,10 @@ +--- +date: "2026-11-22" +order: 330 +area: lab +title: 'the boot chart''s first sample, wait graph and legend (lab 45064083873, spin-stack/systemd-bootchart#10, #534)' +issues: [538] +prs: [34, 38, 40, 44] +runs: [45060814905, 45064083873] +--- +The write graph in lab 45060814905 had the read graph's shape from 85 to 215 ms, in a boot whose tables said it wrote 0.0-0.1 MB. It read the right counter, `pgpgout`. As PID 1 the sampler starts before /proc is mounted, and its first samples held zeros. The first sample that read /proc then differed from zero by everything since the kernel started: 21 MB read, 124 KB written and 79 ms of CPU in one 5 ms interval. The IO graphs' 250 ms average spread that jump into a ramp, and the CPU and pressure graphs began with a full bar. The fork at 3125dea gives the samples before /proc the first counters it reads. It also drops the "CPU wait" graph, which summed every task's run delay, so on one vCPU it sat at its ceiling and read like a boot bound by IO (upstream #13). CPU pressure now sits under CPU utilization. The process graph's title says what its colours and dashed lines are (upstream #39), and the header's "Graph data" and "Sampler" lines are drawn at 12px instead of 8px. `--proc` tests hold three upstream reports that the fork already got right: a "(systemctl)" name kept whole (#44), no nameless process without /proc/PID/sched (#34), and a short-lived `@`/`:` template instance drawn (#40). Upstream #38's leaks are cppcheck not modelling `_cleanup_fclose_`. *What lab 45064083873 shows* (bench, spin's shape, v20261122.05, 3 boots, the fork's branch at 1f00a0f, whose tree 3125dea merged unchanged): `pgpgout` is 124 KB in every sample of every boot, and each write graph is empty. No chart has a wait graph, and each carries the legend and the 12px header lines. The read graph still starts ~20 ms before the first read, from its 250 ms average (#538). *Status:* in place. diff --git a/docs/log/2026-11-22-the-boots-dependency-view-and-what-fills-the.md b/docs/log/2026-11-22-the-boots-dependency-view-and-what-fills-the.md new file mode 100644 index 00000000..4112e792 --- /dev/null +++ b/docs/log/2026-11-22-the-boots-dependency-view-and-what-fills-the.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-22" +order: 380 +area: lab +title: 'the boot''s dependency view, and what fills the stretch before the first job (labs 45070438471, 45070718529, 45071125219, 45071549627, 45071102677, #521, #553, #554)' +issues: [553, 554] +runs: [45070438471, 45070718529, 45071102677, 45071125219, 45071549627] +--- +The bootchart probe now keeps `systemd-analyze critical-chain` of the login's units, the login user's manager's chain, and `systemd-analyze dot --order` among the chain's units, drawn by graphviz (docs/measuring.md, "Boot charts"). *The stretch from ~109 to ~146 ms* (debug boots with `systemd.log_level=debug systemd.log_target=kmsg systemd.log_ratelimit_kmsg=0`; without the last, systemd's own kmsg rate limit cut PID 1's lines at 118 ms): PID 1 loads every unit `multi-user.target` reaches, ~36 ms in those slowed boots, with 56 lookups of mount units that do not exist, and then computes a transaction of 79 jobs in ~0.4 ms. `UnitsLoadFinishTimestamp` is taken before that loading, so the plot's empty stretch is the loading. *dev-vda.device:* no unit queues a job for it, and nothing depends on it. It is `tentative` from PID 1's catchup (root is mounted from it) until udevd announces it, and the plot draws tentative as activating. *The chain to the login* on v20261122.06: the forwarder that stands for spin's supervisor waits for `basic.target`, 28-38 ms after `ssh.service` is active. Taken off it (`--edit forwarder-early`), it was active ~33 ms sooner, and the goal numbers did not move: cold +4.2 [+0.0, +11.0], restored −0.0 [−2.3, +2.3] (`prestart`, 20 a side). The login waits for systemd-logind next (#553). *Status:* the view in place. The forwarder row moved to "Measured and rejected". The release copy is open (#554). diff --git a/docs/log/2026-11-22-the-coverage-floor-counts-what-ci-can-run.md b/docs/log/2026-11-22-the-coverage-floor-counts-what-ci-can-run.md new file mode 100644 index 00000000..38cabee4 --- /dev/null +++ b/docs/log/2026-11-22-the-coverage-floor-counts-what-ci-can-run.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-22" +order: 210 +area: CI +title: the coverage floor counts what CI can run (#410, this change) +issues: [410] +--- +`task test`'s floor counted every statement, and a function marked `mutate-lane:` runs only in a lane with root and KVM. Each probe the lab gained pulled the total down however well its testable half was tested: #406 passed at 79.96%, which `go tool cover -func` rounded to 80.0 before the comparison. `internal/coverfloor` reads coverage.out, leaves out each function whose doc comment carries the marker, as go-tools' mutate does, and compares the exact percentage. *Measured* locally on `140ebbb` with CI's conditions (no release tree, no root): 80.48% before it, 80.65% of 9298 statements with internal/coverfloor's own, and 93.36% of the 7697 left without the lane's 1601. The floor moves from 80 to 93, just under it, so it ratchets. *Status:* in place. diff --git a/docs/log/2026-11-22-the-coverage-floor-is-go-tools-coverfloor.md b/docs/log/2026-11-22-the-coverage-floor-is-go-tools-coverfloor.md new file mode 100644 index 00000000..2f95fdbc --- /dev/null +++ b/docs/log/2026-11-22-the-coverage-floor-is-go-tools-coverfloor.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-22" +order: 250 +area: CI +title: 'the coverage floor is go-tools'' coverfloor (go-tools #131, v20261122.02, #496, this change)' +prs: [490] +--- +`internal/coverfloor` (#490) copied go-tools mutate's rule for lane code, which every spin-stack repository's `task test` should read the same way. go-tools' `coverfloor` reads it through mutate's own `LaneFunctions`, and it refuses a marker that names no test, as mutate does. `task test` runs it by name from go-tools' release, and the copy is deleted. *Checked:* both tools printed the same line on main's profile (93.38% of what CI runs, 80.66% with the 1606 lane statements). The same release copies no ignored directory into mutate's copies (go-tools #132, #129) and stops a run whose importer test fails unmutated (go-tools #133, #130): the `_output` guard in `task test` stays, for a plain `go test`, with its comment saying so. *Status:* in place. diff --git a/docs/log/2026-11-22-the-cpu-weight-while-the-boot-runs-on.md b/docs/log/2026-11-22-the-cpu-weight-while-the-boot-runs-on.md new file mode 100644 index 00000000..048ff861 --- /dev/null +++ b/docs/log/2026-11-22-the-cpu-weight-while-the-boot-runs-on.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-22" +order: 400 +area: lab +title: 'the CPU weight while the boot runs, on user@0''s chain and on two units off the login''s chain (labs 45082870346, 45083184310, 45083106264, 45083184131, #553)' +runs: [45082187351, 45082870346, 45083106264, 45083184131, 45083184310] +--- +The cold login does not wait for logind on v20261122.07. In its ledger (lab 45082187351, 3 boots), logind is active within 1-13 ms of `basic.target`, before or after it. The login's session opens 2-4 ms after it is authenticated, and the session waits 0-5.6 ms for root's manager (`user-early`). The login waits for the forwarder's chain (journald → tmpfiles → `sysinit.target` → `basic.target`) and for the key exchange on a vCPU that idled 14 ms of the 185 from PID 1 to the connection (boot 2). The two arms were lab edits (`logind-weight`, `offpath-weight`), on the bench, spin's shape and login, interleaved against v20261122.07. *logind, `user-runtime-dir@` and `user@` at `StartupCPUWeight=1000`:* first login −9.2 [−16.1, −0.3] at 30 a side in a screening run of three arms (lab 45082870346). The run fixed in advance to decide it, the arm alone at 40 a side, read −3.6 [−10.3, +0.6] (lab 45083184310). Accept to login was −7.7 [−14.0, −4.0] and sshd accepting +8.8 [−1.1, +13.3]. In its ledgers (lab 45083106264), logind is active ~9 ms sooner and `sysinit.target` ~18 ms later (p50 of 3). The weight moves the vCPU from the forwarder's chain to the manager's, and the login needs both. Restored, in noise: −1.2 to +0.1 (lab 45083184131, 20 a side). *`spin-machine-sshd-keygen` and `systemd-udev-load-credentials` at `StartupCPUWeight=1`:* sshd accepting +22.6 [+15.9, +33.5], first login +3.4 [−3.2, +14.6]. ssh.service waits for the keygen, which finished 45-70 ms later (lab 45083106264), and the forwarder waits for ssh.service. The keygen is on spin's path, not off it. Both together +6.0 [+0.5, +15.1]. Under cgroup v2, a weight is shared with the unit's siblings: `user@0` competes in `user-0.slice`, and `user.slice` competes with `system.slice` and `init.scope`. `StartupCPUWeight=` holds until the boot's jobs are done, and on spin's path the getty's wait for `dev-ttyS0` keeps them running past the login. *Decided:* neither is kept, and both rows are in "Measured and rejected". On one busy vCPU, a weight only changes which chain waits. What the login needs before it is the CPU it takes. *Status:* the edits are removed. diff --git a/docs/log/2026-11-22-the-first-login-waits-for-its-user-manager.md b/docs/log/2026-11-22-the-first-login-waits-for-its-user-manager.md new file mode 100644 index 00000000..afdb8227 --- /dev/null +++ b/docs/log/2026-11-22-the-first-login-waits-for-its-user-manager.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-22" +order: 270 +area: image +title: 'the first login waits for its user manager, which root starts in the boot (labs 45030778365, 45031248191, 45031644179, 45031644114, 45031687433, 45032247920, 45032247623, #467, this change)' +issues: [462] +runs: [45030778365, 45031248191, 45031644114, 45031644179, 45031687433, 45032247623, 45032247920] +--- +Since #462 a login's manager started beside it, and the first login's own `systemctl --user` could arrive before it. On spin's login (root, bench, v20261122.03) it failed 10 of 10 (lab 45032247920, `ssh-first` with the first login's command `systemctl --user list-units`, archive tag archive/exp-user-manager-467). *Where the manager's time goes:* a diagnostic read root's manager's timestamps after the logins (`systemctl show` of `user@0` and the manager's own Generators/UnitsLoad timestamps). With class `user-early` the manager took ~48 ms from `user@0` starting to ready: ~11 PAM and exec, ~2.6 the manager's start, ~9 the XDG autostart and environment.d generators, ~2 unit load, ~8 building the first transaction (its lazy unit loads, a debug log showed), and ~15 sockets.target, which waits for dbus.socket's and ssh-agent.socket's `ExecStartPost=systemctl --user set-environment`. The user units are default.target, basic.target, sockets.target (dbus.socket, ssh-agent.socket, systemd-ask-password.socket), timers.target and paths.target with nothing in them, and app.slice. *Cuts* (bench, nested, spin's shape and login, 20 a side, against class `user-early`, lab 45030778365): the sockets' environment from `/etc/environment.d` and their ExecStartPost taken away −17.1 [−27.0, −10.7]; the XDG generator masked −4.8 [−11.2, +1.3]; both generators, a bound, −8.4 [−15.8, −1.0]; the PAM stack down to `pam_permit` and `pam_systemd`, a bound, −3.5 [−11.4, +2.5]. With the environment cut and the XDG mask, `user-early` still cost +29.8 [+17.2, +42.2] (lab 45031248191): what is left is systemd --user's own start. *Root lingering* moves that start into the boot, where the first login finds it done or nearly. Decided at 40 a side (lab 45031644179): `user-early`, the environment cut and root lingering, first login +4.7 [−0.2, +12.2], within noise; sshd accepting +5.6 [+1.1, +10.1]; the second login −16.7 [−17.7, −16.3]. Without the environment cut, +19.6 [+15.9, +25.6]. Restored login −10.8 [−15.9, −6.6] evicted and −12.3 [−15.1, −5.5] cached, 20 a side (lab 45031644114). The likely reason is that root's manager no longer stops 10 s after the cold login's session ends (`UserStopDelaySec`) and starts again beside the restored login (inferred, not measured). *Left out:* the XDG mask, which moved neither goal number. *The lane's login as spin* waits for spin's own manager: first login +29.7 [+22.8, +42.1], and shadowing Ubuntu's `user@` barrier on `systemd-user-sessions` changed nothing (+30.6, lab 45031687433). The lane is no goal number, and the no-systemd floor's Δ in the next release's record is read against it. *Changed:* class `user-early`, root's linger file, `environment.d/10-user-sockets.conf` and the two sockets' `10-env.conf`; `20-manager.conf` deleted, since logind starts the manager of every session of class `user-early` itself. `boot:logind` runs its SSH logins before the console `su`, so the first SSH login's `systemctl --user` is the first login's. `lab`'s lane edit carries the same. *Checked:* the first login's `systemctl --user` passed 10 of 10 on spin's login and on the lane's with these edits, the manager-wants drop-in removed (labs 45032247920, 45032247623). *Status:* in place. diff --git a/docs/log/2026-11-22-the-floors-gap-is-a-with-its-interval.md b/docs/log/2026-11-22-the-floors-gap-is-a-with-its-interval.md new file mode 100644 index 00000000..c776a3a5 --- /dev/null +++ b/docs/log/2026-11-22-the-floors-gap-is-a-with-its-interval.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-22" +order: 240 +area: lab +title: the floor's gap is a Δ with its interval (#495, this change) +issues: [495] +runs: [45018301368] +--- +The record kept the floor as two p50/p95 pairs, and the gap a reader wants, what systemd costs at most, was their difference with no interval, so it could not be read by the one acceptance rule. A record now keeps `bounds.floor`, the floor's Δp50 against the release's lane login from the same run, drawn by `DeltaP50`, the bootstrap every release's Δ uses, and docs/releases.md shows it in "Bounds" beside the two pairs. A bound is still never read against the release before it. *Checked* on the floor's samples from report.yml run 45018301368 (v20261122.02, bench, spin's shape, 20 boots each), kept as `internal/lab/testdata/floor-45018301368.json`: −166.3 [−174.7, −160.3]. The floor keeps its own lane-login arm. Its sshd does not serve spin's path, which is spin's forwarder before sshd, and the floor has no systemd to run it. *Status:* in place. diff --git a/docs/log/2026-11-22-the-host-counts-the-port-i-o-exits.md b/docs/log/2026-11-22-the-host-counts-the-port-i-o-exits.md new file mode 100644 index 00000000..842c1ea9 --- /dev/null +++ b/docs/log/2026-11-22-the-host-counts-the-port-i-o-exits.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-22" +order: 190 +area: kernel, boot +title: 'the host counts the port I/O exits 0004 and 0010 save (labs 45017602084, 45018204750, 45018204645, 45018410483, 45018410313, 45018410890, #486, this change)' +prs: [478] +runs: [45017420814, 45017423344, 45017602084, 45018204645, 45018204750, 45018410313, 45018410483, 45018410890] +--- +The vmlinux check (#478) sees 0004 and 0010 compiled in, not earning. 0004 needs `raw_pci_ext_ops`, set from the ACPI MCFG table, and 0010 needs KVM's CPUID leaf, so a kernel that set up MMCONFIG after enumeration, or a machine without MCFG, would pass it. `boot:patches` now cold-boots spin's shape to `/bin/sh`, reads KVM's `io_exits` and `mmio_exits` for every vCPU through QEMU's `query-stats`, and holds the median of 3 boots' `io_exits` at or under 1,025 (`TestPCIConfigurationCostsNoPortExits`). *Calibrated* on the bench, 20 boots each, v20261122.02 with its own kernel and with kernels built without each patch (parts runs 45017420814, 45017423344, branches `exp/486-no0004` and `exp/486-no0010`, not for merge): the release 955-974, median 958, mmio 2,142; without 0010 1,075-1,097, median 1,094; without 0004 3,477-3,499, median 3,496, mmio 881. 0004 saves 2,520 port exits, not the issue's estimated 1,300: 1,261 configuration accesses move to ECAM, and mmio_exits falls by the same 1,261. 0010 saves ~120, clear of a spread of ~25, so both are guarded. *Checked:* the release passes (974/974/980). The guard fails without 0004 (median 3,481) and without 0010 (median 1,097). *Status:* in place, run by compat.yml with every change's kernel. diff --git a/docs/log/2026-11-22-the-host-key-is-ed25519-alone.md b/docs/log/2026-11-22-the-host-key-is-ed25519-alone.md new file mode 100644 index 00000000..61d16724 --- /dev/null +++ b/docs/log/2026-11-22-the-host-key-is-ed25519-alone.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-22" +order: 100 +area: image +title: the host key is Ed25519 alone (lab 44979726719, this change) +runs: [44979726719] +--- +spin-machine-sshd-keygen made an Ed25519 and an ECDSA key, each with its own ssh-keygen, before ssh.service starts, on the one vCPU. Ed25519 alone: the cold first login −5.0 [−8.3, −1.8], sshd accepting −4.4 [−6.9, −1.9], 60 boots each interleaved, spin's shape and login. Every client since OpenSSH 6.5 takes Ed25519; one that accepts only ECDSA host keys no longer gets in. The same run took `pam_selinux` and `pam_mail` out of sshd's PAM stack, −1.9 [−4.9, +2.8], not separable. *Status:* Ed25519 alone; the restore unchanged (in the description). diff --git a/docs/log/2026-11-22-the-machine-loads-a-state-fast-above-1.md b/docs/log/2026-11-22-the-machine-loads-a-state-fast-above-1.md new file mode 100644 index 00000000..1c2a892f --- /dev/null +++ b/docs/log/2026-11-22-the-machine-loads-a-state-fast-above-1.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-22" +order: 290 +area: machine, lab +title: 'the machine loads a state fast above 1.5 GiB of data, and no caller chooses (labs 45034868686, 45035462371, 45035462478, 45034881876, 45034881433, 45034881366, 45035029887, 45035048486, #470, this change)' +issues: [519] +runs: [44585840498, 44987275543, 45034868686, 45034881366, 45034881433, 45034881876, 45035029887, 45035048486, 45035462371, 45035462478] +--- +`LoadOptions.Fast` was the caller's choice, and spin offered it as a host policy, `fast_load`, off by default, whose comment cited 293 against 152 ms from before mapped-ram and multifd (lab 44585840498). A fast load reached the first login at ~400 ms against ~95 for a full one at today's state (lab 44987275543). *The crossover:* `restore-first` gained `touched=MIB`, which writes that many MiB of non-zero bytes into a tmpfs in the guest after its cold login and before its save. Bench, nested, spin's shape and login, plugged to 2048 MiB up to 1.5 GiB touched, then to 4096 and 8192, the state evicted, 20 a side interleaved, first login p50/p95 in full against fast: 179 MiB of data 95/105 against 489/563, +394 [+388, +420]; 825 MiB 258/310 against 431/446, +173 [+149, +195]; 1.2 GiB 374/510 against 476/534, +103 [+88, +120]; 1.7 GiB 570/763 against 441/498, −129 [−167, −76]; 3.7 GiB 1410/1804 against 451/518, −959 [−1008, −911]; 7.3 GiB 3152/3658 against 538/581, −2615 [−2642, −2589]. A full load costs the disk's read of the data, ~0.4 ms a MiB; a fast load's login barely moves. *Where a fast load's time goes* (branch `exp-470-blocktime`, `postcopy-blocktime` on, lab 45035029887): at 179 MiB ~2,500 faults, mean 69 µs, most 64-128 µs, blocked the vCPU 45 ms of the ~400 the login adds. With the state read ahead each fault took 5.5 µs and blocktime 3 ms, and the login was still 325 ms (−168 against no read-ahead, +234 over a full load). The postcopy lasted 0.8 s at 179 MiB and 2.4 s at 3.7 GiB: QEMU's eager thread places every 4 KiB page of the RAM blocks at their ceilings, 8 GiB, one ioctl each. That this is what slows the guest is inferred, not measured (#519). Postcopy's preempt channel is a second socket from a source, for pages queued behind the precopy stream, and a file load has neither. *Read-ahead during a fast load* (lab 45035048486, 10 a side, 3.7 GiB): faults 78 against 85 µs, login 436 against 458, p95 713 against 490, so it is not carried. *Changed:* `LoadOptions.Fast` and `spin-machine restore --fast` are gone. `Resume` loads fast a mapped-ram state with more than `machine.fastAbove` (1536 MiB) of data on a host that grants QEMU a userfaultfd (`/dev/userfaultfd` open to every user, spin's grant, or `vm.unprivileged_userfaultfd=1`), and in full otherwise. The read-ahead and the channels follow the same choice. `restore-first` lost its `fast` row; a bench runner grants the userfaultfd, so `touched` over 1.5 GiB measures the fast load. `boot:record`'s events test fills 1.6 GiB of a 2 GiB guest for the fast load's events. spin's `fast_load` is spin-stack/spin#1570. *Status:* in place. diff --git a/docs/log/2026-11-22-the-read-ahead-asks-from-four-goroutines.md b/docs/log/2026-11-22-the-read-ahead-asks-from-four-goroutines.md new file mode 100644 index 00000000..3c540bc6 --- /dev/null +++ b/docs/log/2026-11-22-the-read-ahead-asks-from-four-goroutines.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-22" +order: 70 +area: machine +title: the read-ahead asks from four goroutines (lab 44976924478, this change) +runs: [44976924478] +--- +With the read-ahead before the dial, restore-first's evicted login was still 6 ms over the cached one. The read-ahead was one goroutine making a `posix_fadvise(WILLNEED)` per 128 KiB piece, 1432 of them for the state's 179 MiB. Each call allocates its pages and submits their read before it returns, on a nested host. Four goroutines now ask, each for every fourth piece of each extent. *Measured* (bench, nested, spin's shape and login, 30 a side interleaved, against the read-ahead before the dial, lab 44976924478): evicted login 102 → 96.2, −6.2 [−9.1, −4.3], `running` −6.1 [−7.2, −4.8]. The cached row read −0.5 [−1.6, +1.9]. The evicted row is now level with the cached one (96.2 against 96.3), so the one goroutine asking was the limit and not the disk, and the restore has nothing left to win from reading. A test now holds a 64 KiB hole between two extents: a goroutine's last stride can end past it, inside the next extent, and without the reset to the extent's end over a third of that extent went unread. *Status:* in place. diff --git a/docs/log/2026-11-22-udev-after-basic-target-and-the-no-systemd.md b/docs/log/2026-11-22-udev-after-basic-target-and-the-no-systemd.md new file mode 100644 index 00000000..65567016 --- /dev/null +++ b/docs/log/2026-11-22-udev-after-basic-target-and-the-no-systemd.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-22" +order: 80 +area: image/lab +title: udev after basic.target, and the no-systemd floor again (labs 44977226981, 44977605109, 44978034052, 44978079694, 44978927041) +issues: [452] +runs: [44977226981, 44977605109, 44978034052, 44978079694, 44978927041] +--- +In the `chain` probe's timeline sysinit.target waited for udevd's READY, at 280 ms against ssh.service's 237: udevd runs at the lowest weight while the boot runs, so its start came after every early unit, and basic.target and spin's forwarder after it. Copies of systemd-udevd.service and systemd-udev-trigger.service without `Before=sysinit.target`: cold first login −46.3 [−49.4, −39.8] (60 boots each), basic.target 286 → 242 ms on the guest's clock, udevd ready after the login at 342. Restored, ~30% of restores take ~530 instead of ~112 ms (p95 539-547), and one run read restored into prestarted +317. A journal dumped from the slow ones (branch `exp/restore-diag`): the guest resumes at 0.430 s, and the next login is accepted at 0.889 with nothing logged between, 0.04 s idle in the guest's whole uptime. It is the forwarder-early arm's tail and likely the coldplug arm's +463.7: a guest saved before the boot's deferred work is done (#452). The same change at udev's normal weight gains nothing (+0.7 [−5.0, +6.5]), so the gain is the weight and the order together. The serial getty at the lowest weight +2.7 [−4.3, +7.9], four unused varlink sockets masked −0.8 [−4.8, +4.3]. *The floor:* on v20261122.01, no systemd before sshd, the lane's first login 404 → 250 ms, −153.9 [−162.5, −151.2], sshd accepting 242 → 197 (20 boots). *Status:* udev after basic.target open, blocked by #452; the getty and sockets rejected. diff --git a/docs/log/2026-11-22-vmlinux-btf-parsed-on-first-use-moves-the.md b/docs/log/2026-11-22-vmlinux-btf-parsed-on-first-use-moves-the.md new file mode 100644 index 00000000..5a839520 --- /dev/null +++ b/docs/log/2026-11-22-vmlinux-btf-parsed-on-first-use-moves-the.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-22" +order: 90 +area: kernel +title: vmlinux BTF parsed on first use moves the parse, not the login (labs 44982285400, 44982285406) +runs: [44982285400, 44982285406] +--- +kernel/Dockerfile says the first kfunc registration of the boot parses the 4.6 MB of vmlinux BTF, today xfrm's, and that only `DEBUG_INFO_BTF=n` removes it. A patch (branch `exp/btf-first-use`) keeps vmlinux's kfunc sets, destructors and struct_ops registered before the parse on a list, and the first `bpf_get_btf_vmlinux()` parses and registers them, in order, before any other caller gets the BTF; a struct_ops init that registers a kfunc set in turn (io_uring's) registers it at once. A program calling kfuncs of the common set loaded and ran on it. The kernel to "Freeing" −7.2 [−8.6, −6.2], inet_init 6.85 → 0.14 ms (10 boots), but the cold first login −1.5 [−3.1, +1.6] (60 boots): journald's `DeviceAllow=` and `IPAddressDeny=` load cgroup BPF programs at its start, and `bpf_check()` asks for vmlinux BTF for every program, so the parse lands in journald's start, before the login, on the same vCPU. *Status:* not carried. A verifier that asks for BTF only when a program needs it would let the parse leave the boot. diff --git a/docs/log/2026-11-22-what-a-guest-sends-on-the-pressure-port.md b/docs/log/2026-11-22-what-a-guest-sends-on-the-pressure-port.md new file mode 100644 index 00000000..f7700c03 --- /dev/null +++ b/docs/log/2026-11-22-what-a-guest-sends-on-the-pressure-port.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-22" +order: 410 +area: machine +title: what a guest sends on the pressure port is bounded in time (#559, spin-stack/spin#1597, this change) +issues: [559] +--- +spin's security review, adopting the probe, found the guest's bytes bounded in size (128-byte lines) and count (one connection per CID) but not in time, which spin's I7 asks for: a guest's root writing `stall memory 1 1 1` in a loop kept a host goroutine busy on the runner's CPU, a dial-and-drop loop left one goroutine and timer per connection waiting `answerWait` with one `GuestLost` each, and `hello oom=0` then `oom 18446744073709551615`, again on each connection, reset the base and wrapped the reported kills. *Changed:* each watch paces its guest's lines (64 at once, 16 a second) and connections (4 at once, 1 a second) with a token bucket, sized from the sender: a Stall at most once a 1 s window for each of three resources, an OOM line only in an OOM storm, and a dial 1 s after an end. A guest over the line pace is cut off with `ErrGuestTooFast` rather than having lines dropped and counted: the counters are totals, so its next hello and Stall lose nothing, and the end needs no new field to say what happened. A connection over the accept pace is closed and the one held stays. One `GuestLost` waits per watch, and later ends give it their error. A count or `Total` below the last heard is ignored, and `internal/pressure` saturates microseconds past a `time.Duration`. *Measured:* nothing; no guest's path changes, since the sender starts 10 s after boot. *Status:* in place. diff --git a/docs/log/2026-11-22-what-a-restored-login-waits-on-and-sshds.md b/docs/log/2026-11-22-what-a-restored-login-waits-on-and-sshds.md new file mode 100644 index 00000000..a8f59fca --- /dev/null +++ b/docs/log/2026-11-22-what-a-restored-login-waits-on-and-sshds.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-22" +order: 50 +area: image +title: 'what a restored login waits on, and sshd''s sleeps bounded (lab 44980029214, #457)' +issues: [457] +runs: [44980029214] +--- +With the disk gone from the evicted restore, the login after `running` is restore-first's largest phase (~35 ms). A connection that timed each write and read of the login (laptop, v20261122.01, one restore at a time) split a 32 ms restored login into 4.6 ms to the server's banner, ~5 ms of key exchange, 14.5 ms from the signed `userauth` request to `USERAUTH_SUCCESS`, and ~4.7 ms for the channel, `exec` and exit. sshd at `LogLevel DEBUG3` said where the 14.5 ms went: "elapsed 0.903ms, delaying 6.180ms" after the key query and "elapsed 1.468ms, delaying 5.615ms" after the signed request. Both are `ensure_minimum_time_since` in OpenSSH 10.2's `auth2.c`, which waits until 5 ms plus 0-4.2 ms have passed since a userauth request arrived. It runs while `authctxt->authenticated` is 0, and `userauth_finish` sets that flag only after it, so the request that succeeds sleeps too. The query sleeps after sshd has already answered `PK_OK`, before it reads the signed request. spin's users meet the query from both clients: `golang.org/x/crypto/ssh` always asks first, and OpenSSH's `ssh` does for a key whose public half it holds. *Bound* (an `LD_PRELOAD` shim in ssh.service whose `nanosleep` returns at once, `--edit nosleep` on branch `exp-nosleep`, not for merge; bench, nested, spin's shape and login, #447's spin-machine on v20261122.01, 30 each, interleaved): restored login −13.4 [−15.2, −10.5] evicted and −13.5 [−15.6, −12.4] cached, `running` +0.7 [−0.8, +1.5], the cold login before the save −3.2 [−13.7, +2.7], within noise. The cold login hides the sleep behind the boot work its vCPU still has. A laptop check that the shim took: sshd and `sshd-session` mapped it, and the signed request's turn fell from ~14 to 2.9 ms. The shim first went in through the edit's `Files`, which the manifest keeps as JSON, and arrived 136 bytes longer and was ignored; it goes in by `Setup` in base64. *Status:* open (#457). The candidate is a patch that skips the sleep for a request answered with `PK_OK` or that succeeds, which tells the client nothing it does not know, and keeps it for failures. It needs openssh rebuilt from Ubuntu's source, as image/systemd does for systemd. diff --git a/docs/log/2026-11-23-a-bzimage-mapped-not-read-into-qemus-heap.md b/docs/log/2026-11-23-a-bzimage-mapped-not-read-into-qemus-heap.md new file mode 100644 index 00000000..5fc2222a --- /dev/null +++ b/docs/log/2026-11-23-a-bzimage-mapped-not-read-into-qemus-heap.md @@ -0,0 +1,10 @@ +--- +date: "2026-11-23" +order: 350 +area: qemu +title: a bzImage mapped, not read into QEMU's heap (#646, labs 45182382388, 45182382864, 45183618987, this change) +issues: [645, 646] +prs: [326] +runs: [45177817516, 45177818419, 45180746171, 45180892535, 45182382388, 45182382864, 45183618987] +--- +`x86_load_linux` read the whole 16.7 MB bzImage into a buffer that only fw_cfg reads, 6.2-6.9 ms of QEMU's init traced (labs 45177818419, 45177817516, #611), and qboot copies the same bytes again by fw_cfg DMA. `qemu/patches/0007` maps the file read-only (`g_mapped_file_new_from_fd`), as upstream has mapped the initrd since 4.2; a kernel with a dtb appended keeps its buffer. The setup header QEMU patches is already a copy of its own, so nothing writes to the mapping. The QEMU build asserts that a held TCG machine's maps name a stub bzImage given to it; the published QEMU fails that check. *Prior art* is in docs/boot-time.md's row: Garzarella's 2019 series mapped the ELF kernel and the initrd but not the bzImage. *Measured* (bench, nested, spin's shape and login, v20261123.05 against the same release with the patched QEMU, parts run 45180746171, 40 a side, interleaved): first login 380 → 367, −13.4 [−16.9, −7.3], sshd accepting −13.3 [−18.7, −7.5], the console prompt −10.6 [−14.2, −6.3]; QEMU's anonymous RSS −15.9 MiB and its file RSS +16.1, total unmoved (lab 45182382388). Restored, 40 a side: login −9.3 [−11.2, −6.1] evicted and −7.7 [−8.9, −5.1] cached, `running` −8.8 and −7.9, the state unmoved (lab 45182382864): a restore starts QEMU, which loads the kernel into fw_cfg there too. The gain is twice the traced read; what else the anonymous buffer cost nested (its page faults, presumably) was not measured. *A lead, not a decision:* an uncompressed payload (#326's kernel patch, renumbered, branch `exp/646-uncompressed`, parts run 45180892535) against LZ4, both on the patched QEMU: first login −4.0 [−7.9, +0.3], within noise at 40, QEMU's RSS +32 MiB (lab 45183618987). The mapping removes the "+6-7 in QEMU's start" half of #326's rejection; whether the rest is a gain needs more boots, which is #645's. *Status:* in place; the record does not move, as the kernel reaches the guest through fw_cfg. diff --git a/docs/log/2026-11-23-a-guest-that-drops-its-page-cache-before.md b/docs/log/2026-11-23-a-guest-that-drops-its-page-cache-before.md new file mode 100644 index 00000000..b0f336ab --- /dev/null +++ b/docs/log/2026-11-23-a-guest-that-drops-its-page-cache-before.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-23" +order: 290 +area: lab +title: a guest that drops its page cache before its save does not make a smaller state (#276, lab 45110967817, branch archived as `archive/drop-caches-276`) +issues: [276] +runs: [45110967817] +--- +#276's last idea: most of a restored state might be the guest's clean page cache, so a guest asked to drop it right before spin's save would leave less for the restore to load. *Measured* with a `restore-first` option on the experiment's branch, a tree each: `drop=0` ran `sync; echo 1 > /proc/sys/vm/drop_caches` as root after the boot had finished and saved at once, `drop=3` waited 3 s first, which leaves free page reporting its 2 s delay (bench, nested, spin's shape and login, v20261123.04, 20 a side). The state read 183 MiB on all three trees: −0.1 [−0.4, +0.3] at once, −0.0 [−0.3, +0.4] after 3 s. `running` did not move, −0.9 [−2.0, +0.9]. The restored login was worse, +4.7 [+3.5, +7.3] evicted at once, +5.6 [+4.6, +7.6] after 3 s, +6.5 and +6.4 cached. *The instrument saw the drop:* the restored login is the side that moved, as a guest whose cache was emptied must read the login's files from its disk again (inferred: the probe does not read the guest's cache). *Why the state does not shrink* (inferred, not measured): a save writes every page that is not zeros, and a freed page keeps its bytes until something gives it back to the host. Free page reporting gives back only free blocks of `page_reporting_order` (2 MiB here), and a page cache freed 4 KiB at a time beside the boot's live pages leaves few whole ones, even after 3 s. Waiting 3 s with no drop had moved nothing either (docs/measuring.md, "When a checkpoint is taken"). *Decided:* rejected, with its row in docs/boot-time.md. Nothing is asked of spin before a checkpoint. #276's three ideas are answered, and the restore stands at 78-80 ms, under the goal. diff --git a/docs/log/2026-11-23-a-guests-synced-writes-on-a-saturated-host.md b/docs/log/2026-11-23-a-guests-synced-writes-on-a-saturated-host.md new file mode 100644 index 00000000..8f622421 --- /dev/null +++ b/docs/log/2026-11-23-a-guests-synced-writes-on-a-saturated-host.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-23" +order: 300 +area: lab +title: a guest's synced writes on a saturated host disk do not stall QMP on the bench (#391, labs 45111443524, 45112573850, probe archived as `archive/qmp-stall-391`) +issues: [391, 402] +runs: [45111443524, 45112573850] +--- +On a laptop with a 97% full disk, query-status reached 175-950 ms beside small synced writes, and #402 did not reproduce that case. A `stall` probe on the experiment's branch booted spin's shape, logged in, started a row's load, and timed 200 query-status round trips 100 ms apart, sampling QEMU's main thread and its monitor's I/O thread (`stat` and `wchan`) every 0.5 ms across each, with both kernel stacks taken past 20 ms. The rows: the guest's 4 KiB `dd oflag=dsync` writes (fio's `--bs=4k --fsync=1`; the image has no fio); four host streams of 1 MiB O_DIRECT writes on the scratch NVMe the overlay is on; both; and the guest's writes beside four buffered host streams flushed each GiB, so that dirty-page throttling and writeback are in play. *Measured* (bench, nested, spin's shape and login, v20261123.04, 3 boots a row, two runs): the slowest round trip of all 2,400 was 1.2 ms, and none passed 20 ms. p50 0.24-0.37 ms with the guest writing alone, 0.41-0.56 with the host disk busy. *The load was real:* the disk read 99-100% busy from its io_ticks in every busy row, and the guest's writes fell from 113,700-118,400 a row to 2,700-3,100 beside O_DIRECT and 1,500-2,100 beside buffered writes. QEMU's disks are `aio=io_uring` on the main loop's ring, so a slow write waits in the kernel and not in the main thread. *Decided:* the case does not stall QMP on the host kind the goal is measured on, so no `iothread=` arm was measured and the probe was removed with its question. The laptop's stalls stand as #402 explained them: the main thread blocked in the host, in cgroup reclaim at `memory.high`, waiting for the mmap lock under reclaim, or with QEMU's cgroup throttled by `cpu.max`. diff --git a/docs/log/2026-11-23-a-probe-saves-once-the-guests-boot-has.md b/docs/log/2026-11-23-a-probe-saves-once-the-guests-boot-has.md new file mode 100644 index 00000000..e96bd740 --- /dev/null +++ b/docs/log/2026-11-23-a-probe-saves-once-the-guests-boot-has.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-23" +order: 30 +area: lab +title: 'a probe saves once the guest''s boot has finished (lab 45095349849, #578, this change)' +prs: [451, 581] +runs: [45095349849] +--- +Every probe that restores took its checkpoint right after the cold login, while the boot's last jobs still ran, and each restore of that state ran them beside the login it timed. *Decided* (the owner, #578): spin checkpoints an empty workspace, a project's workspace or a prebuild long after its boot, never mid-boot, and restore-first measures that. `bootFinished` now waits, over SSH as the probe's user, for `systemctl is-system-running --wait`, then for `multi-user.target` active with no job queued, then for the user manager's own `is-system-running --wait`. The middle step is there because the manager calls its start finished when its queue first empties, which a `Type=idle` unit starting the rest of the boot (#581) finds. docs/measuring.md, "When a checkpoint is taken", is the definition. restore-first, prestart, restore-together, run-delay and transport wait for it. restore-first records it as `finished`. *Measured* as three rows of one tree, so one run compares the probes (bench, nested, spin's shape and login, v20261123.01 with its own spin-machine, 40 each interleaved, lab 45095349849, branch `exp-save-rows`, not for merge): saved finished against saved at the login, restored login 83.8 → 79.0, −4.9 [−7.3, −3.8], `running` +0.3 [−0.6, +1.4], the state +4.5 MiB [+4.3, +4.9], save −13.5 [−15.2, −12.2]. The boot finished 85.6 ms after the login it used to be saved at. A further 3 s settle moved neither the state (−0.0 [−0.4, +0.3]) nor the restored login (+0.4 [−0.6, +1.3]), so the probe waits for nothing after finished. *What moves:* the restore rows step down ~5 ms at this change, from the probe and not the machine, as with #451. The ladder boots every release with the probe of the run, so a ladder stays comparable within itself. Compare a restore measured before this change only within one run. *Status:* in place. diff --git a/docs/log/2026-11-23-a-regressed-release-is-withdrawn-never-deleted.md b/docs/log/2026-11-23-a-regressed-release-is-withdrawn-never-deleted.md new file mode 100644 index 00000000..f08b7d14 --- /dev/null +++ b/docs/log/2026-11-23-a-regressed-release-is-withdrawn-never-deleted.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-23" +order: 90 +area: release +title: a regressed release is withdrawn, never deleted (#595, spin-stack/go-tools#139, spin-stack/ship-it#45, this change) +issues: [595] +prs: [505] +--- +Releases come several times a day, and report.yml measures each one once it is published. Until now nothing stopped a consumer from adopting one that measured slower. *Decided:* a withdrawal marks the release and deletes nothing. The release becomes a GitHub prerelease titled "(withdrawn)", with the reason and the issue at the top of its notes. Its record gets `withdrawn`, the page names it, and the newest release not withdrawn becomes GitHub's latest (`releases withdraw`/`restore`, `withdraw.yml`, run only by a person). Assets, `SOURCES`, signatures, provenance, the record and its charts stay, and compat goes on resuming the release's checkpoints, because a withdrawal says nobody should adopt it, not that it does not resume. The next release is measured against the newest release not withdrawn, and its `against` says which. *The rule* (docs/releasing.md, "Withdrawing a release"): either goal number's Δp50 against the release before it, with its interval wholly above 0, or a failed functional check, unless docs/log.md accepts the cost, as #505 did for v20261122.04's +6.8. At 20 boots a side about 1 in 40 flags of each number is noise, so report.yml's `releases flag` opens an issue with the Δs and the commits between the two releases, and a person decides. A prerelease is what the consumers already skip, read 2026-11-23. go-tools' `github-release` track reads GitHub's `/releases/latest`, which is never a prerelease. ship-it's release list leaves prereleases out. Here, `LatestRelease` and the notes' "what changed since" leave them out too. go-tools#139 is the pin already on a release that was then withdrawn, which `versions check` reads as behind an older release. ship-it#45 is spin's proposal, opened at publish, before the withdrawal. #595 is the `pause` job's functional checks, which open no issue yet. diff --git a/docs/log/2026-11-23-a-state-of-another-length-than-its-checkpoint.md b/docs/log/2026-11-23-a-state-of-another-length-than-its-checkpoint.md new file mode 100644 index 00000000..8efb3535 --- /dev/null +++ b/docs/log/2026-11-23-a-state-of-another-length-than-its-checkpoint.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-23" +order: 260 +area: machine +title: a state of another length than its checkpoint wrote is refused before QEMU reads it (#546, CI run 45111149822, this change) +issues: [546, 586] +runs: [45111149822] +--- +*Why:* a failed load says only that it failed. QEMU 11.2.0-rc0 ends every failure at `process_incoming_migration_co`'s `fail:` label, and `qemu_fill_buffer` reports a file that ends early and a host's failed read both as `-EIO` (read 2026-11-22). So spin kept a truncated state's memory and retried it forever. *Changed:* `Checkpoint` records the state file's length in `Saved.Length`. `Resume` fstats the file it is handed after `CanResume` and returns a `*Refusal` (part `state length`) before QEMU is asked anything. It costs one `fstat`. It does not catch bytes changed in place, which stay a plain error. `boot:record`'s "a truncated state" now wants that refusal and the state never read. *Compatibility:* the field is new and optional. A `Saved` without it, every checkpoint a released spin-machine wrote, resumes without the check, and the machine's record (`Saved.From`) does not move. In CI run 45111149822, `boot:record` refused a real state cut to half its length, `state length: checkpoint 8597660207, here 4298830103 (same)`, with the state never read. `boot:compat` resumed v20261123.04 and refused v20261123.03 first, by `cpu x-legacy-cpuid2-cache` as before (#586), so this change refuses no release main did not. *Status:* in place. diff --git a/docs/log/2026-11-23-a-workspaces-memory-at-boot-beats-the-same.md b/docs/log/2026-11-23-a-workspaces-memory-at-boot-beats-the-same.md new file mode 100644 index 00000000..b4540dee --- /dev/null +++ b/docs/log/2026-11-23-a-workspaces-memory-at-boot-beats-the-same.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-23" +order: 270 +area: lab +title: a workspace's memory at boot beats the same memory plugged during it (#561, labs 45110554589, 45111507862, 45110570912, 45110562994, 45110580480, spin-stack/spin#1660, this change) +issues: [561] +runs: [45110554589, 45110562994, 45110570912, 45110580480, 45111507862] +--- +spin boots 128 MiB and plugs 2048 through virtio-mem right after the start. #561's lead (−15 nested, −8 metal) came from separate runs, so a tree now takes probe options of its own (`--opt` in a tree spec), and the two shapes ran as two trees of one interleaved run: `plug` (the release, `memory=128 plugged=2048`) and `start` (`memory=2048 plugged=0`), v20261123.04, 1 of 16 vCPUs, ceilings kept, spin's login. *Cold first login:* nested −2.5 [−7.3, +2.0] at 40 a side (lab 45110554589), within noise, then −5.5 [−10.9, −0.7] at 80 a side (lab 45111507862); metal −7.0 [−11.4, −3.4] at 40 (lab 45110570912). sshd accepting −8.3 nested and −7.6 metal, accept to login and the second login unmoved. *Restore* (nested, 20 a side, lab 45110562994): the state −17.6 MiB [−17.8, −17.3], `running` −2.4 [−3.5, −0.8], the restored login −2.5 [−3.7, −1.0] evicted and −2.2 cached. QEMU's RSS at the cold login −26 MiB. *Where it goes* (ledger, traceable kernel, 3 boots each, lab 45110580480): plugged, `kworker/0:1` runs ~7.8-8.0 ms of the vCPU in the kernel's window before PID 1, inferred to be the onlining of the plugged blocks; at boot it runs 0.3 ms, the kernel's own setup (`swapper/0`) takes ~4.5 ms more for the larger memory map, and PID 1 comes 3.4 [−5.9, −2.1] ms sooner. The rest of the cold gain is after PID 1 and the ledger does not pin it at 3 boots. *Decided:* a gain on both goal numbers, and the boot shape is spin's: spin-stack/spin#1660 proposes `canonicalMemory` at the workspace's least, 2048 MiB, with virtio-mem kept for growth to 8 GiB (invariant 3). Base RAM is in the machine's record, so checkpoints from before the change boot cold once. The probes keep spin's shape until spin changes it. *Status:* the tree option is in place; #561 closes here and the decision is spin's. diff --git a/docs/log/2026-11-23-config-hz-250-removes-587-exits-and-no.md b/docs/log/2026-11-23-config-hz-250-removes-587-exits-and-no.md new file mode 100644 index 00000000..1527a066 --- /dev/null +++ b/docs/log/2026-11-23-config-hz-250-removes-587-exits-and-no.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-23" +order: 110 +area: kernel +title: '`CONFIG_HZ_250` removes 587 exits and no time from the login (#567, parts run 45110306519, labs 45111418504, 45111452844, this change)' +issues: [567] +runs: [45110306519, 45111418504, 45111452844] +--- +*Why:* #565's profile counted 1043 TSC-deadline writes and 827 preemption-timer exits at HZ=1000, and #567 inferred ~3.5 ms from ~500 of them at ~7 µs a nested exit. Firecracker's x86_64 guest configs and Cloud Hypervisor's `ch_defconfig` build at 250, with no number published for it. *Measured* (bench, nested, spin's shape and login, v20261123.04 against the same release with a kernel built at `HZ_250`, branch `exp/567-hz250`): every exit −587 [−608, −445] at 3 a side, of them MSR writes 1018 → 755, preemption-timer exits 691 → 482, HLT 332 → 298 and external interrupts 396 → 360; the host's KVM handled them in −0.6 [−8.1, +7.3] ms less. The first login −0.6 [−5.9, +3.1], sshd accepting −1.4 [−7.7, +3.2] and the console prompt +4.7 [+0.4, +7.8] at 60 a side. *Why the inference missed:* a tick's MSR write and its preemption-timer exit take 1.0-1.5 µs each in the L1, against ~10 µs for an MMIO exit and ~18 for a port exit in the same profile, so ~7 µs an exit is the price of an exit handed to QEMU, not of every exit. *Status:* rejected; `HZ_1000` stays. Archived as tag `archive/exp-567-hz250`. diff --git a/docs/log/2026-11-23-containerds-config-is-containerd-ios-own.md b/docs/log/2026-11-23-containerds-config-is-containerd-ios-own.md new file mode 100644 index 00000000..d57ddd90 --- /dev/null +++ b/docs/log/2026-11-23-containerds-config-is-containerd-ios-own.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-23" +order: 130 +area: image +title: containerd's config is containerd.io's own (#510, labs 45111391250, 45111705358, 45112037022, this change) +issues: [510] +runs: [45111391250, 45111705358, 45112037022] +--- +The image replaced containerd.io's `/etc/containerd/config.toml`, which disables CRI, with one that enabled it, a v3 schema with the v2 plugin name, with no consumer named since `2afac47`. dockerd does not use CRI. *Decided* by the owner (#510, option b): containerd.io's file. *Measured* with an overlay edit that wrote the package's setting over the image's (bench, nested, spin's shape and login, against v20261123.04, 20 a side): first login −4.9 [−12.2, +1.6], sshd accepting −5.0 [−12.1, +1.2], both within noise (lab 45111391250). Restored login: evicted −0.6 [−2.1, +1.5], cached −0.5 [−2.1, +0.9], both within noise (lab 45112037022). Neither number can see the file, because containerd starts at a workspace's first docker command (inferred). `boot:workspace` passed on that tree, with docker running a container (lab 45111705358). *Changed:* the image's file is deleted. A workspace that wants CRI, for crictl or a kubelet, writes its own config. *Status:* in place; the experiment branch is archived as `archive/510-containerd`. diff --git a/docs/log/2026-11-23-density-on-metal-and-a-cpu-bound-crowd.md b/docs/log/2026-11-23-density-on-metal-and-a-cpu-bound-crowd.md new file mode 100644 index 00000000..5b0d0e35 --- /dev/null +++ b/docs/log/2026-11-23-density-on-metal-and-a-cpu-bound-crowd.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-23" +order: 310 +area: lab +title: density on metal, and a CPU-bound crowd on the bench (#563 section 2, labs 45110655407, 45110663095, 45110670764, 45110678888, 45110688511, this change) +issues: [563] +runs: [45110655407, 45110663095, 45110670764, 45110678888, 45110688511] +--- +#273 measured an idle crowd on the bench up to 16. #563 asks what a metal host carries, for spin's metal-or-nested cost model, and needs no new code: `density` as it stands, spin's shape and login, v20261123.04. *Bench, nested, 16 CPUs, `load=cpu`, 10 a row:* the first login read 387/417 empty, 378/431 beside 4 busy workspaces, 441/450 beside 8, 1015/1215 beside 16, 941/1196 beside 24. *Metal, c8i.metal-48xl, 192 CPUs:* `load=cpu`, 337/447 empty, 331/488 at 16, 335/344 at 32, 336/341 at 48 (10 a row), and in a second run 342/363 empty, 327/366 at 64, 466/486 at 96 (8 a row; a crowd of 96 took 83 s to boot, past what 10 rows fit in bench-metal's 60 minutes). `load=idle`: 345/368, 336/343, 329/341, 334/352 at 0-48, and 342/356, 328/350, 331/340 at 0, 64 and 96. *Read* by #563's line, a p95 within 25% of the empty host's in the same run: nested, up to 8 busy workspaces of 16 CPUs; metal, up to 64 busy of 192, not 96, and every idle crowd measured. The rows of one host are two runs, so a row compares only with the empty row of its own run. The empty metal row's 447 p95 in the first run is one slow boot of ten. *Not measured:* busy crowds between 64 and 96, and workspaces of more than one vCPU. *Status:* rows in docs/boot-time.md ("The bench fleet is nested, not metal"). Section 1 of #563 (the I/O tax) needs new probes and equal storage on both hosts, and stays open in #563. diff --git a/docs/log/2026-11-23-docker-socket-is-dockers-own-0660-and-group.md b/docs/log/2026-11-23-docker-socket-is-dockers-own-0660-and-group.md new file mode 100644 index 00000000..5c362848 --- /dev/null +++ b/docs/log/2026-11-23-docker-socket-is-dockers-own-0660-and-group.md @@ -0,0 +1,10 @@ +--- +date: "2026-11-23" +order: 140 +area: image +title: docker.socket is Docker's own, 0660 and group docker (#509, labs 45111147182, 45111147449, 45111146715, 45111146865, 45111146854, 45111146735, 45111708456, this change) +issues: [509] +prs: [581] +runs: [45111146715, 45111146735, 45111146854, 45111146865, 45111147182, 45111147449, 45111708456] +--- +*Why:* the image carried its own `docker.socket` since the first commit (`2afac47`), with no recorded reason, at `SocketMode=0666`, `SocketGroup=root`. Any local uid reached dockerd, which is root on the guest: a service's DynamicUser, `nobody`, a sandboxed command running as another uid. Docker's own unit is 0660, group docker, and `spin` is in docker. *Changed:* the image's unit and `optimize-systemd.sh`'s link to it are deleted, so the link docker-ce's postinst made to its own unit stands. `boot:workspace` asserts the socket is `660 root:docker`, that `spin` runs a container through the group, and that uid 65534 with no groups is refused. On v20261123.04 as released the two new checks fail (`666 root:root`, the refusal not refused; lab 45111708456) and with the change they pass (lab 45111146854). *Measured* (bench, nested, spin's shape and login, against v20261123.04, the change as an overlay edit, 20 a side): first login +1.7 [−5.3, +10.0], sshd accepting +1.5 (lab 45111147182); restored login +0.4 [−0.6, +1.3] evicted, +0.3 [−0.3, +0.8] cached (lab 45111147449). Both within noise, so it goes in on function. *Second arm, rejected:* the image's `containerd.socket` out of the boot transaction, against Docker's socket alone: first login +7.4 [−4.7, +15.3] (lab 45111146715), prestart within noise in every row (lab 45111146865). Both sockets start in `sockets.target`, after the first login since #581, so there was nothing on the clock to take. `boot:workspace` passed on that arm too (lab 45111146735). Prior art: upstream containerd binds its own socket and its unit has none; SUSE carried a `containerd.socket` from a 2016 socket-activation patchset never merged upstream. In "Measured and rejected". The experiment edits lived on `exp-509`, tagged `archive/exp-509`. *Status:* in place. diff --git a/docs/log/2026-11-23-dockers-packages-pinned.md b/docs/log/2026-11-23-dockers-packages-pinned.md new file mode 100644 index 00000000..05aa06bb --- /dev/null +++ b/docs/log/2026-11-23-dockers-packages-pinned.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-23" +order: 120 +area: image +title: 'Docker''s packages pinned (#511, #609, Parts run 45111218531)' +issues: [511] +runs: [45111218531] +--- +`install-dev-tools.sh` installed Docker's packages at whatever Docker's repository served that day and fetched its signing key with no hash. *Changed:* each `.deb` in Docker's resolute pool is a `download` in `versions.yaml`, by version and SHA-256, handed in as build arguments with no default and checked before apt installs it. There are six, not the five #511 named, because `docker-ce-rootless-extras` came in unpinned as docker-ce's recommend. The pins are v20261123.04's versions, and each SHA-256 is the one in Docker's `Packages` index, whose `InRelease` verifies against Docker's key. The build no longer reads Docker's repository. The key and the apt source a workspace's `apt upgrade` uses are files in `rootfs/`, the key unchanged from what Docker serves (fingerprint `9DC858229FC7DD38854AE2D88D81803C0EBFCD88`, no expiry). It is not a `versions.yaml` entry, because a `download` needs a version in its URL and the key's has none. *Proved:* one changed character in docker-compose-plugin's pin stops the image build at `sha256sum: WARNING: 1 computed checksum did NOT match` (Parts run 45111218531, branch archived as `archive/511-wrong-pin`). *Status:* in place. diff --git a/docs/log/2026-11-23-each-mmio-exit-put-on-the-guest-code.md b/docs/log/2026-11-23-each-mmio-exit-put-on-the-guest-code.md new file mode 100644 index 00000000..84dfe3c8 --- /dev/null +++ b/docs/log/2026-11-23-each-mmio-exit-put-on-the-guest-code.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-23" +order: 50 +area: lab +title: 'each MMIO exit put on the guest code that made it (labs 45098316459, 45098579511, 45098880914, 45098879979, #566, this change)' +issues: [590, 591, 592] +runs: [45098316459, 45098579511, 45098879979, 45098880914] +--- +`exits` now keys the MMIO and port exits by `guest_rip` and names each one's function through the guest's own kallsyms. A tree booting the traceable kernel with `ftrace=` keeps the guest's trace, so the accessors' callers come with stacks. The trace does not move the counts: 3,104-3,129 EPT_MISCONFIG exits with it and without it. *Found* (bench, nested, spin's shape, v20261123.01): IOAPIC 625, ~576 of them in `apic_intr_mode_init`, where the 24-pin table is read four times and written twice (#590). ECAM 1,078 exits: enumeration 469 accesses, virtio-pci's capability walk 258, `pci_save_state` at add 128, ACPI AML 65, MSI-X enable 64 (#591). virtio's BARs: ~527 emulated at device setup and ~205 MSI-X table writes. About 650 ioeventfd notifications, ~500-650 of them the root disk's requests and ~95 vsock resets to the probe's dials (#592). Port I/O: `rtc_cmos_read` 106, ACPI's ports 137, serial 83, firmware and decompressor 277. *Measured and rejected:* a 1 MiB readahead on the root disk (`opt_io_size=524288`) left the notifications as they were (895 → 927) and the first login at +1.4 [−2.7, +8.0], 40 a side. *Status:* the probe's change is in place. Every lever left is a kernel patch of ~1-3 ms, each in its issue. diff --git a/docs/log/2026-11-23-leaf-2-describes-the-caches-leaf-4-does.md b/docs/log/2026-11-23-leaf-2-describes-the-caches-leaf-4-does.md new file mode 100644 index 00000000..72290e31 --- /dev/null +++ b/docs/log/2026-11-23-leaf-2-describes-the-caches-leaf-4-does.md @@ -0,0 +1,10 @@ +--- +date: "2026-11-23" +order: 80 +area: machine, qemu +title: 'leaf 2 describes the caches leaf 4 does (#586, labs 45100482399, 45101932202, 45101932224, 45101932173, 45101932449, 45101932412, 45101932286, #594, this change)' +issues: [569, 586] +prs: [570, 594] +runs: [45100482399, 45101932173, 45101932202, 45101932224, 45101932286, 45101932412, 45101932449, 45104443218] +--- +*Why:* #565 claimed that with `x-consistent-cache=off` leaves 2 and 4 describe the same caches. *Seen in a guest* (bench, nested, spin's shape, v20261123.02, lab 45100482399): leaf 2 EDX 0x2c307d, ECX 0x4d, so glibc read a 2 MiB 8-way L2 (descriptor 0x7D) while leaf 4 and the guest's kernel said 4 MiB 16-way. L1 and L3 agreed, and so did every threshold glibc derives (`shared_cache_size` 16 MiB, `non_temporal_threshold` 8 MiB, the same before #570), because QEMU's legacy L3 is inclusive and glibc adds the L2 to the shared size only for a non-inclusive one. What moved is `sysconf(_SC_LEVEL2_CACHE_*)`. The host's caches (Xeon 6975P-C, read on the runner) are L2 2 MiB 16-way, L3 480 MiB: neither leaf is the host's, and neither was before #570. *Options read and run:* `legacy-cache=off` is refused under `host` (`CPU model 'host' doesn't support legacy-cache=off`), since only a named model has a cache model of its own. `host-cache-info=on` passes the host's leaf 2 through, 0x00feff01, whose 0xFF sends glibc round leaf 4 again: CPUID exits 2371 → 4087, every exit +1693 [+1657, +1825] (lab 45101932224). No option keeps the descriptors and makes them agree. *Changed:* `qemu/patches/0006` (#594) adds `x-legacy-cpuid2-cache`, default on as QEMU is; off, leaf 2 encodes `env->cache_info` (0x2C, 0x30, 0x49, 0x4D). `-cpu` sets it off and `cpuidProperties` holds it, in the same record change as #569. *Measured* (bench, nested, spin's shape, against v20261123.03, whose leaves disagree, with ctl = #569's spin-machine on the patched QEMU): leaf 2 EDX 0x2c3049, ECX 0x4d, and glibc's L2 4194304/16, the kernel's 4194304/16, its thresholds unchanged (labs 45101932202, 45101932412). CPUID exits 2371 → 2406-2449, leaf 2 and leaf 4 still 12 and 4 a process: two more processes in the fix's boots, not a dearer one (inferred); every exit +13 [−143, +96] (3 a side). First login +0.6 [−6.1, +5.5] against the release, +0.4 [−7.5, +5.8] for ctl, 40 a side (lab 45101932173). Restored login evicted −2.1 [−6.1, +5.2], cached −1.7 [−4.3, +1.7], 30 a side (lab 45101932449). *Compatibility:* no release's QEMU has the switch, so the record refuses every release's checkpoints by it; #569 already refused every checkpoint a released spin-machine wrote, so spin's checkpoints boot cold once. `boot:compat` refuses v20261123.03, the newest release, first: `cpu x-legacy-cpuid2-cache: checkpoint none, here false (same)` (CI run 45104443218). *Status:* in place. diff --git a/docs/log/2026-11-23-login-spin-hands-over-spins-host-key.md b/docs/log/2026-11-23-login-spin-hands-over-spins-host-key.md new file mode 100644 index 00000000..7b5efbb4 --- /dev/null +++ b/docs/log/2026-11-23-login-spin-hands-over-spins-host-key.md @@ -0,0 +1,10 @@ +--- +date: "2026-11-23" +order: 10 +area: lab +title: '`login=spin` hands over spin''s host key (labs 45088516505, 45088516571, 45088516492, #575, this change)' +issues: [515] +prs: [573] +runs: [45088516492, 45088516505, 45088516571] +--- +Since #573 the image's host-key generation steps aside when spin's handoff has placed spin's key, and spin's vminitd always does. `login=spin` did not, so every probe on spin's path paid the keygen spin's own path skips, ~7 ms (#515's −6.9). *Decided* (the maintainer, #575's first option): the handoff is part of `login=spin`. Its overlay carries the drop-in naming `/run/spin/ssh/ssh_host_ed25519_key` sshd's only `HostKey` and a fresh key per boot, made on the host, and every boot on spin's path runs a shell as PID 1 that places the key and execs systemd (`Key.Init`). The `spin-handoff` edit is gone, and a tree's own `--append init=` still comes after the handoff's. *The stand-in's cost:* the shell runs three execs (two mounts and a `mkdir`) and writes the key with builtins. The ledger gives it a window of its own, `handoff`: 6.3, 7.3 and 7.9 ms from its exec to systemd's in three boots (lab 45088516505, bench, spin's shape, v20261123.01 on its traceable kernel). Of the 7.3, 3.3 ms was idle on cold reads of the shell, `mount` and their libraries, 2.7 the mounts and the `mkdir`, and 1.1 the shell. systemd mounts `/proc` and `/run` itself when no one has, so part of that is work moved, not added. vminitd does more before systemd on spin's path, and the lab measures none of it. *What moves:* a release that skips the keygen now reads it on spin's path. v20261123.01 does not carry #573 yet, so the first release that does will read ~7 ms against the one before it, from the image, not from the probe. Every probe ran with the handoff: ssh-first on v20261122.07 and v20261123.01, 20 a side, first login 430 and 416 (lab 45088516571), restore-first on v20261123.01, restored 82.3 evicted (lab 45088516492). *Status:* in place. diff --git a/docs/log/2026-11-23-login-spin-s-forwarder-is-spin-supervisor-service.md b/docs/log/2026-11-23-login-spin-s-forwarder-is-spin-supervisor-service.md new file mode 100644 index 00000000..a672753f --- /dev/null +++ b/docs/log/2026-11-23-login-spin-s-forwarder-is-spin-supervisor-service.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-23" +order: 70 +area: lab +title: '`login=spin`''s forwarder is `spin-supervisor.service` (release run 45100012702, labs 45103075446, 45103442674, 45103464996, #598, this change)' +prs: [581, 598] +runs: [45098372930, 45100012702, 45103075446, 45103442674, 45103464996] +--- +The release run's ladder read v20261123.03, the first release with the login's target (#581), about +50 ms worse cold than v20261123.02: first login ~446 against ~396, sshd accepting ~402 against ~340, the restore unmoved (release run 45100012702, its record in #598). The lab had measured #581 at −21.5 [−26.4, −15.5] (lab 45098372930). *Found:* the edit that measured #581 linked the probe's forwarder into the new target, "as spin's would", and was removed with #581's merge. The target wants spin's supervisor by its name, `spin-supervisor.service`, which spin's vminitd links into `/run/systemd/system` before systemd starts (spin-stack/spin's `internal/guest/vminit/handoff`). `login=spin`'s stand-in was `spin-lab-forward.service`, wanted by `multi-user.target` alone, so on .03 it started only once `spin-machine-boot-rest.service` queued the rest of the boot. Bootchart of .03 on main's probe (lab 45103075446, bench, spin's shape, 1 boot): the forwarder active at 221 ms of PID 1's clock, `ssh.service` at 78, nothing on its chain between them. The ladder measured the stand-in's wiring, not the machine. *Changed:* the stand-in is installed as `spin-supervisor.service`, with spin's unit's default dependencies and `WantedBy=multi-user.target`, and `TestTheImageStartsLoginSpinsSupervisorWithTheLogin` fails when the image's login target does not want the unit `login=spin` installs. With it, the forwarder was active at 160 ms, behind `sysinit.target` as spin's unit is (lab 45103464996, 1 boot). *Measured again* through `releases measure v20261123.03` on this change (report run 45103442674, bench, nested, spin's shape and login, 20 a side): first login −17.8 [−27.9, −8.1], sshd accepting −9.5, accept to login −10.0, second login −0.7 within noise, restored login +0.4 [−1.4, +2.6] within noise; the console prompt +20.4, the serial getty following the login as #581 says. *The record:* #598 carries the stand-in's reading. `releases propose` does not propose a release twice, so once this is on main #598 is closed, its branch deleted, and report.yml dispatched on main with `versions=v20261123.03 record=true`. *Status:* in place. diff --git a/docs/log/2026-11-23-qemu-0007-deleted-no-release-from-v20261123-07.md b/docs/log/2026-11-23-qemu-0007-deleted-no-release-from-v20261123-07.md new file mode 100644 index 00000000..999c7a92 --- /dev/null +++ b/docs/log/2026-11-23-qemu-0007-deleted-no-release-from-v20261123-07.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-23" +order: 420 +area: qemu +title: 'QEMU 0007 deleted: no release from v20261123.07 boots a bzImage (#660, parts run 45256311661, labs 45258887660, 45258106255, this change)' +issues: [645, 646, 660] +runs: [45256311661, 45258106255, 45258887660] +--- +0007 mapped a bzImage given to `-kernel` instead of reading it into QEMU's heap (#646, the 11-23 entry above). Since #645 the machine enters a release's vmlinux through PVH (`machine.OpenRelease` picks it by its two Xen notes), and QEMU's ELF loader maps that file without 0007. A release from .06 or before boots its bzImage with the QEMU it shipped, which carries 0007; only a lab tree of a new QEMU with an old release's kernel pays the read again. *Measured* (bench, nested, spin's shape and login, v20261123.07 against the same release with QEMU built without 0007, 40 a side, interleaved): first login +3.6 [−3.3, +7.8], sshd accepting −1.6 [−6.7, +5.6], QEMU's RSS +0.3 [−1.6, +2.1] MiB, its file RSS +0.2 [+0.2, +0.3], a different binary's pages (inferred) (lab 45258887660); restored login −0.4 [−1.5, +0.9] evicted, −0.1 [−0.9, +0.9] cached, the state unmoved (lab 45258106255). Neither number moves, as #660 expected: 0007 touched nothing on the PVH path. The QEMU build's check of the mapping goes with it. *Status:* deleted. The bzImage and `CONFIG_KERNEL_LZ4` stay until spin's `hack/machine/place.go` stops requiring `kernel/bzImage` (spin-stack/spin#1689). diff --git a/docs/log/2026-11-23-qemus-start-and-the-held-starts-qmp-split.md b/docs/log/2026-11-23-qemus-start-and-the-held-starts-qmp-split.md new file mode 100644 index 00000000..e6b7a374 --- /dev/null +++ b/docs/log/2026-11-23-qemus-start-and-the-held-starts-qmp-split.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-23" +order: 370 +area: machine, qemu +title: 'QEMU''s start and the held start''s QMP, split and rejected (#647, #649, labs 45177818419, 45230790902, 45231358105, #669, this change)' +issues: [647, 649, 669] +runs: [45177818419, 45230790902, 45231358105] +--- +#611's split left two cold phases without an owner. *#649, the held start's 14 commands, 6.1 ms on bench:* QEMU waited 4.5 ms p50 for the client, 0.9 of it busy with the probe's plug monitor (the memory spin sizes right after the start), so spin-machine's own share is ~3.6 ms, ~0.28 ms a round trip (24 boots, lab 45177818419). The candidate sent the bind ahead of its answers (`qmp.Send`): the run state with the places, every serial at once, each image's two nodes together, the reopen with the placeholder's delete, 13 round trips to 9; add-fd still holds the connection until its answer and `cont` waits for the bind. *Measured* (bench, nested, spin's shape and login, v20261123.06's parts, spin-machine main at f273377 against the candidate at c966407, 60 a side): first login −1.7 [−5.6, +2.6], sshd accepting −2.4 [−5.5, +2.8] (lab 45230790902); restored login −0.3 [−3.8, +3.7] evicted, +0.9 [−10.6, +7.5] cached (lab 45231358105). Rejected: the four round trips it removes are ~1.1 ms (inferred), and even all of spin-machine's 3.6 ms is under what 60 boots a side resolve. The code is on `archive/exp-649-held-start`. *#647, QEMU's exec to its first trace event, 9.7 ms on bench:* the release's QEMU is static-pie on musl, so there is no dynamic loader and `LD_DEBUG` has nothing to report; musl relocates its 59,700 relative relocations itself. The split, on the laptop as a lead (exec to the first `flatview_new`, 40 starts a row, 4.7-5.4 ms p50): a trivial static-pie binary 0.23, QEMU's `-version` 2.0, `-sandbox` −0.7 to −0.9, the rest option parsing, trace and main-loop start and the machine object. perf on an unstripped build of the same Dockerfile: relocation 7% of `-version`, page faults ~15%, nothing else over 2%. No candidate's ceiling is over ~2 ms on bench (inferred at ~2× the laptop): a seccomp filter compiled at build time (Firecracker's seccompiler), a non-PIE binary (which gives up ASLR), DT_RELR. None was built. The allocator, musl's mallocng, is ~2.3 of the 17 ms of CPU QEMU's main thread spends from exec to held, a lead across QEMU's whole start, opened as #669. *Status:* rejected, both. diff --git a/docs/log/2026-11-23-systemds-first-patch-drop-in-candidate-names-derived.md b/docs/log/2026-11-23-systemds-first-patch-drop-in-candidate-names-derived.md new file mode 100644 index 00000000..635bef40 --- /dev/null +++ b/docs/log/2026-11-23-systemds-first-patch-drop-in-candidate-names-derived.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-23" +order: 20 +area: image +title: 'systemd''s first patch: drop-in candidate names derived once (labs 45090299768, 45090326943, 45091690423, #574, this change)' +issues: [580] +runs: [45090299768, 45090326943, 45091690423] +--- +#574's second experiment. PID 1 spends most of its loading in `unit_file_find_dirs()`, once for every unit name or alias, lookup directory (~12) and drop-in suffix (4), and each call worked out the unit's candidate names again: the name, its template, its "-" prefixes. Upstream's #42858 (Eric Curtin, merged 2026-07-25, in v262) works them out once per name, `manager_enumerate()` 45.35 → 38.81 ms in its author's container (50 runs, ~270 units). Yocto backported it to 259.5, with an unrelated `CONF_FILES_WARN` change beside it, so the backport here is upstream's commit with one removed line's context moved to 259's `set_get()`. *Measured* (bench, spin's shape and login, v20261123.01, each arm systemd rebuilt on the runner, against a control rebuilt with a comment and no code changed, so both install their packages the same way): first login −6.5 [−9.9, −1.3] at 100 a side, sshd accepting −6.1 [−10.0, −1.1] (lab 45090299768). PID 1's CPU from its exec to the login's sshd-session, 55.1-57.8 ms on the control and 48.1-53.4 with the patch, 5 ledgers each (lab 45090326943). Restored, 20 a side: −0.9 [−4.3, +3.0] evicted, −1.4 [−5.0, +2.1] cached, within noise (lab 45091690423). *Changed:* image/systemd carries its first patch, applied without fuzz after Ubuntu's, as image/openssh does; the Dockerfile fails when it does not apply or its function is not in the source; the release ships it under `usr/share/spin-stack/systemd/` and names it in SOURCES, NOTICE and the SBOM's pedigree. A bump to 262 drops it. *In the same run:* #574's third experiment, no unit made for a `RequiresMountsFor=` prefix with no unit file, read −1.0 [−4.3, +3.9], and PID 1's CPU did not move: rejected, in "Measured and rejected", with the patch and an upstream draft kept in #580. *Status:* in place. diff --git a/docs/log/2026-11-23-the-boot-charts-io-graphs-draw-each-5.md b/docs/log/2026-11-23-the-boot-charts-io-graphs-draw-each-5.md new file mode 100644 index 00000000..4d13d705 --- /dev/null +++ b/docs/log/2026-11-23-the-boot-charts-io-graphs-draw-each-5.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-23" +order: 160 +area: lab +title: 'the boot chart''s IO graphs draw each 5 ms on one scale (spin-stack/systemd-bootchart#11, labs 45110751133, 45113479570, #538, this change)' +runs: [45110751133, 45113479570] +--- +The fork averaged 250 ms around each IO bar and scaled each graph to its own peak. A 5 ms read burst came out as a plateau over the whole chart, and the boot's one 164 KB write filled the write graph for 150 ms. The three boots of lab 45110751133 were replayed through `--proc` and drawn both ways. Unsmoothed on one scale, the ~8 MB burst at the chart's start, the later read bursts and the write each appear where they happened and at their sizes against one another. The other drawing shows none of that, so the fork now draws this one. Lab 45113479570 is the pinned fork's chart of v20261123.04, three boots. *Status:* in place. diff --git a/docs/log/2026-11-23-the-boots-device-setup-exits-as-one-change.md b/docs/log/2026-11-23-the-boots-device-setup-exits-as-one-change.md new file mode 100644 index 00000000..41f08d6d --- /dev/null +++ b/docs/log/2026-11-23-the-boots-device-setup-exits-as-one-change.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-23" +order: 440 +area: kernel +title: 'the boot''s device-setup exits as one change: kernel 0021-0025 (#627, parts run 45256426877, labs 45260781177, 45261629539, this change)' +issues: [590, 627, 645] +runs: [45114405201, 45231943664, 45256426877, 45260781177, 45261629539] +--- +*Why:* five patches each removed the VM exits their changelogs counted (#590, #591, #592), and none moved the first login alone; as a bound the five read −7.4 [−12.1, −2.8] at 60 a side (lab 45114405201). #627 asked whether "the boot's MMIO exits in device setup" is one change and, if so, for one arm at 120 a side, the set chosen before the run. *Changed:* the bound's five, from `archive/exp-batch2-bound`, as 0021-0025 after #645's 0014-0020; they apply to 7.3.6 with no fuzz. The build asserts each on its vmlinux (kernel/README.md); checkpatch `--strict` and sparse pass. 0022 keeps the risk #627 named: upstream a2f1e22390ac took out `pci_restore_state()`'s refusal of a state never saved, so its gate (AER, EEH, s390, Xen pcifront, `reset_root_port`) has to grow by hand with whatever calls error handlers next; it stayed in the set because the set was fixed before the run. *Measured* (bench, nested, spin's shape and login, against v20261123.07, interleaved): first login −9.4 [−14.2, −5.7], sshd accepting −9.5 [−14.4, −5.5], console prompt −10.4 [−14.2, −7.8], second login +0.3 [−0.1, +0.6], QEMU RSS −1.7 MiB [−1.8, −0.1], 120 a side (lab 45260781177). `restore-first`, 60 a side (lab 45261629539): restored login −0.4 [−2.0, +1.7] evicted and +0.2 [−6.6, +7.3] cached, the state +0.0 MiB [−0.1, +0.2], all within noise; its cold row −11.8 [−18.5, −3.2] evicted. The same set against v20261123.06 had read −9.2 [−12.2, −6.0] (lab 45231943664), before 7.3.6 and #645. *Status:* in place; reaches the goal number with the next release. diff --git a/docs/log/2026-11-23-the-dynamic-linkers-share-of-pid-1-journald.md b/docs/log/2026-11-23-the-dynamic-linkers-share-of-pid-1-journald.md new file mode 100644 index 00000000..127faf5e --- /dev/null +++ b/docs/log/2026-11-23-the-dynamic-linkers-share-of-pid-1-journald.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-23" +order: 340 +area: image +title: 'the dynamic linker''s share of PID 1, journald, logind and `user@0` is ~1 ms (labs 45180400607, 45180856158, #638, this change)' +issues: [638] +runs: [45180400607, 45180856158] +--- +#574's runner-up: the four map and relocate `libsystemd-shared` (PID 1 and `user@0` also `libsystemd-core`), and nobody had measured ld.so's share before porting to v262's multicall build (#42304) or a static one (#42820). *Instrument* (branch `exp-ldso`, tagged `archive/exp-ldso`, its `ldso` edit): `LD_DEBUG=statistics` for PID 1 from spin's handoff, which execs it (`systemd.setenv=` does not reach PID 1), and for journald, logind and `user@0` from a drop-in each. PID 1 and journald report on `/dev/kmsg` with `printk.devkmsg=on`, logind and `user@0` on their stderr, the journal: the first run had logind's on `/dev/kmsg` too, its `DevicePolicy=` refused the executor the open, and logind failed at STDERR (lab 45180400607, discarded). glibc 2.43 counts in TSC cycles, 2700 MHz in every boot. *Measured* (bench, nested, spin's shape and login, v20261123.05 on its traceable kernel, the ledger with and without the edit, 8 a side, lab 45180856158), ld.so's total start-up, p50 [range]: PID 1 0.48 [0.46, 0.56] ms, of it loading objects 0.32 and relocation 0.08; journald 0.20 [0.14, 0.31]; logind 0.20 [0.11, 0.31]; `user@0` 0.21 [0.15, 0.36]. Relocations: PID 1 and `user@0` 2,522 symbol (911 from cache) and 16,589 relative; journald 1,157 and 10,518; logind 1,238 and 11,297. Objects at start, from the release's image (`ldd`): 7 for PID 1 and `user@0` (the binary, libsystemd-core, libsystemd-shared, libc, libm, libcrypt, ld.so), 6 for journald and logind, all `BIND_NOW`. The four come to ~1.1 ms, under #638's ~5 ms, so no build was made. *The instrument:* against the ledger alone in the same run, first login +3.4 [−23.0, +11.9], PID 1's CPU −1.1 [−5.1, +0.6], unattributed +0.3 [−0.1, +1.1]; each ld.so total is well inside the trace's wall time from the process's exec to its first sleep. It does not see the kernel's execve before ld.so runs, nor the libraries' pages faulted in later by `main`, which a static build would partly pay too (not measured). `user@0`'s environment generator inherits the variable and reports 0.13 ms more. *Inferred:* the multicall build would not reach even that: it keeps libsystemd-core and libsystemd-shared dynamic, leaves journald and logind alone and makes the executor, static here, dynamic. *Status:* measured and rejected; #638 closed. diff --git a/docs/log/2026-11-23-the-executors-sandbox-a-bound-14-ms.md b/docs/log/2026-11-23-the-executors-sandbox-a-bound-14-ms.md new file mode 100644 index 00000000..ee347256 --- /dev/null +++ b/docs/log/2026-11-23-the-executors-sandbox-a-bound-14-ms.md @@ -0,0 +1,10 @@ +--- +date: "2026-11-23" +order: 320 +area: systemd +title: 'the executors'' sandbox, a bound: −14 ms (#574 experiment 4, labs 45120692382, 45121038332, #637, #638, this change)' +issues: [574, 637, 638] +prs: [581] +runs: [45120692382, 45121038332] +--- +Read first, a release ledger (v20261123.04, spin's shape and login, 5 boots): before the first login the executors spend journald 6.0 ms, logind 10.3 and `user@0` 2.8, p50, beside the units' own binaries. *The bound:* one drop-in each for journald, logind and `user@` emptying `SystemCallFilter=`, `SystemCallArchitectures=`, `SystemCallErrorNumber=`, `RestrictAddressFamilies=`, `RestrictNamespaces=`, `RestrictRealtime=`, `RestrictSUIDSGID=`, `MemoryDenyWriteExecute=`, `LockPersonality=` and every `Protect*=`; `PrivateTmp=`, `IPAddressDeny=` and `DeviceAllow=` kept. udevd was left out: it starts after the first login since #581. *Measured* (bench, nested, 60 a side, branch `exp-batch3`): first login 374 → 360, −14.1 [−18.5, −11.5]; sshd accepting −13.2 [−16.0, −10.9]; accept to login −2.1 [−3.1, −0.1]. *Status:* a bound, not carried. #637 splits it into the seccomp and namespace halves and proposes one seccomp filter per unit in systemd. #574 closed with its five experiments: #579 in (−6.5), #580 rejected, #581 in (−21.5), #460 in (the kernel's), this bound to #637. The runner-up, the dynamic linker's share, is #638. diff --git a/docs/log/2026-11-23-the-executors-sandbox-costs-its-system-call-allow.md b/docs/log/2026-11-23-the-executors-sandbox-costs-its-system-call-allow.md new file mode 100644 index 00000000..bd5cc8ac --- /dev/null +++ b/docs/log/2026-11-23-the-executors-sandbox-costs-its-system-call-allow.md @@ -0,0 +1,10 @@ +--- +date: "2026-11-23" +order: 360 +area: systemd +title: 'the executors'' sandbox costs its system call allow-list, not its number of filters (labs 45228294512, 45229454155, 45231419187, 45235103665, 45235485857, 45238003981, 45239372741, #637, #673, #686, this change)' +issues: [513, 574, 686] +prs: [673] +runs: [45228294512, 45229454155, 45231419187, 45235103665, 45235485857, 45238003981, 45239372741] +--- +#637 split #574's bound and asked for one seccomp filter per unit. *The split* (bench, nested, spin's shape and login, v20261123.06, 60 a side, branch `exp/637-split`, tag `archive/exp-637`): the seccomp settings emptied in journald, logind and `user@` read first login −12.0 [−21.8, −2.1], sshd accepting −13.8 [−19.4, −4.9]; the namespace ones (`ProtectSystem=`, `ProtectHome=`, `ProtectControlGroups=`, `ProtectKernelTunables=`, `ProtectProc=`) +0.3 [−9.4, +7.2] (lab 45228294512). *Fewer filters:* the executor applies `SystemCallArchitectures=` after seven other settings, so each of those loads a filter for i386 and x32 too, which the architecture filter then kills; the kernel has neither ABI. Applied first, journald carries 8 filters, not 17, and logind 13, not 26. `boot:seccomp` (on the tag) runs a probe as each unit's `ExecStartPost=`, with the unit's sandbox, over 3435 calls: every native number with zero arguments and no capabilities, each x32 number, and the calls the settings decide by argument; the table was the release's (labs 45235103665, 45235485857). First login −0.4 [−6.1, +2.7] against systemd rebuilt with a comment only (lab 45231419187). *Where it goes:* an instrument patch timing the executor's steps (thread CPU, one boot, 2 vCPUs): journald's executor 6.7-7.2 ms, `SystemCallFilter=@system-service` 3.7-4.0 of it, its `seccomp_load()` 1.1-1.2; the other seccomp settings ~0.6 together (labs 45238003981, 45239372741). So one filter per unit would reach about the 0.6 ms (inferred). *Found on the way:* the lab's packages edit gave `/usr` the package's mtime, newer than the image's update stamps (#513), so every `--systemd` tree ran ldconfig, sysusers, the hwdb and the catalog before the login: both arms ~658 ms (lab 45229454155); fixed in #673. *Status:* rejected, #637 closed; building the allow-list once is #686. diff --git a/docs/log/2026-11-23-the-first-logins-target.md b/docs/log/2026-11-23-the-first-logins-target.md new file mode 100644 index 00000000..9037b175 --- /dev/null +++ b/docs/log/2026-11-23-the-first-logins-target.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-23" +order: 40 +area: image +title: 'the first login''s target (labs 45089584735, 45089584596, 45090246240, 45090246267, 45091658603, 45091658388, 45098372930, 45098372897, 45098372904, 45098373025, #574, #578, spin-stack/spin#1653, this change)' +issues: [578] +runs: [45089584596, 45089584735, 45090246240, 45090246267, 45090776228, 45090950033, 45091658388, 45091658603, 45091658629, 45091658828, 45098372897, 45098372904, 45098372930, 45098373025] +--- +#574's first experiment. On one vCPU every unit started before the first login is on its clock, so the boot's default target becomes `spin-machine-login.target`, which wants only the login's units (ssh, its keygen, the vsock socket, journald, logind and its Varlink socket, the bus, `/tmp`, spin's supervisor by name), each without default dependencies, and `spin-machine-boot-rest.service` starts `multi-user.target` once the boot's first jobs are done (`Type=idle`). Every unit still runs. *Bound* (the rest 3 s later, the forwarder off `basic.target`): −55.5 [−63.0, −51.6] at 20 a side (lab 45089584596); in its ledgers PID 1's CPU before the login 55 → 38 ms, and udevd, its trigger, tmpfiles, sysctl and user-sessions gone from before the login (lab 45089584735). *Triggers,* the supervisor early, 20 a side (lab 45090246267): idle −59.2, a 2 s timer −66.5, sshd's PAM stack −52.0 with accept to login +15.3; the same PAM trigger with the supervisor as spin orders it −20.8. Idle is kept: it is systemd's own "after the boot's jobs", and the timer's 2 s is arbitrary. *Found:* logind's Varlink socket has to be in the target, since systemd refuses to start a socket whose service runs; without it `boot:logind` failed (lab 45090950033). `lab check` now boots a tree's edits, made in an image of its own: before, a check booted the tree's base image and ignored them. *Carried form,* against v20261123.01, 40 a side (lab 45091658603): cold −17.7 [−26.2, −11.7], accept to login −11.8; with the supervisor off `basic.target` −42.6 [−50.2, −38.4]. Restored, 20 a side (lab 45091658388): +3.1 [+0.9, +5.4] evicted, +2.2 [−1.6, +5.4] cached; an earlier run read +8.1 and +4.6 (lab 45090776228). `boot:workspace` and `boot:logind` pass (labs 45091658629, 45091658828). *Decided* on v20261123.02, with the probe that saves once the boot has finished (the entry above), bench, nested, spin's shape and login, 40 a side, branch `exp-581-finished` (this change and that probe), tagged `archive/exp-581-finished`. ssh-first (lab 45098372930): first login −21.5 [−26.4, −15.5], sshd accepting −10.0 [−16.2, −3.7], accept to login −10.7 [−12.9, −8.2], second login +0.0 [−0.8, +0.6], QEMU's RSS −1.9 MiB. restore-first (lab 45098372897): restored login +1.1 [−6.0, +5.2] evicted, +2.2 [−10.6, +12.9] cached, both within noise; the state and the save within noise; `finished` +35.2 ms, since the rest of the boot runs after the login. The earlier run's restored +3.1 was the probe saving while the rest of the boot still ran (#578). `boot:workspace` and `boot:logind` pass on it (labs 45098372904, 45098373025). *The console prompt* +15.5 [+11.5, +19.0]: the serial getty is in `multi-user.target` and now follows the login. It does not count against the change: nothing a workspace does waits for the getty, and no goal number moves with it. *spin's supervisor off `basic.target`* (the same run, the probe's forwarder with `forwarder-early`'s drop-in): first login −45.3 [−50.2, −39.4], sshd accepting −66.3, but accept to login +21.0 and the second login +43.7 [+41.1, +46.1]. The first login then comes before the boot's first jobs are done, and `Type=idle` starts the rest exactly when the second login comes, so its cost moves from the first login to the second. Restored within noise (evicted +0.4). That half is spin's to decide (spin-stack/spin#1653); on a release with this target, `--edit forwarder-early` reruns it. *Removed:* the lab's `login-target` and `login-target-spin-early` edits, which put this checkout's target into a release that lacked it; the open row for unit loading at boot, which this answers. *Status:* in place. diff --git a/docs/log/2026-11-23-the-inventorys-blind-spot-was-mkosi.md b/docs/log/2026-11-23-the-inventorys-blind-spot-was-mkosi.md new file mode 100644 index 00000000..4c95fc48 --- /dev/null +++ b/docs/log/2026-11-23-the-inventorys-blind-spot-was-mkosi.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-23" +order: 100 +area: image +title: 'the inventory''s blind spot was mkosi (#518, image build on #517, this change)' +issues: [518] +prs: [517] +--- +#518 asked the inventory to tell a path a package ships from one it only lists, because `/etc/systemd/system-generators/systemd-gpt-auto-generator` is in `systemd.list` and an image built without `optimize-systemd.sh`'s link to it had none. *Read* (2026-11-23): Ubuntu's `debian/rules` makes that link with `dh_link`, and `systemd_259.9-0ubuntu0.1_amd64.deb` carries it (`dpkg-deb -c`), so the package ships it and a `.list` holds only what the package's data does. mkosi 27.1's `installer/apt.py` unlinks it after every install, to turn gpt-auto on in mkosi's own images. The image's link puts back Ubuntu's mask, so the inventory is right not to list it, and it did see the deletion, as `deleted /etc/systemd/system-generators/`. Comparing against md5sums would have done harm: md5sums lists no symlinks, so every link a package ships would read as added. *Changed:* docs/image.md's inventory note and generator row say so; nothing in `image/`. *Status:* #518 closed without a change to the inventory. diff --git a/docs/log/2026-11-23-the-ioapics-table-read-once-takes-384-exits.md b/docs/log/2026-11-23-the-ioapics-table-read-once-takes-384-exits.md new file mode 100644 index 00000000..47e356e9 --- /dev/null +++ b/docs/log/2026-11-23-the-ioapics-table-read-once-takes-384-exits.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-23" +order: 170 +area: kernel +title: 'the IOAPIC''s table read once takes 384 exits and no time the login can show (#590, parts run 45111505269, labs 45113437048, 45114405201, 45115330128, #627, this change)' +issues: [590, 592] +runs: [45111505269, 45113437048, 45114405201, 45115330128] +--- +*Why:* #565's profile put 576 IOAPIC MMIO exits in `apic_intr_mode_init`: the 24 redirection entries read four times and written twice (the x2APIC path's save and restore, the ExtINT search, `clear_IO_APIC`'s read, mask and verify). *Built:* a patch (branch `exp/590-ioapic-once`) that reads each entry once for the ExtINT search and the clear, skips the clear's write and verify for an entry already masked and clear, and has `enable_IR_x2apic` restore only when `mask_ioapic_entries` masked something. Every entry is still read, so a kexec'd kernel or other firmware is handled as before. The last 96 reads, reusing the save's copy, were left: the copy goes stale when remapping masks entries. *Measured* (bench, nested, spin's shape and login, against v20261123.04): IOAPIC accesses 589 → 205 (`native_io_apic_read` 397 → 205, `__ioapic_write_entry` and `ioapic_mask_entry` 96 → 0), every exit −322 [−394, −222], the host's KVM handled them in −3.1 [−6.2, −1.1] ms less (3 a side). The first login −4.5 [−7.8, +0.4] at 60 a side and −2.0 [−4.3, +0.6] at 120, both within noise. They are KVM's in-kernel IOAPIC, ~11 µs each in the L1, so ~384 of them are 4-6 ms at most (inferred), and the 120-boot interval reaches −4.3. The five exit patches of #590-#592 together, a bound, read −7.4 [−12.1, −2.8] at 60 a side; #627 asks whether they are one change. *Status:* rejected. Archived as tag `archive/exp-590-ioapic-once`. diff --git a/docs/log/2026-11-23-the-kernel-entered-as-its-vmlinux-through-pvh.md b/docs/log/2026-11-23-the-kernel-entered-as-its-vmlinux-through-pvh.md new file mode 100644 index 00000000..348b98fc --- /dev/null +++ b/docs/log/2026-11-23-the-kernel-entered-as-its-vmlinux-through-pvh.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-23" +order: 380 +area: kernel, qemu, machine +title: 'the kernel entered as its vmlinux through PVH, moving itself to a random base (#645, parts runs 45192017068, 45216245888, labs 45213668842, 45213683698, 45219768990, 45219785493, 45219801969, 45221660056, 45225297602, parts run 45222305257, #660, this change)' +issues: [645, 660] +runs: [45192017068, 45213668842, 45213683698, 45216245888, 45219768990, 45219785493, 45219801969, 45221660056, 45222305257, 45225297602] +--- +*Why:* a bzImage's decompressor spent ~21 ms (bench) on a copy, LZ4 and parse_elf before the kernel's clock, and it was the only thing that randomized the kernel; PVH skipped it and left the kernel at its linked address (11-19). *The bound first*, a vmlinux through PVH with no KASLR at all, against the same build as a bzImage: first login −18.9 [−22.8, −12.4], restored −3.6 [−5.1, −2.1] evicted, at 40 a side. *Two paths with KASLR kept:* QEMU applying the relocations (Holmes et al., EuroSys '22; Firecracker's design) or the kernel applying its own (Hou Wenlong's RFC, 2026-01-26). The kernel's own was chosen: no relocation format for QEMU to parse, nothing on QEMU's command line, the decompressor's entropy code (#645, issuecomment-7106937337). *Carried:* the RFC as kernel 0014-0018, made checkpatch --strict clean with each change noted in its header; 0019, which sets `KASLR_FLAG` once the kernel moved (without it `RANDOMIZE_MEMORY` left the regions where they were: the lowest vmalloc address ffffc90000000000 and the direct map ffff888000000000 at every one of 10 boots, lab 45225297602; with it, 10 distinct bases of each, lab 45221660056); 0020, because the RFC reads RDRAND from CPUID leaf 1's EDX and the TSC from its ECX, the wrong way round, so its virtual base was drawn from the i8254 and a hash of `boot_params` alone, on a guest that has `rdrand` and `tsc` and no `ds_cpl` (lab 45225297602); QEMU 0008, a random physical base from `XEN_ELFNOTE_PHYS32_RELOC`. The relocation table needs 0xc7000 bytes of the 1 MiB reserved: a 512 KiB reserve failed the link naming that size (parts run 45222305257). The machine boots a release's vmlinux when it carries both Xen notes and its bzImage otherwise, so a release from v20261119.02 to v20261123.06 boots as it did. *Measured* (bench, spin's shape and login, against v20261123.06, 60 a side, the kernel without 0020): first login 368 → 352, −16.8 [−20.9, −13.0], sshd accepting −16.7 [−20.2, −12.7], QEMU's RSS −13.8 MiB (lab 45219785493); restored −4.4 [−17.5, −2.0] evicted, −4.3 [−14.0, +10.2] cached, the state −31.9 MiB, the save −14.6 (lab 45219801969). *Status:* kept. What the bzImage, `KERNEL_LZ4` and QEMU 0007 still serve is #660. diff --git a/docs/log/2026-11-23-the-ledger-splits-the-span-before-the-kernels.md b/docs/log/2026-11-23-the-ledger-splits-the-span-before-the-kernels.md new file mode 100644 index 00000000..3bc5f818 --- /dev/null +++ b/docs/log/2026-11-23-the-ledger-splits-the-span-before-the-kernels.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-23" +order: 150 +area: lab +title: 'the ledger splits the span before the kernel''s clock (lab 45110630795, #537, #611, this change)' +issues: [611] +runs: [45110630795] +--- +The ledger had one span from the moment before QEMU is exec'd to the kernel's 0, ~20 ms longer than `boot:firmware-stages`' 73.7 ms, and docs/measuring.md read the 20 ms as spin-machine's start and the held start, inferred. Now the host watches spin-machine's children for QEMU's exec (a bracket of ±0.11 to 0.14 ms), and the kernel's "kvm-clock: using sched offset" line puts the guest's first instruction at the kernel's 0 less it. *Six boots of v20261123.04 on its traceable kernel* (bench, spin's shape): spin-machine to QEMU's exec 2.1 ms, QEMU's exec to the guest's first instruction 49.4, the guest's first instruction to the kernel's clock 47.4 (63.2 on the run's first boot: its ~15 ms more are all in that part). *The premise that broke:* the 20 ms are not before QEMU. They are after its exec, on a machine that firmware-stages does not boot (#611). *Status:* in place. diff --git a/docs/log/2026-11-23-the-ledgers-kernel-zero-on-the-kernels-sched.md b/docs/log/2026-11-23-the-ledgers-kernel-zero-on-the-kernels-sched.md new file mode 100644 index 00000000..27e9c9d9 --- /dev/null +++ b/docs/log/2026-11-23-the-ledgers-kernel-zero-on-the-kernels-sched.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-23" +order: 400 +area: lab +title: the ledger's kernel_zero on the kernel's sched clock (#644, labs 45229897350, 45230233764, this change) +issues: [561, 611, 644, 665, 666] +runs: [45110630795, 45177817516, 45177818419, 45229897350, 45230233764] +--- +The ledger's `kernel_zero` landed 19.5 ms (bench) and 12.6 ms (metal) after a port write at the sched clock's 0 (#611). *Found:* the ledger took CLOCK_MONOTONIC's 0, the trace's clock, for the kernel's. CLOCK_MONOTONIC runs on jiffies from timekeeping_init until the switch to kvm-clock and loses the ticks it misses. The kernel prints both clocks at one tick at late_initcall ("sched_clock: Marking stable"), and their difference was the whole error in all 24 boots of labs 45177818419 and 45177817516, to within 0.15 ms. *Changed:* the ledger moves the trace and the journal forward by that lag (`monotonic_lag`, 18-25 ms nested, 11-14 metal) and refuses a journal without the line. *Checked:* with the marker kernel, `kernel_zero` lands 0.03 to 0.14 ms before QEMU's trace stamps the marker, 10 boots on bench and 10 on metal (spin's shape, v20261123.04). *What moved*, recomputed from the runs' kept journals: docs/measuring.md's split of lab 45110630795, `kernel_zero` 97-114 → 77-95 and `qemu_start` 49.4 → 29.3 (`before_qemu` and `guest_to_zero` do not move); QEMU's exec to the kernel's clock untraced on the workspace's machine is 73.4 ms on bench and 68.7 on metal (labs 45177818419, 45177817516), against firmware-stages' 73.7; PID 1 in #561's ledgers −3.4 → −4.0 ms; the pressure sender's start 0.37-0.38 → 0.39-0.40 s (docs/image.md). #611's comment is corrected. No cold-budget row used the ledger's anchor. Two of its rows use clocks with errors of their own, now noted beside them: firmware-stages' anchor is ~2.8 ms late on bench (#665), and dmesg's clock reads the kernel 13-15 ms short from late_initcall on (#666). *Status:* in place. diff --git a/docs/log/2026-11-23-the-pressure-sender-started-by-the-boots-rest.md b/docs/log/2026-11-23-the-pressure-sender-started-by-the-boots-rest.md new file mode 100644 index 00000000..52b59456 --- /dev/null +++ b/docs/log/2026-11-23-the-pressure-sender-started-by-the-boots-rest.md @@ -0,0 +1,10 @@ +--- +date: "2026-11-23" +order: 240 +area: image +title: the pressure sender started by the boot's rest, its timer deleted (#401, labs 45120950183, 45120950314, 45120692382, 45120950141, this change) +issues: [401] +prs: [581] +runs: [45120692382, 45120950141, 45120950183, 45120950314] +--- +The sender waited for a timer 10 s after the boot because, ordered after `multi-user.target` alone, it started beside the first login and cost it 2.6-3.3 ms (11-21). Since #581, `multi-user.target` is started by `spin-machine-boot-rest.service` once the first login's units are up, the first of #401's arms. *Changed:* `spin-machine-pressure.service` is `WantedBy=multi-user.target`, enabled by optimize-systemd.sh; `spin-machine-pressure.timer` is deleted; build.sh checks the want and refuses the timer; the lab's `pressure` edit makes the same want; `boot:workspace` asserts the sender runs. *Measured* (bench, nested, spin's shape and login, against v20261123.04 with the change in its overlay, branch `exp-batch3`): first login −0.8 [−7.8, +4.8], sshd accepting −0.2 [−9.1, +3.6], 20 a side (lab 45120950183); restored −0.8 [−2.9, +2.1] evicted, −0.4 [−3.6, +0.8] cached, the state +2.1 MiB because the sender is running at the save (lab 45120950314). In 5 ledgers it started at 0.37-0.38 s on the kernel's clock, after the login's end at ~0.29 s (lab 45120692382); in `boot:workspace` on two vCPUs at 0.29 s (lab 45120950141). *Status:* in place. A guest's first ~0.4 s go unreported, not its first 10 s. diff --git a/docs/log/2026-11-23-the-record-holds-the-vcpus-properties-that-shape.md b/docs/log/2026-11-23-the-record-holds-the-vcpus-properties-that-shape.md new file mode 100644 index 00000000..b28d5d7e --- /dev/null +++ b/docs/log/2026-11-23-the-record-holds-the-vcpus-properties-that-shape.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-23" +order: 60 +area: machine +title: the record holds the vCPU's properties that shape CPUID (#569, CI run 45099128633, this change) +issues: [569, 586] +runs: [45099128633] +--- +*Why:* #565's `x-consistent-cache=off` changed CPUID leaf 2, and the record did not move: `machine.CPU` read feature bits only, so a checkpoint taken on one side of the change resumed on the other without a refusal. *Read* (QEMU 11.2.0-rc0's `target/i386/cpu.c`, `host-cpu.c`, `kvm/kvm-cpu.c`, 2026-11-22): the vCPU's properties that shape CPUID without being a feature bit, and of those, the ones `-cpu` sets or the host model takes from the host. #565's claim that a guest reads the same caches from either leaf does not hold under `host`. `legacy-cache` is on there, so with the switch off leaf 2 describes `legacy_intel_cpuid2_cache_info` (L2 2 MiB 8-way) while leaf 4 describes `legacy_intel_cache_info` (L2 4 MiB 16-way). glibc reads a 2 MiB L2 since v20261123.01 (#586). *Changed:* `CPU.Properties` holds `cpuidProperties`, read off the vCPU in the qom-list-get `CPU` already made: `x-consistent-cache`, `l3-cache`, `legacy-cache`, `host-cache-info`, `family`, `model`, `stepping`, `model-id`, `level`, `xlevel`, `phys-bits`, `guest-phys-bits` and `pmu`. `CanResume` refuses each difference as `cpu `, and refuses a property only one side has. `TestTheRecordHoldsWhatTheCPUIsGiven` fails a `-cpu` option that is neither a feature, a feature filter (`migratable`, `enforce`) nor held. *Compatibility:* a record written before this change holds no property, and is refused by each, `cpu x-consistent-cache: checkpoint none, here false` among them. The record names no release, and v20261122.07 (switch on) and v20261123.01 (off) run the same QEMU, 11.2.0-rc0, so nothing in an old record says which side of the switch it was taken on. Reading it as either value would let the other side's checkpoints through. Every checkpoint saved by a released spin-machine boots cold once. `boot:compat` saves each release's checkpoint with this tree's spin-machine, so it reads each release's own switch. With this change alone, v20261123.02 and v20261123.01 resumed and v20261122.07 was the first it refused, `cpu x-consistent-cache: checkpoint true, here false` (CI run 45099128633). The entry below rides in the same record change, and moves the first refused release to the newest. *Opened:* #586 (leaves 2 and 4 disagree under host), #587 (`Unshared` ignores the properties), #588 (leaf 0xA is the host's PMU and nothing holds it). *Status:* in place. diff --git a/docs/log/2026-11-23-the-release-is-its-vmlinux-alone-no-bzimage.md b/docs/log/2026-11-23-the-release-is-its-vmlinux-alone-no-bzimage.md new file mode 100644 index 00000000..87175293 --- /dev/null +++ b/docs/log/2026-11-23-the-release-is-its-vmlinux-alone-no-bzimage.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-23" +order: 450 +area: kernel, release +title: 'the release is its vmlinux alone: no bzImage, no `KERNEL_LZ4`, no kernel 0018 (#660, lab 45262046768, spin-stack/spin#1689, this change)' +issues: [645, 660] +runs: [45262046768] +--- +*Why:* since #645 (v20261123.07) the machine boots a release's vmlinux through PVH, and the bzImage beside it was booted by nothing: spin's `hack/machine/place.go` still asked for it, and its runner reads the vmlinux and `pvh.bin`. The maintainer decided not to wait for spin. *Done:* `kernel/Dockerfile` makes `vmlinux` instead of `all`; `CONFIG_KERNEL_LZ4` and the builder's `lz4` go, and the compression mode is Kconfig's default (gzip), which compresses nothing shipped; kernel 0018, the RFC's change to the decompressor, is deleted, as nothing compiles `arch/x86/boot/compressed/` any more, and with it sparse's rebuild of the bzImage to check that file; CodeQL's kernel analysis builds `vmlinux` for the relocs tool where it built the bzImage. The release packs, hashes (SBOM) and describes (SOURCES) `kernel/vmlinux` alone, and `verify kernel` reads no setup header. `machine.OpenRelease` still boots the bzImage of a release from v20261119.02 to v20261123.06: the lab (`--from release:TAG`) and compat open them. Compat stopped at the first release with no bzImage, which every release from this one on is, and now stops at the first `OpenRelease` refuses. *Measured* (bench, nested, spin's shape and login, 20 a side, interleaved): the boot path is unchanged, first login −4.3 [−14.4, +7.4] at 20 a side, within noise, sshd accepting −5.3 [−11.1, +7.0], QEMU's RSS −1.7 MiB (the arm's kernel is also 7.3.6, main's, against .07's 7.3.5). *Left:* spin's place.go must stop requiring `kernel/bzImage` before it takes a release from this one on (spin-stack/spin#1689). diff --git a/docs/log/2026-11-23-the-traceable-kernel-is-a-vmlinux-entered-through.md b/docs/log/2026-11-23-the-traceable-kernel-is-a-vmlinux-entered-through.md new file mode 100644 index 00000000..9e6c3984 --- /dev/null +++ b/docs/log/2026-11-23-the-traceable-kernel-is-a-vmlinux-entered-through.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-23" +order: 430 +area: lab +title: the traceable kernel is a vmlinux entered through PVH, as the release's (#697, lab 45260129735, this change) +issues: [645, 697, 698] +runs: [45260129735] +--- +*Why:* since #645 the release boots its vmlinux through PVH, and its traceable kernel was still a bzImage, so v20261123.07's published ledger read firmware, entry and setup at 47.1 ms against .06's 45.0, where the release had dropped its decompressor. *Changed:* `release traceable-kernel` publishes a self-randomizing vmlinux, checked as the release's, and no bzImage; `traceable:TAG` places whichever the release published; the ledger records `pvh` and names the window by it. *Proof* (bench, spin's shape, v20261123.07, 10 boots a tree, interleaved, the old traceable bzImage against the new traceable vmlinux): firmware, entry and setup 44.3 → 19.4, −24.9 [−25.8, −23.4]; QEMU's start and held start 41.9 → 50.3, +8.4, the vmlinux's load (#698); the kernel's 0 −16.8 [−18.2, −15.1]; first login −21.6 [−32.9, −11.0]. *Status:* in place. diff --git a/docs/log/2026-11-23-the-update-stamps-written-at-build-the-five.md b/docs/log/2026-11-23-the-update-stamps-written-at-build-the-five.md new file mode 100644 index 00000000..4f0520c6 --- /dev/null +++ b/docs/log/2026-11-23-the-update-stamps-written-at-build-the-five.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-23" +order: 230 +area: image +title: the update stamps written at build, the five units of `ConditionNeedsUpdate` unmasked (#513, labs 45120950183, 45120950314, 45120950141, this change) +issues: [509, 512, 513] +runs: [45120950141, 45120950183, 45120950314] +--- +The image had no `/etc/.updated` or `/var/.updated`, so `ldconfig`, `systemd-sysusers`, `systemd-hwdb-update`, `systemd-journal-catalog-update` and `systemd-update-done` were masked: without the stamps they rebuild the caches in every boot (+260 ms, laptop, 11-21). *Changed:* `image/build.sh` writes both stamps last, with `/usr`'s mtime and `TIMESTAMP_NSEC=`, as `systemd-update-done` does, and fails an image whose stamps' mtime is not `/usr`'s; the five masks are gone from optimize-systemd.sh; `boot:workspace` asserts each unit checked its condition and skipped. `/usr`'s mtime in the release is 0 (`SOURCE_DATE_EPOCH`), which first failed the arm's setup through `expr`'s exit status on a result of 0. *Measured* (bench, nested, spin's shape and login, against v20261123.04 with the stamps and the unmasks in its overlay, branch `exp-batch3`): first login −0.3 [−6.8, +4.5], sshd accepting −1.3 [−7.7, +1.1], 20 a side (lab 45120950183); restored +0.2 [−2.1, +0.9] evicted, −1.3 [−4.5, −0.4] cached, cold login +1.2 [−2.6, +7.3] (lab 45120950314); `boot:workspace` on the overlay: the five units' conditions false and no unit failed (lab 45120950141, whose other failures are #509's and #512's checks, which v20261123.04 predates). The overlay measures the stamps and unmasks as files of the overlay, not of the base, which only changes where their few blocks are read from. *Status:* in place, a functional change: a `/usr` change made later is applied at the next boot. diff --git a/docs/log/2026-11-23-the-vmlinux-copied-into-guest-ram-beside-qemus.md b/docs/log/2026-11-23-the-vmlinux-copied-into-guest-ram-beside-qemus.md new file mode 100644 index 00000000..6e69efeb --- /dev/null +++ b/docs/log/2026-11-23-the-vmlinux-copied-into-guest-ram-beside-qemus.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-23" +order: 410 +area: qemu +title: the vmlinux copied into guest RAM beside QEMU's main loop (#698, labs 45257214350, 45260098299, 45260694485, parts run 45257975711, this change) +issues: [645, 698, 705] +runs: [45257214350, 45257975711, 45260098299, 45260129735, 45260694485, 45261567066] +--- +*Why:* since #645 QEMU loads the vmlinux through `load_elf`. #698 asked whether it read the 40 MB file into ROM blobs at start, as `x86_load_linux` read a bzImage before 0007. It does not: `load_elf` has mapped the file since QEMU 4.2 (816b9fe450, Garzarella, 2019), and the blobs point into the mapping. What it does is copy the 37.4 MB of segments into guest RAM at the machine's first reset, on the main thread, before the main loop answers the monitor. *The phase,* a probe that traces QEMU's reset (`romcopy`, branch `exp/698-romcopy`, never merged): 9.1 ms p50, p95 9.3, 20 boots, bench, spin's shape (lab 45257214350); the ledger read the vmlinux's QEMU start +8.4 against a bzImage's (lab 45260129735, #697). On a laptop half the copy is faulting in the destination's huge pages and half the copy, and a `pread` into guest RAM was no faster than the mapping's `memcpy`, so no cheaper copy was built. *Carried:* QEMU 0009 copies the segments 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; a machine made for an incoming migration copies nothing at reset, as before. *Measured* (bench, spin's shape and login, v20261123.07 against the same release with 0009's QEMU, interleaved): first login 351 → 342, −8.6 [−11.0, −4.0], sshd accepting −9.1 [−12.4, −5.9], the console prompt −7.7 [−11.4, −5.5], QEMU's RSS unmoved, 60 a side (lab 45260098299); restored −0.1 [−1.1, +0.7] evicted, −0.3 [−2.1, +0.9] cached, the state unmoved, the same run's cold login −6.9 [−12.9, −0.8], 40 a side (lab 45260694485). The gain is the whole traced copy. The record does not move: the patch adds no device, property or RAM block, and `boot:record` passed on the patched tree (lab 45261567066). A stub ELF whose notes have `p_align` 0 kills QEMU 11.2 with SIGFPE in `load_elf`, found while writing the build check (#705, not affected). *Status:* kept. diff --git a/docs/log/2026-11-23-the-volatile-journal-holds-8-mb-not-4.md b/docs/log/2026-11-23-the-volatile-journal-holds-8-mb-not-4.md new file mode 100644 index 00000000..d83305b0 --- /dev/null +++ b/docs/log/2026-11-23-the-volatile-journal-holds-8-mb-not-4.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-23" +order: 330 +area: image +title: the volatile journal holds 8 MB, not 4 (#514, labs 45121159504, 45121159741, 45121159883, 45120692139, this change) +issues: [514] +runs: [45120692139, 45120950183, 45121159504, 45121159741, 45121159883] +--- +*Found:* `/run` is a tmpfs of 20% of the RAM at its mount, and the guest mounts it at 128 MiB, before spin sizes it to 2 GiB: 19 MiB in spin's shape, whatever the guest grows to. Ubuntu's default cap, 10% of `/run`, would be ~2 MB there. *Measured* (bench, nested, spin's shape: 1 vCPU, 128 MiB sized to 2048 right after the start, a guest running `docker build --no-cache` of 20 `RUN` steps for 10 minutes, branch `exp-batch3`'s `boot:exp-journal`): the journal grows ~0.4 MB a minute, mostly systemd's and dockerd's lines for each build step. At 4 MB the oldest entry was the kernel's first line for 8 minutes, then the boot's first 90 s were gone by the end (lab 45121159741). At 8 MB the whole journal was kept, 3.6 MB used (lab 45121159883). A first try at 16 MB was left: it is 84% of `/run`, near journald's 15% keep-free. The first login, 8 MB against 4 MB in v20261123.04's overlay: −2.2 [−12.1, +6.4], 20 a side (lab 45121159504), and 16 MB −0.2 [−5.6, +9.1] (lab 45120950183). *Status:* in place; a busy workspace keeps ~15-20 minutes. diff --git a/docs/log/2026-11-23-two-levers-on-the-boots-ecam-reads-remove.md b/docs/log/2026-11-23-two-levers-on-the-boots-ecam-reads-remove.md new file mode 100644 index 00000000..26f866a0 --- /dev/null +++ b/docs/log/2026-11-23-two-levers-on-the-boots-ecam-reads-remove.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-23" +order: 180 +area: kernel +title: 'two levers on the boot''s ECAM reads remove what they claim and no time the login shows (#591, parts runs 45111902862, 45111905648, labs 45113437048, 45114405201, 45115330128, #627, this change)' +issues: [590, 591, 592, 627] +runs: [45111902862, 45111905648, 45113437048, 45114405201, 45115330128] +--- +*Why:* since 0004 every configuration read is an MMIO exit, and #591 counted the reads by caller. *(a)* `pci_bus_add_device()` saves every device's state at its add (upstream a2f1e22390ac, v6.19, for error recovery), 16 reads for each of 8 functions. A patch (branch `exp/591a-no-save-state`) keeps the save only where something can restore it without the driver's own save: AER (and DPC and EDR, which need it), EEH, s390, Xen's pcifront, and a root-bus device whose host bridge sets `reset_root_port`. CONFIG_PCIEAER alone was not a safe gate, because the same commit took out `pci_restore_state()`'s refusal of a state never saved, and those mechanisms call drivers' error handlers without AER. *(b)* `vp_modern_probe()` walked the vendor capabilities once for each of four types; a patch (branch `exp/591b-virtio-caps-once`) walks them once and keeps the first usable one of each type, as before. *Measured* (bench, nested, spin's shape and login, against v20261123.04): (a) MMIO exits −128 exactly, the host's handling −3.3 [−6.2, −2.1] ms; (b) −114 exactly, both at 3 a side and both the counts the source gave. The first login at 60 a side: (a) −4.3 [−6.8, +0.5], within noise; (b) −5.8 [−8.2, −0.6], outside it, but 114 exits at ~15 µs each (10 in the L1 and ~4.7 for the L0's trips) are ~1.7 ms, a third of that. A run of 120 a side, made because both arms straddled the noise, read (a) −1.3 [−3.5, +1.3] and (b) +0.9 [−1.8, +2.7]. The larger run decides, and it was chosen after the first was read, which this entry says. *Status:* both rejected. With #590 and #592's patches, as a bound, −7.4 [−12.1, −2.8] (#627). Lever 3, BAR sizing from the firmware, was not tried: it needs a new reason over the rejected configuration-space snapshot (11-13). Archived as tags `archive/exp-591a-no-save-state` and `archive/exp-591b-virtio-caps-once`. diff --git a/docs/log/2026-11-23-tzdata-e2fsprogs-and-fuse3-are-installed.md b/docs/log/2026-11-23-tzdata-e2fsprogs-and-fuse3-are-installed.md new file mode 100644 index 00000000..2d7416ec --- /dev/null +++ b/docs/log/2026-11-23-tzdata-e2fsprogs-and-fuse3-are-installed.md @@ -0,0 +1,10 @@ +--- +date: "2026-11-23" +order: 210 +area: image +title: 'tzdata, e2fsprogs and fuse3 are installed (#512, labs 45112622373, 45112622091, 45112622071, 45113946185, image jobs on #616 and #625, this change)' +issues: [512] +prs: [616, 625] +runs: [45112622071, 45112622091, 45112622373, 45113946185] +--- +*Decided* (the owner, #512, option b): the three a workspace cannot work around from inside, a zone loaded by name, a disk attached to a running workspace formatted and checked, and FUSE, which the kernel has. python3, lsb-release and the smaller tools stay out. *Changed:* `image/mkosi.conf` names them; `deviations.py` counts `/etc/localtime`, tzdata's postinst link to `Etc/UTC`, as a file a maintainer script writes on every Ubuntu, so the inventory is unchanged at 118 lines. `boot:workspace` loads `Europe/Madrid` by name, asserts the default zone is still UTC, finds `fusermount3` and `/dev/fuse`, and formats, mounts, writes and fscks an empty disk the host attaches while the guest runs; all pass with the packages in an overlay of v20261123.04 (lab 45112622373). *Measured* (bench, nested, spin's shape and login, the packages installed into the release's overlay by its own apt, branch `exp-512`, tagged `archive/exp-512`): first login −2.9 [−9.7, +3.6], sshd accepting −3.4 [−8.6, +4.0], 20 a side (lab 45112622091). Restored, 20 a side: evicted −0.3 [−1.8, +1.1], cached +1.8 [+0.3, +2.9], all of it in `running`, before any guest code (lab 45112622071); at 60 a side evicted −0.9 [−3.9, +2.0], cached +0.3 [−10.4, +12.5], within noise (lab 45113946185). The boot finishes +9.8 ms later and the state is +0.8 MiB, from `e2scrub_reap.service` in `multi-user.target` after the login; the console prompt +8.5. None is a goal number. *Size:* 217 → 224 packages, the tree +5.1 MiB (987408 → 992672 KiB), the qcow2 1013587968 → 1019158528 bytes (+5.3 MiB). *Status:* in place. diff --git a/docs/log/2026-11-23-unshared-refuses-a-pool-whose-cpus-differ-in.md b/docs/log/2026-11-23-unshared-refuses-a-pool-whose-cpus-differ-in.md new file mode 100644 index 00000000..7dd91624 --- /dev/null +++ b/docs/log/2026-11-23-unshared-refuses-a-pool-whose-cpus-differ-in.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-23" +order: 250 +area: machine +title: '`Unshared` refuses a pool whose CPUs differ in what taking features away leaves as it is (#587, this change)' +issues: [587] +--- +*Why:* `Unshared` compared only the vendor and the model, so a pool whose hosts differ in stepping or physical address bits got a `CPUWithout` as if it made them share one CPU, and every cross-host resume was then refused by `CanResume`. *Read* (QEMU 11.2.0-rc0's `target/i386/cpu.c`, `host-cpu.c`, `kvm/kvm-cpu.c`, 2026-11-23): under `host`, `family`, `model`, `stepping` and `model-id` are the host's (`host_cpu_instance_init`), `phys-bits` and `guest-phys-bits` the host's and KVM's whenever `lm` is on, `pmu` is set by `kvm_cpu_max_instance_init`, and the cache switches by the machine type and `-cpu`. No feature taken away moves any of them. `level` and `xlevel` can move: `kvm_cpu_max_instance_init` starts the minimum leaves at KVM's, and `x86_cpu_expand_features` raises them for each feature word that is on (AVX10 to 0x24, APX to 0x29, SVM to 0x8000000A). Two hosts' levels can then agree or differ either way once `CPUWithout` is applied, and the record does not hold KVM's own leaf to say which. *Changed:* `Unshared` refuses, naming each, a pool whose hosts differ in any property but `level` and `xlevel`, and leaves those two to the records of the machines started with `CPUWithout`. *Status:* in place; spin-stack/spin#1417 told. diff --git a/docs/log/2026-11-23-v20261123-07-holds-645s-cold-gain-its-records.md b/docs/log/2026-11-23-v20261123-07-holds-645s-cold-gain-its-records.md new file mode 100644 index 00000000..91bd625b --- /dev/null +++ b/docs/log/2026-11-23-v20261123-07-holds-645s-cold-gain-its-records.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-23" +order: 390 +area: release +title: 'v20261123.07 holds #645''s cold gain; its record''s 20 a side did not see it (labs 45252584128, 45219785493, release run 45241645340, #694)' +issues: [645, 694] +runs: [45219785493, 45241645340, 45252584128] +--- +*Why:* the record read the cold first login at −3.5 [−12.9, +2.9], within noise, against #645's −16.8 [−20.9, −13.0], and spin was about to be told what the bump gains. *Ruled out* (read from the artefacts): the lab arm and the release boot the same machine. QEMU (`f271a946…`), qboot, `pvh.bin` and `linuxboot_dma.bin` are byte-identical, `spin-machine args` prints one command line but for paths, and both vmlinux files are stripped, 40,165,128 bytes, with the same two LOAD segments and the same config; the release's adds 0020. QEMU's RSS moves the same in both (anonymous −34.0 MiB, file +19.9/+20.1). *Measured* (bench, nested, spin's shape and login, both releases as published, each with its own spin-machine, 60 a side, interleaved): first login 378 → 359, −18.6 [−23.6, −14.0], sshd accepting −15.3 [−21.2, −12.6], the console prompt −18.7 [−24.0, −12.8] (lab 45252584128). The record's run disagreed with itself: its `restore-first` cold boot, the same boot at 40 a side, read −14.2 [−19.9, −8.6]; its 20 `.07` boots sat at a p50 of 370 where the lab's sit at 352-359, and 20 a side drawn from lab 45219785493's samples reach −3.5 in 5 of 100,000 draws. *Status:* the gain stands at ~−17 to −19 ms cold. How many boots the record takes is #694. diff --git a/docs/log/2026-11-23-virtio-pcis-queue-selection-and-msi-x-rewrites.md b/docs/log/2026-11-23-virtio-pcis-queue-selection-and-msi-x-rewrites.md new file mode 100644 index 00000000..5321bc4c --- /dev/null +++ b/docs/log/2026-11-23-virtio-pcis-queue-selection-and-msi-x-rewrites.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-23" +order: 190 +area: kernel +title: 'virtio-pci''s queue selection and MSI-X rewrites: exits removed, no time on the login, and spin''s dialer filed (#592, parts runs 45111690155, 45111693255, 45113393915, labs 45113437048, 45114428660, 45114405201, 45115330128, spin-stack/spin#1661, #627, this change)' +issues: [592] +runs: [45111690155, 45111693255, 45113393915, 45113437048, 45114405201, 45114428660, 45115330128, 45115341056] +--- +*Lever 1:* every `vp_modern_*` queue accessor writes `queue_select` first, so setting up 13 queues wrote it 91 times. The same patch as 0011 (deleted with two others in a group arm, #345), here alone (branch `exp/592-l1-queue-select`), writes it 23 times. The MSI-X vector read-back after writing a queue's vector stays: virtio 1.2 §4.1.5.1.2 says a device refuses a vector by reading back NO_VECTOR and the driver must check, and `vp_find_vqs` falls back to shared vectors on it. *Lever 2:* each MSI-X message was written at activation and again by x86's `msi_set_affinity` before startup (`IRQCHIP_AFFINITY_PRE_STARTUP`, ff363f480e59), with the same vector and destination. A patch (branch `exp/592-l2-msix-once`) returns without the write when neither changed; a skip in `__pci_write_msi_msg` would have broken the restore of MSI state after resume. *Measured* (bench, nested, spin's shape and login, against v20261123.04, 3 a side for exits): lever 1 MMIO exits −68, lever 2 −56 (14 messages of 4 accesses, not the 19 inferred). The first login: lever 1 −2.8 [−6.6, +3.4] at 60 a side and +0.6 [−1.8, +2.3] at 120; lever 2 −0.1 [−3.1, +4.5] at 60. *The bound:* #590's, #591's and these patches in one kernel (branch `exp/batch2-bound`, 0017 refreshed to apply after 0016): every exit −838, MMIO −366, the host's handling −5.2 [−11.2, +1.2] ms (lab 45114428660); first login −7.4 [−12.1, −2.8] and sshd accepting −10.5 [−14.9, −4.1] at 60 a side (lab 45114405201); the restored login +0.0 [−5.4, +4.9] evicted (lab 45115341056). A bound is not a candidate; #627 asks whether the five are one change. *Lever 3:* spin's runner redials vminitd's RPC port every ≤2 ms until it listens (spin-stack/spin `internal/runner/qemu/guest_rpc.go`, `connectVsockRPC`), so spin's path pays refused-dial resets as the probe's dial did; how many is spin's to count (spin-stack/spin#1661). *Status:* levers 1 and 2 rejected. Archived as tags `archive/exp-592-l1-queue-select`, `archive/exp-592-l2-msix-once` and `archive/exp-batch2-bound`. diff --git a/docs/log/2026-11-23-vmlinux-btf-is-parsed-when-a-program-first.md b/docs/log/2026-11-23-vmlinux-btf-is-parsed-when-a-program-first.md new file mode 100644 index 00000000..10edd0d8 --- /dev/null +++ b/docs/log/2026-11-23-vmlinux-btf-is-parsed-when-a-program-first.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-23" +order: 220 +area: kernel +title: vmlinux BTF is parsed when a program first needs it, not before the login (#460, parts runs 45112032746, 45116894547, labs 45113437048, 45114405201, 45115330128, 45115341056, 45118194310, this change) +issues: [460] +runs: [45112032746, 45113437048, 45114405201, 45115330128, 45115341056, 45116894547, 45118194310] +--- +*Why:* 0012, parsing vmlinux BTF on first use instead of at the first kfunc registration (11-22, archived as `archive/exp-btf-first-use`), took 7 ms out of the kernel and put it into journald's start, because `bpf_check()` asked for the BTF for every program, journald's cgroup device and skb programs (`DeviceAllow=`, `IPAddressDeny=`) among them. *Changed:* 0012 as measured, and 0013, which has the verifier ask for the BTF only where a kernel type first enters a program: a program with its own BTF or a BTF-typed attach point, the first kfunc call, a vmlinux BTF id in ld_imm64, a map pointer access, a helper argument or return typed by vmlinux BTF, `bpf_find_vma()`'s callback, and `bpf_snprintf_btf()` / `bpf_seq_printf_btf()`. Prior art: Jay Wang's bpf-next series of 2026-09-23 (LWN 1096093, not merged) chose the same points; the eager fetch came with 8580ac9404f6 (2019). *Reviewed* (an independent read of both patches, every `btf_vmlinux` reader in kernel/bpf): two bugs found and fixed before the patch was carried. The printf-BTF helpers read the BTF as the program runs, in atomic or NMI context, and with no trigger at load they could have started the parse there; they now ask for it at load. A parse that failed for memory in whichever task asked first (an unprivileged bpffs mount's `delegate_*` options can choose that task) latched the error for the whole boot; it is now tried again by the next user, and only a malformed BTF is final. vmlinux BTF now has no object id until it is parsed. *Measured* (bench, nested, spin's shape and login, against v20261123.04): no exit moves (3 a side, lab 45113437048). The first login −10.0 [−12.7, −3.3] at 60 a side and −6.3 [−9.1, −4.6] at 120 before the fixes; the kernel carried −6.4 [−9.4, −1.0] at 60, sshd accepting −6.7 [−9.5, −2.2]. Restored −1.0 [−6.0, +4.2] evicted and +1.7 [−9.1, +10.2] cached, 30 a side, the state 1.3 MiB smaller (the BTF is not in it). The build asserts both (kernel/README.md). *Status:* in place; reaches the goal number with the next release. diff --git a/docs/log/2026-11-23-what-setmemory-down-and-one-vcpu-cost.md b/docs/log/2026-11-23-what-setmemory-down-and-one-vcpu-cost.md new file mode 100644 index 00000000..98103efb --- /dev/null +++ b/docs/log/2026-11-23-what-setmemory-down-and-one-vcpu-cost.md @@ -0,0 +1,8 @@ +--- +date: "2026-11-23" +order: 200 +area: machine +title: 'what SetMemory down and one vCPU cost (labs 45113957566, 45117940800, #549, this change)' +runs: [45113957566, 45117940800] +--- +`boot:actuators` boots spin's shape to systemd at 2048 MiB and times each actuator until the guest shows it, 10 times each. Its first reading counted the 128 MiB memory blocks online, and 19 of 20 unplugs to 1024 MiB stood at 1536 MiB for the whole 2 minutes. virtio-mem's own log said QEMU had all 1024 MiB back. The driver takes back its smaller blocks from inside a memory block, and the block stays online until all of it is gone. So the check now reads MemTotal. *Bench, spin's shape:* SetMemory 2048 → 1024 MiB 21.2 ms idle and 53.7 with 1180 MiB of page cache; back up 9.1; a vCPU added 13.2 and removed 14.8. docs/machine.md's actuators table has them. *Status:* in place. diff --git a/docs/log/2026-11-23-where-a-cold-boots-ept-violations-land.md b/docs/log/2026-11-23-where-a-cold-boots-ept-violations-land.md new file mode 100644 index 00000000..0fe832cf --- /dev/null +++ b/docs/log/2026-11-23-where-a-cold-boots-ept-violations-land.md @@ -0,0 +1,9 @@ +--- +date: "2026-11-23" +order: 280 +area: lab +title: where a cold boot's EPT violations land (#568, lab 45111606645, this change) +issues: [561, 568] +runs: [45111606645] +--- +#565 counted 172 EPT violations in a cold boot at ~115 µs each nested and asked whether prefaulting the base memory in a QEMU started ahead would take them off the path. `exits` now keeps a histogram of `kvm_page_fault` by guest-physical address in 128 MiB buckets. *Found* (bench, nested, spin's shape and login, v20261123.04, 3 boots, the same in each): 171 violations, 18.9 ms of the L1's time. 52 in the base (0-128 MiB) and 6 in the bucket above it, 48-51 in the memory virtio-mem plugs (QEMU puts its device memory at 4 GiB when there is no RAM above 4 GiB), 39 in the PCIe ECAM at 0xB0000000, 9 in 0xF8000000-0xFFFFFFFF (IOAPIC, local APIC, flash) and 17 in the 64-bit BARs at 12 GiB. The MMIO ones are inferred from the addresses: KVM's first fault on an MMIO page installs the misconfigured entry that every later access exits through. *Decided:* closed as off the goal's clock. Prefaulting the base could win only the base's ~58 faults, ~6 ms at most, and only in `prestart`, because `ssh-first` starts before QEMU's exec and a prefault there is on its path. The plugged faults cannot be prefaulted without zeroing all that is plugged. With the memory at boot (#561) they become base faults, and the split is the same question. *Status:* the histogram is kept in `exits`. diff --git a/docs/log/README.md b/docs/log/README.md new file mode 100644 index 00000000..e08911d8 --- /dev/null +++ b/docs/log/README.md @@ -0,0 +1,11 @@ +# Log: what was done, why, and what it measured + +First built on 2026-11-13 from `git log origin/main` (327 commits, to `3e8075f`), the 150 pull requests of that day (merged, closed and open), the 44 releases' notes, the tree at `origin/main` (comments, `docs/`, `boot/*_test.go` row comments), and spin-stack/spin#1206 and spin-stack/open-remote-ssh#8. Hashes are short commit ids on `origin/main`; `#N` is a pull request here; "lab N" is a `lab.yml` run id as the tree or a PR quotes it. Dates are UTC, as the bench fleet and spin keep them. A commit made in UTC−3 can carry the day before. Nothing here was re-measured. Every change that decides something since adds its entry. + +Where boot time stands, what each phase costs, how a number is measured, and the tables of what was kept, measured and rejected, and is next are `docs/boot-time.md`. This log is the chronology. + +--- + +## 1. Chronological log + +Format: **date · area · refs**, then what was done, why, the result and its status. diff --git a/docs/log/rework.md b/docs/log/rework.md new file mode 100644 index 00000000..8d0ae294 --- /dev/null +++ b/docs/log/rework.md @@ -0,0 +1,121 @@ +## 2. Rework cycles + +Each cycle: the sequence, what each step measured, and the lesson. + +### 2.1 udev: masked, unmasked, then argued over for weeks +1. Initial import: udev masked "to save boot time" (`8aee03a`). The serial getty could not start, so a debug init was written to work around it (`5e7d60e`, `8aee03a`, `24c8a06`). +2. 09-10 `4cbd229`: masking buys nothing (826 vs 829). The first harness had left `systemd-udev-trigger` masked and read "udev changes nothing". +3. 09-10 `722d468`: unmasked. `b5f361f`: the harness's udev row was itself a no-op. +4. 09-10 `064c4f4`: unmasking udev quietly enabled the serial getty that the console unit existed to avoid. This was left open as "a decision". +5. 09-26 `adc52cd`/`e2f6b8f`: udev's 46 ms "overlaps" the boot; removing devices, rules or VT gives 0. +6. 11-12 `3c8da99`: the memory half of the hot-add rule, added 09-10, raced the kernel and was removed. + +**Lesson:** an optimisation imported without its measurement survived 3 days and cost a debug init, a console unit and a harness. Measure before inheriting a mask, and make a variant fail when its edit matches nothing (`e2f6b8f` added that check). + +### 2.2 logind: out of the boot, then back in +1. 09-10 `6aba37b`: logind 63 ms on the chain, worth 24 ms to the console prompt (laptop). +2. 09-12 `bb6bb89` (#5): logind is started at the first login through the seats directory, worth 24 ms (249 vs 273). Two dead ends were recorded, and `boot:logind` was written to hold it. +3. 11-12 #240: back in the boot, with spin lingering. First SSH login 570 → 510 (lab 43308825692). The comment says the 09-12 change "moved logind, dbus-broker and user@1000.service into the first login instead, which is what a workspace waits for." +4. 11-13: the side effect, console prompt +77 ms, was fixed with getty Type=simple (#241), and that fix was removed the same day (#249). +5. #240's notes: the `SPIN_LOGIND_NO_SEATS=1` control "was written to fail, and on this image … it passes". `10-seats.conf` may now be unnecessary. Not settled. + +**Lesson:** the 09-12 decision optimised the console prompt, a metric nobody waits for, and paid for it in the first login, which was not measured until 11-12. Name the metric that matters before optimising. The first SSH login probe arrived two months after the change it would have rejected. + +### 2.3 Serial getty Type=idle / Type=simple +1. 09-10 `80f984b`: removing Type=idle was within noise against agetty's `sleep(1)`. +2. 09-10 `064c4f4`: Type=idle worth 25 ms (291/344 vs 266/283), read as "systemd's job queue draining". +3. 09-26 `b9707e3`/`7b08e5a`: Type=idle was eliminated as the cause of the 340 ms console-swap cost. +4. 11-13 #241: Type=simple shipped, 346/358 vs 423/441, after linger made the idle hold 91.8 ms. +5. 11-13 #249: removed, since the console prompt is not a workspace metric. + +**Lesson:** the value of this setting depends on what else is in the boot transaction. It was re-measured each time something upstream changed (linger), and its worth turns on a metric (the console prompt) that does not matter (#249). Decide which metrics count before shipping fixes for the others. + +### 2.4 SSH host key generation (moved 5 times) +1. 09-07 `8aee03a`: ssh fails five times per boot; "SSH keys are identity and belong wherever the rest of a VM's identity comes from" (not fixed). +2. 09-07 `2df3dbf`: generated per boot, hung off ssh.service. Hanging it off ssh.socket made an ordering cycle. +3. 09-24 `a01c847`: RSA dropped (309 ms in blame). +4. 11-12 #240 `28823fb`: `sshd@` must wait for the keys. Before this, SSH over vsock "worked not at all"; nothing had tested vsock SSH since the socket path changed. +5. 11-12 lab 43312419007: keygen wanted by multi-user.target, 518 vs 514. Nothing gained, because default dependencies kept it after basic.target. Not shipped. +6. 11-13 #247 → #248: wanted by sysinit.target with `DefaultDependencies=no`, 489 → 468 (lab 43483372488). Consumer consequence: a checkpoint taken after boot always carries host keys, so the restorer must re-key (`image/README.md`). + +**Lesson:** the per-connection vsock path ran without host keys until a probe logged in over it. A functional probe of the real login path (`boot:ssh-first`) should come before timing work on it. Step 5 failed for a reason (`DefaultDependencies`) that reading the unit's ordering would have shown. + +### 2.5 Save/restore and templates in the CLI; restore measurement; mapped-ram (proposed twice) +1. 09-07 `656d55b`: save/resume added; reverted the same day as lifecycle (`b882171`). +2. 09-26 `20e14d9`/`ab4844c`: TEMPLATES.md, template restore 24 ms, `drop-cache=off`. +3. 09-28 `c202568`: `save --template`/`restore`, plus `boot:restore`. +4. 09-30 #51: templates removed upstream (spin #194). `boot:restore` deleted, two days after it was written. +5. 11-13 #242: restore measured again, and mapped-ram proposed with `--channels`. Its numbers (lab 43364516874) were contaminated by leaked VMs. +6. 11-13 #246: mapped-ram in the contract. The fleet shows no win (385 vs 386); closed. + +**Lesson:** the product's path (template restore, then checkpoint resume) changed outside this repository, and probes were built and deleted around it within days. Restore of a checkpoint was not measured at all between 09-30 and 11-13. The mapped-ram decision had a fleet result and was reopened with a new reason: on 11-19 `machine.VM` writes every checkpoint in mapped-ram (`FormatMappedRAM`), and on 11-20 multifd channels on it took the restore under 100 ms (#320). A restore with more RAM is still unmeasured (#242's checklist). + +### 2.6 Fingerprint: what it hashes (rewritten ~8 times) +1. Binaries plus shape (09-07). +2. Plus device topology, `b476f6d`. +3. Topology corrected to exclude disks and NICs, `b882171`. +4. NIC count and MTU back in, `6599829`/`2b46d78`. +5. Root ports, then virtio-scsi, in. +6. Firmware by content in, `f2f4da0`. +7. Templates removed, `a9d6083`. +8. One hash, `c5baaa7`. +9. **Contract, not binaries**, `fa3041c` (10-13), after the QEMU 11.1.2 bump stranded every checkpoint (`f0ec1e0`). +10. **No hash at all** (11-21): a record read from the running QEMU, compared part by part (`QEMU.Target`, `CanResume`). + +Each step moved every fingerprint. Comments that said "a QEMU or kernel bump strands checkpoints" survived until `e452afc` (11-12). The verdict tool was blind to `machine/` changes until #98. + +**Lesson:** a prediction of the machine has to be kept honest by a test of its own (boot:roms) and still cannot say what differs. Since 11-21 the record is asked of QEMU, and a refusal names each difference. Check claims about which checkpoints resume against `CanResume`, boot:record and boot:compat, not against older comments. + +### 2.7 Console unit (spin-machine-console.service) +Sequence: created 09-07 (`24c8a06`); made redundant by udev 09-10 (`064c4f4`); measured 340 ms worse as a swap; TERM=dumb fixed it, 09-26 (`7b08e5a`); "viable", but the exposure question was left open; deleted 11-12 (`3a7864d`). + +**Lesson:** two months of a unit nothing enabled. Delete as soon as nothing references a unit. + +### 2.8 Debug init and diagnostic initrds +`cmd/spin-machine-init` was created 09-07 and deleted 09-10 (`8eeb01c`). Diagnostic initrds came back as `boot/probeinit` (09-29, `a81b6b5`), now allowed by CLAUDE.md as isolated diagnostics. + +**Lesson:** the rule ("no init in a release") was clarified rather than broken. AGENTS.md no longer carries that rule. Its "Experiments" section keeps diagnostic initrds apart from release outputs. + +### 2.9 Probes added then deleted (short-lived) +- `boot:matrix` (09-10 → 09-10) +- `kernel/minimal` + `boot:floor` (09-26 → 09-30) +- `boot:kernel-pages` (09-30 → 09-30) +- `boot:memory-unplug` (09-30 → 09-30) +- cache bench (09-11 → 09-30) +- `boot:restore` (09-28 → 09-30) +- `boot:unitload` (09-26 → 10-01) +- `boot:memory-policy` (09-28 → 10-01) +- page-cache sub-probes (09-30 → 10-01) +- bench rows (09-10 … → 10-01) +- console-swap variants (09-26 → 09-30) +- `boot:exits`, `boot:mmio`, `boot:jobs` (11-12 → 11-13, #249) +- `boot:bench`, `boot:trace`, `boot:userspace`, `boot:systemd`, `boot:ssh-load` (→ 11-13, #250) + +This is the cycle AGENTS.md asks for ("Remove an experiment once its question is answered"). The cost is that the answers live only in commit messages and comments. + +**Lesson:** this log, or `docs/memory-and-disk.md`-style records, is where an answered probe's result should land. Before writing a probe, check docs/boot-time.md's "Measured and rejected" and the row comments in `internal/lab/sshfirst.go`. + +### 2.10 /tmp and tmpfiles; erofs; BPF_LSM; chrony +- **/tmp:** masked by the imported optimizer; unmasked 09-26 (`f36ae13`, noise); capped at a quarter 09-28. +- **erofs:** removed from the kernel 09-26 (`5a3d509`); the build assertion relaxed 09-30 (#66) for the pmem/DAX experiment, which was rejected (#63, #65). +- **BPF_LSM:** off 09-07 ("a boundary inside the boundary"); on 10-01 (`1400f6a`), and the stale note was fixed 10-05 (`ebe2a6e`). +- **chrony:** added 09-07, removed 09-10. + +**Lesson:** the imported scripts carried decisions without numbers. Each has been re-decided one at a time. + +### 2.11 CI cache and runners (rebuilt ~5 times) +- gha cache that stored nothing (`c767cd5`, 09-15); +- Blacksmith (09-20); +- the builder's silent fallback (`aa157cf`/`1ef95d1`, 09-26); +- export from main only (`bdec6cc`); +- GitHub runners for builds plus the bench/kvm fleets (10-24); +- the gha cache unreadable on the fleet, so a registry cache (`1666cb5`, 11-12). + +Also the reusable builder, added and reverted on 10-13. + +**Lesson:** each move was taken without checking that the cache was actually hit. A cache-hit assertion would have caught `c767cd5` and `1666cb5` on day one. + +### 2.12 apk locks broke three times +`6e7ba47` (11-03), `8d495c5` (11-09), release run 43157106109 / `ec2c7fb` (11-12); fixed by a daily refresh (`c6c29b5`), which then compiled QEMU cold twice every move. It was fixed structurally on 11-20 by pinning builder images instead of packages. + +**Lesson:** a mirror that serves only the newest build cannot be pinned. Pin something that keeps its contents, such as an image, and move it when the move is wanted. diff --git a/docs/machine.md b/docs/machine.md index da6c4e64..03650fb3 100644 --- a/docs/machine.md +++ b/docs/machine.md @@ -504,7 +504,7 @@ guest's wall clock 1.001 s further behind the host's, while the process's lines apart on both clocks and the host saw a 1.10 s gap between them on the console. A resumed guest starts on its checkpoint's clock: 48 ms after a resume it read 6.34 s behind, the time since the checkpoint's stop, and 5 s later it read the same. Nothing in the machine steps it, by the decision -that took chrony out (docs/log.md, 09-10): whoever restores corrects the clock. spin's supervisor +that took chrony out (docs/log/2026-09-10-6aba37b-064c4f4-c7bab94-c7af4d3-08c56e1.md): whoever restores corrects the clock. spin's supervisor steps it when it registers again after a restore. Nothing steps it after a snapshot continued in place (spin-stack/spin#1498). diff --git a/docs/measuring.md b/docs/measuring.md index 1e247c93..86a197d6 100644 --- a/docs/measuring.md +++ b/docs/measuring.md @@ -9,16 +9,17 @@ stand, where their time goes, and what was kept, rejected and is open are in 1. Find the phase in `docs/boot-time.md`, "Where the time goes". 2. Look the idea up in "Measured and rejected" and in "What the machine carries". An idea already there needs a new reason, not a new run. -3. Write its row in "Open experiments" first: the phase, its p50, the ceiling, the rule that - decides it. +3. Write its record in "Open experiments" first (`docs/experiments`, `"decision": "open"`): the + phase, its p50, the ceiling, the rule that decides it. 4. Measure it with the rules below. The commands are in `docs/cli.md`, "Measuring". -5. When it is decided, move the row: to "What the machine carries" when it is kept, or to - "Measured and rejected" when it is not. Then write its entry, dated and with its run, in `docs/log.md`. +5. When it is decided, move the record: its `decision` becomes `carried` ("What the machine + carries") when it is kept, or `rejected` ("Measured and rejected") when it is not. Then write + its entry, dated and with its run, as a file of its own in `docs/log` (AGENTS.md says how). ## Follow the rules of a measurement -1. **Write the budget entry first.** Before an experiment runs, write its row in "Open - experiments". Name the phase it attacks in `docs/boot-time.md`'s budget tables, the phase's p50 today, its +1. **Write the budget entry first.** Before an experiment runs, write its record in "Open + experiments" (`docs/experiments`). Name the phase it attacks in `docs/boot-time.md`'s budget tables, the phase's p50 today, its ceiling (what the goal number gains if the phase cost nothing), and the result that would decide it. An experiment whose ceiling is under the noise needs more boots before it needs a run. @@ -84,7 +85,7 @@ shape and login, v20261123.01, 40 a side, lab 45095349849, measured 2026-11-23). asked. The probes that save are `restore-first`, `prestart`, `restore-together`, `run-delay` and `transport`. `lab compat`'s checkpoint boots a shell as PID 1, with no systemd to finish. A restore measured before this rule saved at the login, so its numbers do not compare with one -measured after (docs/log.md, 11-23). +measured after (docs/log/2026-11-23-a-probe-saves-once-the-guests-boot-has.md). ## Boot charts diff --git a/docs/memory-and-disk.md b/docs/memory-and-disk.md index 5fc1efda..1866df8e 100644 --- a/docs/memory-and-disk.md +++ b/docs/memory-and-disk.md @@ -35,7 +35,7 @@ one restore alone to the first login 99.6 → 99.5 ms, Δ −0.1 [−2.0, +1.6]; disk 283 → 239, Δ −44.1 [−53.2, −35.2]; eight from the page cache 268 → 193, Δ −74.9 [−83.2, −64.9]. spin restores workspaces concurrently and does not set the policy, so the host's setup must set it (`echo defer > /sys/kernel/mm/transparent_hugepage/defrag` at boot, or a tmpfiles.d -`w` line). `docs/log.md`, 11-21, has the run. +`w` line). `docs/log/2026-11-21-where-a-burst-of-restores-waits.md` has the run. ## The host's copy of the guest's disk diff --git a/docs/releasing.md b/docs/releasing.md index 0fe2c1bb..cda88037 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -179,7 +179,7 @@ withdrawn one stays a release that a host may already run and hold checkpoints o restore to the first login, against the release before it in the same run (report.yml), with a Δp50 whose 95% interval is wholly above 0: slower, beyond noise. A failed functional check counts too: `boot:logind` or `boot:workspace` in release.yml's `pause` job, or compat. Compat runs before a -release is built, so a release that fails it is never published. A cost that docs/log.md records +release is built, so a release that fails it is never published. A cost that the log (docs/log) records as accepted is no regression: a correctness change, as #505 was for v20261122.04's +6.8 [+0.1, +13.6]. With 20 boots a side and a 95% interval, about 1 in 40 flags of each number is noise. Detection flags, and a person decides. diff --git a/gates/docs_test.go b/gates/docs_test.go new file mode 100644 index 00000000..b73aad2a --- /dev/null +++ b/gates/docs_test.go @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: Apache-2.0 + +package gates_test + +import ( + "path/filepath" + "testing" + + "github.com/spin-stack/machine/internal/docsrec" +) + +// Every log entry and experiment record parses, with its required fields, a decision and section +// that exist, valid dates, and the issues, pull requests and runs its text cites (AGENTS.md, +// "Experiments"). The pages they make are rendered, never committed (#709), so this is where a +// broken file is found, not on the site after a merge. +func TestEveryLogEntryAndExperimentRecordParses(t *testing.T) { + l, err := docsrec.ReadLog(filepath.Join(root, docsrec.LogDir)) + if err != nil { + t.Fatal(err) + } + if len(l.Entries) < 200 { + t.Fatalf("the log read %d entries: the check reads almost nothing", len(l.Entries)) + } + records, err := docsrec.ReadRecords(filepath.Join(root, docsrec.ExperimentsDir)) + if err != nil { + t.Fatal(err) + } + if len(records) < 150 { + t.Fatalf("the experiments read %d records: the check reads almost nothing", len(records)) + } +} diff --git a/internal/docsrec/docsrec.go b/internal/docsrec/docsrec.go index bc69584f..e7328021 100644 --- a/internal/docsrec/docsrec.go +++ b/internal/docsrec/docsrec.go @@ -50,7 +50,7 @@ func checkRefs(text string, issues, prs, runs []int) error { return fmt.Errorf("issues and prs: #%d is listed but the text does not cite it", n) } } - for _, id := range runID.FindAllString(text, -1) { + for _, id := range runID.FindAllString(text, -1) { // mutate-exempt: any negative count finds every match n, _ := strconv.Atoi(id) if !slices.Contains(runs, n) { return fmt.Errorf("runs: the text cites run %s, which runs does not list", id) diff --git a/internal/docsrec/docsrec_test.go b/internal/docsrec/docsrec_test.go new file mode 100644 index 00000000..e6a28456 --- /dev/null +++ b/internal/docsrec/docsrec_test.go @@ -0,0 +1,203 @@ +// SPDX-License-Identifier: Apache-2.0 + +package docsrec + +import ( + "os" + "path/filepath" + "strings" + "testing" + "time" +) + +func TestTheLogIsItsHeadEntriesByDateUnderTheirWeeksAndRework(t *testing.T) { + l, err := ReadLog("testdata/log") + if err != nil { + t.Fatal(err) + } + want := `# Log + +The head. + +### Week 10: 2026-11-09 to 11-13 + +**11-13 · kernel · the last of week ten (#5, lab 45000000001).** One paragraph. + +And another, with a list: +- one; +- two. + +### Week 11: 2026-11-14 to 11-20 + +**11-14/15 · image/lab · spans two days (#7).** +- its prose starts on the line after the head. + +**11-14 · lab · also twenty.** Its order is the next's, and its file name comes first. + +**11-14 · lab · second of the day.** It follows the first, whatever its name. + +## 2. Rework cycles + +The narrative. +` + if got := l.Markdown(); got != want { + t.Errorf("the log:\n%s\nwant:\n%s", got, want) + } +} + +func TestWeeks(t *testing.T) { + for day, want := range map[string]string{ + "2026-09-07": "### Week 1: 2026-09-07 to 09-13", + "2026-09-13": "### Week 1: 2026-09-07 to 09-13", + "2026-09-30": "### Week 4: 2026-09-28 to 10-04", + "2026-11-09": "### Week 10: 2026-11-09 to 11-13", + "2026-11-13": "### Week 10: 2026-11-09 to 11-13", + "2026-11-20": "### Week 11: 2026-11-14 to 11-20", + "2026-11-21": "### Week 12: 2026-11-21 to 11-27", + "2026-12-31": "### Week 17: 2026-12-26 to 2027-01-01", + } { + d, err := time.Parse(dateLayout, day) + if err != nil { + t.Fatal(err) + } + if got := weekHeading(d); got != want { + t.Errorf("%s: %q, want %q", day, got, want) + } + } +} + +func TestAnEntryIsRefusedNamingItsFileAndField(t *testing.T) { + entry := func(front, body string) string { return "---\n" + front + "---\n" + body + "\n" } + good := "date: \"2026-11-14\"\norder: 1\narea: lab\ntitle: a title (#7, lab 45000000001)\nprs: [7]\nruns: [45000000001]\n" + if _, err := ParseEntry("2026-11-14-a-title.md", []byte(entry(good, "Prose."))); err != nil { + t.Fatalf("a good entry: %v", err) + } + for _, c := range []struct{ name, data, want string }{ + {"2026-11-14-a.md", "date: 2026-11-14\n", "does not open with front matter"}, + {"2026-11-14-a.md", "---\ndate: \"2026-11-14\"\n", "not closed"}, + {"2026-11-14-a.md", entry("date: \"2026-11-14\"\nwhen: today\n", "Prose."), "field when not found"}, + {"2026-11-14-a.md", entry(strings.Replace(good, "2026-11-14", "2026-11-31", 1), "Prose."), `date "2026-11-31" is not YYYY-MM-DD`}, + {"2026-11-15-a.md", entry(good, "Prose."), "not named 2026-11-14-.md"}, + {"2026-11-14-A_b.md", entry(good, "Prose."), "not named 2026-11-14-.md"}, + {"2026-11-14-a.md", entry(good+"days: 11-15/16\n", "Prose."), `days "11-15/16" does not start with the date's 11-14/`}, + {"2026-11-14-a.md", entry(strings.Replace(good, "order: 1", "order: 0", 1), "Prose."), "order: required"}, + {"2026-11-14-a.md", entry(strings.Replace(good, "area: lab", "area: \"\"", 1), "Prose."), "area: required"}, + {"2026-11-14-a.md", entry(good, " "), "the prose: required"}, + {"2026-11-14-a.md", entry(good+"issues: [8]\n", "Prose."), "#8 is listed but the text does not cite it"}, + {"2026-11-14-a.md", entry(good, "Prose, lab 45000000002."), "cites run 45000000002, which runs does not list"}, + {"2026-11-14-a.md", entry(strings.Replace(good, "runs: [45000000001]", "runs: [45000000001, 45000000003]", 1), "Prose."), "45000000003 is listed but the text does not cite it"}, + {"2026-11-14-a.md", entry(strings.Replace(good, "runs: [45000000001]", "runs: [lab]", 1), "Prose."), "front matter"}, + } { + _, err := ParseEntry(c.name, []byte(c.data)) + if err == nil || !strings.Contains(err.Error(), c.want) || !strings.HasPrefix(err.Error(), c.name+": ") { + t.Errorf("%s %q: %v, want %s: ...%s...", c.name, c.data, err, c.name, c.want) + } + } +} + +func TestTheLogRefusesAFileThatIsNotAnEntry(t *testing.T) { + dir := t.TempDir() + put := func(name, body string) { + if err := os.WriteFile(filepath.Join(dir, name), []byte(body), 0o644); err != nil { + t.Fatal(err) + } + } + put(logHead, "# Log\n") + if _, err := ReadLog(dir); err == nil || !strings.Contains(err.Error(), "needs README.md and rework.md") { + t.Errorf("a log without rework.md: %v", err) + } + put(logRework, "## 2.\n") + put("notes.txt", "a note") + if _, err := ReadLog(dir); err == nil || !strings.Contains(err.Error(), "notes.txt: does not open with front matter") { + t.Errorf("a log with notes.txt: %v", err) + } + if _, err := ReadLog(filepath.Join(dir, "none")); err == nil { + t.Error("a log that is not there was read") + } +} + +func TestTheTablesAreTheRecordsInOrder(t *testing.T) { + records, err := ReadRecords("testdata/experiments") + if err != nil { + t.Fatal(err) + } + got := TablesMarkdown(records) + for _, want := range []string{ + "# Experiments\n", + "\n## What the machine carries\n\n| Item | Where | Earns (Δp50 of taking it back) | Evidence | Run |\n|---|---|---|---|---|\n" + + "| Kernel patch 0001 (#5) | kernel/patches | cold −7.0 [−9.0, −5.0] | measured | lab 45000000001 |\n", + "\n## Measured and rejected\n\n### Kernel and its command line\n\n| Idea | Result | Shape | Source | Date |\n|---|---|---|---|---|\n" + + "| An earlier idea (#7) | 154 µs | runner | `c03ed89` | 09-10 |\n| A later idea | nothing | spin | the same | 11-20 |\n\n### Firmware, QEMU and the machine\n", + "\n### Memory and the host\n\n| Idea | Result | Shape | Source | Date |\n|---|---|---|---|---|\n\n## Open experiments\n", + "| An open experiment | cold | ~15 ms | `ssh-first`, 40 a side | open |\n", + } { + if !strings.Contains(got, want) { + t.Errorf("the tables do not hold\n%s\nin\n%s", want, got) + } + } + if strings.Count(got, "## Measured and rejected") != 1 { + t.Errorf("one heading over the rejected tables:\n%s", got) + } +} + +func TestARecordIsRefusedNamingItsFileAndField(t *testing.T) { + good := `{"decision": "rejected", "section": "kernel", "order": 1, "date": "2026-09-10", "change": "An idea (#7, lab 45000000001)", "result": "nothing", "shape": "spin", "source": "the same", "issues": [7], "runs": [45000000001]}` + if _, err := ParseRecord("7-an-idea.json", []byte(good)); err != nil { + t.Fatalf("a good record: %v", err) + } + edit := func(old, new string) string { return strings.Replace(good, old, new, 1) } + for _, c := range []struct{ name, data, want string }{ + {"a.json", `{"decision": "rejected",}`, "invalid character"}, + {"a.json", edit(`"order"`, `"rank": 1, "order"`), `unknown field "rank"`}, + {"An_idea.json", good, "not named [-].json"}, + {"a.yaml", good, "not named [-].json"}, + {"a.json", edit(`"rejected"`, `"kept"`), `decision "kept" is not carried, rejected or open`}, + {"a.json", edit(`"kernel"`, `"network"`), `section "network" is not kernel`}, + {"a.json", edit(`"decision": "rejected"`, `"decision": "open"`), "section: a open record has none"}, + {"a.json", edit(`"order": 1`, `"order": 0`), "order: required"}, + {"a.json", edit(`"2026-09-10"`, `"09-10"`), `date "09-10" is not YYYY-MM-DD`}, + {"a.json", edit(`"shape": "spin"`, `"shape": " "`), `shape: required, the table's "Shape"`}, + {"a.json", edit(`"date": "2026-09-10", `, ""), `date: required, the table's "Date"`}, + {"a.json", edit(`"result": "nothing"`, `"result": "two\nlines"`), "result: a cell is one line"}, + {"a.json", edit(`"shape": "spin"`, `"shape": "spin", "where": "machine"`), `where: "Kernel and its command line" has no such column`}, + {"a.json", edit(`"issues": [7]`, `"issues": [7, 8]`), "#8 is listed but the text does not cite it"}, + {"a.json", edit(`"source": "the same"`, `"source": "lab 45000000002"`), "cites run 45000000002"}, + {"a.json", edit(`"runs": [45000000001]`, `"runs": ["45000000001"]`), "cannot unmarshal string"}, + } { + _, err := ParseRecord(c.name, []byte(c.data)) + if err == nil || !strings.Contains(err.Error(), c.want) || !strings.HasPrefix(err.Error(), c.name+": ") { + t.Errorf("%s %s: %v, want %s: ...%s...", c.name, c.data, err, c.name, c.want) + } + } +} + +func TestTheExperimentsRefuseARecordThatDoesNotParse(t *testing.T) { + dir := t.TempDir() + if err := os.WriteFile(filepath.Join(dir, "a.json"), []byte(`{"decision": "kept"}`), 0o644); err != nil { + t.Fatal(err) + } + if _, err := ReadRecords(dir); err == nil || !strings.Contains(err.Error(), "a.json: decision") { + t.Errorf("a directory with a bad record: %v", err) + } + if _, err := ReadRecords(filepath.Join(dir, "none")); err == nil { + t.Error("experiments that are not there were read") + } +} + +func TestAPageIsTheMarkdownAsHTML(t *testing.T) { + got, err := HTML("Experiments", "# Experiments\n\n| a | b |\n|---|---|\n| `xExperiments - spin-machine", + `

Experiments

`, + "", + "", + `Log`, + } { + if !strings.Contains(got, want) { + t.Errorf("the page has no %q:\n%s", want, got) + } + } +} diff --git a/internal/docsrec/log.go b/internal/docsrec/log.go index d8b49ac1..a5463f50 100644 --- a/internal/docsrec/log.go +++ b/internal/docsrec/log.go @@ -45,8 +45,6 @@ type Entry struct { // Body is the prose after the head: on the head's line, or from the next when it starts with a // newline. Body string `yaml:"-"` - // File is the entry's file name. - File string `yaml:"-"` day time.Time } @@ -93,7 +91,6 @@ func parseEntry(name string, data []byte) (Entry, error) { if err := dec.Decode(&e); err != nil { return Entry{}, fmt.Errorf("front matter: %w", err) } - e.File = name e.Body = strings.TrimRight(string(body), " \n") day, err := parseDate(e.Date) if err != nil { @@ -159,8 +156,9 @@ func ReadLog(dir string) (Log, error) { if l.Head == "" || l.Rework == "" { return Log{}, fmt.Errorf("reading the log: %s needs %s and %s", dir, logHead, logRework) } - slices.SortFunc(l.Entries, func(a, b Entry) int { - return cmp.Or(a.day.Compare(b.day), cmp.Compare(a.Order, b.Order), strings.Compare(a.File, b.File)) + // Stable: the directory is read in file-name order, which breaks a tie. + slices.SortStableFunc(l.Entries, func(a, b Entry) int { + return cmp.Or(a.day.Compare(b.day), cmp.Compare(a.Order, b.Order)) }) return l, nil } @@ -184,7 +182,7 @@ func week(day time.Time) (n int, first, last time.Time) { } return k + 1, first, last } - before := (days(firstWeek, weeksMove) + 6) / 7 + before, _, _ := week(weeksMove.AddDate(0, 0, -1)) // mutate-exempt: any day of the last week before the move has its number k := days(weeksMove, day) / 7 first = weeksMove.AddDate(0, 0, 7*k) return before + 1 + k, first, first.AddDate(0, 0, 6) diff --git a/internal/docsrec/split.go b/internal/docsrec/split.go deleted file mode 100644 index 3c64fa07..00000000 --- a/internal/docsrec/split.go +++ /dev/null @@ -1,238 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 - -package docsrec - -import ( - "bytes" - "encoding/json" - "errors" - "fmt" - "regexp" - "slices" - "strconv" - "strings" - "time" - - "go.yaml.in/yaml/v3" -) - -// Kinds says whether each number of this repository is an issue or a pull request. -type Kinds map[int]string - -// localRef is a #N of this repository: not owner/repo#N, and not after the name of another -// project, as in "go-tools #131" or "upstream #42858". -var localRef = regexp.MustCompile(`(?:^|([A-Za-z-]+) |[^\w/#\s])#(\d+)\b`) - -var otherProjects = []string{"upstream", "go-tools", "spin", "Firecracker", "linux-loader"} - -// refs are the issues, pull requests and runs text cites. -func (k Kinds) refs(text string) (issues, prs, runs []int) { - for _, m := range localRef.FindAllStringSubmatch(text, -1) { - if slices.Contains(otherProjects, m[1]) { - continue - } - n, _ := strconv.Atoi(m[2]) - switch k[n] { - case "issue": - issues = append(issues, n) - case "pr": - prs = append(prs, n) - } - } - for _, id := range runID.FindAllString(text, -1) { - n, _ := strconv.Atoi(id) - runs = append(runs, n) - } - for _, s := range []*[]int{&issues, &prs, &runs} { - slices.Sort(*s) - *s = slices.Compact(*s) - } - return issues, prs, runs -} - -// first is the first issue or pull request text cites, or 0. -func (k Kinds) first(text string) int { - for _, m := range localRef.FindAllStringSubmatch(text, -1) { - n, _ := strconv.Atoi(m[2]) - if !slices.Contains(otherProjects, m[1]) && k[n] != "" { - return n - } - } - return 0 -} - -var ( - parenthetical = regexp.MustCompile(`\([^()]*\)`) - notSlug = regexp.MustCompile(`[^a-z0-9]+`) -) - -// slugOf is a file name's slug for text: its first words outside parentheses. -func slugOf(text string, words int) string { - text = strings.NewReplacer("'", "", "’", "").Replace(text) - s := strings.ToLower(parenthetical.ReplaceAllString(text, "")) - if strings.Trim(notSlug.ReplaceAllString(s, ""), "-") == "" { - s = strings.ToLower(text) - } - parts := strings.Split(strings.Trim(notSlug.ReplaceAllString(s, "-"), "-"), "-") - if len(parts) > words { - parts = parts[:words] - } - return strings.Join(parts, "-") -} - -// unique makes name unique among taken by a numbered suffix. -func unique(taken map[string]bool, name, ext string) string { - n := name + ext - for i := 2; taken[n]; i++ { - n = fmt.Sprintf("%s-%d%s", name, i, ext) - } - taken[n] = true - return n -} - -var ( - entryHead = regexp.MustCompile(`^\*\*(\d\d)-(\d\d)(/[\d-]+)? · (.+?) · (.+?)\.\*\*( .*)?$`) - weekLine = regexp.MustCompile(`^### Week \d+: (\d{4})-(\d\d)-`) -) - -// Split turns docs/log.md and the tables of docs/boot-time.md into the files that replace them, -// keyed by their paths in the repository. It is the migration of spin-stack/machine#709, run once. -// -// The log's entries carry their month and day only. Each takes its year from the week heading it -// is under, which names it, a year later when its month comes before the heading's. -func Split(log, bootTime string, k Kinds) (map[string][]byte, error) { - files := map[string][]byte{} - if err := k.splitLog(log, files); err != nil { - return nil, err - } - if err := k.splitTables(bootTime, files); err != nil { - return nil, err - } - return files, nil -} - -func (k Kinds) splitLog(log string, files map[string][]byte) error { - lines := strings.Split(log, "\n") - s1 := slices.Index(lines, "## 1. Chronological log") - s2 := slices.Index(lines, "## 2. Rework cycles") - if s1 < 0 || s2 < s1 { - return errors.New("docs/log.md: no sections 1 and 2") - } - files[LogDir+"/"+logHead] = []byte(strings.Join(lines[:s1+3], "\n") + "\n") - files[LogDir+"/"+logRework] = []byte(strings.Join(lines[s2:], "\n")) - - type raw struct { - e Entry - lines []string - } - var entries []*raw - var year int - var month time.Month - for i, l := range lines[s1+3 : s2] { - if m := weekLine.FindStringSubmatch(l); m != nil { - year, _ = strconv.Atoi(m[1]) - mo, _ := strconv.Atoi(m[2]) - month = time.Month(mo) - continue - } - m := entryHead.FindStringSubmatch(l) - if m == nil { - if len(entries) > 0 { - entries[len(entries)-1].lines = append(entries[len(entries)-1].lines, l) - } else if strings.TrimSpace(l) != "" { - return fmt.Errorf("docs/log.md:%d: text before the first entry", s1+4+i) - } - continue - } - mo, _ := strconv.Atoi(m[1]) - day, _ := strconv.Atoi(m[2]) - y := year - if time.Month(mo) < month { - y++ - } - e := Entry{ - Date: time.Date(y, time.Month(mo), day, 0, 0, 0, 0, time.UTC).Format(dateLayout), - Area: m[4], - Title: m[5], - } - if m[3] != "" { - e.Days = m[1] + "-" + m[2] + m[3] - } - first := strings.TrimPrefix(m[6], " ") - entries = append(entries, &raw{e: e, lines: []string{first}}) - } - taken := map[string]bool{} - orders := map[string]int{} - for _, r := range entries { - e := r.e - e.Body = strings.TrimRight(strings.Join(r.lines, "\n"), " \n") - orders[e.Date] += 10 - e.Order = orders[e.Date] - e.Issues, e.PRs, e.Runs = k.refs(e.Title + "\n" + e.Body) - var front bytes.Buffer - enc := yaml.NewEncoder(&front) - enc.SetIndent(2) - if err := enc.Encode(e); err != nil { - return fmt.Errorf("writing the entry %s %s: %w", e.Date, e.Title, err) - } - name := unique(taken, e.Date+"-"+slugOf(e.Title, 8), ".md") - files[LogDir+"/"+name] = []byte("---\n" + front.String() + "---\n" + e.Body + "\n") - } - return nil -} - -func (k Kinds) splitTables(bootTime string, files map[string][]byte) error { - lines := strings.Split(bootTime, "\n") - taken := map[string]bool{} - for _, t := range Tables { - at := slices.Index(lines, strings.Repeat("#", t.Level)+" "+t.Heading) - if at < 0 { - return fmt.Errorf("docs/boot-time.md: no heading %q", t.Heading) - } - header := strings.SplitN(t.Markdown(nil), "\n", 2)[0] - for at < len(lines) && lines[at] != header { - at++ - } - if at == len(lines) { - return fmt.Errorf("docs/boot-time.md: %q has no table", t.Heading) - } - for i, l := range lines[at+2:] { - if !strings.HasPrefix(l, "|") { - break - } - cells := strings.Split(strings.TrimSuffix(strings.TrimPrefix(l, "| "), " |"), " | ") - if len(cells) != len(t.columns) { - return fmt.Errorf("docs/boot-time.md:%d: %d cells, %q has %d columns", at+3+i, len(cells), t.Heading, len(t.columns)) - } - byField := map[string]string{} - for j, c := range t.columns { - byField[c.field] = cells[j] - } - r := Record{ - Decision: t.Decision, Section: t.Section, Order: 10 * (i + 1), - Change: byField["change"], Where: byField["where"], Result: byField["result"], - Evidence: byField["evidence"], Shape: byField["shape"], Source: byField["source"], - Number: byField["number"], Phase: byField["phase"], DecidedBy: byField["decided_by"], - State: byField["state"], - } - if d := byField["date"]; d != "" { - // The tables began with the repository on 2026-09-07 and have not seen a new year. - r.Date = "2026-" + d - } - r.Issues, r.PRs, r.Runs = k.refs(l) - name := slugOf(r.Change, 6) - if n := k.first(r.Change); n > 0 { - name = strconv.Itoa(n) + "-" + name - } - var data bytes.Buffer - enc := json.NewEncoder(&data) - enc.SetEscapeHTML(false) - enc.SetIndent("", " ") - if err := enc.Encode(r); err != nil { - return fmt.Errorf("writing the record %q: %w", r.Change, err) - } - files[ExperimentsDir+"/"+unique(taken, name, ".json")] = data.Bytes() - } - } - return nil -} diff --git a/internal/docsrec/split_test.go b/internal/docsrec/split_test.go deleted file mode 100644 index 7fbd0265..00000000 --- a/internal/docsrec/split_test.go +++ /dev/null @@ -1,91 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 - -package docsrec - -import ( - "os" - "path/filepath" - "strconv" - "strings" - "testing" -) - -// TestSplitGivesTheTextBack is the migration's proof: the files Split makes from docs/log.md and -// docs/boot-time.md, as they stood before it, render the log and every table byte for byte. -func TestSplitGivesTheTextBack(t *testing.T) { - read := func(name string) string { - data, err := os.ReadFile(filepath.Join("testdata/split", name)) - if err != nil { - t.Fatal(err) - } - return string(data) - } - kinds := Kinds{} - lines := strings.Split(strings.TrimSpace(read("kinds.txt")), "\n") - for _, l := range lines { - n, kind, _ := strings.Cut(l, " ") - i, err := strconv.Atoi(n) - if err != nil { - t.Fatalf("kinds.txt: %q", l) - } - kinds[i] = kind - } - log, bootTime := read("log.md"), read("boot-time.md") - files, err := Split(log, bootTime, kinds) - if err != nil { - t.Fatal(err) - } - root := t.TempDir() - for name, data := range files { - p := filepath.Join(root, name) - if err := os.MkdirAll(filepath.Dir(p), 0o755); err != nil { - t.Fatal(err) - } - if err := os.WriteFile(p, data, 0o644); err != nil { - t.Fatal(err) - } - } - l, err := ReadLog(filepath.Join(root, LogDir)) - if err != nil { - t.Fatal(err) - } - if got := l.Markdown(); got != log { - diff(t, "docs/log.md", log, got) - } - n := 0 - for _, line := range strings.Split(log, "\n") { - if entryHead.MatchString(line) { - n++ - } - } - if len(l.Entries) != n { - t.Errorf("%d entries from a log with %d heads", len(l.Entries), n) - } - records, err := ReadRecords(filepath.Join(root, ExperimentsDir)) - if err != nil { - t.Fatal(err) - } - for _, tb := range Tables { - got := tb.Markdown(records) - header := strings.SplitN(got, "\n", 2)[0] + "\n" - at := strings.Index(bootTime, "#"+" "+tb.Heading+"\n") - start := at + strings.Index(bootTime[at:], header) - end := start + strings.Index(bootTime[start:], "\n\n") + 1 - if want := bootTime[start:end]; got != want { - diff(t, tb.Heading, want, got) - } - } - t.Logf("%d entries, %d records", len(l.Entries), len(records)) -} - -func diff(t *testing.T, what, want, got string) { - t.Helper() - w, g := strings.Split(want, "\n"), strings.Split(got, "\n") - for i := range min(len(w), len(g)) { - if w[i] != g[i] { - t.Errorf("%s: line %d differs:\nwant %q\ngot %q", what, i+1, w[i], g[i]) - return - } - } - t.Errorf("%s: %d lines, want %d", what, len(g), len(w)) -} diff --git a/internal/docsrec/tables.go b/internal/docsrec/tables.go index cc3fed5b..9f0d0cc0 100644 --- a/internal/docsrec/tables.go +++ b/internal/docsrec/tables.go @@ -44,9 +44,6 @@ type Record struct { Issues []int `json:"issues,omitempty"` PRs []int `json:"prs,omitempty"` Runs []int `json:"runs,omitempty"` - - // File is the record's file name. - File string `json:"-"` } // cells is each text field by its JSON name. Date's cell is its month and day, as the tables have @@ -136,7 +133,6 @@ func parseRecord(name string, data []byte) (Record, error) { if err := dec.Decode(&r); err != nil { return Record{}, err } - r.File = name if base, ok := strings.CutSuffix(name, ".json"); !ok || !slug.MatchString(base) { return Record{}, errors.New("the file is not named [-].json, a slug of a-z, 0-9 and -") } @@ -196,9 +192,8 @@ func ReadRecords(dir string) ([]Record, error) { } records = append(records, r) } - slices.SortFunc(records, func(a, b Record) int { - return cmp.Or(cmp.Compare(a.Order, b.Order), strings.Compare(a.File, b.File)) - }) + // Stable: the directory is read in file-name order, which breaks a tie. + slices.SortStableFunc(records, func(a, b Record) int { return cmp.Compare(a.Order, b.Order) }) return records, nil } diff --git a/internal/docsrec/testdata/experiments/7-rejected-earlier.json b/internal/docsrec/testdata/experiments/7-rejected-earlier.json new file mode 100644 index 00000000..63c02e7c --- /dev/null +++ b/internal/docsrec/testdata/experiments/7-rejected-earlier.json @@ -0,0 +1,11 @@ +{ + "decision": "rejected", + "section": "kernel", + "order": 10, + "date": "2026-09-10", + "change": "An earlier idea (#7)", + "result": "154 µs", + "shape": "runner", + "source": "`c03ed89`", + "prs": [7] +} diff --git a/internal/docsrec/testdata/experiments/carried-one.json b/internal/docsrec/testdata/experiments/carried-one.json new file mode 100644 index 00000000..1bfe949f --- /dev/null +++ b/internal/docsrec/testdata/experiments/carried-one.json @@ -0,0 +1,11 @@ +{ + "decision": "carried", + "order": 10, + "change": "Kernel patch 0001 (#5)", + "where": "kernel/patches", + "result": "cold −7.0 [−9.0, −5.0]", + "evidence": "measured", + "source": "lab 45000000001", + "issues": [5], + "runs": [45000000001] +} diff --git a/internal/docsrec/testdata/experiments/open-one.json b/internal/docsrec/testdata/experiments/open-one.json new file mode 100644 index 00000000..7ad415a9 --- /dev/null +++ b/internal/docsrec/testdata/experiments/open-one.json @@ -0,0 +1,9 @@ +{ + "decision": "open", + "order": 10, + "change": "An open experiment", + "number": "cold", + "phase": "~15 ms", + "decided_by": "`ssh-first`, 40 a side", + "state": "open" +} diff --git a/internal/docsrec/testdata/experiments/rejected-later.json b/internal/docsrec/testdata/experiments/rejected-later.json new file mode 100644 index 00000000..7ee954b8 --- /dev/null +++ b/internal/docsrec/testdata/experiments/rejected-later.json @@ -0,0 +1,10 @@ +{ + "decision": "rejected", + "section": "kernel", + "order": 20, + "date": "2026-11-20", + "change": "A later idea", + "result": "nothing", + "shape": "spin", + "source": "the same" +} diff --git a/internal/docsrec/testdata/log/2026-11-13-the-last-of-week-ten.md b/internal/docsrec/testdata/log/2026-11-13-the-last-of-week-ten.md new file mode 100644 index 00000000..c44cd90d --- /dev/null +++ b/internal/docsrec/testdata/log/2026-11-13-the-last-of-week-ten.md @@ -0,0 +1,13 @@ +--- +date: "2026-11-13" +order: 10 +area: kernel +title: the last of week ten (#5, lab 45000000001) +issues: [5] +runs: [45000000001] +--- +One paragraph. + +And another, with a list: +- one; +- two. diff --git a/internal/docsrec/testdata/log/2026-11-14-also-twenty.md b/internal/docsrec/testdata/log/2026-11-14-also-twenty.md new file mode 100644 index 00000000..a02df9eb --- /dev/null +++ b/internal/docsrec/testdata/log/2026-11-14-also-twenty.md @@ -0,0 +1,7 @@ +--- +date: "2026-11-14" +order: 20 +area: lab +title: also twenty +--- +Its order is the next's, and its file name comes first. diff --git a/internal/docsrec/testdata/log/2026-11-14-second-of-the-day.md b/internal/docsrec/testdata/log/2026-11-14-second-of-the-day.md new file mode 100644 index 00000000..beebf45c --- /dev/null +++ b/internal/docsrec/testdata/log/2026-11-14-second-of-the-day.md @@ -0,0 +1,7 @@ +--- +date: "2026-11-14" +order: 20 +area: lab +title: second of the day +--- +It follows the first, whatever its name. diff --git a/internal/docsrec/testdata/log/2026-11-14-spans-two-days.md b/internal/docsrec/testdata/log/2026-11-14-spans-two-days.md new file mode 100644 index 00000000..16566f55 --- /dev/null +++ b/internal/docsrec/testdata/log/2026-11-14-spans-two-days.md @@ -0,0 +1,10 @@ +--- +date: "2026-11-14" +days: 11-14/15 +order: 10 +area: image/lab +title: spans two days (#7) +prs: [7] +--- + +- its prose starts on the line after the head. diff --git a/internal/docsrec/testdata/log/README.md b/internal/docsrec/testdata/log/README.md new file mode 100644 index 00000000..f8cf1eb8 --- /dev/null +++ b/internal/docsrec/testdata/log/README.md @@ -0,0 +1,3 @@ +# Log + +The head. diff --git a/internal/docsrec/testdata/log/rework.md b/internal/docsrec/testdata/log/rework.md new file mode 100644 index 00000000..8ae5c5cd --- /dev/null +++ b/internal/docsrec/testdata/log/rework.md @@ -0,0 +1,3 @@ +## 2. Rework cycles + +The narrative. diff --git a/internal/docsrec/testdata/split/boot-time.md b/internal/docsrec/testdata/split/boot-time.md deleted file mode 100644 index d3c30fb9..00000000 --- a/internal/docsrec/testdata/split/boot-time.md +++ /dev/null @@ -1,517 +0,0 @@ -# Boot time: where it stands - -This page follows the goal's two numbers (AGENTS.md, "The goal"). It says where each stands and where -its time goes. It lists what the machine carries for them and what each -item earns, what was tried and rejected, and what is open. `docs/log.md` tells each change, dated. -Each release's own numbers are in `docs/releases.md`. What the guest's memory and disk cost is in -`docs/memory-and-disk.md`. How a number is measured is [measuring.md](measuring.md), and the lab's -commands are in `docs/cli.md`, "Measuring". - -Every number here comes from the bench fleet (spin-stack/ci: AWS c8id.4xlarge, Xeon 6975P-C, -nested KVM, scratch on local NVMe) in spin's shape, as p50 or p50/p95 in ms, unless a row says -otherwise. An interval is the bootstrap 95% interval of a Δp50. - -## Where the two numbers stand - -| Number | Probe | p50/p95 | Over 100 ms | Run | -|---|---|---|---|---| -| Cold boot to the first SSH login | `ssh-first`: from before QEMU's exec to `true` run over SSH | 456/477 | +356 | report 44811347183, v20261120.04 | -| The same, QEMU started ahead | `prestart`, `prestarted boot`: from the request | 428/440 | +328 | the same | -| A checkpoint restored to the first login | `restore-first`, `evicted`: the state read from NVMe, out of the page cache | 108/111 | +8 | the same | -| The same, QEMU started ahead | `prestart`, `restored into prestarted` | 83.2/87.1 | under | the same | - -**The cold number's probe stopped adding work on 11-22 (#450).** `ssh-first` used to close the -connection that timed `accepts` and log in on a new one, and on spin's path sshd started a session -for the closed one beside the first login. It now logs in over the connection accepted. In one -run, the probe's two versions as rows of one tree: accept to login −4.3 [−5.4, −3.0], first login -−4.4 [−9.1, +0.3] (bench, spin's shape and login, v20261122.01, 40 each, lab 44987441326). A -release measured with the new probe reads ~4 ms lower without the machine having changed. - -These are the release's numbers, booted interleaved with v20261120.03 (`docs/releases.md`). Two -runs are two machines, so compare a new number only with one booted in the same run (`docs/measuring.md`, -rule 3). - -**The restore is under 100 ms when QEMU is started ahead, and the cold boot is not close.** A -cold boot cannot reach 100 ms by userspace work alone: QEMU, the firmware and the kernel take -~140 ms before PID 1 runs (budget below), ~150 once two of its clocks are corrected (#665, #666). Without systemd, sshd accepted at 189 ms in spin's shape -(lab 44750322384, 2026-11-20). Every phase before PID 1 has to shrink as well. - -### What spin runs, and what the probes boot - -The probes boot and log in as spin does, unless a run asks otherwise (docs/cli.md, "Measuring"): - -- **The shape.** spin (spin-stack/spin, `internal/runner/vmm/vmm.go`) boots 1 vCPU and 128 MiB, - with ceilings of 16 vCPUs and 8 GiB. Its hotplug controller has 16 targets, 4 of them for disks - attached while it runs and the rest for the extensions it boots with - (`internal/runner/qemu/spec.go`, `controllerTargets`, since spin's c0ffbc0 of 2026-11-20). The - probes boot 16 too. Against the 4 they booted before, 16 read within noise: first login −3.8 - [−11.1, +4.5] (lab 44847364468, 2026-11-21), so the budget's rows taken with 4 stand. -- **The memory.** spin sizes every workspace through virtio-mem right after it starts, to 2048 MiB - unless the workspace asks for more (`installconfig.MinMemoryMB`, the least and the default). The - probes plug 2048 (`plugged=2048`). A guest left at 128 MiB runs its OOM killer through every boot - (lab 44784196287). -- **The login.** spin turns off systemd's vsock sshd (`systemd.ssh_auto=0`). It reaches a - long-running `ssh.service` as root through its supervisor's forwarder to 127.0.0.1:22 - (`login=spin`). The image's own vsock lane is `login=lane`. -- **Checkpoints.** A checkpoint is mapped-ram, saved and loaded on 8 multifd channels - (`machine.DefaultChannels`). Before the RAM load, the resume reads the state ahead. -- **The host.** spin's host must set THP defrag to `defer`, and spin does not set it - (`docs/memory-and-disk.md`, "What the host must set"). The probes leave the bench host's policy - as it is, unless `restore-together` is given `defrag=`. -- **The host key.** Before it execs systemd, spin's vminitd places the workspace's host key at - `/run/spin/ssh/ssh_host_ed25519_key` with a drop-in naming it sshd's only `HostKey`, and the - image's keygen then does not run (#515). `login=spin` does the same from a shell as PID 1, a - stand-in that costs 6-8 ms of its own before systemd (docs/measuring.md, "The ledger"; #575). -- **Still not spin's.** spin boots `/sbin/vminitd` from its own initrd before systemd. Its - supervisor starts `ssh.service` when it installs the user CA. The probes boot the image's init - behind the handoff's shell. - -Most numbers taken before 2026-11-21 used another shape (2 vCPUs, 2 GiB, no ceilings, the -"ladder" shape) and another login (the lane). The "Shape" column of each row below says which. A -row marked spin from before that date passed spin's shape options by hand (#319). Read a number -in the ladder shape as a lead in spin's shape. - -### The bench fleet is nested, not metal - -On a c8i.metal-48xl (the same CPU), the cold first login read 332 ms against 378-392 nested -(v20261114.02, ladder shape, lab 44537498507), so nesting costs ~50-60 ms. Most of that is VM -exits: the PCI walk takes 5.00 ms nested against 2.22 on metal, about 29 µs an exit against 13 -(labs 44535161371, 44535156851). A production host that is not nested starts closer to the goal. - -**Both hosts make the same exits, and the nested ones cost more** (#565, the `exits` probe, -v20261122.06, labs 45082640147 and 45082640186). A cold boot to the first login makes ~10,400 -exits on either host: CPUID 3805, MMIO 3138, MSR writes 1169 (1043 of them the TSC deadline), -preemption timer 827, port I/O 667, interrupts 424, HLT 334, EPT violations 172. The nested L1 -spends 78.7 ms on them against 48.3 on metal. Removing 1541 CPUID exits moved the first login -−10.3 ms, ~6.7 µs an exit. EC2 gives the L1 EPT, VMCS shadowing and APICv, all on, so no L1 -setting is left to turn. Every exit removed counts at ~5-15 µs nested. #565 ranks the levers. - -**The EPT violations are half guest RAM first touched, half MMIO first touched** (#568, `exits`, -v20261123.04, lab 45111606645, 3 boots, the same counts in each). Of 171 at ~110 µs each nested -(18.9 ms), 52 land in the 128 MiB base and 6 just above it, 48-51 in the memory virtio-mem plugs -from 4 GiB, and ~65 at MMIO addresses, where KVM's first fault on a page installs the entry that -every later access exits through as EPT_MISCONFIG: 39 in the PCIe ECAM at 2.75 GiB, 9 below 4 GiB -(the IOAPIC, the local APIC, the flash), 17 in the 64-bit BARs at 12 GiB. Prefaulting the base -in a QEMU started ahead could win at most the base's ~58 × 110 µs, ~6 ms, of `prestart` alone, -since `ssh-first`'s clock starts before QEMU's exec. That is under the noise and off both goal -numbers, so it was not built. - -**Density: a host's first login holds until about a third to a half of its CPUs are busy** (#563, -section 2, `density`, v20261123.04, spin's shape and login, 2026-11-23). Each row boots that many -workspaces first, logs into each, lets them settle 10 s, and times one more's first login. Under -`load=cpu` every crowd workspace keeps its one vCPU busy. The line #563 reads is a first login p95 -within 25% of the empty host's in the same run. - -| host | load | crowd: first login p50/p95 | within 25% | runs | -|---|---|---|---|---| -| nested c8id.4xlarge, 16 CPUs | cpu | 0: 387/417; 4: 378/431; 8: 441/450; 16: 1015/1215; 24: 941/1196 | up to 8 | lab 45110655407, 10 a row | -| metal c8i.metal-48xl, 192 CPUs | cpu | 0: 337/447; 16: 331/488; 32: 335/344; 48: 336/341 | up to 48 | lab 45110663095, 10 a row | -| the same | cpu | 0: 342/363; 64: 327/366; 96: 466/486 | up to 64, not 96 | lab 45110670764, 8 a row | -| the same | idle | 0: 345/368; 16: 336/343; 32: 329/341; 48: 334/352 | all | lab 45110678888, 10 a row | -| the same | idle | 0: 342/356; 64: 328/350; 96: 331/340 | all | lab 45110688511, 8 a row | - -Idle workspaces cost a metal host nothing up to 96, as they cost the bench nothing up to 16 (lab -44667235868). Busy ones moved the first login at 16 of the bench's 16 CPUs, and at 96 of metal's -192 (+124 ms p50). The metal empty row's p95 of 447 in lab 45110663095 is one slow boot of ten. -Between 64 and 96 is unmeasured. The crowd boots one at a time, ~0.8 s each on metal's EBS -scratch and ~0.75-1.1 s on the bench's NVMe. Section 1 of #563, what nesting costs a running -workspace's I/O, needs `io` and `build` probes and equal storage on both hosts, and is open. - -## Where the time goes - -Each table splits one number into phases, in spin's shape, and gives each phase a source. A phase -"by difference" is two numbers of one run subtracted. A phase marked "approximate" comes from -another run or another release. The last column is one way to spend 100 ms. It is an allocation, -not a measurement: it says how far each phase has to move. - -### Cold boot - -| Phase | p50 | Source | How well known | For 100 ms | -|---|---|---|---|---| -| QEMU's exec to a guest ready to run | ~28 | cold 456 less the boot into a QEMU started ahead, 428 (report 44811347183) | by difference, one run | 0, started ahead | -| … of it, QMP: QEMU's main loop free to `cont` answered, 14 commands | 6.2 | `transport` `cold_qmp`, lab 44912471522 (v20261121.01); 4.5 of it QEMU waiting on spin-machine's next command | measured | | -| … of it, the reset copying the vmlinux's 37.4 MB of segments into guest RAM, before the main loop | 9.1 before QEMU 0009, now beside the main loop | `romcopy` (a probe on branch `exp/698-romcopy`, not on main) `rom_copy`, lab 45257214350 (v20261123.07, 20 boots, p95 9.3); the ledger read the vmlinux's QEMU start +8.4 against a bzImage's (lab 45260129735, #697) | measured | | -| qboot and the bzImage's decompression, to the kernel's clock | 33.6 | `boot:firmware-stages`, lab 44787491631 (v20261120.02's kernel); ~21 of it is the decompression KASLR needed, which the machine no longer runs since #645 (first login −18.6, "What the machine carries"). Its end, KVM_SET_CLOCK plus the sched offset, is 2.8 ms after the kernel's 0 on bench, so ~31 (#665) | measured, another run; its anchor late | 5 | -| The kernel's clock to "Freeing unused kernel image" | 79.9 | report 44811347183, on dmesg's clock, which from late_initcall on is 13-15 ms behind the kernel's on bench, so ~93 (#666) | measured on a clock that reads short | 25 | -| PID 1 to sshd accepting | ~255 | sshd accepts 396 (lab 44841266997) less the three rows above; ~244 with the two corrections above | by difference, across runs | 35 | -| sshd's accept to the first login | 68.4 | `ssh-first` `accept_to_login`, lab 44841266997 | measured | 35 | -| … of it, what any login costs (a second login) | 35.9 | `ssh-first` `second_login`, the same | measured | | -| … of a login, vsock: 10 round trips of 57.5 µs through the forwarder | 0.6 | `transport` `login_turns`, `forward_rtt`, lab 44912471522 | measured | | -| **Total** | **465** | lab 44841266997, v20261120.04 (456 in the report's run) | | **100** | - -**PID 1 to sshd is more than half the cold boot.** On one vCPU, everything systemd starts before -sshd accepts is on the login's path. The groups in "What the machine carries" show how much -masks, generators and the coldplug filter took off it. The no-systemd floor accepted at 189 ms in -spin's shape. Before PID 1, ~140 ms of QEMU, firmware and kernel remain (~150 corrected, #665, #666), ~113 of them with QEMU -started ahead. Each phase from the first row to the fourth has to shrink to reach 100 ms. - -### Restore, QEMU started ahead - -| Phase | p50 | Source | How well known | For 100 ms | -|---|---|---|---|---| -| spin-machine's exec and its dial | 2.3 | `split` (a probe on branch `restore-split-lab`, not on main), lab 44809015139 (v20261120.03) | measured, one run | 1 | -| QMP round trips to `migrate-incoming` (17 of them) | 6.7 | `transport` `restore_qmp`, lab 44912471522 (v20261121.01); 5.2 of it QEMU waiting on spin-machine. The read-ahead runs beside it | measured, one run | 3 | -| The RAM load (8 channels, 181 MiB of data, evicted) | 38.8 before the read-ahead; ~27 after it | the same; the read-ahead −11.9 to running (lab 44809512339) | measured, then by difference | 25 | -| Device state and `cont` | 4.5 | the same | measured, one run | 3 | -| … after it, the guest running to the restore's last answer (`remove-fd`, `query-status`) | 2.7 | `transport` `restore_after`, lab 44912471522 | measured, one run | | -| Running to the first login | ~35 | 83.2 less running (~47); laptop: the connection ~5, to "Accepted publickey" ~22, the session ~4 | by difference; split on a laptop | 35 | -| **Total** | **83.2** | report 44811347183 | | **67** | - -A restore that starts QEMU itself adds ~25 ms (108 against 83.2). From the page cache, the RAM -load is ~10 ms instead of ~50 on a laptop, so the evicted load is the disk. Eight restores let go -at once read ~190-240 ms each under `defer`, against ~100 alone ("Open experiments", the burst). - -### Restore, QEMU started by the restore - -This is the goal's second number, `restore-first`'s evicted row. The rows come from lab -44976494418 (v20261122.01's parts, main's spin-machine at ee1be0f, 30 restores). - -| Phase | p50 | Source | How well known | -|---|---|---|---| -| The monitor's socket listening | 2.5 | `listening`. `machine.Start` binds it before QEMU exists, so it no longer marks QEMU's start | measured | -| QEMU's exec to its first answer | ~19.5 | `transport`, lab 44912471522 (v20261121.01). `spin-machine restore` waits on it in its dial | measured, another run | -| The first answer to `spin-machine restore` returning: 17 QMP commands, the load, device state, `cont` | ~49 evicted, ~35 cached | `running` 70.8 evicted and 57.0 cached, less the two rows above | by difference | -| Running to the first login | 40.2 | `login` 111 less `running` 70.8 | by difference | -| **Total** | **111** evicted, 95.2 cached | the same | | - -The evicted row read 16 ms more than the cached one, and that was the disk. The read-ahead -started in `Resume`, after the dial had waited ~19.5 ms for QEMU. Started before the dial, it -runs beside QEMU's start: `running` 62.7, login 101, 6 ms over the cached row ("What the machine -carries"). Asked for by four goroutines instead of one, the evicted row is level with the cached -one, login 96.2 against 96.3 (lab 44976924478). What is left of the restore is not the disk. - -**About a third of the restored login is sshd sleeping.** On a laptop, a restored login of -32 ms split into 4.6 ms to the server's banner, ~5 ms of key exchange, 14.5 ms from the signed -`userauth` request to its success, and ~4.7 ms for the channel, `exec` and exit. ~12 ms of the -14.5 are OpenSSH's minimum time for a userauth request (`auth2.c`, `ensure_minimum_time_since`): -5 ms plus 0-4.2 ms after the key query, and again after the signed request that succeeds, because -the flag it checks is set only after the sleep. sshd logs both at `LogLevel DEBUG3`. With every -`nanosleep` in sshd returning at once, a bound and not a candidate, the restored login read −13.4 -[−15.2, −10.5] on the bench and the cold login −3.2 [−13.7, +2.7], within noise (lab -44980029214). On a cold boot the vCPU still has boot work to run while sshd sleeps. ("Open -experiments", #457.) - -## What the machine carries - -This table lists every change the tree makes for boot time, with what it earns in spin's shape. -It is the current state. `docs/log.md` tells how each change came in. A row's evidence is one of -these: - -- *measured*: its own arm, in spin's shape; -- *group*: an arm that took back its group (below); -- *ladder*, *lane*, *runner* or *laptop*: measured in another shape, on another login, on the lab - runner of 2026-09 (Ryzen 9 5900X), or as a lead; -- *mechanism*: what it removes is visible, but no goal number has timed it; -- *unmeasured*. - -A row that is not *measured* or *group* is a candidate for deletion, which rule 5 of -`docs/measuring.md` decides. -Functional rows (security, correctness, a consumer's contract) are listed so that nobody takes -them for boot time. - -| Item | Where | Earns (Δp50 of taking it back) | Evidence | Run | -|---|---|---|---|---| -| Kernel patches 0001-0005, 0007, 0008, 0010 | kernel/patches | cold +67.5 [+62.5, +72.4], with 0006, 0009 and 0011 (since deleted, worth nothing) | group A | lab 44818953987 | -| Kernel 0012 (vmlinux BTF parsed on first use) and 0013 (the verifier asks for it only where a kernel type enters a program) | kernel/patches | cold −6.4 [−9.4, −1.0] at 60 a side (lab 45118194310, the kernel carried); before the review's fixes −10.0 [−12.7, −3.3] at 60 and −6.3 [−9.1, −4.6] at 120 (labs 45114405201, 45115330128); restored −1.0 [−6.0, +4.2] evicted, the state 1.3 MiB smaller (lab 45115341056) | measured | lab 45118194310 | -| Kernel 0021-0025, the boot's device-setup exits as one change (#627): the IOAPIC table read once (#590), the state save at add only where error recovery can restore it (#591 a), virtio-pci's vendor capabilities walked once (#591 b), `queue_select` written only on a change and an unchanged MSI message not rewritten (#592). 0022's gate has to grow with whatever calls error handlers next (its changelog). Alone each was within noise ("Measured and rejected") | kernel/patches | against v20261123.07: first login −9.4 [−14.2, −5.7], sshd accepting −9.5 [−14.4, −5.5], 120 a side (lab 45260781177); restored −0.4 [−2.0, +1.7] evicted and +0.2 [−6.6, +7.3] cached, the state +0.0 MiB [−0.1, +0.2], 60 a side (lab 45261629539); 838 exits fewer, 366 of them MMIO (3 a side, lab 45114428660) | measured | labs 45260781177, 45261629539 | -| `BLK_DEV_LOOP_MIN_COUNT=0`, `SERIAL_8250_RUNTIME_UARTS=1` | kernel/config-7.3-x86_64 | cold +5.3 [−3.2, +15.0]: inside the noise, but the upper bound does not rule out its ~2-4 ms ceiling | measured, 40 a side | lab 44839538785 | -| `VT=n`, `X86_MSR=n`, `X86_CPUID=n` | kernel/config-7.3-x86_64 | function: dead code, less surface | - | kernel/Dockerfile | -| qboot instead of SeaBIOS | qemu, `machine.DefaultBIOS` | cold +68.5 [+62.7, +71.7] | group F | lab 44818953987 | -| QEMU 0001 (device creation in one memory transaction) | qemu/patches | restored +11.7 [+0.9, +19.3], running +6.8 [+1.2, +8.8]: a restore starts QEMU too; cold +0.2 [−8.7, +7.1]. With `pam.patch`, cold +11.5 [+6.7, +20.2] (group B, lab 44818953987) | measured, 20 a side | lab 44993254745 | -| qboot `pam.patch` (PAM in three writes) | qemu/qboot | cold +3.9 [−3.4, +8.0]: inside the noise, and the upper bound over +5 keeps it (rule 5 of docs/measuring.md) | measured, 40 a side | lab 44993790452 | -| QEMU 0002, virtio-scsi `max_target`, which spin-machine passes | qemu/patches, machine | cold −8.9 [−15.5, −0.9] when it came in | measured | lab 44788216590 | -| QEMU 0009 (the vmlinux's segments copied into guest RAM in a thread beside the main loop at the machine's first reset, #698) | qemu/patches | first login −8.6 [−11.0, −4.0], 351 → 342, sshd accepting −9.1 [−12.4, −5.9], the console prompt −7.7 [−11.4, −5.5], QEMU's RSS unmoved, 60 a side (lab 45260098299); restored −0.1 [−1.1, +0.7] evicted, −0.3 [−2.1, +0.9] cached, and the same run's cold login −6.9 [−12.9, −0.8], 40 a side (lab 45260694485): a restore's reset copies nothing. The copy it moves off the main thread was 9.1 ms (p50 of 20, p95 9.3, lab 45257214350), and the gain is all of it. Prior art: QEMU has mapped an ELF kernel instead of reading it since 4.2 (Stefano Garzarella, `816b9fe450`, [qemu-devel 2019-07-24](https://patchew.org/QEMU/20190724143105.307042-1-sgarzare@redhat.com/20190724143105.307042-3-sgarzare@redhat.com), 2019), so #698's first candidate, mapping the file, was already upstream; what was left is the copy into guest RAM, which any loader pays: Firecracker and Cloud Hypervisor read each PT_LOAD straight into guest memory ([rust-vmm/linux-loader](https://github.com/rust-vmm/linux-loader)), one copy as QEMU's. A `pread` into guest RAM against the mapping's `memcpy` was no faster on a laptop (9-11 ms each, not nested), where half the copy was faulting in the destination's huge pages and half the copy itself. No ROM copy off the main thread found in QEMU 11.2's tree or by a web search of qemu-devel (2026-11-23) | measured | labs 45260098299, 45260694485 | -| The kernel entered as its vmlinux through PVH, randomizing itself: kernel 0014-0017 (Hou Wenlong's RFC, less its decompressor patch, deleted with the bzImage in #660; [the cover letter](https://lkml.iu.edu/2601.3/01845.html), lore `cover.1769434279.git.houwenlong.hwl@antgroup.com`, 2026-01-26, unchanged on 7.3.5), 0019 (sets `KASLR_FLAG`, without which `RANDOMIZE_MEMORY` did nothing), 0020 (RDRAND and TSC read from the registers that hold them), QEMU 0008 (a random physical base from `XEN_ELFNOTE_PHYS32_RELOC`), #645 | kernel/patches, qemu/patches, machine | first login −16.8 [−20.9, −13.0], 368 → 352, sshd accepting −16.7 [−20.2, −12.7], QEMU's RSS −13.8 MiB, 60 a side (lab 45219785493); restored −4.4 [−17.5, −2.0] evicted, −4.3 [−14.0, +10.2] cached, within noise, the state −31.9 MiB, the save −14.6 (lab 45219801969). As released, v20261123.07 against v20261123.06, each with its own spin-machine: first login −18.6 [−23.6, −14.0], 378 → 359, sshd accepting −15.3 [−21.2, −12.6], 60 a side (lab 45252584128); the release record's −3.5 [−12.9, +2.9] at 20 a side was a shifted run (#694). The bound, the same vmlinux entered with no KASLR at all: −18.9 [−22.8, −12.4] cold, −3.6 [−5.1, −2.1] restored evicted at 40 a side (labs 45213668842, 45213683698), so KASLR without the decompressor costs ~2 ms against no KASLR (inferred across runs; Hou measured ~2 ms too). Arms booted the kernel without 0020. KASLR across 10 boots (lab 45221660056): `_text` 10 distinct, the physical base 8, the direct map and vmalloc each 10 distinct 1 GiB-aligned bases. Entropy: the virtual base the decompressor's slot rule and seed sources once 0020 is in, the physical base QEMU's `getrandom` over the decompressor's range, the regions the kernel's own (#645, "entropy"). Chosen over QEMU applying the relocations (Holmes et al., "KASLR in the age of MicroVMs", EuroSys '22, 20-25 ms over an LZ4 bzImage; Firecracker #5661, parked; rust-vmm/linux-loader #84, open): no relocation format for QEMU to parse, nothing new on its command line, the kernel's own entropy code | measured, 60 a side | labs 45219785493, 45219801969, 45252584128 | -| qboot `no-pci-walk.patch` | qemu/qboot | cold +5.2 [−1.7, +9.2]: inside the noise, and the upper bound over +5 keeps it; 5.0 ms nested in `firmware-stages` | measured, 40 a side | lab 44993790452 | -| qboot `mtrr.patch`, `write-pointer.patch` | qemu/qboot | function: write-back mappings, vmgenid | - | - | -| `hpet=off` | machine | nothing on record: a timer the guest would enumerate and then not use | unmeasured | - | -| ICH9 `sata=off`, `smbus=off` | machine | kernel to init 62.3 → 60.6 (09-08) | laptop, 400 boots | `fa1803f` | -| Hotplug disks on virtio-scsi, not PCIe root ports | machine | boot −31, attach 135 → 1.5 (09-29) | runner | #25 | -| Every machine started held, so QEMU can start ahead | machine | the "QEMU started ahead" rows: ~28 ms cold, ~25 restored | measured | report 44811347183 | -| Checkpoints on 8 multifd channels | machine | restored into a QEMU started ahead 150 → 103 against 1 channel; 16 channels lose to 8 when 4 restore at once, +3.2 [+1.1, +5.8] | measured | labs 44789688221, 44792429636 | -| The resume reads the state ahead | machine | restored into a QEMU started ahead −12.9 [−14.7, −9.8] | measured | lab 44809512339 | -| `spin-machine restore` reads the state ahead before its dial (`machine.ReadAhead`), beside QEMU's start | cmd/spin-machine, machine | restored −9.3 [−12.2, −7.3] evicted, cached −0.2 [−2.2, +1.5] | measured, 30 a side | lab 44976494418 | -| The read-ahead asked for by four goroutines, each every fourth 128 KiB piece | machine | restored −6.2 [−9.1, −4.3] evicted against one goroutine, cached −0.5 [−1.6, +1.9] | measured, 30 a side | lab 44976924478 | -| CPUID leaf 2 with QEMU's cache descriptors (`x-consistent-cache=off`), so glibc does not walk leaf 4 at every process start; `x-legacy-cpuid2-cache=off` (qemu/patches/0006) makes them leaf 4's caches, first login +0.6 [−6.1, +5.5] (lab 45101932173, #586) | machine/shape.go | first login −10.3 [−14.2, −4.0], 40 a side; CPUID exits 3727 → 2176; restored +1.0 [−3.9, +4.4] evicted, in noise | measured | labs 45083473790, 45083473855, 45083754801 | -| `pci=lastbus=0` | machine/cmdline.go | kernel to init 87.6 → 51.1 (2026-09): 8192 configuration reads, each an exit | runner, mechanism | log.md, 09 | -| `no_timer_check`, `tsc=reliable` | machine/cmdline.go | nothing on record (09-07) | unmeasured | - | -| `TERM=dumb` | machine/cmdline.go | 687 → 19 ms to systemd's first line (09-10), while systemd queries the console | laptop, mechanism | `b5f361f` | -| `rootfstype=ext4` | machine/cmdline.go | lead (11-19) | laptop | - | -| `quiet`, `loglevel=3`, `panic=1`, `net.ifnames=0`, `biosdevname=0`, cgroup v2, `memhp_default_state` | machine/cmdline.go | console, function | - | - | -| systemd built from Ubuntu's source with the `stage1` profile | image/systemd | first login −47, −38, −47: no BPF verifier in PID 1 | ladder | labs 44531842773, 44537549305, 44538877783 | -| systemd's drop-in candidate names derived once per unit, not once per lookup directory: upstream #42858 (v262), backported to 259 | image/systemd/0001-dropin-derive-candidate-names-once.patch | first login −6.5 [−9.9, −1.3], 100 a side against systemd rebuilt without it; PID 1's CPU before the login 56.0 → 52.4, p50 of 5 ledgers. Prior art: Eric Curtin's PR, `manager_enumerate()` 45.35 → 38.81 ms (50 runs, ~270 units, a container); Yocto's backport to 259.5 | measured | labs 45090299768, 45090326943 | -| systemd's tools linked static | image/systemd | −10 and −1, inside the noise | ladder | the same | -| SELinux off, `pcre2` on | image/systemd | function | - | - | -| `-O ^orphan_file` | image/build.sh | lead (11-19) | laptop | - | -| `lazy_itable_init=0` | image/build.sh | function: no 16 MiB of zeros in every overlay | - | - | -| 16 more unit masks (journal-flush, fsck-root, modules-load, pstore, random-seed, four modprobe@, …) | optimize-systemd.sh | cold +57.5 [+49.0, +63.0] | group C-masks | lab 44818953987 | -| 8 generators disabled, 3 tmpfiles rules masked | optimize-systemd.sh | cold +16.7 [+11.6, +23.3] | group C-generators | lab 44818953987 | -| udev's coldplug filtered (`10-coldplug.conf`), `cpu` kept for hot-added cores | image | cold +14.9 [+8.2, +19.8]; restored +463.7, which was not the coldplug but QEMU's TSC, a guest saved with its tick running (#452, QEMU 0005) | group C-coldplug | lab 44818953987 | -| ssh.socket, ssh.service and sshd-keygen without default dependencies; logind and dbus-broker without PrivateTmp; udev at `StartupCPUWeight=1` | image drop-ins | −59.4 [−65.9, −56.2] with the probe's forwarder early as well (lab 44805051310, `login-early` and `udev-startup`). In a second run, the image's half alone (`--edit lane`) −17.4 [−25.0, −8.5] and with the forwarder early as well −68.5 [−78.0, −61.8] (lab 44807457606). Each run against its own release, v20261120.03 | measured | labs 44805051310, 44807457606 | -| ssh.service without Ubuntu's `sshd -t` before it starts (`20-no-config-test.conf`); the check stays on reload | image drop-in | −3.2 [−7.2, −0.8], sshd accepting −2.4 [−6.4, −1.1], 60 boots a side | measured | lab 44977044826 | -| udevd and its coldplug not before sysinit.target (copies of the units without that line), so basic.target does not wait for udevd's start at the lowest weight | configure-system.sh | cold −48.6 [−51.7, −42.6], restored −2.0 [−8.0, +4.7] p95 114 against 114, cached p95 126 against 128, with QEMU 0005, 30 a side; prestart cold −44.7 [−53.4, −39.4], restored into prestarted −1.3 [−4.1, +3.6] p95 98.8 against 101. Without 0005 the restored p95 is 539-548 | measured | labs 44987412171, 44987412210 | -| The boot's default target holds only what the first login needs (`spin-machine-login.target`), and `multi-user.target` starts once its units are up (`spin-machine-boot-rest.service`, `Type=idle`) | image, docs/image.md "The first login's target" | first login −21.5 [−26.4, −15.5], sshd accepting −10.0 [−16.2, −3.7], accept to login −10.7 [−12.9, −8.2], second login +0.0 [−0.8, +0.6]; restored +1.1 [−6.0, +5.2] evicted, +2.2 [−10.6, +12.9] cached. The console prompt +15.5 [+11.5, +19.0], since the getty now follows the login: nothing a workspace does waits for it. With spin's supervisor off `basic.target` (spin-stack/spin#1653) the first login −45.3 [−50.2, −39.4] but the second +43.7 [+41.1, +46.1] | measured, v20261123.02, 40 a side | labs 45098372930, 45098372897 | -| QEMU 0005: a machine made for an incoming migration writes its TSC only from the migration, so KVM takes the checkpoint's TSC as given | qemu/patches | correctness: without it a guest saved with its tick running sleeps until its old TSC deadline, ~450 ms (#452). Alone it moves neither number: cold −3.0 [−5.8, +0.1], restored −1.9 [−7.6, +2.0] | measured | lab 44987412171 | -| logind, its Varlink socket, `user-runtime-dir@`, `user@` without default dependencies; `dbus.socket` without sysinit | image drop-ins, configure-system.sh | cold +16.5 [+9.8, +20.4], prestarted +11.0 [+6.2, +18.8], restored in noise; lane 478 → 402 (11-13) | measured | lab 45034963004, lab 43518915618 | -| Sessions of class `user-early-light` | configure-system.sh | lane 472 vs 436 | lane, mechanism: a root session would start `user@0` | lab 43518044150 | -| Sessions of class `user-early` and root lingering, so a login waits for its user manager and root's starts in the boot (#467) | configure-system.sh | correctness: the first login's own `systemctl --user` failed 10 of 10 on v20261122.03 and passed 10 of 10 with it (lab 45032247920). First login +4.7 [−0.2, +12.2] at 40 a side, sshd accepting +5.6 [+1.1, +10.1]; restored −10.8 [−15.9, −6.6] evicted, −12.3 [−15.1, −5.5] cached. The lane's login as spin, whose manager does not linger, +29.7 [+22.8, +42.1] | measured | labs 45031644179, 45031644114, 45031687433 | -| The user manager's sockets' environment from `environment.d/10-user-sockets.conf`, not two `systemctl --user set-environment` | image | with the row above: first login +19.6 [+15.9, +25.6] without it (lab 45031644179); with class `user-early` alone, −17.1 [−27.0, −10.7] (lab 45030778365) | measured | labs 45031644179, 45030778365 | -| Root's manager without the XDG autostart generator, which turns a graphical session's `.desktop` files into user units (#527) | optimize-systemd.sh | first login −3.8 [−6.2, −0.7], accept to login −6.1 [−9.0, −0.3], 100 boots a side; restored −1.7 [−4.4, +2.2] evicted, in noise | measured | labs 45070150688, 45070973943 | -| Host keys made from the boot's first dispatch | spin-machine-sshd-keygen.service | cold −0.8 [−10.5, +3.5], restored in noise: not a gain in spin's shape, where they are no longer made (the row below); kept for the lane, 489 → 468 (#515) | measured | lab 45034963004, lab 43483372488 | -| No host key made when spin's handoff has placed its own at `/run/spin/ssh/ssh_host_ed25519_key` (#515) | spin-machine-sshd-keygen.service | first login −6.9 [−9.6, −2.4], sshd accepting −6.8 [−10.4, −1.8], 120 a side, both arms with `--edit spin-handoff`; restored in noise, 20 a side. Prior art: RHEL's cloud-init conditions `sshd-keygen@` off while it provisions the keys (git.centos.org rpms/cloud-init, `ci-Inhibit-sshd-keygen-.service-if-cloud-init-is-active.patch`), for function and unmeasured | measured | labs 45086250796, 45085877238 | -| sshd without OpenSSH's userauth minimum time on a login: a request that authenticated, or a public key query answered with `PK_OK`, does not wait; a failure still does (#457) | image/openssh | restored −13.6 [−14.9, −9.8] evicted, −13.6 [−16.2, −11.4] cached; cold −9.4 [−15.8, −2.6], the second login −10.9 [−12.3, −9.0] | measured, 30 a side | labs 44983986606, 44983986575 | -| An Ed25519 host key only, no ECDSA | spin-machine-sshd-keygen.service | −5.0 [−8.3, −1.8], sshd accepting −4.4 [−6.9, −1.9], 60 boots a side | measured | lab 44979726719 | -| MOTD and `pam_motd` off; `mlkem768x25519-sha256` alone | configure-system.sh | −12 on the first login; 104 → 40 a login against sntrup761 | ladder, mechanism: a root login runs the same PAM and kex | #240, lab 43479854381 | -| journald volatile, 8 MB, its flush masked | optimize-systemd.sh | cold +6.1 [+2.3, +15.8], prestarted +6.5 [+3.1, +13.1], restored in noise; 8 MB against 4 MB, first login −2.2 [−12.1, +6.4], 20 a side | measured | labs 45034963004, 45121159504 | -| docker and containerd started by their sockets, not at boot (deferred: the first `docker` command waits for them, docs/image.md) | optimize-systemd.sh | cold +13.9 [+11.4, +18.2], restored +55.7 [+12.0, +73.9], into prestarted +40.7 [+33.5, +59.0] | measured | lab 45034963004 | -| timedated, firstboot, machine-id-commit masked | optimize-systemd.sh | function: time from the host, no first-boot prompt, no identity | - | - | -| `10-seats.conf`, the getty's TERM, `/tmp`'s size | image drop-ins | function | - | - | -| The pressure probe's sender, started with `multi-user.target` by the boot's rest, at the lowest priority | spin-machine-pressure.service | function (docs/machine.md, "Pressure"); from the boot's rest in place of a timer 10 s after the boot: first login −0.8 [−7.8, +4.8], restored −0.8 [−2.9, +2.1] evicted, 20 a side; it starts at 0.37-0.38 s, after the login. Before #581, after multi-user.target beside the first login, sshd accepting to login +2.6 to +3.3 in three runs | measured | labs 45120950183, 45120950314, 45120692382; 44921602512, 44924252325, 44924755505 | - -**What holds each patch.** Every patch the table names, and QEMU's 0003 and 0004, which are not -for boot time, has a test that fails when the patch is lost or rebased into doing nothing, since -either still builds and boots. QEMU's are in qemu/README.md ("The patches"), qboot's in -qemu/qboot/README.md, the kernel's in kernel/README.md. OpenSSH's is held by its build, which -looks for the patched condition in the `auth2.c` it compiles, and by `boot:sshd-delay`. The qemu, -qboot, kernel and openssh-source entries of `versions.yaml` name the checks a bump runs. - -**What only the lane uses.** spin's path earns nothing from `sshd-vsock.socket.d/10-lane.conf`, -`sshd@.service.d/10-lane.conf`, `sshd@.service.d/keygen.conf` or the masked -`systemd-nologin.conf`. The probes still offer `login=lane`, and the no-systemd floor uses it. -Whether the image keeps a vsock login of its own is the maintainer's decision ("Open questions"). - -**What spin does, not the image.** spin no longer lingers its user (cold −36.1 [−45.8, −23.6], -labs 44785179901, 44785565313). Its supervisor's forwarder order is the proposal in "Open -experiments". - -### How the groups were decided - -The groups were decided by one `prestart` run in spin's shape, 20 boots each, against -v20261120.04 as published (lab 44818953987). The base read 453/464 cold, 124/144 restored and -93.0/120 restored into a QEMU started ahead. Each cell is the Δp50 of taking the group back. - -| Arm | Takes back | Tree | Cold | Restored | Into prestarted | -|---|---|---|---|---|---| -| A | every kernel patch | `--kernel run:44812049304` | +67.5 [+62.5, +72.4] | +8.1 [−8.4, +20.1] | +12.1 [−6.5, +21.2] | -| A1 | 0006, 0009, 0011 | `--kernel run:44812044088` | +1.2 [−4.5, +8.3]; at 40 boots −2.5 [−8.4, +1.8] | −5.2 | +1.3 | -| A2 | `DEFERRED_STRUCT_PAGE_INIT` | `--kernel run:44837940315` (lab 44839538785, 40 boots) | −2.5 [−9.3, +3.8] | +1.1 | −4.0 | -| A3 | the loop and 8250 counts | `--kernel run:44837906170` (lab 44839538785, 40 boots) | +5.3 [−3.2, +15.0] | +1.7 | −4.6 | -| B | QEMU 0001, qboot's `pam.patch` | `--qemu run:44812062232` | +11.5 [+6.7, +20.2] | +4.4 | +0.9 | -| C-masks | 16 unit masks | `--edit carry-masks` | +57.5 [+49.0, +63.0] | −0.7 | +0.1 | -| C-generators | 8 generators, 3 tmpfiles rules | `--edit carry-generators` | +16.7 [+11.6, +23.3] | −5.3 | −1.3 | -| C-logging | PID 1's quiet logging, the printk sysctl | `--edit carry-logging` | +2.4 [−2.3, +7.8]; at 40 boots −1.8 [−7.7, +3.2] | −4.0 | +0.6 | -| C-coldplug | the coldplug filter | `--edit carry-coldplug` | +14.9 [+8.2, +19.8] | +463.7 | +358.0 | -| E | `rcu_expedited`, `driver_async_probe` | `--append 'driver_async_probe= rcupdate.rcu_expedited=0'` | −1.4 [−4.9, +3.1] | +1.4 | +1.7 | -| F | qboot, for SeaBIOS | `--boot --bios=bios-256k.bin` | +68.5 [+62.7, +71.7] | −1.9 | +7.4 | - -A1, A2, C-logging and E were deleted (#345, #356, #354, #352); `--edit carry-logging` went with `fast-boot.conf`, the last file it edited (2026-11-22). The rest earn what the cold column -says. On one vCPU, every unit, generator and exit before the login is on the login's path. The -`carry-*` edits stay in `internal/lab`, so the ablation can run again when the shape, the kernel or -systemd moves. An edit checks what it undoes, so an edit whose item was deleted fails on later -releases. - -## Measured and rejected - -An idea already here needs a new reason, not a new run. The tables group ideas by the part they -touch, oldest first within a group. The "Shape" column says which shape a row was measured in, -and a row measured in another shape than spin's has such a reason. - -### Kernel and its command line - -| Idea | Result | Shape | Source | Date | -|---|---|---|---|---| -| Trim the 8250 driver | 154 µs | runner | `c03ed89` | 09-10 | -| Modular kernel | 0.57 ms; breaks "a release is one machine" | runner | `1a8e25c` | 09-10 | -| ACPI params (acpi=noirq, pnpacpi=off, …) | 69.9 vs 68.6 ms, slower | runner | `64d2901` | 09-10 | -| initcall_blacklist ksm/kcompactd | 0; event_trace's 6 ms is the profiler | runner | `64d2901` | 09-10 | -| `CONFIG_XFRM=n` | moves BTF's 9 ms first parse elsewhere | runner | `e285dec` | 09-10 | -| A generous vCPU ceiling | maxcpus=16 +5 ms, 64 +9 ms of kernel; the ceiling stays (invariant) | runner | `f32d527` | 09-10 | -| MICROVM | no ACPI CPU hotplug | - | `b151186` | 09-10 | -| `CONFIG_VT=n` for speed | 0 to login; 0.31 ms of kernel | runner | `e2f6b8f`, `9b5f0dd` | 09-26 | -| KSM and THP off | −0.50 ms | runner | `cda04b1` | 09-26 | -| COMPACTION off | impossible: virtio-mem needs CONTIG_ALLOC | - | `cda04b1` | 09-26 | -| erofs removed for speed | noise (100.46 vs 102.22) | runner | `5a3d509` | 09-26 | -| Smaller TCP hash tables | moved nothing | runner | `dae6a14`, #48 | 09-26 | -| ZRAM | the runaway killed later (20 vs 14 s), worst login 3.8 s | runner | kernel/Dockerfile, `430d2b3` | 09-28 | -| `pci=noearly` | the guest does not boot | - | #240 | 11-12 | -| A configuration-space snapshot over fw_cfg (QEMU and kernel) | 209 vs 211 with 0005 | ladder | lab 43514884598 | 11-13 | -| `scsi_mod.scan=manual` | kernel −9.3, but since Linux 5.10 a disk added at run time, at boot, or under `-S` never appears, silently. `max_target` took its place | spin | lab 44570773103; `drivers/scsi/virtio_scsi.c`, `scsi_scan.c` | 11-19 | -| `CONFIG_SCSI_SCAN_ASYNC` | −2.6 [−8.9, +6.8]: the scan is waited for before "Freeing", and `max_target` leaves it little | spin | #325, lab 44788216590 | 11-20 | -| The decompressor without `X86_VERBOSE_BOOTUP` | to the kernel's clock 35.1 → 32.4 ms, under the 3 ms set before the run | spin | #328, lab 44787878809 | 11-20 | -| An uncompressed bzImage payload, KASLR kept | to the kernel's clock −3 ms, but +3.3 in qboot's copy and +6-7 in QEMU's start | laptop | #326 | 11-20 | -| The same on QEMU 0007, which maps the bzImage and so no longer reads the 40 MB file in its start (#646, a lead for #645) | first login −4.0 [−7.9, +0.3], sshd accepting −2.9 [−6.9, +2.4] at 40 a side against LZ4 on the same QEMU; QEMU's RSS +32.0 MiB (+22.2 file, +9.9 anonymous). The QEMU half of the 11-20 rejection is gone; what is left is under the interval at 40 | spin | lab 45183618987 | 11-23 | -| The bzImage's decompression made cheaper, in general | ~21 ms before the kernel's clock with the bzImage against PVH; most of it is the copy and relocation KASLR needs, and KASLR stays. No candidate left | spin | lab 44787491631 | 11-20 | -| The bzImage beside the vmlinux, `KERNEL_LZ4` (its compression) and kernel 0018 (its decompressor reading `.data.reloc`), shipped since 11-19 | no release booted the bzImage after #645: spin's place.go was its last reader (spin-stack/spin#1689). Deleted: the build makes vmlinux alone, and a release from #660 on has no `kernel/bzImage`. The boot path is unchanged: first login −4.3 [−14.4, +7.4] at 20 a side, within noise, sshd accepting −5.3 [−11.1, +7.0], QEMU's RSS −1.7 MiB (the arm's kernel is also 7.3.6, main's, against .07's 7.3.5) | spin | #660, lab 45262046768 | 11-23 | -| `driver_async_probe` for rng, balloon and vsock; `rcupdate.rcu_expedited=1` (carried since 11-13 and 09-07) | taken back −1.4 [−4.9, +3.1]: one vCPU has no second CPU to probe on. Deleted | spin | lab 44818953987, #352 | 11-21 | -| Kernel 0006 (BTF parsed in the background), 0009 (a booting AP polled by local_clock()), 0011 (queue_select written only on a change) | taken back −2.5 [−8.4, +1.8] at 40 boots. Deleted | spin | labs 44818953987, 44822157367, #345 | 11-21 | -| `DEFERRED_STRUCT_PAGE_INIT` (carried since 11-13, for 2 GiB at boot) | taken back −2.5 [−9.3, +3.8] at 40 boots: spin boots 128 MiB, which the kernel does not defer, and plugged memory is never deferred. Deleted | spin | lab 44839538785, #356 | 11-21 | -| vmlinux BTF parsed on first use, not at the first kfunc registration (a kernel patch on branch `exp/btf-first-use`) | kernel to "Freeing" −7.2 [−8.6, −6.2], inet_init 6.85 → 0.14 ms (lab 44982285400, 10 boots), but the first login −1.5 [−3.1, +1.6] at 60 boots (lab 44982285406): journald's `DeviceAllow=` and `IPAddressDeny=` load cgroup BPF programs at its start, and `bpf_check()` parses the BTF there, before the login. A verifier that asks for BTF only when a program needs it is the next step | spin | labs 44982285400, 44982285406 | 11-22 | -| `CONFIG_HZ_250` for `HZ_1000` (#567), as Firecracker's and Cloud Hypervisor's guest configs build | every exit −587 [−608, −445] (MSR writes 1018 → 755, preemption timer 691 → 482, HLT 332 → 298, 3 a side, lab 45111418504), but the first login −0.6 [−5.9, +3.1] at 60 a side (lab 45111452844): a tick's exits are handled in ~1-1.5 µs each in the L1, not the ~7 µs a nested MMIO or port exit costs | spin | labs 45111418504, 45111452844 | 11-23 | -| virtio-pci writes `queue_select` only when the queue changes, a second time and alone (#592 lever 1, a kernel patch on branch `exp/592-l1-queue-select`; first as 0011) | 68 MMIO exits fewer (91 → 23 writes, 3 a side, lab 45113437048), the first login −2.8 [−6.6, +3.4] at 60 a side (lab 45114405201) and +0.6 [−1.8, +2.3] at 120 (lab 45115330128). The vector read-back stays: virtio 1.2 §4.1.5.1.2 makes it how a device refuses a vector | spin | labs 45113437048, 45114405201, 45115330128 | 11-23 | -| x86's `msi_set_affinity` skips the message write when the vector and destination did not change (#592 lever 2, a kernel patch on branch `exp/592-l2-msix-once`) | 56 MMIO exits fewer (`__pci_write_msi_msg` 168 → 112, 3 a side, lab 45113437048), the first login −0.1 [−3.1, +4.5] at 60 a side (lab 45114405201) | spin | labs 45113437048, 45114405201 | 11-23 | -| `pci_save_state()` at a device's add kept only where an error handler can restore it (#591 a, a kernel patch on branch `exp/591a-no-save-state`) | 128 MMIO exits fewer, the host's handling −3.3 [−6.2, −2.1] ms (3 a side, lab 45113437048), but the first login −4.3 [−6.8, +0.5] at 60 a side (lab 45114405201) and −1.3 [−3.5, +1.3] at 120 (lab 45115330128). Its gate has to grow by hand: upstream a2f1e22390ac took out `pci_restore_state()`'s refusal of a state never saved | spin | labs 45113437048, 45114405201, 45115330128 | 11-23 | -| virtio-pci's vendor capabilities walked once per device (#591 b, a kernel patch on branch `exp/591b-virtio-caps-once`) | 114 MMIO exits fewer (3 a side, lab 45113437048). The first login −5.8 [−8.2, −0.6] at 60 a side (lab 45114405201), three times what 114 exits can cost, and +0.9 [−1.8, +2.7] at 120 (lab 45115330128) | spin | labs 45113437048, 45114405201, 45115330128 | 11-23 | -| The IOAPIC's redirection table read once at boot, and written back only where it was masked (#590, a kernel patch on branch `exp/590-ioapic-once`) | IOAPIC accesses 589 → 205 and the host's handling −3.1 [−6.2, −1.1] ms (3 a side, lab 45113437048), but the first login −4.5 [−7.8, +0.4] at 60 a side (lab 45114405201) and −2.0 [−4.3, +0.6] at 120 (lab 45115330128). With the four other exit patches of #591 and #592, as a bound, −7.4 [−12.1, −2.8], and as one change −9.4 [−14.2, −5.7] at 120 a side: carried as 0021-0025 (#627, "What the machine carries") | spin | labs 45113437048, 45114405201, 45115330128 | 11-23 | - -### Firmware, QEMU and the machine - -| Idea | Result | Shape | Source | Date | -|---|---|---|---|---| -| `usb=off`, `vmport=off`, `smm=off`, `i8042=off` | 63.0/62.6/62.3/62.5 vs 62.9 ms | laptop | `fa1803f` | 09-08 | -| A named CPU model instead of `host`, for memories that resume on any host (`--cpu baseline`) | the newest model a nested c8id runs is Cascadelake-Server-v5, not SapphireRapids or GraniteRapids; cold first login +27.2 [+13.0, +30.8], sshd accepting +23.1 [+9.7, +28.5], warm login and RSS unmoved; the cause is not measured. `host` with a pool's common features is the next candidate (spin-stack/spin#1417) | spin | lab 44855890737 | 11-21 | -| Less guest RAM (512 MiB) | 1241 vs 1256 ms, nothing | runner | `80f984b` | 09-10 | -| `cache=none` on disks | breaks the shared base's caching, fails on tmpfs | - | `8b7391a` | 09-07 | -| Overlay O_DIRECT | small reads 1490 vs 530 ms | runner | docs/memory-and-disk.md | 10-01 | -| Board init wrapped in one memory transaction | the guest prints nothing | runner | `f10383b`, lab 36662499370 | 09-30 | -| Base on virtio-pmem and DAX | ~155 MB less per VM, but a side channel | runner | #63, #65 | 10-01 | -| Remove virtio-rng | −13.6 ms to the console prompt, never on a goal number; what seeds the RNG without it is open ("Open questions") | ladder | lab 43321809471 | 11-12 | -| QEMU copies the kernel's ELF segments on threads | laptop QEMU start 30.9 → 21.6; nested it adds nothing | ladder | labs 44580080420, 44581350077, #290 | 11-19 | -| A 1 MiB readahead on the root disk (`opt_io_size=524288` on virtio-blk), for fewer requests and so fewer notifications (#566) | iowrite16 exits 895 → 927 (3 a side, lab 45098880914); first login +1.4 [−2.7, +8.0] at 40 a side. The boot's reads are not readahead-bound (inferred) | spin | lab 45098879979, #592 | 11-23 | -| QEMU's start from its exec to its first trace event made cheaper (#647) | 9.7 ms on bench (lab 45177818419), no part of it over ~2 ms. The release's QEMU is static-pie on musl, so there is no dynamic loader to time (`LD_DEBUG` reads nothing): musl relocates its 59,700 relative relocations itself. On the laptop the phase read 4.7-5.4 ms p50, 40 starts each: a trivial static-pie binary's exec 0.23, QEMU's `-version` (exec, relocation, constructors, QOM type registration, the first options) 2.0, `-sandbox` dropped −0.7 to −0.9 (libseccomp builds its filter at run time), and the rest is option parsing, the trace's and the main loop's start and the machine object up to its first address space. perf over 200 `-version` runs: the relocation 7% of it, the kernel's page faults (copy-on-write, file fault-around, zeroing) ~15%, nothing else over 2%. From exec to held, malloc (musl's mallocng) is ~2.3 of 17 ms of the main thread's CPU. Candidates and their ceilings, each inferred at ~2× the laptop on bench: a filter compiled at build time as Firecracker's seccompiler does, ≤~1.5 ms; a non-PIE binary, no relocation and fewer copy-on-write faults, ≤~1 ms and it gives up ASLR of QEMU's image; DT_RELR, ≤~0.3 ms. Every one is under the ±4-5 ms that 60 boots a side resolve, so none was built. Another allocator is a lead across all of QEMU's start, not this phase (#669) | spin, laptop | lab 45177818419, #647 | 11-23 | -| QEMU 0007 kept once no release boots a bzImage: `-kernel` mapped a bzImage read-only instead of reading it into QEMU's heap (#646, carried from 11-23). From v20261123.07 the machine enters the vmlinux through PVH, which QEMU's ELF loader maps without it (#645) | taken back, against v20261123.07: first login +3.6 [−3.3, +7.8], sshd accepting −1.6 [−6.7, +5.6], QEMU's RSS +0.3 [−1.6, +2.1] MiB (lab 45258887660); restored −0.4 [−1.5, +0.9] evicted, −0.1 [−0.9, +0.9] cached, the cold boot of the same run +2.7 [−3.1, +8.7] (lab 45258106255), 40 a side, all within noise. A release before .07 boots its bzImage with its own QEMU, which carries 0007. When it came in, on a bzImage: first login −13.4 [−16.9, −7.3], restored −9.3 [−11.2, −6.1] evicted (labs 45182382388, 45182382864). Deleted | spin | labs 45258887660, 45258106255, parts run 45256311661, #660 | 11-23 | -| Lower the vCPU ceiling, drop the balloon or ACPI | not tried: an invariant | - | AGENTS.md | 11-13 | - -### systemd and the image - -| Idea | Result | Shape | Source | Date | -|---|---|---|---|---| -| Mask udev | saves 0, and boots never reach a login (10 s ttyS0 timeout) | runner | `4cbd229`, `80f984b` | 09-10 | -| agetty tweaks (TTYReset, --noissue, --delay 0, …) | within the noise of agetty's sleep(1) | runner | `80f984b` | 09-10 | -| chrony or another time daemon | 10 ms; cannot know it was restored | runner | `c7af4d3` | 09-10 | -| systemd-timesyncd | SNTP only, no refclock | - | `c7af4d3` | 09-10 | -| 19 udev rules masked; loop and 8250 counts as command-line parameters | 0 to the console prompt | runner | `e2f6b8f` | 09-26 | -| A console unit instead of serial-getty | +340 ms until TERM=dumb, then equal | runner | `c6e48de`, `7b08e5a` | 09-26 | -| Fewer unit files | 300 extra: 236 vs 246 | runner | `9fab3f1` | 09-26 | -| systemd-oomd | the kernel always beat it | runner | `337c08d` | 09-28 | -| CPUWeight/IOWeight/MemoryLow on ssh.service | no change | runner | `f7cd1ab` | 09-28 | -| Getty without BindsTo dev-ttyS0 | 342 vs 345 | ladder | lab 43303190733 | 11-12 | -| The serial getty at `StartupCPUWeight=1`, out of the first login's way | +2.7 [−4.3, +7.9] at 60 boots | spin | lab 44977226981 | 11-22 | -| Mask four varlink sockets nothing uses (factory-reset, mute-console, sysext, creds) | −0.8 [−4.8, +4.3] at 60 boots | spin | the same | 11-22 | -| Keygen wanted by multi-user.target | 518 vs 514 | ladder | lab 43312419007 | 11-12 | -| Mask sshd-socket- and run-generators | login 489, no change | ladder | lab 43483372488 | 11-13 | -| Mask 11 always-failing units | 484, no change | ladder | lab 43483372488 | 11-13 | -| Mask `modprobe@drm` (logind is ordered after it) | 327/345 vs 328/337. It is masked all the same, since 09-07, one of the 16 masks of group C-masks | ladder | lab 44558035927 | 11-19 | -| Mask `systemd-udev-load-credentials` | −8 then −6 ms, p95 unchanged: not separable at 20 boots | ladder | labs 44537549305, 44538877783 | 11-19 | -| systemd with `-Db_lto=true` | Ubuntu already passes `-flto=auto`: the same packages | - | image/systemd/Dockerfile | 11-19 | -| Masks of 15 units and a generator the image does not have | they masked nothing. Deleted without a run; image/build.sh refuses such a mask | - | #352 | 11-21 | -| PID 1's `LogLevel=err`, `LogTarget=journal`, `ShowStatus=no`, `StatusUnitFormat=name`; `kernel.printk = 3 3 3 3` | taken back −1.8 [−7.7, +3.2] at 40 boots; the console stays quiet through the command line. Deleted | spin | labs 44818953987, 44822157367, #354 | 11-21 | -| logind, `user-runtime-dir@` and `user@` at `StartupCPUWeight=1000`, the units user@0's chain is (#553) | −3.6 [−10.3, +0.6] at 40 boots (−9.2 [−16.1, −0.3] at 30 in a screening run of three arms, lab 45082870346). Accept to login −7.7, sshd accepting +8.8: logind and the manager come sooner and `sysinit.target` later, on the one vCPU | spin | lab 45083184310 | 11-22 | -| `spin-machine-sshd-keygen` and `systemd-udev-load-credentials` at `StartupCPUWeight=1` (#553) | sshd accepting +22.6 [+15.9, +33.5], first login +3.4 [−3.2, +14.6] at 30 boots: ssh.service waits for the keygen, and the forwarder for ssh.service. With the arm above, first login +6.0 [+0.5, +15.1] | spin | lab 45082870346 | 11-22 | -| Mask `systemd-udev-load-credentials` again, in spin's shape on one vCPU (it was −8 and −6 on two) | −2.1 [−6.3, +0.3] at 60 boots: not separable | spin | lab 44977044826 | 11-22 | -| `systemd-user-sessions` without its ExecStart (it removes a /run/nologin the image never writes), its ExecStop kept | −0.6 [−5.2, +1.5] at 60 boots | spin | the same | 11-22 | -| Mask `sshd-socket-generator`, again on spin's path | +0.8 [−4.0, +4.7] at 60 boots | spin | the same | 11-22 | -| `DefaultMemoryAccounting=no`, for cheaper unit cgroups | +4.1 [+0.8, +7.1] at 60 boots, worse; sshd accepting +6.2 [+2.2, +8.0]. The cause is not measured | spin | the same | 11-22 | -| No unit made for a `RequiresMountsFor=` prefix with no unit file (`unit_add_mount_dependencies` checks the unit name map before it loads one) | −1.0 [−4.3, +3.9] at 100 boots, and PID 1's CPU before the login 57.2 against 56.0, p50 of 5: not separable. Whether the stubs went in those boots was not observed (no debug boot of the arm). The patch and an upstream draft, not sent, are #580 | spin | labs 45090299768, 45090326943 | 11-23 | -| The rest of the boot started by a timer 2 s after the boot, in place of `Type=idle` (#574) | −66.5 [−75.2, −56.1] against idle's −59.2 [−69.1, −47.4] in the same run, both with the supervisor early: the timer starts the rest at an arbitrary time whatever the login, and docker's socket waits for it | spin | lab 45090246267 | 11-23 | -| The rest of the boot started from sshd's PAM stack at the first session (#574) | −52.0 [−61.6, −37.4], accept to login +15.3 [+10.8, +21.7]: it runs beside the login's last steps, and every login pays its `pam_exec` | spin | lab 45090246267 | 11-23 | -| `pam_selinux` (twice) and `pam_mail` out of sshd's PAM stack: SELinux is off and there is no mail | −1.9 [−4.9, +2.8] at 60 boots | spin | lab 44979726719 | 11-22 | -| `nsswitch.conf` without the `db` entries libnss-db would serve (kept since 09, never measured); reverted to Ubuntu's | taking it back +0.8 [−8.4, +5.2] cold, restored in noise | spin | lab 45034963004 | 11-22 | -| The manager's timeouts at 15 s and 10 s, the watchdogs off (`fast-boot.conf`); reverted to systemd's defaults | taking it back +0.3 [−5.2, +3.3] cold, restored in noise | spin | lab 45034963004 | 11-22 | -| containerd's CRI-enabled config replaced by containerd.io's own (#510); reverted to the package's | first login −4.9 [−12.2, +1.6] at 20 boots, restored login −0.6 [−2.1, +1.5] evicted: containerd starts at the first docker command, after the login | spin | labs 45111391250, 45112037022 | 11-23 | -| The image's `containerd.socket` out of the boot transaction, Docker's own `docker.socket` on both sides (#509) | first login +7.4 [−4.7, +15.3], sshd accepting +7.5 [−6.6, +14.9] (lab 45111146715); prestart cold −1.1 [−8.0, +9.0], prestarted +4.5 [−4.6, +9.9], restored −0.1 [−1.0, +1.7], restored into prestarted −0.5 [−1.8, +0.7] (lab 45111146865): all within noise. The socket starts in `sockets.target`, after the first login since #581. Kept: nothing to gain, and a tool that dials containerd's socket before docker has run would lose its start | spin | lab 45111146715, 45111146865 (20 a side, v20261123.04) | 11-23 | -| PID 1, journald, logind and `user@0` linked without the dynamic linker: v262's multicall build (#42304) or a static one (#42820), for their ld.so start-up (#638) | ld.so's own start-up, `LD_DEBUG=statistics`, p50 [range] of 8 boots: PID 1 0.48 [0.46, 0.56] ms, journald 0.20 [0.14, 0.31], logind 0.20 [0.11, 0.31], `user@0` 0.21 [0.15, 0.36]; 1.1 ms for the four, under #638's 5 ms threshold, so no build was run. Relocation 0.08-0.11 ms each (2,522 symbol and 16,589 relative relocations in PID 1 and `user@0`). The instrument moved nothing: first login +3.4 [−23.0, +11.9], PID 1's CPU −1.1 [−5.1, +0.6]. The multicall build keeps libsystemd-core and libsystemd-shared dynamic and leaves journald and logind as they are; the static one has no PAM for `user@`'s `PAMName=` | spin | lab 45180856158 | 11-23 | -| journald's, logind's and `user@`'s seccomp and sandbox settings, split from #574's bound (−14.1 [−18.5, −11.5]), and one seccomp filter per unit (#637) | the seccomp half carries it, −12.0 [−21.8, −2.1]; the namespace half +0.3 [−9.4, +7.2] (lab 45228294512). Fewer filters do not: `SystemCallArchitectures=` applied first takes journald's 17 → 8 and logind's 26 → 13, the same answer to 3435 calls (`boot:seccomp`, labs 45235103665, 45235485857), and read −0.4 [−6.1, +2.7] against systemd rebuilt without it (lab 45231419187). In journald's executor `SystemCallFilter=@system-service` takes 3.7-4.0 ms of 6.7-7.2, its `seccomp_load()` 1.1-1.2 of that, every other seccomp setting ~0.6 together (labs 45238003981, 45239372741, 2 vCPUs): one filter per unit would reach the 0.6. Building the allow-list once is #686. Prior art: systemd#17451 (one program per feature; Lennart wants each filter's application checked), libseccomp#499 (one context drops a conditional rule beside an unconditional one with another action, so merging settings is unsafe) | spin | labs 45228294512, 45231419187 | 11-23 | - -### The login - -| Idea | Result | Shape | Source | Date | -|---|---|---|---|---| -| sntrup761 (OpenSSH's default kex) | 104 vs 40 ms a login | ladder | #245, lab 43479854381 | 11-13 | -| The vsock socket and sshd@ without default dependencies | no sooner; dropped 7 of 22 first connections. Carried since with the lane's other drop-ins (`sshd-vsock.socket.d`, `sshd@.service.d`), which the lane kept together (lab 43518915618) | laptop | `c3c0fd1` | 11-13 | -| CPUWeight/IOWeight/Nice on the first login's lane | −2 ms over the filtered coldplug; second login 63 vs 45 | lane | lab 43518915618 | 11-13 | -| One sshd for every connection (vsock `Accept=no`, `sshd -D` early) | first login 382 vs 381; second 40 vs 48 | lane | lab 43524721490 | 11-13 | -| A login without pam_systemd (a bound) | 380 vs 436, but no session and no XDG_RUNTIME_DIR | lane | lab 43518044150 | 11-13 | -| logind's Varlink socket without default dependencies | accept to login 131 → 120, first login inside the noise; kept with the lane's other drop-ins | ladder | labs 44558035927, 44558053261 | 11-19 | -| Sessions of class `user-early` with the manager started inside the login (#462). Kept since with root lingering (#467, "What the machine carries") | first login +36.2 [+32.0, +45.7], accept to login +39.5; restored +0.5 [−3.0, +3.8] | spin | lab 44987167474, 44987167549 | 11-22 | -| Every login's user manager started beside it, not waited for (`user-runtime-dir@`'s `20-manager.conf`, #462): a command that needs the user bus at once in the first login came before the manager | correctness: the first login's own `systemctl --user` failed 10 of 10. Replaced by class `user-early` (#467) | spin | lab 45032247920 | 11-22 | -| The user manager without the XDG autostart generator, on top of class `user-early` (#467) | first login −4.8 [−11.2, +1.3], accept to login −3.7 [−7.5, −0.5] at 20 boots. Carried since #527, with root's manager in the boot: −3.8 [−6.2, −0.7] at 100 ("What the machine carries") | spin | lab 45030778365 | 11-22 | -| Both user generators masked, a bound: the environment.d one also brings `/etc/environment` to user services | first login −8.4 [−15.8, −1.0] against class `user-early` | spin | lab 45030778365 | 11-22 | -| The user manager's PAM stack down to `pam_permit` and `pam_systemd`, a bound | first login −3.5 [−11.4, +2.5] against class `user-early` | spin | lab 45030778365 | 11-22 | -| `user@`'s `After=systemd-user-sessions.service` (Ubuntu's `10-login-barrier.conf`) shadowed, for a login as spin | lane +30.6 against +29.7 without it: the barrier is not what the lane waits for | lane | lab 45031687433 | 11-22 | -| Root's manager cut to what a workspace could do without, a bound: both user generators, the PAM stack down to `pam_permit` and `pam_systemd`, `ssh-agent.socket` and `systemd-ask-password.socket` masked. Without the environment.d generator user services lose the bus's address (`10-user-sockets.conf`) and `/etc/environment`; without `pam_unix`, `pam_limits` and `pam_loginuid` the manager skips the account check, the limits and the audit login uid | first login −9.6 [−13.3, −6.7] against v20261122.06, the ledger's ~10 ms of CPU for the same cuts. The XDG generator alone was carried; the rest is function | spin | labs 45070150688, 45070208762 | 11-22 | -| No user manager for root, a bound: sessions of class `user-early-light` and root not lingering, as before #467 | first login −17.3 [−19.2, −12.4], console prompt −26.6: the manager's 17.5 ms of CPU, 1:1, on a vCPU with no idle from ~155 ms to the login. The first login's `systemctl --user` fails without it (#467) | spin | lab 45070150688 | 11-22 | -| spin's forwarder (spin's supervisor) without default dependencies, after `ssh.service` only (`--edit forwarder-early`), on v20261122.06 | cold +4.2 [+0.0, +11.0], restored −0.0 [−2.3, +2.3], restored into prestarted −4.3 [−7.7, −0.4]: not a gain on either goal number, though the forwarder was active 116-141 ms after PID 1 against 154-176 (bootchart, 3 a side). The login then waits for systemd-logind, active at 162-186 ms in both arms, before `user-runtime-dir@0` (#553). On earlier releases it read cold −60.4 (lab 44987584707); what changed since is not measured | spin | labs 45071102677 (`prestart`, 20 a side), 45071549627 | 11-22 | - -### The restore and checkpoints - -| Idea | Result | Shape | Source | Date | -|---|---|---|---|---| -| mapped-ram with multifd ×4, 11-13 | not comparable by its own run's log; channels were measured again on 11-20 and kept | ladder | #246, lab 43483852339 | 11-13 | -| Fast snapshot load (mapped-ram and postcopy-ram on a `file:` URI) as the restore | running at 38 ms, but the login at 293/325 instead of 152/161: every page touched is a fault served by one read. `LoadOptions.Fast` stays for large states | ladder | lab 44585840498 | 11-19 | -| Fast snapshot load for every state, the caller's choice (`LoadOptions.Fast`, spin's `fast_load`) | login +394 [+388, +420] at 179 MiB of data, +103 at 1.2 GiB, −129 at 1.7 GiB, −2615 at 7.3 GiB. Replaced by the machine's choice above 1.5 GiB (#470) | spin, touched | labs 45034868686, 45035462478, 45034881876, 45034881366 | 11-22 | -| The state read ahead during a fast load | at 179 MiB the login −168 ms, still +234 over a full load; at 3.7 GiB within noise, p95 713 against 490 | spin, touched | labs 45035029887, 45035048486 | 11-22 | -| Base memory in a shared file, left out of the checkpoint (`x-ignore-shared`) | state 0.3 MiB, save 15 ms, but neither goal number improves: cold 1089 ms on disk, 709-719 on tmpfs | ladder | labs 44663272360, 44664989139, #306 | 11-20 | -| 16 multifd channels as the default | −10.1 alone, but +3.2 [+1.1, +5.8] against 8 when 4 restore at once | spin | lab 44792429636 | 11-20 | -| `direct-io` (O_DIRECT) on the channels | within the noise evicted, +45 ms cached | laptop | log.md, 11-21 | 11-21 | -| `direct-io` on the channels of a save, against dirty-page throttling in the stop | never converged beside a busy disk: each pass ~2.5 s, the save cancelled after 10 min | spin, plugged 2 GiB | lab 44973775066, docs/memory-and-disk.md | 11-22 | -| `downtime-limit` 15 instead of 30 | the guest's stop −2.5 [−7.5, +3.0] short of memory beside a busy disk, −1.5 [−6.0, +2.8] with a writer | spin, plugged 2 GiB | lab 44975130836 | 11-22 | -| The guest's clean page cache dropped right before its save (`sync; echo 1 > /proc/sys/vm/drop_caches`), #276's last idea | the state did not shrink: 183 MiB with the drop, saved at once −0.1 [−0.4, +0.3] and 3 s later −0.0 [−0.3, +0.4]. The restored login was worse, +4.7 [+3.5, +7.3] evicted at once and +5.6 [+4.6, +7.6] 3 s later, as the login read again from the guest's disk what the drop took from its cache | spin | lab 45110967817 | 11-23 | - -### QMP and vsock - -Both transports were measured in spin's shape on the bench, 20 boots, with the `transport` probe -(lab 44912471522, v20261121.01, 2026-11-21). Each ceiling is what the goal number would gain if the -part cost nothing. None is above the noise (±7-9 ms cold, ±13 restored at 20 boots), so none was -built. - -| Idea | Result | Shape | Source | Date | -|---|---|---|---|---| -| Faster QMP in general | the cold boot waits on 14 commands, 6.2 ms from QEMU's main loop being free to `cont` answered (1.3% of 470). A restore waits on 17 before `migrate-incoming`, 6.7 ms, and 2.7 after the guest runs. The commands' own run is ~1.2 ms of each path. The rest is round trips: query-status alone is 131 µs from the client, 18 µs in QEMU. spin-machine's start and dial are off the path: its first command waits 17 ms (cold) and 19.5 (restored) for QEMU | spin | lab 44912471522 | 11-21 | -| Pipelining the bind (every command sent before the first answer) | ceiling: QEMU's wait on the client, 4.5 ms cold and 5.2 restored, under the noise. The read-ahead overlaps the restore's half, so its share is smaller | spin | the same | 11-21 | -| The held start's bind sent ahead of its answers: the run state with the places, every place's serial at once, each image's two nodes together, the reopen with the placeholder's delete; 13 round trips to 9, add-fd still waiting for its answer and `cont` for the bind's last (#649) | first login −1.7 [−5.6, +2.6], sshd accepting −2.4 [−5.5, +2.8] at 60 a side (lab 45230790902); restored −0.3 [−3.8, +3.7] evicted, +0.9 [−10.6, +7.5] cached (lab 45231358105). The split: QEMU waited 4.5 ms p50 for the client in 24 boots, 0.9 of it QEMU busy with the probe's plug monitor, so ~3.6 ms is spin-machine's own, ~0.28 ms a round trip (lab 45177818419). The four round trips removed are ~1.1 ms (inferred), and the whole of spin-machine's share is under what 60 boots resolve. Code on tag `archive/exp-649-held-start` | spin | labs 45230790902, 45231358105 | 11-23 | -| Fewer round trips (no `query-status` before the bind, places read from the Spec instead of `query-block` and `qom-get`, `Last(RESUME)` for the `query-status` after a load) | ceiling ~1.3 ms cold, ~1.9 restored | spin | the same, the detail by command | 11-21 | -| Smaller answers | nothing large is on either path: `query-block` runs in 0.12 ms. The record's 125 KB answers left the restore's clock with `Resume(here)` | spin | the same | 11-21 | -| QMP over vsock, SEQPACKET, ivshmem, virtio-serial, gRPC or protobuf framing | QMP does not ride vsock: it is a Unix socket between the host and QEMU. vsock carries the login, and a login is 10 round trips of 47.8 µs (57.5 through the forwarder), 0.6 ms of a 32.8 ms warm login. Every vsock change shares that ceiling | spin | the same | 11-21 | -| `kvm.halt_poll_ns`, CPU pinning, for vsock | bounded by the same 0.6 ms a login. What they do to the boot's other wake-ups is a different question, not measured here | spin | the same | 11-21 | -| An `iothread=` for the disks, against QMP stalls beside a guest's synced writes on a busy host disk (#391) | no stall to take off the monitor: 2,400 query-status round trips beside 4 KiB `oflag=dsync` writes, with the scratch NVMe idle, 99-100% busy with O_DIRECT writes and 100% busy through the page cache, never took more than 1.2 ms (p50 0.24-0.56 ms), while the guest's writes fell from ~115,000 to 1,500-3,100 in the row. The laptop's 175-950 ms was QEMU's main thread blocked in the host, by #402 in reclaim, the mmap lock or a cgroup throttle, which an iothread does not move | spin | labs 45111443524, 45112573850, `stall` probe archived as `archive/qmp-stall-391` | 11-23 | - -### Memory and the host - -| Idea | Result | Shape | Source | Date | -|---|---|---|---|---| -| Lower `memhp_default_state` (unplug policies) | kept `online` | runner | `2903d8c`, #48 | 09-30 | -| DAMON_RECLAIM, MGLRU eviction | slower, or not selective | runner | docs/memory-and-disk.md | 10-01 | -| `page_reporting_order` 0 or 3 | ~100 MB transient vs ~180 MB of huge pages lost | runner | docs/memory-and-disk.md, #83 | 10-01 | -| Prefetch the boot's files | 47 ms to win 24 | runner | run 36803912357 | 10-01 | -| A second limit (`memory.high`) | `memory.max` suffices | - | docs/memory-and-disk.md | 10-01 | -| KSM, free page hinting, virtio-fs DAX | security, correctness, unsupported | - | docs/memory-and-disk.md | 10-01 | -| QEMU at a higher host priority (cgroup `cpu.weight`, nice, a real-time class) on an idle host | ceiling: QEMU's threads wait 0.2/1.1 ms for a CPU from its exec to the cold first login and 0.1/0.2 to the restored one, the guest's steal 0. Priority can win back only that wait. On a busy host it is a lead for spin ("Open experiments") | spin | lab 44925573288, `run-delay` | 11-21 | -| A burst of restores bound by host CPU0 | no: busy time, interrupts and QEMU's threads spread over all 16 CPUs, and irqbalance runs | spin | lab 44817486118 | 11-21 | - -## Open experiments - -The rows are ranked by ceiling. A row stays here until it is decided, and then moves. - -| Experiment | Number | Phase, p50, ceiling | Decided by | State | -|---|---|---|---|---| -| A burst of restores: 8 at once read ~190-240 ms each under `defer`, against ~100 alone | restore, as a host sees it; spin restores concurrently with no host-wide limit | the burst's ~100-140 ms over one restore alone | `restore-together`, `together=1 8`, evicted, with the change against without it | open. The host's CPUs are 72-78% busy in the burst, and direct reclaim runs as the states fill the page cache (lab 44817486118). Next candidates: `vm.watermark_scale_factor`, and the CPU one restore costs | -| A login without OpenSSH's exec per connection and PAM | both | a warm login, ~25-43 ms, is in both numbers | a bound first: `prestart` with the login replaced | lead (log.md, 11-20, "spin's login, spin's memory"). spin's path already runs one sshd, and PAM and pam_systemd are what spin's sessions are made of | -| Carried items never measured alone: kernel patches 0005, 0007, 0008 and 0010 each (group A is +67.5 together); `pci=lastbus=0` (2026-09, before patches 0004 and 0010); logind's early varlink socket (measured on 2 vCPUs); QEMU 0001 and qboot's `pam.patch` apart; `no_timer_check`, `tsc=reliable`; `hpet=off`; systemd's static tools; `-O ^orphan_file`; `rootfstype=ext4`; the lane's drop-ins on spin's path | cold | each ≤ a few ms; B together +11.5 | rule 5, an arm each, 40 boots | open. The static tools and `orphan_file` need an image build (`--systemd` builds only an experiment patch) | -| What functional items cost, last measured on another machine: BPF JIT and BTF (+21.4 ms to "Freeing", 09-07, a vmlinux through PVH, before the ftrace patches), lockdown at confidentiality (nothing told from noise, 10-01, a host at load 6-10) | cold | a few ms each, unknown in spin's shape | `ssh-first` with a `--kernel` built without each, 20 boots | open. They stay for function, so a number says what they cost and decides nothing | -| The no-systemd floor, each release | a bound | how much of the cold number is systemd's to give back: 445 → 240 in spin's shape | `ssh-first` on the release with `--edit floor --append init=/usr/local/sbin/spin-floor` and `login=lane`; `releases measure` does it beside every release, and report.yml records it (docs/releases.md, "Bounds") | last measured 11-22 on v20261122.02: the lane's first login 407 → 241, −166.3 [−174.7, −160.3] (report.yml run 45018301368, 20 boots). On v20261122.01: 404 → 250, −153.9 [−162.5, −151.2], sshd accepting 242 → 197 (lab 44978079694, 20 boots). 11-20: 445 → 240 (lab 44750322384) | -| A workspace's cgroup at a higher `cpu.weight` while it boots or restores, on a busy host (spin's runner owns the cgroup) | restore, as a busy host sees it | with 16 workspaces keeping the 16 CPUs busy, the restored first login is 306 ms against 115 idle, and QEMU's threads wait 282 ms for a CPU (lab 44925573288). The same weight ratio as QEMU at nice −10, set as the crowd at nice 10: restored −79.3 [−93.5, −71.0], cold −104.7 [−258.3, +150.9], within noise (lab 44927312303) | spin's `restore-together` or a crowd on its runner, with the weight raised through the workspace's cgroup and set back after the login, against without it | a proposal for spin. Measured in one cgroup, where each thread competes alone. In spin each workspace is a cgroup, and the weight is shared by its threads. The idle host has nothing to win (Measured and rejected, "Memory and the host") | -| The restore with more than 2 GiB of RAM | restore | unmeasured (#242's checklist) | `restore-first` with `plugged` above 2048 | open | -| A workspace's 2048 MiB at boot (`memory=2048 plugged=0`) instead of 128 plugged to 2048 through virtio-mem during the boot (#561) | cold | the plug and the onlining of 2048 MiB on the one vCPU while the boot runs; separate runs read −15 nested and −8 metal (v20261122.06, labs 45074465204, 45074579100, 45074680619, 45078339515), so the ceiling is ~15 ms. Prior art: the kernel onlines hotplugged memory strictly in sequence, one memory block after another, and deferred struct page init, which spreads the boot's own memory over threads, does not apply to it (David Hildenbrand on linux-mm, [lore](https://lore.kernel.org/linux-mm/87v9disj2s.fsf@oracle.com/T/)). Squeezy (arXiv 2411.12893, 2024) measured virtio-mem's operations in seconds at GiB sizes and found init_on_free slows a plug. Neither measured a boot. The kernel has init_on_alloc and init_on_free off | `ssh-first`, the two shapes as two trees of one run (`--opt` on a tree), 40 a side on bench and on bench-metal, `restore-first` beside them; 3 ledgers of each shape for the onlining's CPU | a proposal for spin, spin-stack/spin#1660. Measured as two trees of one run (v20261123.04, spin's login): cold first login −5.5 [−10.9, −0.7] nested at 80 a side (lab 45111507862; −2.5 [−7.3, +2.0] at 40, lab 45110554589), −7.0 [−11.4, −3.4] on metal at 40 (lab 45110570912); restored login −2.5 [−3.7, −1.0], the state −17.6 MiB, QEMU's RSS −26 MiB (labs 45110562994, 45111507862). The ledger (lab 45110580480, 3 boots each) shows `kworker/0:1` on the vCPU ~8 ms before PID 1 when plugged and not at all when the memory is at boot, which costs the kernel's own setup ~4.5 ms more: PID 1 −4.0 ms on the kernel's clock (−3.4 on CLOCK_MONOTONIC, before #644). The probes keep spin's shape until spin changes it | - -The floor is a bound and never a candidate: systemd stays (AGENTS.md, "What must not break"). - -## Open questions - -No lab run answers these questions. - -- **Does the image keep a vsock login of its own?** spin does not use the lane (see "What the - machine carries"). This is the maintainer's decision. -- **Is `10-seats.conf` still needed?** The control that should fail passes on systemd 259 (#240). -- **What seeds the guest's RNG without virtio-rng?** It has to be answered before the removal is - measured. -- **musl under long-running load.** No run has measured it (`31a57e7`). -- **`page_reporting_order`.** Revisit only if memory per host becomes the limit - (`docs/memory-and-disk.md`). -- **`machine.Type` off pc-q35-11.1.** QEMU is 11.2 and the machine is still pc-q35-11.1 - (`machine/shape.go`, `internal/build/machinetype.go`). It is a change of its own. -- **The kernel CVE judge.** 9 CVEs apply with a fix later in 7.3, and 1 has no fix (`0ce27ad`, - against 7.3.1; the kernel is 7.3.5 on 2026-11-20). -- **The min_ttl_ms evidence disagrees.** `47aa681` and the LRU_GEN comment in `kernel/Dockerfile` - say different things (docs/log.md, 09-28). -- **The guest clock on 09-30.** `1d5e7f5` blames chrony, which had left the image on 09-10 - (`c7af4d3`). The fix (time by `/proc/uptime`) stands either way. diff --git a/internal/docsrec/testdata/split/kinds.txt b/internal/docsrec/testdata/split/kinds.txt deleted file mode 100644 index 97729ddf..00000000 --- a/internal/docsrec/testdata/split/kinds.txt +++ /dev/null @@ -1,711 +0,0 @@ -1 pr -2 pr -3 pr -4 pr -5 pr -6 pr -7 pr -8 pr -9 pr -10 pr -11 pr -12 pr -13 pr -14 pr -15 pr -16 pr -17 pr -18 pr -19 pr -20 pr -21 pr -22 pr -23 pr -24 pr -25 pr -26 pr -27 pr -28 pr -29 pr -30 pr -31 pr -32 pr -33 pr -34 pr -35 pr -36 pr -37 pr -38 pr -39 pr -40 pr -41 pr -42 pr -43 pr -44 pr -45 pr -46 pr -47 pr -48 pr -49 pr -50 pr -51 pr -52 pr -53 pr -54 pr -55 pr -56 pr -57 pr -58 pr -59 pr -60 pr -61 pr -62 pr -63 pr -64 pr -65 pr -66 pr -67 pr -68 pr -69 pr -70 pr -71 pr -72 pr -73 pr -74 pr -75 pr -76 pr -77 pr -78 pr -79 pr -80 pr -81 pr -82 pr -83 pr -84 pr -85 pr -86 pr -87 pr -88 pr -89 pr -90 pr -91 pr -92 pr -93 pr -94 pr -95 pr -96 pr -97 pr -98 pr -99 pr -100 pr -101 pr -102 pr -103 pr -104 pr -105 pr -106 pr -107 pr -108 pr -109 pr -110 pr -111 pr -112 pr -113 issue -114 pr -115 pr -116 pr -117 issue -118 issue -119 issue -120 issue -121 issue -122 issue -123 issue -124 issue -125 issue -126 issue -127 issue -128 issue -129 issue -130 issue -131 issue -132 issue -133 issue -134 issue -135 issue -136 issue -137 issue -138 issue -139 issue -140 issue -141 issue -142 issue -143 issue -144 issue -145 issue -146 issue -147 issue -148 issue -149 issue -150 issue -151 issue -152 issue -153 issue -154 issue -155 issue -156 issue -157 issue -158 issue -159 issue -160 issue -161 issue -162 issue -163 issue -164 issue -165 issue -166 issue -167 issue -168 issue -169 issue -170 issue -171 issue -172 issue -173 issue -174 issue -175 pr -176 issue -177 issue -178 issue -179 issue -180 issue -181 issue -182 issue -183 issue -184 issue -185 issue -186 issue -187 issue -188 issue -189 issue -190 issue -191 issue -192 issue -193 issue -194 issue -195 pr -196 pr -197 pr -198 issue -199 issue -200 issue -201 issue -202 issue -203 issue -204 issue -205 issue -206 issue -207 issue -208 issue -209 issue -210 pr -211 issue -212 issue -213 pr -214 pr -215 pr -216 pr -217 pr -218 pr -219 pr -220 issue -221 issue -222 issue -223 pr -224 pr -225 pr -226 pr -227 pr -228 pr -229 pr -230 issue -231 issue -232 pr -233 pr -234 pr -235 pr -236 pr -237 pr -238 pr -239 pr -240 pr -241 pr -242 pr -243 issue -244 issue -245 pr -246 pr -247 pr -248 pr -249 pr -250 pr -251 pr -252 pr -253 pr -254 pr -255 pr -256 pr -257 pr -258 pr -259 issue -260 pr -261 issue -262 pr -263 pr -264 issue -265 issue -266 pr -267 pr -268 pr -269 pr -270 pr -271 pr -272 pr -273 issue -274 issue -275 pr -276 issue -277 pr -278 pr -279 pr -280 pr -281 pr -282 pr -283 pr -284 pr -285 pr -286 pr -287 pr -288 pr -289 pr -290 pr -291 pr -292 pr -293 pr -294 pr -295 pr -296 pr -297 issue -298 pr -299 pr -300 pr -301 pr -302 pr -303 pr -304 pr -305 pr -306 pr -307 pr -308 pr -309 pr -310 pr -311 pr -312 pr -313 pr -314 pr -315 pr -316 pr -317 pr -318 pr -319 pr -320 pr -321 pr -322 pr -323 pr -324 pr -325 pr -326 pr -327 pr -328 pr -329 pr -330 pr -331 pr -332 pr -333 pr -334 pr -335 pr -336 pr -337 pr -338 pr -339 pr -340 pr -341 pr -342 pr -343 pr -344 pr -345 pr -346 pr -347 pr -348 pr -349 pr -350 pr -351 pr -352 pr -353 pr -354 pr -355 pr -356 pr -357 pr -358 pr -359 pr -360 pr -361 pr -362 issue -363 issue -364 pr -365 pr -366 pr -367 pr -368 pr -369 pr -370 pr -371 pr -372 pr -373 pr -374 pr -375 pr -376 pr -377 pr -378 pr -379 pr -380 pr -381 pr -382 pr -383 pr -384 pr -385 pr -386 pr -387 pr -388 pr -389 pr -390 pr -391 issue -392 issue -393 issue -394 issue -395 issue -396 issue -397 pr -398 pr -399 issue -400 pr -401 issue -402 issue -403 issue -404 pr -405 pr -406 pr -407 issue -408 issue -409 issue -410 issue -411 pr -412 issue -413 issue -414 pr -415 issue -416 issue -417 pr -418 pr -419 issue -420 pr -421 issue -422 pr -423 issue -424 pr -425 issue -426 issue -427 pr -428 issue -429 issue -430 pr -431 pr -432 pr -433 issue -434 pr -435 pr -436 pr -437 issue -438 issue -439 pr -440 pr -441 pr -442 issue -443 pr -444 issue -445 pr -446 pr -447 pr -448 pr -449 pr -450 issue -451 pr -452 issue -453 pr -454 pr -455 issue -456 issue -457 issue -458 pr -459 issue -460 issue -461 pr -462 issue -463 issue -464 pr -465 issue -466 pr -467 issue -468 pr -469 pr -470 issue -471 pr -472 issue -473 pr -474 pr -475 pr -476 pr -477 pr -478 pr -479 pr -480 pr -481 pr -482 pr -483 pr -484 pr -485 issue -486 issue -487 issue -488 issue -489 issue -490 pr -491 pr -492 pr -493 pr -494 pr -495 issue -496 issue -497 issue -498 pr -499 pr -500 pr -501 issue -502 pr -503 pr -504 pr -505 pr -506 pr -507 issue -508 pr -509 issue -510 issue -511 issue -512 issue -513 issue -514 issue -515 issue -516 issue -517 pr -518 issue -519 issue -520 issue -521 issue -522 pr -523 pr -524 pr -525 pr -526 pr -527 issue -528 issue -529 pr -530 pr -531 pr -532 pr -533 issue -534 issue -535 pr -536 issue -537 issue -538 issue -539 pr -540 pr -541 pr -542 pr -543 issue -544 pr -545 pr -546 issue -547 pr -548 pr -549 issue -550 pr -551 pr -552 pr -553 issue -554 issue -555 pr -556 pr -557 pr -558 issue -559 issue -560 pr -561 issue -562 pr -563 issue -564 pr -565 issue -566 issue -567 issue -568 issue -569 issue -570 pr -571 pr -572 pr -573 pr -574 issue -575 issue -576 pr -577 pr -578 issue -579 pr -580 issue -581 pr -582 issue -583 pr -584 pr -585 pr -586 issue -587 issue -588 issue -589 pr -590 issue -591 issue -592 issue -593 pr -594 pr -595 issue -596 pr -597 pr -598 pr -599 pr -600 pr -601 pr -602 pr -603 pr -604 pr -605 pr -606 pr -607 pr -608 pr -609 pr -610 pr -611 issue -612 pr -613 pr -614 pr -615 pr -616 pr -617 pr -618 pr -619 pr -620 pr -621 issue -622 issue -623 pr -624 pr -625 pr -626 pr -627 issue -628 pr -629 pr -630 pr -631 pr -632 pr -633 pr -634 issue -635 pr -636 pr -637 issue -638 issue -639 pr -640 pr -641 pr -642 pr -643 pr -644 issue -645 issue -646 issue -647 issue -648 issue -649 issue -650 pr -651 pr -652 pr -653 issue -654 pr -655 pr -656 pr -657 pr -658 issue -659 pr -660 issue -661 pr -662 issue -663 pr -664 pr -665 issue -666 issue -667 pr -668 pr -669 issue -670 pr -671 pr -672 pr -673 pr -674 pr -675 pr -676 pr -677 issue -678 pr -679 issue -680 issue -681 pr -682 pr -683 pr -684 pr -685 issue -686 issue -687 pr -688 pr -689 pr -690 pr -691 pr -692 pr -693 pr -694 issue -695 pr -696 pr -697 issue -698 issue -699 pr -700 pr -701 pr -702 pr -703 issue -704 pr -705 issue -706 pr -707 issue -708 pr -709 issue -710 pr -711 pr diff --git a/internal/docsrec/testdata/split/log.md b/internal/docsrec/testdata/split/log.md deleted file mode 100644 index 4299085c..00000000 --- a/internal/docsrec/testdata/split/log.md +++ /dev/null @@ -1,815 +0,0 @@ -# Log: what was done, why, and what it measured - -First built on 2026-11-13 from `git log origin/main` (327 commits, to `3e8075f`), the 150 pull requests of that day (merged, closed and open), the 44 releases' notes, the tree at `origin/main` (comments, `docs/`, `boot/*_test.go` row comments), and spin-stack/spin#1206 and spin-stack/open-remote-ssh#8. Hashes are short commit ids on `origin/main`; `#N` is a pull request here; "lab N" is a `lab.yml` run id as the tree or a PR quotes it. Dates are UTC, as the bench fleet and spin keep them. A commit made in UTC−3 can carry the day before. Nothing here was re-measured. Every change that decides something since adds its entry. - -Where boot time stands, what each phase costs, how a number is measured, and the tables of what was kept, measured and rejected, and is next are `docs/boot-time.md`. This log is the chronology. - ---- - -## 1. Chronological log - -Format: **date · area · refs**, then what was done, why, the result and its status. - -### Week 1: 2026-09-07 to 09-13 - -**09-07 · all · `2afac47`, `219b98a`.** The repository is created from spinbox's and storage's QEMU, kernel and image (image ported to mkosi, ext4 in a read-only qcow2). qemu-nbd dropped, Taskfile split per part, `task shell` added. *Why:* they were one machine, duplicated across repositories. *Result:* "boots as one machine … in 151 ms" (`2afac47`, consumer's initrd). *Status:* in place. - -**09-07 · machine/fingerprint · `5e7d60e`, `b476f6d`, `57e827a`, `b882171`, `17d844f`, `02709d7`.** `machine/` defines the slot map, the shape and the cmdline. `Fingerprint` hashes QEMU, the kernel and the initrd by content, plus the shape. Same day: -- the device topology goes into the hash (`b476f6d`); -- the host CPU goes back in under `-cpu host` (`57e827a`); -- the topology is corrected to leave out disks and NICs (`b882171`: templates have neither); -- the encoding is made length-prefixed (`17d844f`); -- an identity split is added for memoising (`02709d7`). - -*Status:* superseded. See the fingerprint cycle in §2. - -**09-07 · machine · `656d55b` → `b882171`.** `spin-machine save` and `boot --incoming file:` are added, then reverted the same day as "lifecycle" that belongs to the consumer. Kept: `Spec.CPU` with `enforce=on`. Measured: a state saved with Broadwell-v4 resumes on Broadwell-v4 and Skylake-Client-v4, and Nehalem refuses (`656d55b`, now in `docs/migration.md`). *Status:* save/restore came back as checkpoint commands (`c202568`, 09-28; kept after #51). - -**09-07 · tooling · `5e7d60e`, `8aee03a`, `24c8a06`.** `cmd/spin-machine-init` is a debug initramfs, and `spin-machine-console.service` is shipped but not enabled. *Why:* systemd gave no serial login, because the image masked udev, so `dev-ttyS0.device` never appeared. *Status:* the init was deleted `8eeb01c` (09-10) and the console unit deleted `3a7864d` (11-12). See §2. - -**09-07 · qemu · `31a57e7`.** QEMU is linked statically against musl. *Measured:* process start to QMP quit, 44 ms glibc vs 43 ms musl over 5 runs. Not measured: a long-running guest under load (musl allocator, thread stack). *Status:* in place; the load question is still open. - -**09-07 · image/kernel · `2df3dbf`.** Changes: -- root password removed; -- SSH host keys generated per boot (unit hung off ssh.service); -- chrony via `/dev/ptp0`; -- BPF_JIT and BTF on, at +21.4 ms of kernel boot and 5.0 MB (5 runs each way; also `kernel/README.md`); -- `-no-reboot`. - -BPF_LSM was left off. *Status:* BPF on and in place; chrony removed 09-10; BPF_LSM turned on 10-01 (`1400f6a`); the keys moved 3 more times (§2). - -**09-07 · qemu/machine · `8b7391a`.** aio=io_uring, discard=unmap, vhost=on requested, qom_cast_debug off. *Rejected:* -- `cache=none`: the shared base must stay in the host page cache, and O_DIRECT fails on tmpfs; -- `--enable-virtfs`; -- four configure flags that do not exist in 11.1.1. - -*Status:* in place. - -**09-07 · machine/kernel · `b476f6d`, `ee34d31`.** virtio-balloon with free-page-reporting. *Measured:* "costs nothing measurable", 158.9-162.5 ms with vs 157.9-171.6 without, noise ~14 ms. virtio-mem replaces DIMM slots, with `memhp_default_state=online` required: without it a request for 2048 then 3072 MiB plugged 1024 and stopped. Measured 0→2048→3072→512→2 MiB. *Status:* in place. - -**09-07 · machine · `58d404e`.** `tsc=reliable` restored; it had been lost in the move from spinbox. Not measured. In place. - -**09-08 · machine · `fa1803f`.** ICH9 `sata=off`, `smbus=off`. *Measured:* 400 boots per variant, kernel to init: 62.3 baseline, 61.3 sata=off, 61.7 smbus=off, 60.6 both; an earlier 150-boot series agrees. *Measured and rejected:* `usb=off` 63.0 vs 62.9; `vmport=off` 62.6; `smm=off` 62.3; `i8042=off` 62.5. *Status:* in place. - -**09-08 · CI · `fe332b4` (#4).** `task verify:args` starts 9 Specs under the TCG binary with `-S` and requires a QMP answer. *Why:* nothing checked that QEMU accepts the command line. In place (it became `TestQEMUAcceptsEveryArgument`). - -**09-09 · kernel cmdline · `9ca453a`.** `nohz=off` removed. *Measured:* a forced tick is 1.7% of a core per idle vCPU. Boot 821-853 ms vs 843-846; restore 113-221 vs 124-216 (template era). In place. - -**09-09 · machine · `76aacf9`, `7cafdf6`, `6599829`, `2b46d78`, `354c8a6`.** Changes: -- PCIe root ports for hotplug: no measured change to boot or restore; -- a NIC through a root port via `netdev_add fd=`; -- NIC count and `host_mtu` go into the fingerprint, while MAC and fd stay out; -- a second QMP monitor. - -*Status:* root ports were replaced by virtio-scsi on 09-29 (`2b19096`); NIC hotplug was dropped then; MTU and NIC in the fingerprint were superseded by `Spec.Contract` (`fa3041c`). - -**09-10 · boot probes/image · `4cbd229`, `bab6f16`, `c2c4c6a`, `722d468`, `b5f361f`.** `task boot:matrix` (shell). *Found:* masking udev buys nothing (826 vs 829 ms), and masking it costs a 10 s `dev-ttyS0.device` timeout with no login. udev was unmasked (`722d468`) and `40-spin-hotadd.rules` added for CPU and memory. Two stalls of 334 ms waiting on the console (XTGETTCAP and a terminal reset) are fixed by `TERM=dumb` on the kernel cmdline: 687→19 ms, and the whole boot 855→163-207 ms (`b5f361f`). The harness itself was contaminated: `unmask_udev` had become a no-op, so the first udev rows (826/829) were wrong (`b5f361f`). *Status:* udev on and TERM=dumb in place. The memory half of the hot-add rule was removed 11-12 (`3c8da99`). - -**09-10 · tooling · `8eeb01c`.** Debug initramfs deleted. "this repository does not ship an init". With udev on, the serial getty works: 204 ms to a login prompt. In place. - -**09-10 · boot probes · `80f984b`.** The boot bench is ported to Go and the shell harness deleted. *Found:* -- `systemd.mask=` on the cmdline does nothing (debug-generator masked), so every earlier row that used it measured nothing; -- agetty has an unconditional `sleep(1)`; -- the shell harness throttled the console (it read 1424 ms where the guest said 190); -- a Percentile bug. - -*Measured (15 boots, laptop):* as shipped 1256/1276; without agetty 253/320; 512 MiB 1241/1261; 1 vCPU 1309/1326; udev masked: 15 of 15 boots never reached a login. Superseded by `boot:bench`; `boot:bench` was deleted in #250. - -**09-10 · kernel · `c03ed89`, `1a8e25c`, `a31d7b2`, `f32d527`, `64d2901`, `e285dec`.** A kernel-phase investigation. Results, each recorded in `kernel/Dockerfile`: -- initcall_debug with a console attached measures the console (103.9 vs 42.8 ms); -- the 8250 trim is worth 154 µs; -- a modular kernel buys 0.57 ms and was rejected; -- acpi_bus_scan scales with the vCPU ceiling: maxcpus=16 +5 ms and maxcpus=64 +9 ms of kernel (63.0/68.1/72.1 ms), recorded at `Spec.MaxCPUs`; -- four ACPI cmdline parameters are worth 0 (69.9 vs 68.6); -- ksm_init and kcompactd_init are worth 0; -- `event_trace_enable_again`'s 6 ms is the profiler; -- inet_init's 9 ms is BTF's first parse, not XFRM. - -*Status:* rejected (docs/boot-time.md, "Measured and rejected"). - -**09-10 · image · `6aba37b`, `064c4f4`, `c7bab94`, `c7af4d3`, `08c56e1`.** Changes and measurements: -- logind 63 ms on the chain, worth 24 ms; chrony worth 10 (15 boots, laptop); -- Type=idle on the getty measured at 25 ms (291/344 vs 266/283); -- `disable-udev-settle.rules` deleted as wrong; -- chrony deleted: 248/322 vs 261/288; "a restore is invisible from the inside", and correcting the clock belongs to whoever restores; -- blame figures that summed to ~380 ms out of a 175 ms userspace are kept only as history. - -*Status:* chrony removed and in place. - -**09-10 · qemu · `b151186`.** The device list is turned into an allowlist (`--without-default-devices`): 363→225 instantiable types and a 23.7→8.7 MB binary. MICROVM rejected ("no ACPI CPU hotplug"). Boot unchanged (240/274 vs 245/265, laptop). In place. - -**09-10 · boot probes · `c049a21`, `8eef89d`, `a0efd65`.** QEMU's startup split: 1.4 ms launcher, ~27 ms exec to first instruction, ~7 ms guest to first console byte. The QMP greeting is not a checkpoint: it comes before the board is built, so the real QMP reply is at 18-20 ms, not 8. Cold-start cost is the host zeroing pages (18.8%) plus rom_reset; a restore pays neither (09-26). Not acted on. - -**09-11 · machine · `21a830c`.** `Disk.DirectOverBacking`, with a cache-modes bench of 16 VMs. Writes were inconclusive: the disk was 94% full and times moved tenfold. `mincore` reports every page resident for a file the caller does not own. *Status:* the field is now in `machine/vm.go`; the bench was deleted in #48; `Disk.Cache` was removed in #94. - -**09-11 · image · `ec008b0`.** sshd `TrustedUserCAKeys` (the CA file is written by the consumer). #101 (10-03): without the CA nothing logs in. In place. - -**09-12 · machine · `9177475`.** `Spec.Accel` (tcg). TCG guest to PID 1 in 6.5 s vs 33 ms under KVM. In place. - -**09-12 · image · `bb6bb89` (#5).** logind out of the boot transaction. The first login starts it through the varlink socket and a `/run/systemd/seats` drop-in (`10-seats.conf`). *Measured:* 249/287 vs 273/297, 25 boots, two runs (laptop). `boot:logind` holds sessions. *Status:* **reversed 11-12** (#240). See §2. - -### Week 2: 2026-09-14 to 09-20 - -**09-14 · image · `9335335`, `fe7d4ab`, `891e2f7`, `b5908ee`.** Changes: -- the image is sized in two passes: 974 MiB with 132 free, was 1163 with 317; -- e2fsprogs 1.47.4 is built static and pinned; -- `-m 0` for reserved blocks; -- a 64 MiB journal. - -Bug: `891e2f7` (shipped in v20260914.01) made a 4.08 GiB filesystem, because `-b` read the size as a block count. Fixed in `b5908ee`. In place. - -**09-14 · kernel · `b9d1985`.** A trixie toolchain and a reproducible vmlinux. *Why:* v20260914.01 and .02 had different kernels from the same source. bookworm's pahole 1.24 encoded `.BTF` in parallel, in a non-deterministic order, and the banner carried the build date. Two `--no-cache` builds now give the same vmlinux. Usable 503/575 vs 509/547 with gcc 12 (laptop, 20 boots). In place. - -**09-15 · CI · `c767cd5`.** The BuildKit `type=gha` cache had never stored anything: the runtime token does not reach `run:` steps, and every build shared one scope. Fixed with named scopes. Superseded by the registry cache (`1666cb5`, 11-12). - -**09-18 · machine · `da17b34`, `f023b56`, `5d4a01c`, `4947281`.** A restore opens its template read-only. Disks can be given as a chain of descriptors (`-add-fd`), and so can the console, `/dev/kvm`, vhost-vsock and vhost-net. In place, apart from the template parts. - -**09-20 · CI · `f63aa38` (#10).** Workflows move to Blacksmith. Superseded 10-24 (`f29e59d`). - -### Week 3: 2026-09-21 to 09-27 - -**09-21 · machine · `3d10256`, `56f6fea`.** `FingerprintCache` added. *Status:* removed `2d9b7e3` (09-29), with no caller; the identity split went in `c5baaa7` (10-01). - -**09-24 · machine · `35df9cf`.** No VMX/SVM in the guest. Measured with 3 hot-added cores: vmx=1,0,0,0 plus a warning before, vmx=0 on all after. Fingerprint moved. In place. - -**09-24 · image · `a01c847`.** Host keys made without RSA. RSA was 309 ms in blame in a guest, and on the host 141 ms vs 6 (ECDSA) and 5 (Ed25519). In place. - -**09-26 · image · `f36ae13`.** `/tmp` is a tmpfs again and tmpfiles-setup is unmasked. The imported optimizer had masked both. 223/230 vs 220/232, within noise. In place; `/tmp` was capped at a quarter of memory in `47aa681`. - -**09-26 · machine · `8063bcd`.** discard=unmap on the format node of a chain. Before this, fstrim freed nothing and deleted data stayed readable. Not measured. In place. - -**09-26 · firmware/qboot · `e4f456f` (#12).** The qboot experiment: `write-pointer.patch` (vmgenid needs WRITE_POINTER), built in a pinned container. The compiler moves the number: 6.32 ms saved with GCC 15.2 vs 3.86 with GCC 14.2 (`qemu/qboot/README.md`). Not adopted yet, because firmware was not in the fingerprint. *Status:* adopted 09-29 (`f2f4da0`). - -**09-26 · boot probes · `5221690`, `c6e48de`, `adc52cd`, `e2f6b8f`, `b9707e3`, `7b08e5a`.** Probes added: `boot:initcalls`, `boot:userspace`, `boot:systemd`. Findings: -- p50 98.2 ms kernel to "Freeing", of which 54.5 ms is 680 initcalls; -- udev coldplugs 266 devices, 64 of them `ttyN`; -- `CONFIG_VT=n` was predicted at 5-12 ms and measured at 0 (228/237 vs 228/246); -- 19 udev rule files masked: 0; -- device-count boot parameters: 0; -- the console-unit swap measured 340 ms worse, and the cause was finally found to be a 334 ms XTGETTCAP timeout, fixed with `TERM=dumb` on that unit (221/233 vs 558/572). - -*Status:* findings recorded. The rows were deleted in `3f669ef` and #90. `boot:userspace` and `boot:systemd` were deleted in #250. - -**09-26 · kernel · `dae6a14`, `5a3d509`, `cda04b1`, `9b5f0dd`.** A floor kernel (tinyconfig + PVH): release 97.95 vs floor 52.33 ms, so the config costs 45.6 ms (BTF, ACPI, ftrace). lz4 instead of gzip for an initrd: 6.4 ms. erofs removed (100.46 vs 102.22, noise). KSM and THP off: -0.50 ms, rejected. `CONFIG_VT` off as dead config. The 2.09 ms quoted for it was withdrawn (0.31 ms over 40 boots on an idle host). *Status:* erofs and VT off are in place. The floor probe and `kernel/minimal` were deleted in #48 (09-30). - -**09-26 · image · `9fab3f1`, `ad05544`, `9b5f0dd`.** Unit-file count does not matter: 300 extra units gave 236 vs 246. Unit loading costs 26 ms per `systemd --test`, not the 212 the debug log suggested. Masking the tpm2 and factory-reset generators is worth 1.0 ms of that 26. An empty `/etc/machine-id` skips the preset pass. *Status:* the masks are in place, except the tpm2 generator's, deleted 11-20 (#352). `boot:unitload` was deleted in #88. - -**09-26 · machine · `ab4844c`.** `drop-cache=off` on chain images: a restore had been issuing `POSIX_FADV_DONTNEED` on the shared base. Restore exec-to-running 29 ms with an overlay vs 24 without disks; `cont` 8.9→2.8 ms; a cold cache has been measured at 251 ms. In place. - -**09-26 · CI · `aa157cf`, `1ef95d1`.** The Blacksmith builder v2 required a `cache-key` and silently fell back to a local builder without it. Fixed with `nofallback`. Superseded 10-24. - -**09-27 · machine · `7ec3601`, `2f5a7b0`.** ACPI PCI hotplug is turned off and the guest's pciehp used instead. *Why:* device_del never completed, and spin's lane waited 30 s. Fingerprint moved. *Status:* superseded by virtio-scsi (09-29). - -**09-27 · tooling · `0b1f470`, `51c1fe9`, `2f03d09`, `e7e52db`.** `boot` with no disk uses `-snapshot`. Added: attach/detach, and the rule that checks go through the CLI. boot now execs QEMU, and the QMP handshake has a 5 s deadline. Validation was hardened, and the fingerprint moved again (`-accel` became its own argument). In place. - -### Week 4: 2026-09-28 to 10-04 - -**09-28 · machine/CLI · `c202568`.** `save --template` and `restore` added, plus `boot:restore`: restore ~20 ms; first request 14 ms warm, 33 cold, 31 after a reclaim. *Status:* the template parts were removed 09-30 (#51); restore was not measured again until 11-13. - -**09-28 · tooling · `30b717b`, `a8e2737`.** Every pin goes into `versions.yaml` with a gate test; the versions tool moved to go-tools. In place. - -**09-28 · kernel · `2fd0fff`, `430d2b3`.** 7.2.8 with PSI; then MGLRU, PARAVIRT_SPINLOCKS, PARAVIRT_TIME_ACCOUNTING, fq_codel and hung-task detectors. 322 vs 333 ms usable (15 boots). ZRAM rejected. In place. - -**09-28 · boot probes/image · `f7cd1ab`, `47aa681`, `337c08d`.** `boot:ssh-load`: CPU load does not slow a login, and 16 MiB available doubles one to ~210-310 ms. CPUWeight/IOWeight/MemoryLow on ssh.service changed nothing and are not shipped. MGLRU `min_ttl_ms=1000` and `/tmp` at a quarter of memory. **The sources disagree** on min_ttl_ms: `47aa681` says worst login 1369-7106 ms without vs 94-128 with; `kernel/Dockerfile:192-194` says 611-1785 vs 105-106. *Status:* in place; `boot:memory-policy` was deleted in #88, and `boot:ssh-load` was deleted in #250. - -**09-28 · CI · `5332e97`, `3bef421`, `e6a0a1b`, `6b0f338`.** Actions pinned by commit, actionlint, the race detector, `task mutate`, a coverage floor. The floor was set at 85% against a local 85.7%. CI measures 84.7%, so it broke main and was lowered to 80% (`e6a0a1b`). In place. - -**09-29 · machine/qemu · `43fb03b` (#24), `2b19096` (#25).** Hotplugged disks go on virtio-scsi instead of PCIe root ports. *Measured 2026-09-29, 4 ports vs 1 controller:* boot -31 ms; attach 135 → 1.5 ms; detach 6.1 s → 0.7 ms. NIC hotplug dropped. In place. - -**09-29 · boot probes/CI · `a503db7` (#23), `e9e0c8e`, `de9b7db` (#29).** A report feature matrix (96 rows) published with every release, and `lab.yml` on the self-hosted KVM runner. *Why:* a laptop read 61 vs 105 ms minutes apart. Fixed along the way: -- the lab went green having measured nothing (a skip) (`8d8e97b`); -- a concurrency group cancelled queued experiments (`a3ba5a6`); -- two runners both took nbd0 (`b21e100`); -- an NBD device was mounted before it had a size (`8946f67`). - -In place, with the lab on the bench fleet since 10-24. - -**09-29/30 · kernel · `349dacb` (#33), `20fd702`, `3e26963` (#40).** Four local patches: 0001 objtool writes NOPs, -7.0 ms; 0002 skips the weak-function scan, 11.9 ms; 0003 rewrites the eval maps on first use, -9.0 ms; 0004 PCI config through ECAM, -4.5 ms. Kernel boot 109.4 → 73.7 ms (lab runner, workspace shape, 15-20 boots). The whole report boots on it (run 36651858261). Fingerprint moved. In place. - -**09-29 · firmware · `ae6ab48` (#37), `f2f4da0` (#39).** qboot becomes the default BIOS and the firmware goes into the fingerprint. SeaBIOS 121.89 vs qboot 114.76 ms p50, 7.14 ms saved (lab runner, run 36650049960); 106 rows boot (run 36650559189). In place; the firmware *contents* were later dropped from the fingerprint and only its size kept (`fa3041c`). - -**09-30 · qemu/firmware · `6f65249` (#42), `f10383b` (#43).** qboot writes the PAM registers in 3 writes instead of 7, at ~0.5 ms each. QEMU patch 0001 wraps device creation in one memory transaction (438 flat-view rebuilds). The first version also wrapped board init and the guest printed nothing (lab run 36662499370). In place. - -**09-30 · kernel · `98c3589` (#47).** 7.3-rc5, 1.2 ms slower than 7.2.8 (30 boots). Superseded by 7.3 (10-26) and then 7.3.x. - -**09-30 · boot probes · `f2c47f7` (#48).** Probes deleted with their conclusions kept: `boot:floor` and `kernel/minimal`, `boot:kernel-pages` (#44, added the same day), `boot:memory-unplug` (#46, same day), `cache_bench`, the report's disk axis (96 → 32 rows), the console-swap rows, and the SeaBIOS timing. See §2. - -**09-30 · machine · `a9d6083` (#51).** **Templates removed** (spin #194). `Memory.File`, `x-ignore-shared`, `save/restore --template`, `boot:restore` and `docs/templates.md` all go. The fingerprint now means "a checkpoint resumes only onto a machine with the same fingerprint". Fingerprint moved. In place. - -**09-30/10-01 · boot probes (memory/disk) · #57-#62, #64, #67-#74, #77, #78, #83, #84, #89.** The page-cache lab on construct (AMD Ryzen 9 5900X, Spin OS metal), recorded in `docs/memory-and-disk.md`. Kept as defaults: writeback overlay; hourly fstrim; discard accounting; qboot MTRRs; `page_reporting_order` stays 9. Rejected: docs/boot-time.md, "Measured and rejected". Sub-probes deleted in #89. `caches` and `reclaim` remained until c3c0fd1 (11-19). - -**10-01 · firmware · `4511798` (#75).** qboot programs the MTRRs. virtio-pmem read at 8.3 MB/s uncached-minus vs 1.1 GB/s with SeaBIOS (runs 36818224412, 36818721809). No boot cost: 103.5 vs 103.1 ms. Fingerprint moved. In place. - -**10-01 · image · `5b7b1dc` (#76).** fstrim hourly: 657 → 21 MB on disk, 657 → 20 MB in the host's cache (run 36815822140). In place. - -**10-01 · qemu · `aaf2d86` (#79).** Upstream's virtio-blk discard accounting is carried as a patch: before it, `query-blockstats` showed 0 unmaps for 1.1 GiB trimmed (run 36815822140); with it, 10-12 operations and 1123 MB (run 36884702758). "to delete in the bump that brings it". In place. Deleted 11-19 with QEMU 11.2.0-rc0, which has it upstream (#289). - -**10-01 · kernel · `1400f6a` (#80).** Lockdown at confidentiality plus the BPF LSM; no `/dev/mem` or `/proc/kcore`. "No cost that can be told from noise." *Side effect, found later:* SPIN_GRAPH and SPIN_CPU_SHARE silently traced nothing until #240 (11-13). In place. - -**10-01 · CI/release · `2cd98f0` (#81).** Release notes say what changed, and the report boots each row 20 times, KVM only. *Why:* at 3 boots a row every KVM row read 5-11% slower between two releases that 20 alternated boots put within 5 ms. Also: `v20261001.01` shipped a `qboot.bin` without `mtrr.patch` in the tarball, because hack/release named the patches one by one. In place. The report's 20 boots a row went with the feature matrix 11-19 (#303). - -**10-01 · boot probes · #88, #90.** `unitload` deleted (it compared the image with itself) and `memory-policy` deleted. Bench rows reduced to "as shipped" and "baseline", with findings left as notes. In place. The bench rows went with `boot:bench` 11-13 (#250). - -**10-01 · machine · `c5baaa7` (#97), `ca7b54f` (#98), #94.** The fingerprint becomes one hash, and `Incoming` one field. The release verdict was blind to `machine/` changes, so `fingerprint_sha256` is now recorded. `Disk.Cache` removed. In place. - -### Week 5: 2026-10-05 to 10-11 - -**10-09 · qemu · `f0ec1e0` (#103).** QEMU 11.1.2. "A new machine: every checkpoint taken on 11.1.1 stops resuming." That stranded v20261002.01's checkpoints (v20261013.01). Led to the next entry. - -### Week 6: 2026-10-12 to 10-18 - -**10-13 · CI/release · `d692a7c`, `03aeb28`, `96a39d2`, `845fb5d`, `f033995` (#109), `b207bee` (#110), `302ced2` (#111), `99e31f9`.** Supply chain: -- signing and attestation, an SBOM, release from main only, apk locks; -- a reusable builder (#109, #110), reverted the same day (#111): it never achieved SLSA L3 and needed guards; -- an OSV scan, kept; -- attestations checked by digest, because the 338 MB tarball was over cosign's 128 MiB limit. - -In place, apart from the reusable builder. The apk locks gave way to pinned builder images 11-20 (#309). - -**10-13 · machine/fingerprint · `fa3041c` (#114).** **The fingerprint is the machine's contract.** `MachineType=pc-q35-11.1`. It hashes: the shape; `Spec.Contract` (every device as Args writes it); the BIOS's size; and the host CPU under `-cpu host`. It no longer hashes the QEMU, kernel, initrd or pvh.bin bytes. Added `boot:roms`, `boot:compat` (a v20261002.01 checkpoint resumes on 11.1.2), and `hack/machinetype`. One break by design. In place; `fingerprint_sha256=2bd7da6b…` from v20261013.02 onward. - -**10-13/14 · CI · `7628981`, `4f7d55e`, `8c6d1c7`.** compat runs on main and before a release, not on PRs, because the KVM runner refuses pull_request jobs. cosign is built from its pin. Docker Hub images come from mirror.gcr.io after a 429. In place. - -### Week 7: 2026-10-19 to 10-25 - -**10-19 · image · `fb39fd5` (#210).** GNU coreutils instead of uutils: 21 OSV findings against rust-coreutils 0.10.0; image 855M vs 877M. In place. - -**10-19 · CI · `7bf5429` (#197).** One OSV issue per package; there had been 77 open. In place. - -**10-24 · CI · `c75f144` (#214), `f29e59d` (#215), `d67afc4`, `97a6de1`.** Every workflow step is one task. Builds move to GitHub's runners. **Report and lab move to the bench fleet** (one instance type) and compat to the kvm fleet. A fix: vhost-vsock permissions were reset by udev after `modprobe` (`97a6de1`). In place. The first report on the fleet (v20261026.01) compared a Ryzen 9 5900X with a Xeon 6975P-C, and its notes say so (docs/measuring.md, "Avoid the pitfalls"). - -### Week 8: 2026-10-26 to 11-01 - -**10-26/29 · kernel · `1c12413`, `0bb00ce`, `fc1079c`.** Kernel 7.3; the apk locks moved; the kernel now tracks mainline. Superseded: refresh.yml now proposes the newest stable release of the 7.3 series (`spin-machine-dev refresh kernel`). - -### Week 9: 2026-11-02 to 11-08 - -**11-03 · qemu/kernel · `7c37270`, `b4b67c3`, `6e7ba47`.** QEMU 11.1.3, kernel 7.3.1. The apk lock broke because Alpine's mirror dropped python3 3.14.8. In place. Superseded by QEMU 11.2.0-rc0 11-19 (#289) and kernel 7.3.5 11-17 (#266). - -### Week 10: 2026-11-09 to 11-13 - -**11-09 · kernel/CI · `00db122` (#223), `0ce27ad` (#224), `8d495c5` (#225).** Kernel 7.3.3, with the config named by series and a daily proposal job. A kernel CVE judge: of 18221 CVEs against 7.3.1, 9 apply with a fix later in 7.3 and 1 has no fix. The apk lock broke again (zlib 1.4). In place; the kernel is 7.3.5 since 11-17 (#266). - -**11-09 · tooling · `ed4ad86`, `e1d40ad`, `6e25bb3`.** Retries and tokens for GitHub downloads after 504s. Task and go-tools as released binaries (455 → 81 modules). In place. - -**11-11 · kernel · `cce320f` (#229).** 7.3.4. In place. Superseded by 7.3.5 11-17 (#266). - -**11-12 · docs/image · `e452afc` (#232), `3a7864d`.** A comment sweep: several comments still said a QEMU or kernel bump strands checkpoints, which has been false since `fa3041c`. Dead code deleted: `spin-machine-console.service`, the modprobe blacklist, and the getty@tty2-6 masks. In place. - -**11-12 · image · `02c58b9` (#235).** bubblewrap, socat and ripgrep for agent sandboxes. In place. - -**11-12 · CI · `c6c29b5` (#236), `ec2c7fb` (#237), `1666cb5` (#239).** A daily apk-lock refresh PR. *Why:* the lock broke three times (`6e7ba47`, `8d495c5`, release run 43157106109). The BuildKit cache moved to ghcr: on the fleet the gha cache read a store nobody wrote, so compat compiled cold on every run and failed on main 4 times from 11-09; both release attempts on 11-12 failed. In place. The daily apk-lock refresh was replaced by pinned builder images 11-20 (#309). - -**11-12 · image · `3c8da99` (#238).** The hot-add rule onlines CPUs only. udev's memory "online" write raced the kernel's `memhp_default_state=online` and logged EINVAL for every block. Closes #230. In place. - -**11-12/13 · image/kernel/boot probes · #240 (`bc41f44`, `a8df865`, `28823fb`, `8fb1dd9`, `e5b8003`).** -- Kernel patch 0005, each PCI capability list walked once: kernel 95.1 → 88.9 ms; ECAM accesses 1,032 → 680 (lab 43327612594). -- **logind back in the boot, and spin lingers:** first SSH login 570/626 → 510/525 (lab 43308825692, 10 boots). -- MOTD and pam_motd off: -7 ms per login, -12 on the first. -- `sshd@` waits for the host keys. Before this, SSH over vsock "worked not at all". -- New probes: `boot:waits`, `boot:jobs` (+ jobwatch, godbus), `boot:ssh-first` (+ vsockproxy), `boot:exits`, `boot:mmio`. - -Measured and not shipped: -- the getty without BindsTo: 342 vs 345 (lab 43303190733); -- keygen in the boot: 518 vs 514 (lab 43312419007); -- virtio-rng removed: -13.6 ms to the prompt (lab 43321809471), not done because it would move the fingerprint; -- `pci=noearly`: the guest does not boot; -- PID 1 spends ~25 ms in the BPF verifier. - -*Side effect:* v20261113.01's console prompt came 21-25% later (release notes). *Status:* patch 0005 and the exits/mmio/jobs probes were deleted in #249 (11-13). 0005 came back the same day (#255) and is in place. - -**11-13 · image · `43de41e` (#241).** serial-getty Type=simple. *Why:* with linger, `user@1000` runs inside the boot transaction, and Type=idle held the getty for 91.8 ms (lab 43361486792). 346/358 vs 423/441 (lab 43362067503); v20261112.01 was 344/353. Released in v20261113.02. *Status:* removed in #249 (11-13): nothing a workspace does waits for the console's prompt. - -**11-13 · boot probes/machine · #242, #246 (both closed).** Restore measured, and a **mapped-ram** checkpoint layout proposed twice: -- #242 (draft): `--channels`; mapped-ram ×4 restore-to-login 394/410 vs stream 877/1888 (lab 43364516874). Those numbers were later declared contaminated by restored VMs leaking between repetitions. -- #246: mapped-ram put in `Spec.Contract`, which would move the fingerprint, plus `boot:score`. On the fleet, with every cold boot run before every restore: restore login 385/400 mapped-ram vs 386/399 stream (lab 43483852339); also lab 43482829958, 373/402 vs 376/416. Closed: "does not earn moving the fingerprint". A laptop lead of 188/358 vs 412/732 was called "a lead, not a finding". - -*Status:* rejected; #242 and #246 closed. - -**11-13 · image · `d895543` (#245), `5e0cc2f`.** sshd offers only `mlkem768x25519-sha256`. ML-KEM costs the same as curve25519: first login 461 for both; a second login 40 vs 39; OpenSSH 9.6 with sntrup761 took 489 first and 104 for a second (lab 43479854381, also 43463472762). `boot:ssh-first` logs in with x/crypto/ssh, and vsockproxy is removed. *Status:* merged 18:30Z. #245's own body said "Do not merge before the clients move": open-remote-ssh#8 merged at 18:57Z, and spin-stack/spin#1206 (the spin CLI refusing OpenSSH < 9.9) merged after its CI and KVM lanes passed. Not yet released. Released in v20261113.03. - -**11-13 · image · `3e8075f` (#247 → #248).** SSH host keys are made from the boot's first dispatch (wanted by sysinit.target, `DefaultDependencies=no`). First login 489/506 → 468/494; accept to login 177 → 154 (lab 43483372488). Rejected in the same run: masking two generators (489), and masking 11 always-failing units (484). Not released. Released in v20261113.03. - -**11-13 · boot probes · #249, #250.** Removed: -- kernel patch 0005 ("6 ms of a ~470 ms first SSH login, for a local patch carried across every kernel bump"); -- the getty Type=simple drop-in ("nothing a workspace does waits for that prompt"); -- `boot:exits`, `boot:mmio`, `boot:jobs`/jobwatch/godbus. - -#250 also removes `boot:bench`, `boot:trace`, `boot:userspace`, `boot:systemd` and `boot:ssh-load`, keeping "a gate …, the release's report, the metric a workspace waits for (ssh-first), and one tool per layer". - -**11-13 · goal · #251, #252, #254.** The goal is written down: a cold boot to the first SSH login in under 100 ms (AGENTS.md), with restore as the second number. The rules that held exploration back are removed (no init in a release, the fingerprint as an event to avoid, one default per experiment, the bench fleet alone deciding); hotplug and dynamic memory become an invariant that is never traded for boot time. - -**11-13 · boot probes · branch `floor-kernel` (experiment).** The floor without systemd: PID 1 a script that mounts what sshd needs, makes an Ed25519 key and has socat hand vsock connections to `sshd -i`. First login 467 → 220 ms (lab 43492686353), 506 → 240 (lab 43493135230); guest uptime puts init at ~90 ms of kernel and the keys 10-20 ms later. What is left at the floor: QEMU and firmware ~44 ms (boot:firmware-stages, lab 43494513791: QEMU's own start 35.9, qboot ~8.5, of QEMU's start 7.9 copying vmlinux), kernel ~80-90, init ~20, the login ~44. `/proc/uptime` starts partway into the kernel, so it hides ~35 ms that an earlier reading charged to QEMU. - -**11-13 · CI · spin-stack/ci#14, #15, spin-machine#253.** A `bench-metal` fleet (c8i.metal-48xl, then r7i.metal-24xl behind it) and lab.yml's `host` input. It has not run: metal spot scored 1-3 of 10 for placement and failed `UnfulfillableCapacity` in every zone; on-demand failed `VcpuLimitExceeded` at a quota of 96 vCPU. An increase to 288 was requested the same day (case open). *Status:* the fleet first ran 11-19 (spin-stack/ci#20; below). - -**11-13 · kernel · #255 (this change).** Where the kernel's ~100 ms goes on the bench fleet (boot:initcalls lab 43495583323): initcalls 52 (acpi_init 12, of which `acpi_pci_root_create`, bus 0's enumeration, 11.2 traced on a kernel without forced lockdown, lab 43499868986; inet_init 7.9, which is vmlinux BTF's first parse; the virtio probes ~17), before the first initcall ~15-20 (SPIN_EARLY, lab 43507472288; ~4 of it the probe's own 18 MB log buffer), SMP ~4, the root mount ~6. Kept: patch 0005 back, 0006 (BTF parsed in the background from a core_initcall), `CONFIG_DEFERRED_STRUCT_PAGE_INIT=y`: kernel 96.3 → 87.1 ms (lab 43505126131), first login 466 → 456 as built and 223 → 214 at the floor (lab 43501992969). `driver_async_probe` for rng, balloon and vsock on the command line: 214 → 209 at the floor (lab 43506390106). *Status:* 0005 in place; `driver_async_probe` deleted 11-20 (#352), 0006 11-20 (#345), `DEFERRED_STRUCT_PAGE_INIT` 11-21 (#356). - -**11-13 · image · the first login's lane (this change).** Where systemd's ~250 ms over the floor went, on the bench fleet: ~60 before sshd accepts (sysinit, udev, journald), ~105 in pam_systemd, and ~65 in a handshake competing for the CPU. logind answers a session of class `user` only once the user's manager has started, and orders its scope after `systemd-user-sessions` (systemd v259.9 source, `logind-session.c`). The vsock socket, `sshd@`, dbus, logind, `user-runtime-dir@` and `user@` without default dependencies, no `/run/nologin` at boot (pam_nologin refused the lane's first login: "Access denied for user spin by PAM account configuration"), sessions of class `user-early-light`, and udev's coldplug filtered to block, net, virtio, misc, input, rtc, ptp and ttyS0: first login 478 → 402 ms (lab 43518915618). Measured and left out: priority (`CPUWeight`, `Nice`) on the lane, −2 ms over the filter and a slower second login (63 vs 45 ms). - -**11-13 · kernel/qemu · branches `kernel-snapshot`, `qemu-snapshot` (rejected).** QEMU publishes bus 0's configuration space over fw_cfg after the firmware (etc/spin/pci-config) and the kernel answers boot-time configuration reads from it until each dword is written. It works (`PCI: configuration space of 5 devices on bus 0`) and is worth -14 ms against the same kernel without it (lab 43514550646), but only 2-3 ms against 0005, which already removes most repeated reads: 209/217 against 211/222 (lab 43514884598). Not worth a QEMU patch and a 250-line kernel patch. - -**11-13 · boot/qemu · branch `first-login-report` (this change).** v20261113.03's report read +11-18% on every row: the report times the serial console's prompt, and the getty drop-in removed in #250 left it Type=idle, waiting for the lane's units. The first login it does not time went from 478/500 (v20261113.02, lab 43524334205) to 381/410 ms (v20261113.03, lab 43524721490), two runs and not interleaved. The report now logs into the release over SSH too (`first_login`), and compare writes it first. The QEMU build asserts static-pie, full RELRO, an NX stack and stack canaries, which come from QEMU's and Alpine's defaults and no flag here. Measured and left out: one sshd for every connection (the vsock socket with Accept=no, an `sshd -D` from the first dispatch), first login 382/393 against 381/410 and a second 40 against 48 ms (lab 43524721490). - -**11-13 · image · udev's coldplug keeps cpu (this change).** The coldplug filtered in `630fa2c` left out cpu, and a core attached before systemd starts is onlined by that replay reaching `40-spin-hotadd.rules` and by nothing else. spin gives a workspace its cores while its own init is PID 1, so with v20261113.03 every workspace came up with one core whatever it was sized to (spin's kvm run 43527839765, four tests "still waiting for the guest to have its floor's two cores"). `task boot:hotadd` attaches a core before systemd and reads `online` after: `0` on v20261113.03's image, `0-1` with cpu in the filter. What cpu costs the first login was not measured; it is one device per core. - -### Week 11: 2026-11-14 to 11-20 - -**11-19 · image · systemd from Ubuntu's source package, stage1 (this change).** The image installs Ubuntu's own systemd 259.9-0ubuntu0.1, rebuilt from its .dsc (versions.yaml `systemd-source`) by `image/systemd/Dockerfile`. The build uses Debian's `stage1` build profile (no BPF framework, audit, AppArmor, SELinux, OpenSSL, TPM2, homed, cryptsetup…) and links systemd-executor, udevd, systemctl and journalctl statically against libsystemd-shared. The packages are versioned `+spin1` and held. *Why:* PID 1 spent ~25 ms in the BPF verifier on socket-bind at every boot (#240, "measured, nothing done"), and restrict-fs failed to load under lockdown on every boot (#261). *Measured:* -- `boot:ssh-first` on the bench fleet, 20 boots of each, interleaved, first login p50 against the archive's systemd: - - stage1: −47 (lab 44531842773), −38 (44537549305) and −47 ms (44538877783); - - static over stage1: −10 and −1 ms, within noise. Accept to login was −7 ms in both runs. -- `boot:waits` on a laptop: PID 1's setup before the generators goes from 25.8 to 5.6 ms. -- `boot:restore-first` (new, below): unchanged. The guest's part, from running to login, is ~50 ms with either systemd (44533227886). - -*Left out:* masking `systemd-udev-load-credentials` (−8, −6 ms) and `-Db_lto=true` (Ubuntu already builds with `-flto=auto`); see docs/boot-time.md, "Measured and rejected". The patch that would make restrict-fs load under lockdown, reading `s_magic` through BTF, loaded in this guest. It is for systemd upstream and is not needed here. *Cost:* a rebuild whenever Ubuntu publishes a systemd. The archive serves only the current source, so the build fails the day it moves, and `refresh:systemd` proposes the move. - -**11-19 · boot · `boot:restore-first` (this change).** The goal's second number had had no probe in the tree since #246 closed. Every row of `boot:ssh-first` is booted cold, logged into and saved, then restored with its state evicted from the page cache (checked with mincore) and logged into again. Every cold boot runs before every restore. On the bench fleet a restore reaches the first login at 841/913 ms, ~790 of it before the guest runs, reading the state from the runner's gp3 volume (44533227886). #246 read 386 ms on 11-13. What moved is not known. On a c8i.metal-48xl it is 905/942 (44535167653), so the restore is the host's disk, not the virtualization. - -**11-19 · lab · nested against metal.** `bench-metal` ran for the first time (spin-stack/ci#20 keeps it to c8i.metal-48xl, on-demand when spot has none; spin-machine#272 caps the job at 60 minutes). The same CPU (Xeon 6975P-C) on both, p50: -- first login: 378-392 ms nested (two runs) against 332 metal (44537498507), so **nesting costs ~50-60 ms**; -- `boot:firmware-stages`: QEMU start 30.5 against 28.1, the PCI walk 5.00 against 2.22 (173 exits, ~29 against 13 µs each), kernel and init 108.7 against 69.5 (44535161371, 44535156851). - -An r7i.metal-24xl (Sapphire Rapids, slower per core) read 296 ms (44534028478), faster than the c8i.metal. Unexplained. Repeat it before quoting it. Every bench-fleet number in this log and in docs/boot-time.md is nested. - -**11-19 · boot/image · where the first login's own time goes, and logind's socket early (this change).** `boot:login-lane` marks the guest's journal through the first login: accept → authenticated 55.5, PAM's session → logind's new session 29.0, → scope 4.3, → command 8.4 ms (v20261119.01, lab 44555905383). Its diagnostic rows (`SPIN_LANE_DIAG`, sshd at DEBUG1 and logind at debug, lab 44557162195) say what they are: -- **Before authentication.** PID 1 starting `sshd@` takes ~11 ms, and OpenSSH 10's three execs (`sshd` → `sshd-session` → `sshd-auth`) ~12. Loading PAM's modules cold takes 8.3 ms, against 0.9 at the second login. ML-KEM is 3.5. -- **The hop to logind** is logind not running yet. Its Varlink socket kept its default dependencies, so logind waited behind `sysinit.target` and udevd, ready ~230 ms into the boot (`boot:waits TARGET=systemd-logind.service`, lab 44557605832). The first login waited ~32 ms for it, the second 1. - -The socket without default dependencies (`systemd-logind-varlink.socket.d/20-lane.conf`), 20 boots of each (labs 44558035927, 44558053261): -- the hop: 24.5/41.8 → 15.8/22.7; -- accept to login: 131/137 → 120/128; -- the first login: 332/355 → 328/337. The p50 moves little because logind starting sooner takes the CPU sshd was starting on. - -Masking `modprobe@drm`, which logind is ordered after, added nothing (327/345). What is left of the login is CPU contention on 2 vCPUs, `user@1000` (38 ms) and the host key generation (21 ms) starting in the same window, rather than waits. - -**11-19 · systemd/boot · where PID 1's gap between the unit load and the first job goes (experiment, tooling kept).** `image/systemd/experiments/pid1-marks.patch` makes PID 1 append its monotonic clock, its own CPU time, the units loaded and the time in `unit_load` after each step of `manager_startup` and `do_queue_default_job` to `/run/spin-pid1-marks`. `boot:waits` reads the file. `lab.yml`'s `systemd_experiment` builds the patched systemd on the runner and puts it into each overlay. Bench fleet, 10 boots (lab 44561762624), p50 ms: -- bus, varlink, coldplug, vacuum, ready: < 0.2 together; -- **loading what `default.target` reaches: 28.4 wall, 20.9 of it PID 1's CPU, 192 units** (~0.11 ms of CPU each; the rest is likely cold reads); -- building the transaction: 0.30; -- the first dispatch: 0.87. - -The gap is unit loading, not the transaction that 11-13's single debug-logged boot named. 96 of the units a boot lists are inactive, loaded because another unit names them in `After=`/`Wants=`: `initrd-*`, `plymouth-*`, `modprobe@*`, hibernate, cryptsetup's targets, `firewalld` and `auditd` named by docker. Masking does not spare a load (a masked unit is still looked up and loaded as masked), which is why masking 11 units moved nothing (docs/boot-time.md, "Measured and rejected"). - -**11-19 · image/machine · the root mount's storage path (branch `ext4-mount`, not yet on the fleet).** The kernel gap `security_initcall_late_sync` → `EXT4-fs (vda): mounted` was 6.8 ms nested and 5.0 metal (`boot:initcalls`). Three changes, from reading Linux 7.3 and the image: -- the image without `orphan_file`, a mke2fs.conf default since 1.47.0: every mount, read-only included, reads it one block at a time (`ext4_init_orphan_info`, ~73 single-block reads with no readahead). Crash correctness is the classic orphan list's; -- `lazy_itable_init=0`: `mke2fs -d` left no group `ITABLE_ZEROED`, so each overlay's first read-write mount had `ext4lazyinit` zero every inode table in the first second of the boot. After one `--init /bin/sh` boot the overlay held 16.06 MiB of zero clusters, and none with the tables zeroed at build. The thread still starts, to prefetch block bitmaps (it does not with `no_prefetch_block_bitmaps`). The image is 256 KiB smaller; -- `rootfstype=ext4`: without it the root mount tries ext3, then ext2 (`EXT4_USE_FOR_EXT2`), on the superblock before ext4. - -Laptop lead only, on a host at load ~30: the gap's p50 over three alternated rounds of `TestKernelInitcalls` (8-10 boots each) was 8.8/2.8/4.3 ms with the release, 4.1/3.2/2.9 with `rootfstype` alone, and under 2.4 (below the rows printed)/1.3/1.2 with all three. Not decided until `boot:ssh-first` and `boot:restore-first` run interleaved on the bench fleet. *Status:* merged 11-19 (#286) and in place; `rootfstype` and `^orphan_file` are still leads, not measured on the bench (docs/boot-time.md, "What the machine carries"). - -**11-19 · kernel/qemu/machine · the kernel is entered as a bzImage (this change, functional: security).** KASLR was inactive under PVH. The PVH entry into `vmlinux` skips `arch/x86/boot/compressed`, where KASLR picks the random base and sets `KASLR_FLAG`, so `CONFIG_RANDOMIZE_BASE` and `RANDOMIZE_MEMORY` did nothing: every PVH boot had `_text` at `ffffffff81000000`. The machine now boots `kernel/bzImage` (LZ4, as the config already had: x86 has no `KERNEL_UNCOMPRESSED`), which qboot loads from fw_cfg itself (`boot_from_fwcfg`); `linuxboot_dma.bin`, the ROM QEMU adds for a bzImage and SeaBIOS runs, ships again. `vmlinux` and `pvh.bin` stay, for `--kernel vmlinux`, debugging and BTF. A tree without a bzImage (every release before this one) still boots its `vmlinux`, which boot:compat needs. Two builds, the second on a fresh BuildKit with no cache, gave the same bzImage (`ff9f0ec6…`) and vmlinux (`ff53d597…`). *Checked:* `boot:lockdown` now requires `_text` present and not `ffffffff81000000`, and no `nokaslr`; it fails on the PVH tree. Three bzImage boots: `_text` `ffffffffb5c00000`, `ffffffffa2a00000`, `ffffffff90800000`, the physical base moving too (`/proc/iomem`); the PVH `vmlinux`, three times `ffffffff81000000`. The fingerprint does not move (`2bd7da6b…` either way) and `boot:roms` passes: on q35 an option ROM is a fw_cfg file, not a RAM block. *Cost on a laptop (i9-13900HK), a lead only that the bench fleet decides:* `boot:firmware-stages` REPS=5, QEMU exec to the diagnostic init 105.6 vs 83.6 ms p50 summed (qboot copying the bzImage 2.3 ms; the rest the decompressor and the kernel after it); kernel start to init over 10 boots 34-92 ms, p50 ~51, against 34-37 for PVH, so the spread is the bzImage's and not yet explained. `boot:ssh-first` alternated A/B/A/B/A/B at REPS=5: first login 500/658/603 vs 504/587/764 ms p50. The laptop's noise is larger than the difference. Kept whatever the bench fleet says: it is a security fix, and what it costs is the next thing to make cheaper. - -Bench, nested (2026-11-19): it costs nothing measurable. `boot:initcalls` in the workspace shape, kernel start to "Freeing" 94.5 → 93.9 ms (lab 44577696958): the laptop's 34-92 ms spread did not reproduce. `boot:ssh-first` against the PVH release, sshd accepts 199 → 198 ms and first login 328 → 317 (lab 44583379559, 20 each); the login gain is in accept-to-login and is main's, not the bzImage's. The LZ4 decompression and the fw_cfg load do not show. - -**11-19 · machine · one surface for spin: `machine.VM`, every machine started held (this change).** spin built a `Spec`, exec'd `Args()` and drove QMP with a client of its own, so what a checkpoint is (the migration capabilities both ends must agree on), how a disk reaches a device, and the `-S` before a CPU plug lived in spin. Now `machine.VM` (QEMU's: `machine.Attach`) is that conversation: `Boot`, `Resume` with `Load{Fast}`, `Loaded`, `Checkpoint` with a seal at pre-switchover, `Continue`, `AttachDisk`/`DetachDisk`, `SetCPUs`, `SetMemory`, `CPU`. An interface on purpose, so another VMM can be put behind it and compared. Every machine starts held, `-S` or `-incoming defer` (`Spec.Restore`): under `-incoming defer`, `cont` leaves QEMU in `inmigrate` (11.2.0-rc0), so one QEMU cannot wait for both. A disk is bound to its place (`Spec.Disks`, a raw node over an empty `null-co`) by serial, `blockdev-reopen` onto the chain handed over `add-fd`: the device's serial and read-only-ness are fixed at realize, and QEMU 11.2 has no `blockdev-replace`, so the raw node stays and a seal targets `machine.TopNode`. The prestart prototype measured it on the bench fleet: cold first login 313→291, restore 170→153 ms (lab 44573266140). Checkpoints are written in mapped-ram (`FormatMappedRAM`, recorded in `Saved`); a stream checkpoint from before still loads, in full (`boot:compat`). The host CPU's model name left the fingerprint: a checkpoint records the CPU its guest was shown and `CanResume` checks it (spin#1348). Fast load needs userfaultfd for QEMU's user and was not run here: an unprivileged QEMU refuses postcopy ("Userfaultfd not available"). *Status:* PR, measured on the bench fleet with `boot:restore-first` (`SPIN_RESTORE_FAST=1`) and `boot:prestart`. Merged 11-19 (#293). - -**11-19 · machine · one rule for where a checkpoint resumes: `CanResume(Saved, Target)` (this change, functional).** After #293 a checkpoint recorded its format and CPU, but the machine it was of was still spin's `machine_identity` string, and nothing recorded the QEMU that wrote it: QEMU loads what an older QEMU of the same machine type wrote and promises nothing the other way, so during a rolling update a checkpoint from an updated host could be placed on one not yet updated with an identical fingerprint (spin-stack/spin#1348). `Saved` now carries `Fingerprint` and `VMM` ("qemu 11.1.90"), a machine says what it resumes (`VM.Target`: formats, fingerprint, VMM, CPU), and `CanResume` is the one rule a placement and `Resume` both ask: the format read, the same fingerprint, the same VMM at the writer's version or newer, the CPU shown again. `Args` names the machine by its fingerprint (`-name guest=spin-machine:`, read back with `query-name`), which the guest does not see and `Contract` does not hash. Records from before a field was kept are not checked on it. - -**11-19 · machine · a place is a filter node (this change, functional).** A place's node was raw over the bound disk's top image. spin's storage compacts a chain by rewriting a bound image's backing file (`change-backing-file`), which QEMU takes only on a root node whose chain, followed by backing and filter links, contains the image: on the root it answered "'slot0' and image file are not in the same chain", on the image "Need a root block node" (QEMU 11.2.0-rc0). A place is now a `throttle` node in a group with no limits: a filter, so the chain is seen through it, and pass-through. copy-on-read, compress and preallocate are filters too, and each changes what is written. Checked on QEMU 11.2.0-rc0: bind by `blockdev-reopen`, then `change-backing-file` through the place, then a seal under an overlay. The fingerprint does not move (`-object` is not in `Contract`). Its cost per I/O is the bench's to say. - -**11-19 · kernel · branch `kernel-floor`, patches 0007-0011 and a config trim (this change).** The kernel was 78.0 ms nested against 45.0 on metal, same CPU (boot:initcalls, labs 44563496308, 44563512999). Five of its gaps, each a patch: -- 0007, ORC's lookup table by one merge pass instead of 59,650 binary searches: 3.5 ms on both hosts. Every block checked against the binary search, 0 differ. -- 0008, init's 1,989 ftrace records freed with one memmove: 2.6 ms on both hosts. -- 0009, the boot CPU polls for an AP by `local_clock()` while booting: 4.1 ms nested, under 1.4 on metal. -- 0010, no early-quirks PCI scan under KVM: 2.1 ms nested. pci=noearly also defers MMCONFIG; this skips only the scan. -- 0011, virtio-pci's `queue_select` written only when the queue changes: 84 → 22 writes. - -Config: `X86_MSR`, `X86_CPUID` off (nothing in the image or spin opens `/dev/cpu`); `BLK_DEV_LOOP_MIN_COUNT=0` and `SERIAL_8250_RUNTIME_UARTS=1` (from `kernel-trim`). *Measured:* only on a laptop, not nested, 10 boots each interleaved, a lead: the ORC gap 4.59 → 0.93 and 4.45 → 0.72, the WAET gap 0.44 → 0.07 and 0.32 → 0.06, the ftrace gap 2.7 → under 1.1 ms. 0009 and 0011 cannot move there: the AP never waits and exits are cheap. The kernel's total read 61.5 → 55.7 in one run and 53.0 → 54.3 in the other on a host building QEMU at the time: noise. Not yet measured on the bench fleet or against the first login. - -Bench, nested, workspace shape (2026-11-19, lab 44587603255, 20 boots each): kernel start to "Freeing" 96.4 → 86.6 ms (−9.8), in initcalls 61.7 → 58.7, outside them 35.1 → 27.8, where ORC and ftrace are. `virtio_pci_driver_init` 8.57 → 8.59: 0011 does not show even nested. *Status:* merged 11-19 (#291); 0009 and 0011 deleted 11-20 (#345); 0007, 0008, 0010 and the config trim in place. - -**11-19 · lab · the probes become `spin-machine-dev lab` (branch `dev-cli-lab`, this change).** Each probe was a Go test behind a `SPIN_*` switch of its own, and took a second kernel, a second QEMU, an edit of the image or a rebuilt systemd each through another environment variable (`SPIN_KERNEL_B`, `SPIN_KERNEL_C`, `SPIN_MACHINE_OUTPUT_B`, `SPIN_APPEND_B`, `SPIN_SYSTEMD_DEBS`), laid out by lab.yml's `variant=beside|instead`. Two failures in one day came from that shape: `boot:restore-first` read no `SPIN_MACHINE_OUTPUT_B` and measured the release's QEMU under the name of 11.2's (lab 44584214362), and a Kernel run from before the bzImage failed `lab:place` with no message (lab 44587254371). Now a tree is a whole machine with a manifest naming every part's source, refused when it is not whole, and a probe is handed trees (`internal/lab`, docs/cli.md). Ported: `ssh-first`, `restore-first` (its `fast` rows an option), `prestart`, `initcalls` (totals, the initcalls of interest per tree, each tree's slowest initcalls and largest gaps). The "as this branch" row is the tree edit `lane`. Not ported, and kept as `boot:` targets `lab check` runs on any tree: `firmware-stages`, `waits`. Deleted, each question answered and its answer in this log or beside it: -- `boot:login-lane` (`boot/login_lane_test.go`): where the first login's own time goes, on the guest's clock. See the 11-19 entry above and docs/boot-time.md's cold-boot budget, lab 44555905383. -- `boot:density` (`boot/density_test.go`): one idle workspace's host memory, ~125 MiB (lab 44546329726). -- `boot:page-cache` (`boot/pagecache_test.go`): the page caches a machine has. See docs/memory-and-disk.md and docs/boot-time.md's "Measured and rejected". -- initcalls' extra passes, not ported: `SPIN_GRAPH` (function_graph under chosen functions, `boot/graph_test.go`), `SPIN_CPU_SHARE` (who had the CPU during one initcall, `boot/cpushare_test.go`), `SPIN_EARLY` (the lines before the first initcall) and `SPIN_FORMAT_CHECK` (an event's format after patch 0003). Each served one question, answered above. When another asks for one, it comes back from git (`boot/initcalls_test.go` and those two files before this change) as an option of the `initcalls` probe. -- `boot:ssh-first`, `boot:restore-first`, `boot:prestart`, `boot:initcalls` are now lab runs over `OUTPUT_DIR`, the same targets. - -Checked against the probe it replaced on the bench fleet, `lab dispatch ssh-first`, the release and the release with the lane, 20 each (lab 44596983249): sshd accepts 215/228 and 216/229, first login 349/366 and 339/353. The old probe's rows read 215/223 and 216/223, 348/360 and 335/345 (lab 44585268429). A release ships no spin-machine. The old targets' `:tools` built this checkout's into the release tree, and a tree does the same, named in its manifest (the first dispatch, 44596065601, failed on it). - -**11-19 · lab · the release report is a ladder (this change).** The report measured each release alone, through the feature matrix (eight combinations of memory, vsock and hotplug, and the image's boot variants, each timed to the serial console's prompt), and compared its report.json with the previous release's, taken on another day on another instance. For v20261119.02 it said sshd accepted 7.3% later than v20261119.01 (202.6 → 217.3 ms); the two interleaved on one host said 199 → 198 (lab 44583379559). And the goal's second number, a restore to the first login, was not in it. Now `spin-machine-dev lab ladder` boots the newest five releases on one bench host, each with the spin-machine of its own commit, interleaved: a cold boot and a restore to the first login, both into a QEMU started ahead, and save, state, the kernel and QEMU's RSS as diagnostics. report.yml runs it after each release (ladder.json beside it, the table in its notes) and weekly. A release whose spin-machine cannot run a probe is a dash with the reason. boot:compat is now `lab compat`: every release since the fingerprint last moved, fetched against its sha256 and signature, and CanResume held to QEMU's one-way promise against each one's QEMU. The feature matrix is deleted: its last answer is v20261119.02's report.json asset and the "Feature matrix" section of its notes (no row moved beyond 5%, every row 344-389 ms usable), and git has the code (boot/report.go, boot/report_test.go). *Status:* the report measures each release alone since 11-20 (#314); `lab ladder` and `lab compat` in place. - -**11-20 · machine · a named CPU model, what it costs (#222).** spin-machine can show the guest a named model the fleet shares (`CanResume`, `Models`, `Baseline`, #293). The question left was its cost. The bench host is nested, and its L0 hides features the Xeon 6 has (la57, TSX, fsrm): QEMU refuses GraniteRapids-v1, SapphireRapids-v1 and Icelake-Server-v2 there ("Host doesn't support requested features", lab 44657973748, cancelled after 50 minutes of boots each waiting out its login; `lab` now refuses such a tree at its first boot). The newest model it runs, chosen on the runner (`lab tree --cpu baseline`), is Cascadelake-Server-v5. Against `-cpu host`, 20 boots each, interleaved: the cold boot's first login 327/342 → 343/353 ms (+16.4, sshd accepts +12.6; lab 44664362024); the restore's 160/170 → 161/170 evicted and 167/188 → 165/203 cached (lab 44664603720). A fleet that takes a baseline model pays ~16 ms on every cold boot for checkpoints that cross host generations. On one generation `-cpu host` with `CanResume`'s feature check is free. - -**11-20 · lab · density, the latency half (#273).** #278 answered the memory half (an idle workspace costs its host ~165-170 MiB). `lab` probe `density` boots the row's number of workspaces, logs into each, lets them settle 10 s, times one more's first login, and ends them all before the next measurement. On the bench (c8id.4xlarge, 16 vCPUs, 32 GiB, nested), 2 vCPU / 2 GiB workspaces, idle, 10 of each interleaved: with 0, 4, 8 and 16 already running the first login is 332/343, 328/340, 328/345 and 326/338 ms (lab 44667235868). Each of the crowd took ~625 ms to boot and log into. Idle workspaces do not move the first number up to 16 on this host. The 25% point is past that. Not measured yet: a CPU-bound crowd (`load=cpu`), more than 16, and metal. A first run left every crowd up until the experiment ended (m.Cleanup runs then) and measured a host carrying a growing pile of machines (lab 44665519945); the probe ends its crowd itself. - -**11-20 · lab/machine · multifd channels on the checkpoint, the no-systemd floor, and spin's shape (#320, lab 44750713447, lab 44750322384).** The two experiments of the methodology review, and the first runs in spin's shape (#319). *multifd:* `spin-machine save` and `restore` move a checkpoint's memory over `--channels` threads (QEMU's multifd on mapped-ram); with QEMU started ahead, in the ladder's shape, the restore's first login reads 140.9/152.0 at one channel, 140.5/178.0 at two (inside the noise), 101.5/117.4 at eight and 93.5/114.9 at sixteen, Δp50 −47.4 [−54.4, −39.4]: the first goal number under 100 ms. In spin's shape the p50 falls 149 → 114 but ~20% of restores with channels (56 of 280) stall ~400 ms between running and the login, against 5% at one, and the p95 goes 254 → 435. *Floor:* `lab tree --edit floor` boots sshd with no systemd before it, a bound only: the ladder's shape 322 → 219 (Δ −103.5 [−108.6, −100.5]), spin's 445 → 240 (Δ −204.8); sshd accepts at 173 and 189 ms with nothing before it. *Spin's shape:* the cold first login is 445 ms against 322, Δ +122.9 [+116.6, +129.8]; accept to login 214 against 114. *Later the same day:* the stall was a guest left at 128 MiB. At 128 MiB MGLRU's `min_ttl_ms` (armed by tmpfiles at boot) forbids eviction for the first second, so the guest OOM-kills sshd-session, logind and systemd units, and the client retries (lab 44784196287: kills up to 27, failed logins up to 14 a login); a second, idle ~400 ms stall in states saved with 8 channels sat inside sshd's key authentication. spin sizes every workspace to 2048 MiB right after its start (spin's `vmm.resize`), and sized so (`plugged=2048`) neither appears: no kills, every row's gap p95 under 69 ms (lab 44788801555). Restored into a QEMU started ahead, spin's shape and login: 150/156 at one channel, 103/108 at 8, 92.7/111 at 16, Δp50 −57.4 [−59.4, −54.3], and 16 against 8 −11.0 [−13.0, −7.9] (lab 44789688221). *Status:* channels kept. Restores run side by side decide the default count: 8 since 11-20 (#332). The floor edit is kept as the bound's instrument. - -**11-20 · qemu/machine · the hotplug controller scans the places it has (#324, lab 44788216590).** In spin's shape the 4 hotplug disks' virtio-scsi controller made the guest scan 256 targets at boot: `virtio_scsi_init` 12.1 ms (lab 44587603255), ~460 of the boot's exits (QEMU's trace, laptop). `qemu/patches/0002` gives virtio-scsi a `max_target` property (default 255, a disk plugged above it is refused, the build asserts the property), and the machine sets it to the hotplug disks less one, so the guest scans the places a disk can be attached to and no more. Every place is still scanned, unlike `scsi_mod.scan=manual` (rejected: it loses disks); 4 disks attached to a running guest all appear. On the bench, spin's shape (`plugged=2048`, `login=spin`), 20 each against the same QEMU without the property: first login 512/531 → 503/514, Δp50 −8.9 [−15.5, −0.9], sshd accepts −10.3 [−18.8, −0.2], the console prompt −12.5 [−19.0, −5.3]. The fingerprint moves for machines with hotplug disks, so their older checkpoints boot cold. In the same run `CONFIG_SCSI_SCAN_ASYNC` (#325) read −2.6 [−8.9, +6.8]: rejected. The decompressor without its VGA cursor (#328) and an uncompressed payload (#326) are in "Measured and rejected" (docs/boot-time.md). *Status:* kept. - -**11-20 · machine/lab · a checkpoint's memory moves on 8 channels by default (this change, lab 44792429636).** One restore at a time, 16 channels were best in spin's shape (92.7 against 103 at 8, lab 44789688221), but each channel is a thread of QEMU's and restores share a host. `lab` probe `restore-together` lets 1, 4 and 8 restores go at once, each from its own checkpoint into its own QEMU started ahead, evicted from the page cache. On the bench (spin's shape and login, 30 bursts, first logins pooled; the pooled interval is narrower than the truth, since restores in one burst are not independent): alone 152 / 100 / 90.2 ms at 1 / 8 / 16 channels; 4 at once 184 / 140 / 143; 8 at once 400 / 329 / 337. Against 8, 16 gains −10.1 [−12.2, −7.6] alone and loses +3.2 [+1.1, +5.8] at 4 at once (+10.9 [−4.7, +30.4] at 8). The rule set before the run picked 8: it gains on 1 at every count. `machine.DefaultChannels` is 8. A Save or Load that names a count, and `spin-machine save/restore --channels`, still choose any. A fast load or a stream state stays at one thread. The release record's restore numbers measure each release at its own default, so this release's Δ against the one before it is the change. Eight restores at once take ~330-400 ms whatever the count: what a host does with a burst is its own question. *Status:* kept. - -**11-20 · CI · the builders are images, and the apk locks are gone (this change).** The daily apk-lock refresh (`c6c29b5`) kept the locks buildable, at a price: Alpine's mirror serves only the newest build of each package, so a lock moved every two or three days (11-09, two on 11-12, 11-19, #308 on 11-20), and the lock is the first layer of QEMU's build, so each move compiled QEMU cold on its pull request (17-21 min) and again on main (12 min), since only main exports the cache. #308 was libxml2 r2 → r3, which nothing links. QEMU's and e2fsprogs' builders are now images, Alpine with the part's apk.list installed (`builder/Dockerfile`), published to ghcr and pinned by digest (`qemu-builder`, `e2fsprogs-builder`). An image keeps its packages after the mirror drops them, so nothing forces a move: refresh.yml makes them again weekly and proposes the ones whose packages moved, with the list of what did. The tag is a hash of the Alpine, the list and every package installed, so it never names two images. A part's build stops at its first step when the tree's apk.list is not the builder's. In place. - -**11-20 · CI · qemu.yml, kernel.yml and image.yml are parts.yml (this change).** Three workflows of the same shape, each a path-filtered `changed` job and build, and none of them a required check, since a path-filtered workflow does not report on a change outside its paths: a pull request could merge with its QEMU build red (#309's was not blocking). One workflow now, with no path filter: `changed` decides for each part, the builds run when it says so, and `parts` (`spin-machine-dev needs`) fails when one that ran did not pass, which gives a ruleset one check to require. A change that reaches all three runs one `changed` where it ran three (each a billed minute). Over the 200 runs before it (gha-optimize, 2026-11-20): build p50 1m01s cached, cold 10-22 min; `changed` 20 s. In place. - -**11-20 · lab · each release's numbers in the repository, measured alone (this change).** The ladder (11-19) made every release re-measure the newest five on the bench (~13 min of the `report` job), uploaded a 31 MB ladder.json as a release asset and ended the release's notes with a table: numbers no one could share or read back but by downloading the asset, and the same five releases booted again with every release. Now the `report` job measures the release alone (`spin-machine-dev releases measure`, a ladder of one), keeps its p50/p95s as `docs/releases/RELEASE.json` with its host, date and run (whose artifact keeps every sample, 90 days), writes `docs/releases.md` from every record (a Mermaid chart of each goal number release by release, the tables, where each was measured), and proposes both as a pull request as the release app. It boots one release where it booted five, and nothing goes on the release. *Why alone, not beside the release before:* every record is then read the same way, one run each, and the page says plainly what that costs: the 11-19 report said v20261119.02 accepted SSH 7.3% later than v20261119.01, and the two interleaved said they did not (labs 44583379559, 44600043625), so a Δ on the page is a lead and a decision is `lab ladder` over the two, interleaved. `releases compare A B` prints two records with each one's host and date, and that command. Past releases are `releases missing`, measured by `report.yml` dispatched with `versions` (each alone, one after another, proposed together). Seeded from the two ladder.json assets there were, taking only each one's newest release, the one that run was for: v20261120.01 (cold 327/337, restore 159/164, run 44641240861) and v20261120.02 (cold 323/329, restore 168/180, run 44727451080); the older releases inside them were measured interleaved, and are left for `releases measure`. `lab publish` and the release-notes section are deleted. - -**11-20 · lab · the records' chart is an SVG, and the records a web page (this change).** The page's two Mermaid `xychart-beta` blocks drew one p50 line each and could not draw a gap: a release without a number was left off that chart's axis, so the cold and the restore charts had different x axes, and neither showed the p95. `spin-machine-dev releases doc` now writes `docs/releases.svg` beside the page, from the same code (`lab.Chart`, hand-written, no dependency): both goal numbers on one axis, each a p50 line over a band to its p95, broken where a release has not the number, the 100 ms goal dashed, a tooltip on every point. One SVG is shown on GitHub's light page and its dark one, and an image cannot follow the theme, so its two colours were chosen to clear 3:1 on both (#2a78d6, #d95926; dataviz's palette checks against #ffffff and #0d1117) with text in a mid grey (3.9:1 and 4.8:1). `releases site` writes the same page as one HTML file with the chart inline, so its tooltips show, and each record beside it. `pages.yml` publishes it at https://spin-stack.github.io/spin-machine/ from every merge that changes a record. The tables are one list of rows that the Markdown and the HTML both write, so the two cannot say different things. Each release in "Where each was measured" now links its record. - -**11-20 · lab/docs · the methodology review, and docs/boot-time.md (this change).** Two adversarial reviews of how boot time is measured, each finding re-run on the ladders of runs 44641240861 and 44727451080 (five releases interleaved, 20 boots each). *Found:* -- No per-phase budget existed, so nothing said whether 100 ms is reachable. Split by phase, the cold boot spends ~125-135 ms in QEMU, qboot and the kernel before PID 1 runs. The no-systemd floor (209 ms) was measured once, on 11-13, on an 87 ms kernel. -- The goal probes boot a shape and a login path spin does not: no CPU or memory ceilings, where spin boots 1 CPU and 128 MiB with ceilings of 16 and 8 GiB (the kernel 86.6 ms against 62, lab 44587603255), and an `sshd-vsock.socket` that spin turns off. -- Effects inside the noise were accepted. Two releases booting the same guest read Δp50 of the first login in [−8.7, +4.8] ms (bootstrap, n=20), yet the logind socket's −4 and `driver_async_probe`'s −5 were kept while −8 and −6 were rejected as noise. -- `docs/releases.md`'s Δ is drift between runs: v20261120.01's restore login read 158.9 and 167.0 in the two runs. -- The bzImage's cost was recorded as zero by a clock that starts after decompression: sshd accepted ~10-13 ms later from v20261119.01 to .02 while "Freeing" went 76 → 62.5. -- `restore-first`'s `read` reads the mapped-ram file's holes (2 GiB for 155 MiB of data), and its `up` times the monitor socket. - -*Decided by the maintainer:* the kernel, systemd, QEMU and qboot may all be patched without limit. systemd is a must, so a no-systemd init is only ever a bound. *Done:* `docs/boot-time.md` holds where both numbers stand, the per-phase budget, the method with one acceptance rule (a gain when the 95% interval of Δp50 excludes 0), the kept and rejected tables, the measurement pitfalls, and what is next. This log's former "Where we stand", "Measured and rejected", "Measurement pitfalls found" and "Open questions" moved there. *Next:* the probes in spin's shape (branch `lab-measure`); multifd channels on the restore and the no-systemd floor on today's kernel, both on the bench. - -**11-20 · lab/image · spin's login, spin's memory, and spin no longer lingers (this change).** What spin expects of the guest's SSH server, read in spin-stack/spin at 1bd3414: sshd on 127.0.0.1:22 reached through its supervisor's vsock forwarder (a Go dialer, so TCP_NODELAY), ssh.service started by the supervisor's `systemctl reload-or-restart` when it installs the user CA and before it lets SSH through, a certificate for **root** (the CLI, the exec server and the terminal agent all log in as root), sessions in `user.slice` (spin writes its memory limits there, internal/guest/sessionmem), and a workspace sized to 2048 MiB through virtio-mem right after its start, before the guest's handoff (vmm.go, resize). The goal probes did none of it: they logged in as spin through systemd's vsock socket, an `sshd@` a connection, and left spin's shape at 128 MiB. *Found, on a laptop (leads, not nested):* -- At 128 MiB the guest's OOM killer runs through the boot and the logins: user@1000, logind, `sshd@`, `ssh.service` and session scopes killed, ssh.service hitting its start limit, logins lost and retried, in every boot of spin's shape. Sized to 2048 MiB right after its start (67-79 ms to plug) nothing is killed. Every number in spin's shape so far measured a guest spin never runs. The ~400 ms stalls between running and the login in ~20% of multifd restores (lab 44750713447) look like it. -- spin's path costs less than the lane's: accept to the first login 67-70 against 142-155 ms, a warm login 27-30 against 33-37 (6 boots each, 2048 MiB). socat as the forwarder without `nodelay` read 69 ms warm against 26 with it: Nagle against the delayed ACK, which spin's Go forwarder does not have. -- On spin's path, sessions of class `user-early-light` and nobody logged in as spin, the lingering user@1000 is a systemd --user started in every boot for nobody: without it accept to login 40 against 70 ms and the first login 294 against 316 (6 each); through `lab run`, 8 each, first login −13.1 [−33.3, +5.6], accept to login −7.1 [−28.5, −2.4], the console prompt −37.8 [−63.2, −22.4]. The lane's login as spin did not move (283 against 281). -- Measured and not kept, each a lead on spin's path: `UsePAM no` refuses root, whose password is locked, and would take the session and `user.slice` with it; pam_systemd removed, −15 ms on the first login and −5 warm, but no session, no `XDG_RUNTIME_DIR` and no `user.slice`, where spin holds a person's sessions below the machine's memory; the sshd PAM stack cut to pam_nologin, pam_unix, pam_loginuid and pam_systemd, nothing (70 against 67). Exec costs, warm: `sshd-auth` 1.7 ms a start against 0.56 for `true` (16 libraries, 7 of them Kerberos'), `sshd-session` 0.9, `sshd -t` 2.2; a rebuilt OpenSSH without GSSAPI has a ceiling of ~1-2 ms a login, under the bench's noise. - -*Changed:* `lab`'s shape options `plugged=MIB` (the guest sized right after its start, as spin does) and `login=spin` (root, through a socat forwarder to ssh.service, systemd's vsock socket masked), both off by default. The image no longer lingers spin, and `--edit nolinger` puts that into a release's overlay. *Measured on the bench* (spin's shape, `plugged=2048`, `login=spin`, 20 each, interleaved): the first cold login 532/551 → 496/514, Δp50 −36.1 [−45.8, −23.6], accept to login −26.9 [−39.8, −18.9], the console prompt −89.5 [−103.6, −73.9], QEMU's RSS −7.9 MiB (lab 44785179901); `prestart` cold −27.4 [−32.7, −19.9], prestarted −25.8 [−35.2, −15.1], both restore rows within the noise (lab 44785565313). *Status:* kept. - -**11-20 · boot · the time before the kernel's clock gets an instrument (this change).** docs/measuring.md's rule 7 (then docs/boot-time.md's rule 6): the bzImage's decompression ran where no clock looked. QEMU zeroes kvm-clock as the machine goes to "running" (`kvmclock_vm_state_change`, KVM_SET_CLOCK with the 0 a machine never run has), and the kernel prints the kvm-clock it read when it made it the scheduler's clock ("kvm-clock: using sched offset of N cycles", in ns). The probe init prints that line and "Freeing" with their kmsg times, and `boot:firmware-stages` places them on QEMU's trace: after the firmware's last select, "to the kernel's clock" (the initrd's copy, the jump, the decompression and the kernel's setup until kvmclock_init), "kernel to Freeing", and "Freeing to SPIN-READY", what is left, which a wrong anchor would push below zero and the probe refuses. Its default shape is spin's (1 CPU, 128 MiB, ceilings 16 and 8 GiB, 4 hotplug disks), and `lab check` hands a second tree to it as SPIN_MACHINE_OUTPUT_B. *Checked, laptop, a lead (8 boots each interleaved):* v20261120.02 (bzImage) against v20261119.01 (PVH, no decompressor): to the kernel's clock 24.3 against 7.9 ms, kernel to Freeing 28.4 against 34.3, and Freeing to SPIN-READY 9.5 against 9.7: what moved is the phase the bzImage added, and the residual on the other side of the anchor did not. The bench reading is next. - -**11-20 · lab · initcalls and density size their guests (this change).** v20261120.03's release report failed on a diagnostic: `initcalls` lost 3 of 40 boots, and the report of 63049ff 4 of 40, each `never saw "SPIN-DMESG-END" in 1m30s` with an empty console tail (report runs 44800662338, 44805222647). ssh-first and the restores lost none in either, and initcalls lost none in the 2-vCPU, 2 GiB shape (44735598126). `plugged=2048` became every probe's default, but only ssh-first, restore-first, prestart and restore-together called `Plug`: initcalls and density booted spin's shape and left it at 128 MiB, while the record said "sized to 2048 MiB". Such a guest had 6 MiB of its 72 free, and had already stalled on memory, when the dump ran (laptop, 3 boots; sized, 1.9 GiB free and no stall), so the bench's loss reads as a guest at the edge of its memory. That is a lead: the laptop lost none of 20 at 128 MiB, and the tail that would say so was empty because `readUntil` returned nothing on a timeout, which it now does not. Both probes now plug as the others do, and a test holds that every probe taking `plugged` needs `memory --to`. initcalls' numbers are now of the kernel booting while virtio-mem plugs, which is what spin's kernel does, so its record moves with this: "Freeing" read 43.1/50.2 sized against 33.6/212 unsized (laptop, 20 each, two runs apart: a lead, not a Δ). *Decided by:* 0 lost in 40+ bench boots (the dispatch on the PR). - -### Week 12: 2026-11-21 to 11-27 - -**11-21 · lab · the probes boot, size and log in as spin does, unless asked (this change).** #319 made spin's shape the probes' default, but left the guest at 128 MiB and logged in by the lane, and both made numbers spin never sees: at 128 MiB the guest OOM-kills its way through the boot (lab 44784196287), and on spin's path the cold first login read 532 ms where the lane's read 445 (labs 44785179901, 44750322384). `plugged` is now 2048 and `login` spin unless a run says otherwise; `plugged=0 login=lane` with the old shape options is the shape before. The release records measure what the probes measure, so the first record after this one is the first in spin's shape, and its pair's Δ (`against`) is measured in the same shape. The `floor` edit's sshd serves the lane, so a floor run passes `login=lane`. - -**11-21 · image/lab · where one vCPU's time goes before the first login, and what the CPU weights do (laptop leads, PR #329 closed).** With the guest sized to 2048 MiB (`plugged=2048`) one vCPU adds ~85 ms to the first login against two, on the lane and on spin's path alike (4 boots each). The guest spends ~225 ms of CPU to the login either way, with 0 ms idle at one vCPU: the second CPU used to run beside the login what one CPU runs before it, and no unit waits longer of its own. Up to the login, in ms of CPU at one vCPU on spin's path: PID 1 ~49, udevd with its workers, trigger and credentials ~41, the kernel and its threads ~31, the lingering user@1000 ~20 (gone since #327), `ssh.service` with its `sshd -t` ~20, journald ~13, logind ~13, the session ~9-12, dbus-broker ~7, the host-key generation ~5, getty ~3. `StartupCPUWeight=1` on udevd and its coldplug trigger took the lane's first login 285 → 240 ms (Δp50 −45.7 [−49.3, −35.8], 12 boots each) and did nothing on spin's path (308 against 307): there `ssh.service` and the forwarder wait for `basic.target`, which waits for udev, so its CPU is on the login's path whatever its weight. `children_max=2` and journald's `ReadKMsg=no` gained nothing. On spin's path the host keys `spin-machine-sshd-keygen` makes are not loaded (spin's own key comes first), ~5 ms of CPU `ssh.service` waits for: spin could mask the unit at its handoff. Not benched. The lever is the order spin starts the login in (docs/boot-time.md, "Open experiments"). - -**11-21 · lab · restores in a burst (lab 44792429636).** Beside picking 8 channels (above), `restore-together` showed that 8 restores let go at once take ~330-400 ms each to the first login at any channel count, against ~100 alone and ~140 four at once. Not explained (docs/boot-time.md, "Open experiments"). - -**11-21 · image · spin's login path starts from the boot's first dispatch, beside udev at the lowest weight (lab 44805051310, PR #338's edits).** docs/boot-time.md's "Open experiments" row, a bound on spin's path. ssh.service alone without default dependencies had still started right after basic.target: it is after Ubuntu's `sshd-keygen.service`, wanted by it and with default dependencies, whose `ConditionFirstBoot` never holds here: a job waits for its ordering before PID 1 checks its condition. logind and dbus-broker had none, but `PrivateTmp=` orders a unit after `systemd-tmpfiles-setup.service`. `lab` edits `login-early` (ssh.socket, ssh.service, sshd-keygen and the probe's forwarder without default dependencies, shutdown conflicts kept; logind and the broker with `PrivateTmp=no`) and `udev-startup` (udevd and its trigger at `StartupCPUWeight=1`). On the bench, spin's shape and login, v20261120.03, 20 boots each interleaved: `login-early` first login −10.8 [−16.3, −5.2], sshd accepts −33.6, accept to login +23.0, console prompt +18, because with the login early it ran beside udev's coldplug on the one vCPU. Both edits −59.4 [−65.9, −56.2], accepts −56.0, accept to login −4.6, second login +6.1 [+3.7, +7.9], console prompt +51.4 (the serial getty waits for dev-ttyS0, which the coldplug announces). On a laptop, sessions had their `XDG_RUNTIME_DIR`, no unit failed and poweroff stopped QEMU in ~123 ms as the release does. *Side effects:* logind and the bus share the machine's /tmp (read-only to logind under ProtectSystem=strict); the console prompt later; udev's coldplug finishes later. *Status:* the image's half kept (`image/`: the three `10-lane.conf`, `30-privatetmp.conf`, `20-startup.conf`, asserted by build.sh). spin's supervisor forwarder is spin's to order, proposed in docs/boot-time.md's "Open experiments". parts.yml keeps no image artifact, so the image is measured as the release with `--edit lane`, which now carries these drop-ins, and `--edit forwarder-early` orders the probe's forwarder as spin's supervisor would be. A laptop lead, 8 boots each: the image with the forwarder as spin orders its supervisor today (after basic.target) +21.3 [-46.1, +261.0], with it early -56.0 [-116.5, +169.8]: with udev at the lowest weight, basic.target can come later, and the image alone may cost spin until its supervisor moves. The bench decides. - -**11-21 · lab/machine · the restore into a QEMU started ahead, taken apart (laptop leads; the `split` probe, branch `restore-split-lab`, not for main).** 106/112 ms on the bench (lab 44798669409): running at 59, the login ~47 after. `lab` probe `split` runs the prestarted QEMU under its trace with host timestamps and reads the guest's journal and per-task CPU. *To running* (laptop, spin's shape, 8 channels, state evicted, 24 restores): spin-machine's exec and dial 2.1 ms, ~20 QMP round trips to migrate-incoming 6.0 (query-cpu-model-expansion 0.5 of it, each round trip ~0.25), the header 1.5-9 (the first read of a cold file), the RAM load 50.4, the device state 3.4 (~0.4 a virtio device), to running 1.1, the reply 1.5. The state is 181 MiB of data: the guest's ~117 MiB in use, the memmap of 2 GiB plugged, the kernel; settling 10 s before the save took off 3 MiB, so free page reporting has little to give. Read from the page cache the load is ~10 ms instead of 50 (running 29.6 against 78, 6 each), so the load evicted is the disk. `direct-io` (O_DIRECT for the channels) was within the noise evicted and +45 ms cached. *Running to the login* (laptop ~33 ms, guest clock from vmgenid's "crng reseeded due to virtual machine fork"): the accept probe's connection ~5 ms (socat's child, sshd forking an sshd-session that reads EOF), the connection to "Accepted publickey" ~22, the session and `true` ~4. A second login right after reads 25-29, so the restore costs the first login ~5 ms over a warm one here. The probes' logins were never closed (`Key.Run` gave Go a blocking socket, closed only once nothing read it): the checkpoint held the cold login's session, and the restore's vsock transport reset tore it down beside the login timed. Closing it: 37.1 → 34.8 ms after running, dropping the accept probe as well 31.5 (8 each). *On the bench* (spin's shape, v20261120.03, 20 each): `split` (lab 44809015139) read to running 58.7 ms, of it the RAM load 38.8, the QMP round trips 8.3, the dial 2.3, the device state 4.5; the login left open cost the first login ~5 ms (104 → 99.1), the accept probe ~4 more (95.3). `prestart` (lab 44809512339), the read-ahead against the release: restored into a QEMU started ahead 95.0/100 → 82.1/87.4, Δp50 −12.9 [−14.7, −9.8], running −11.9; restored −12.1 [−15.3, −8.9]; the cold boots within the noise. *Changed:* the probes close their logins; `machine.Resume` reads the state's data ahead from its first line. spin resumes through `machine.VM.Resume` (`internal/runner/qemu/checkpoint.go`), so it takes the read-ahead with the pin. *Status:* kept. - -**11-21 · lab · where a burst of restores waits (laptop leads; this change).** Lab 44792429636's samples, read again: the eight-at-once rows read ~210 ms to the first login (running 165-177) in their first three bursts, at 1, 8 and 16 channels alike, and 285-480 in every burst after; the extra is before running (1 channel: running max 168 → 369 p50, the median login 44 ms after it both times; 8 channels 166 → 272, 46 → 67 after), one and four at once at 8 and 16 channels do not move over the run, four at once at 1 channel creeps 165 → ~190, and no restore is slower for its place in the order (each index's mean rank 2.8-4.1 of 0-7). A host whose state changed during the run, which only a burst feels. `restore-together` now records what the host counted during each burst (PSI stall time of CPU, I/O and memory; `/proc/vmstat`'s direct reclaim, compaction stalls and huge-page fallbacks, MiB read; CPU busy; memory free and cached going in) and every restore's `running`, and takes `states=cached` (the disk out of the burst) and `defrag` (the host's THP defrag policy for the burst). *Laptop, i9-13900HK, not nested, 5-6 bursts a row, leads only:* 8 at once from the disk read 590-740 ms against 107-110 alone, the disk the bound (1.4 GiB at ~2.7 GB/s, I/O PSI full ~120-260 ms a burst) with or without huge pages. From the page cache: 440-445 ms under the default `madvise`, with ~3000 compaction stalls that all failed, ~2.4 GiB scanned by direct reclaim and memory PSI full ~250 ms a burst, and 85% of 20 CPUs busy; 133 ms with huge pages off for QEMU (PR_SET_THP_DISABLE, a wrapper, Δ −307 [−437, −156]); 150 under `defrag=defer` with no compaction and memory PSI 3 ms. Alone, huge pages off cost +16.0 [+8.9, +22.6] after running (the guest on 4 KiB pages), and `defer` 74.5 → 80.3 (5 each). QEMU marks guest RAM MADV_HUGEPAGE, so under `madvise` every fault of a load that finds no free 2 MiB block compacts and reclaims before it returns: one restore finds the ~90 blocks it needs, eight need ~700 at once and fight over them, and a host that has run a while (a page cache full of states, the bench after its first ~20 GiB) has none to spare. spin restores workspaces concurrently (spin-stack/spin at 1bd3414: an actor goroutine per workspace in `internal/runner/reconcile`, a per-workspace lock in `workspace.Manager.Resume`, up to 10 commands at once in `handler`), and leaves the host's THP policy as the distribution sets it. *On the bench* (lab 44810128678, v20261120.03, spin's shape, 8 channels, 30 bursts a row, every restore one sample): under `defer` against `madvise`, 1 at once 99.6 → 99.5, Δ −0.1 [−2.0, +1.6]; 8 at once from the disk 283/384 → 239/281, Δ −44.1 [−53.2, −35.2]; from the page cache 1 at once 72.3 → 72.0, 8 at once 268/317 → 193/241, Δ −74.9 [−83.2, −64.9]. *Decided:* THP defrag `defer` is a requirement of spin's host (`/sys/kernel/mm/transparent_hugepage/defrag`; `docs/memory-and-disk.md`): it gains in a burst and costs one restore alone nothing, spin never sets the policy and Ubuntu's default is `madvise`. *Not explained:* 8 at once under `defer` still read ~190-240 against ~100 alone, and from the cache barely less than from the disk. `restore-together` now records where a burst ran on the host's CPUs: each CPU's busy time (/proc/stat) and interrupts by line (/proc/interrupts), the CPUs QEMU's running threads were on, sampled every 5 ms, and the QEMUs', the job's CPU lists and irqbalance. It records them because nothing pins QEMU (spin-machine runs it with `-sandbox resourcecontrol=deny`, spin sets only a cgroup `cpu.weight`) and one CPU taking the disk's interrupts or the threads would look like this. *Where on the host's CPUs* (lab 44817486118, v20261120.04, 20 bursts): not one CPU. In the 8-at-once rows the busiest CPU held 6-7% of the busy time (16 CPUs evenly would be 6%), CPU 0 was busy 212-270 ms a burst against the others' 221-276, the interrupts were spread (the busiest CPU 7%, an NVMe queue on top), irqbalance runs, and the job and every QEMU may run on 0-15; QEMU's threads ran on every CPU about alike. What the burst is instead: the host's CPUs 72-78% busy (CPU PSI some 84-190 ms a burst), so 8 restores of ~1 CPU-burst each on 16 CPUs are near the host's capacity, and direct reclaim of the page cache that the states fill (MemFree ~2 GiB of 32 against 28 GiB cached; pgscan_direct 408k pages under `madvise`, 48k under `defer`, with 743 allocation stalls). Here `defer` read 379/445 → 302/388 at 8 at once and 83.2 → 84.0 alone. *Next:* the host keeping memory free ahead of a burst (kswapd's watermarks, `vm.watermark_scale_factor`), and the CPU a restore costs. - ---- - -**11-21 · CI · a release is measured at its tag and recorded by main (this change).** report.yml checked out the release's tag and ran `releases measure`, which wrote the record and the page with the tag's code, and `releases propose` put them on main (#337). v20261120.04's proposal (#350) failed main's TestTheCommittedPageIsTheRecords: #342 had changed `lab.Chart` after the tag, so the tag's page was not the one main writes from the same records, and it was fixed by hand with main's `releases doc` (75a3b24). Measuring stays at the tag, which boots each release with its own spin-machine and the tag's probes, and `releases measure` now only keeps the ladders. A second checkout of main builds its own spin-machine-dev, `releases record` (now taking every ladder.json) writes the records and the page, and `propose` runs there. Functional: no boot number moves. - -**11-21 · lab · what we carry, and what it earns (this change, lab 44818953987).** The reverse of a kept change: every boot-time modification the tree carries, with the shape and host it was kept on, in docs/boot-time.md's section of that name, grouped for removal one arm a group. Found before the bench: 15 masks and 1 disabled generator name units the image does not have (deleted, #352). The 5 masks of `ConditionNeedsUpdate` units are load-bearing, because the image has no `/etc/.updated`, and unmasked they rebuild hwdb.bin and the linker cache at every boot (first login +260 ms, QEMU's RSS +90 MiB, laptop). *Measured* (prestart, spin's shape, 20 each against v20261120.04, the removal's Δp50 of the cold first login): every kernel patch +67.5 [+62.5, +72.4]; SeaBIOS for qboot +68.5; the 16 other masks +57.5; the generators +16.7; the coldplug filter +14.9, and without it a restore +464 (a guest saved with its coldplug still running, a guess); QEMU 0001 with qboot's PAM patch +11.5 [+6.7, +20.2]; `driver_async_probe` with `rcu_expedited` −1.4 [−4.9, +3.1]; kernel 0006, 0009, 0011 and the in-doubt options +1.2 [−4.5, +8.3]; PID 1's quiet logging +2.4 [−2.3, +7.8]. In one vCPU what runs before the login is on its path, so most of what was kept on two still earns. *Status:* the command-line pair deleted (#352); A1 and the logging measured again at 40 boots, cold; the rest kept, with what it earns in the table. A1 deleted 11-20 (#345), the logging 11-20 (#354). - -**11-21 · machine/image · what earned nothing in spin's shape, deleted (lab 44818953987).** The first decisions of the carry ablation (docs/boot-time.md, "What the machine carries"; #349). `driver_async_probe=` for rng, balloon and vsock (11-13, 2 vCPUs, inside the noise at the floor) and `rcupdate.rcu_expedited=1` (09-07, never measured) leave the command line: taken out together, on the bench in spin's shape, 20 boots each against v20261120.04, the first login read −1.4 [−4.9, +3.1] ms cold, +1.4 restored and +1.7 into a QEMU started ahead. With one vCPU an asynchronous probe has no second CPU to run beside. The command line is not in `Spec.Contract`, so the fingerprint does not move. And 16 masks in optimize-systemd.sh named units no package installs (timesyncd, pcrmachine, both tpm2-setups and the tpm2 generator of a systemd built without TPM2, boot-system-token, avahi, cups, bluetooth, smartd, both e2scrubs, both multipathds, lvm2-monitor, run-lock.mount): deleted without a run, and image/build.sh now fails a mask that shadows nothing. *Status:* in place. - -**11-21 · kernel · 0006, 0009 and 0011 deleted (labs 44818953987, 44822157367, #345).** The kernel's half of the carry ablation that read nothing in spin's shape (docs/boot-time.md, "What the machine carries"): 0006 parses vmlinux BTF on another CPU and 0009 polls for a booting AP, and spin boots one vCPU. 0011 had never shown a time, even nested. Taken out together, against v20261120.04, the cold first login read +1.2 [−4.5, +8.3] ms at 20 boots and −2.5 [−8.4, +1.8] at 40 (sshd accepts −1.9, the console +4.2, both within noise). The arm was meant to carry `DEFERRED_STRUCT_PAGE_INIT=n` and the loop and 8250 counts back as well, and did not: the branch's commit staged the patches' removal and not the config, so the parts run (44812044088) built the three patches' removal alone and those options were measured only inside the whole stack's arm, which is kept. *Status:* the three patches deleted; the options open. `DEFERRED_STRUCT_PAGE_INIT` deleted 11-21 (#356); the loop and 8250 counts kept, #357 closed. - -**11-21 · image · PID 1's quiet logging and the printk sysctl deleted (labs 44818953987, 44822157367, #354).** optimize-systemd.sh set the manager's `LogLevel=err`, `LogTarget=journal`, `ShowStatus=no` and `StatusUnitFormat=name`, and wrote `kernel.printk = 3 3 3 3`, for a quiet, fast boot, never measured. Taken back together (`lab` edit `carry-logging`) against v20261120.04 in spin's shape, the cold first login read +2.4 [−2.3, +7.8] ms at 20 boots and −1.8 [−7.7, +3.2] at 40; accept to login +1.7 [+0.2, +3.2], the second login +1.8 within noise. The console is quiet through the command line's `quiet loglevel=3` either way. The timeouts in fast-boot.conf stay. The `carry-*` edits stay too, as the tool to run the ablation again (docs/boot-time.md). *Status:* deleted. - -**11-21 · kernel · `DEFERRED_STRUCT_PAGE_INIT` deleted, the loop and 8250 counts kept (lab 44839538785, #356, #357).** The three options #345's arm meant to measure and did not, one arm each against main's kernel (d255113), prestart in spin's shape, 40 boots a side, v20261120.04's QEMU and image. `DEFERRED_STRUCT_PAGE_INIT` off, upstream's default: cold first login −2.5 [−9.3, +3.8] ms, restored +1.1 [−6.4, +7.9], into a QEMU started ahead −4.0 [−13.0, +13.3]. It was kept on 11-13 for a memmap of 5.2 ms at 2 GiB at boot (lab 43495583323). spin boots 128 MiB, which the kernel does not defer, and plugs the rest through virtio-mem, which it never defers. A boot option does not run in a restored guest, so the restored row's upper bound over +5 says the run's noise, not the option. Upstream's 8 loop devices and 4 runtime ports: cold +5.3 [−3.2, +15.0], restored +1.7 [−6.7, +12.7]: within noise, but the cold bound does not rule out the 2-4 ms the initcalls and udev's coldplug of 8 more block devices would cost, so the counts stay. *Status:* the deferred page init deleted; the counts kept. - -**11-21 · docs · the cold budget in spin's shape, and docs/boot-time.md (lab 44841266997, this change).** `ssh-first` on v20261120.04 as published, spin's shape and login, 20 boots: sshd accepts 396/406, first login 465/479, accept to login 68.4, a second login 35.9. With the release's report (QEMU's exec to a guest ready ~28 by difference, "Freeing" 79.9) and `firmware-stages` (33.6 to the kernel's clock), PID 1 to sshd accepting is ~255 ms, more than half the cold boot. The budget measured before was in the ladder's shape and showed ~75-85. A QEMU started ahead removes the first ~28 ms only: firmware and the kernel run after `cont`. docs/lab.md is renamed docs/boot-time.md and reordered for the next investigation: the numbers, both budgets in spin's shape, the method with the deletion rule, one ledger of what the machine carries, the rejected ideas by part with the shape each was measured in, the open experiments with their budget entries, and the questions no run answers. *Status:* in place. - -**11-21 · machine/kernel/qemu · the PVH boot path deleted (this change).** Since v20261119.02 the machine boots a bzImage through qboot and fw_cfg, and PVH stayed only as a fallback: `machine.OpenRelease` booted a release's vmlinux through `pvh.bin` when it had no bzImage, `--kernel` took a vmlinux, and machine's QEMU tests loaded an ELF stub through `pvh.bin`. Nothing called any of it. `OpenRelease` now requires `kernel/bzImage` and `linuxboot_dma.bin` and names the missing file. `--kernel` refuses a file without the bzImage's `HdrS` header. `pvh.bin` no longer ships, and machine.env loses `pvh_sha256`. The machine's QEMU tests load a bzImage stub instead. The kernel config changes: `CONFIG_PVH` is off, so the kernel and its checksum change, and the vmlinux still ships for what reads its symbols. *What it costs:* `lab compat` stops at the first release without a bzImage, which is v20261119.01 and every release before it, so v20261119.02 is the oldest it checks. spin's Taskfile.yml:250 checks for `_output/qemu/pvh.bin` and must drop that line. The fingerprint does not move: it hashes neither the kernel nor the option ROM. *Status:* in place. - -**11-21 · lab · the probes boot spin's 16 controller targets (lab 44847364468, this change).** spin's c0ffbc0 (2026-11-20) gave the hotplug controller 16 targets, 4 for disks attached at run time and the rest for the extensions a workspace boots with, where the probes booted 4. `ssh-first` on v20261120.04, 20 boots each, interleaved: first login −3.8 [−11.1, +4.5], sshd accepting −2.3 [−6.3, +2.4], within noise. *Why:* the probes measure spin's shape. *Result:* `hotplug-disks` defaults to 16, and the budget's rows taken with 4 stand. *Status:* in place. - -**11-21 · docs · every doc checked against the tree and spin's main (this change).** A pass over every document for claims the code no longer bears out: names, defaults, files, spin's policy (read at spin's d4f62bd), and *Status* lines. Numbers that only a run can settle are listed in docs/boot-time.md's open experiments, not changed. Two were measured: TCG reaches the first login in 7604 ms against KVM's 455, ~17 times, where the docs said fifty (`ssh-first`, lab 44848049631, 5 boots each). QEMU's mapped files are 6.6 MiB resident on v20261120.04 against the ~42 MB of 11-14, because the bzImage is read into QEMU's memory where the vmlinux was mapped (`ssh-first`'s new `qemu_rss_anon`, `qemu_rss_file` and `qemu_rss_shmem`, lab 44847770977). *Status:* in place. - -**11-21 · machine/lab · a named CPU model costs the cold login 27 ms on the bench (lab 44855890737).** For memories that resume on any host of a pool, `ssh-first` compared `host` with `lab tree --cpu baseline`, which is `machine.Models` plus `machine.Baseline` on the runner. The nested c8id's newest runnable model is Cascadelake-Server-v5: Nitro's L1 does not expose enough for SapphireRapids or GraniteRapids. Against `host`: first login +27.2 [+13.0, +30.8], sshd accepting +23.1 [+9.7, +28.5], warm login −0.4 within noise, QEMU's RSS unmoved. *Why:* spin runs `-cpu host`, so a memory resumes only on a host showing every saved feature (spin-stack/spin#1417). *Result:* a fleet-wide named model is rejected for now. `Baseline` stays public for spin. *Status:* open. Next is `host` minus the features a pool's hosts do not share, measured the same way. - -**11-21 · machine · a record read from QEMU replaces the fingerprint (this change).** The fingerprint was a sha256 over a prediction of the machine (`Spec.Contract`, the shape, the BIOS file's size), passed to QEMU as `-name` and read back. A refusal could not say what differed. spin overwrote its probe's fingerprint with one computed from a Spec of placeholders. And the release's `fingerprint_sha256` hashed the CLI's default machine, not spin's, so v20261120.03's notes said checkpoints still resume when spin's shape had moved (`max_target`). *Measured* (laptop KVM, QEMU 11.2.0-rc0, v20261120.04, mapped-ram, the fingerprint taken out so that QEMU decides): QEMU refuses by itself fewer or more boot vCPUs, another vCPU ceiling, another virtio-mem size, a missing device, a smaller RAM or BIOS block and another machine type. It loads silently an extra device (a vsock the guest never finds), a larger BIOS block and more base RAM, because mapped-ram's `parse_ramblock` refuses only a smaller block, and a larger `max_target`, whose extra targets the guest used. A QMP dump of spin's shape: between a machine held and the same machine after a boot, a memory plug, the balloon polled, a vCPU and a disk added, only the balloon's statistics, virtio-mem's sizes, ICH9-LPC's `pm_io_base` and `gpe0_blk` and the RTC's date moved; between two machines, the MAC, the vsock's context id and vmgenid's GUID. *Result:* `QEMU.Target` reads the machine from the running QEMU (every device it was started with and every property but those, its options, its RAM blocks, the features its vCPU has on), and `CanResume` compares two records and returns a `*Refusal` naming every difference. `max_target` may grow; the CPU's features compare as one set, so a richer host is refused too. At spin's shape the record is 25.6 KB of JSON and 126 features, read in 8 round trips, 8.4 ms (boot:record). boot:record holds a machine to its own checkpoint and the silent cases to a refusal by name. boot:compat checkpoints the release before with this tree's `spin-machine save` and compares records; its local run on v20261120.04 resumed. *What it costs:* read inside `Resume`, the destination's record put its 8 round trips on the second goal number: restore-first's first login +4.3 ms [+0.2, +7.5] evicted and +8.2 [+6.2, +10.8] cached against v20261120.04 (bench, lab 44868324811). None of it could leave the clock: QEMU answers no monitor while it loads a state, and a read on a second monitor from QEMU's greeting stayed on it (laptop, +29 ms against +16 read in `Resume`), because QEMU's main loop is busy from its exec to the end of the load. The source's record is read while QEMU writes the state, where QEMU does answer, which brought `spin-machine save` from +7.0 and +10.6 ms (lab 44866054104) to within the noise (lab 44868324811). *Decided* (the maintainer, option C): the destination's record is a constant of a host, its QEMU binary, its CPU and the shape it resumes into, so `Resume` takes it from the caller (`here`), runs `CanResume` before it sends QEMU anything, and never asks QEMU. spin computes it once at runner start and holds each pool machine to it once (spin-stack/spin#1416). `spin-machine restore --target FILE` takes one as given, `spin-machine target` prints one, and the restore probes read each tree's record once before measuring, from a machine held for a checkpoint in the probe's shape. With it, against v20261120.04, whose restore reads its fingerprint record (name, version and CPU, five round trips) inside the restore (bench, spin's shape, 20 each): restore-first's first login +1.0 ms [-2.3, +4.1] evicted and -3.0 [-6.2, +0.0] cached, running +0.1 [-1.7, +1.3] and -1.4 [-2.9, -0.7] (lab 44871809382); prestart within the noise in every row, its restored login -2.5 [-4.3, +0.3] and restored into a QEMU started ahead -1.6 [-3.1, +2.1] (lab 44872699993). A checkpoint or a stored identity from before is refused, as a `vmm` difference, and boots from disk once. A newer QEMU that adds a property to a device is a refusal, which boot:compat reports at the bump. `Spec.CPUWithout` and `Unshared` are there for spin#1417's pools, not yet measured. *Status:* in place; spin follows (spin-stack/spin#1416). - -**11-21 · machine/qmp · the machine sends QMP through the public client, each command defined once (this change).** `machine.QEMU` runs on `*qmp.Client`, and machine/qmp.go, the third QMP client after spin's two, is deleted. Every command the machine sends is a `qmpdef.Define`d value beside the code that sends it, and the block and descriptor commands spin's storage agent also sends are public in qmp/block.go. `spin-machine-dev verify qemu` holds all of them to the binary's query-qmp-schema, which refused the record's `query-kvm`: QEMU 11.2.0-rc0 deprecates it. The accelerator is read from `query-accelerators`, whose `enabled` is the accelerator's name, `kvm` or `tcg` for every machine `Spec.Args` starts, so the record's part stays `{"accel", "kvm"}` or `{"accel", "tcg"}`. The version comes from the monitor's greeting, which is query-version's answer, so a record is 7 round trips. *Measured* (laptop, v20261120.04 with QEMU 11.2.0-rc0, spin's shape, `spin-machine` built before and after): the record of a running machine and of one held for a checkpoint are byte-identical under KVM and under TCG, a checkpoint saved by the old `spin-machine` restores with the new one (`restore --target`), and boot:record passes. A round trip costs more through the client: query-memory-size-summary's p50 went from 216 to 263 µs, +47 [+44, +49], and in a second run from 136 to 159, +23 [+21, +27] (laptop under load, one held machine of spin's shape, the old and new client in turn, 6000 and 4500 each). What it pays for is the reader waking the waiting call on another thread: the same client under GOMAXPROCS=1 read 106 µs, below the old client. The record's read moved −0.4 ms [−2.6, +1.7] with one round trip fewer. A restore sends ~20 commands before QEMU loads its state, so 0.5-1 ms more on restore-first is expected (inferred, under the bench's noise at 20 boots). The query-migrate polls stay; events replace them in a change of their own, interleaved against the release on the bench, which decides both. *Status:* in place; no checkpoint is stranded. - -**11-21 · machine · a checkpoint's waits are its MIGRATION events (this change, labs 44898418357, 44898581478, 44898910862).** Checkpoint, Resume and Loaded asked `query-migrate` every millisecond until the migration reached the state they waited for. They now turn on the `events` capability with the others they set, arm a `qmp.Expect` for `MIGRATION` before the command that moves the migration, and wait on it. `query-migrate` is asked only after a save that failed, for its reason. *What QEMU 11.2.0-rc0 sends* (`TestACheckpointIsWaitedOnByItsEvents`, in `boot:record`, laptop and bench): a save sends setup, active, `STOP`, pre-switchover, device, completed. A full load sends setup, active, `RESUME`, completed, so the guest runs before the event. A fast load sends setup, active, postcopy-device, postcopy-active, `RESUME`, completed (bench only, where the runner turns userfaultfd on), so `Resume` returns before the guest runs, as it did when it polled. Half a state sends setup, active, failed, and QEMU exits (migrate-incoming's exit-on-error) with the reason on its stderr. A `query-migrate` after that event found the connection reset, so a failed load asks nothing and says where the reason is. *Measured* on the bench, spin's shape and login, 20 each interleaved, v20261120.04 with its own spin-machine against the same tree with this branch's (which also carries the record, the module rename and the public QMP client): restore-first's first login −0.4 [−2.9, +0.8] evicted and −1.4 [−3.2, +0.8] cached, running −0.3 [−1.8, +0.7] and −0.7 [−1.7, +0.3], all within noise (lab 44898581478). ssh-first's first login +0.9 [−5.4, +5.3], sshd accepts −0.2 [−5.1, +5.2], within noise; the console prompt read +6.1 [+0.3, +9.0], a diagnostic on a path this change does not touch (a cold boot waits on no migration), left for the next release's record to confirm or not (lab 44898910862). The 23-47 µs a round trip costs more through the client (the entry above) does not show at 20 boots. *Status:* in place; nothing a checkpoint records changes. - -**11-21 · machine · the verbs spin's runner drives a QEMU by (this change).** `machine.QEMU` gains `CPUs`, `Status`, `Hold`, `Shutdown`, `Done`, `End` and `GuestMemory`. `Memory` returns `MemorySize{Now, Base, Ceiling, Block}`, and `Checkpoint` returns the save's `Cost{Paused, Total, RAM}` from one `query-migrate` after it completes. `VM` gains `CPUs` and the two new returns. The balloon gets an id, `balloon0`, so that `GuestMemory` reads it at a fixed path. It turns the guest's reports on at its first call, so no timer runs in a boot that never asks. *The record:* a held machine of spin's shape read the same 34170 bytes of record with and without the id (laptop, v20261120.04, `spin-machine target` from each build), because the record leaves every id out and names the balloon by its slot. *Shutdown, decided by observation:* spin's runner pressed ctrl-alt-del and pressed the power button only if QEMU refused the keys. QEMU takes them, and the guest never sees them: its kernel has no i8042 or AT keyboard driver. Booted to systemd, a machine sent the keys ran until it was killed (SHUTDOWN host-signal), and one whose power button was pressed powered off 0.64 s later (SHUTDOWN guest-shutdown). So `Shutdown` presses the button alone. *What `End` says* (`TestTheMachineSaysHowItEnded`, in `boot:record`): `poweroff -f` ends as {guest, guest-shutdown}, `Shutdown` under systemd as {guest, guest-shutdown}, and a panic as {guest, guest-reset}, since `panic=1` reboots and `-no-reboot` ends the reboot. No panic device exists, so `GUEST_PANICKED` is never sent. A checkpoint of a 128 MiB guest at the `/bin/sh` prompt cost a 5 ms pause, 56 ms in all and 86 MiB of RAM written. No goal path changes timing: `Boot` and `Resume` send what they sent, and the cost's round trip is on the save, before either clock. *Status:* in place; no checkpoint is refused. - -**11-21 · lab · what QMP and vsock cost the goal's paths: the `transport` probe (lab 44912471522, this change).** The question was how to make QMP faster, posed as if QMP ran over vsock, with vsock RTT tuning, CPU pinning, `halt_poll_ns`, SEQPACKET, ivshmem, virtio-serial and gRPC framing as candidates. QMP is a Unix socket between the host and QEMU. vsock is between the host and the guest, and carries spin's SSH login. So two questions: how much of each goal number is QMP, and how much is the login's vsock. `transport` boots and restores spin's shape with QEMU traced (`qmp_enter_*`, the monitor's queue and answers, the run state, host time). After the cold login it times query-status, a one-byte echo over vsock and through a forwarder hop, and a warm login's round trips. *Measured* (bench, spin's shape and login, v20261121.01, 20 boots, 0 lost): the cold boot waits on 14 commands, 6.2/6.6 ms from QEMU's main loop being free to `cont` answered, 1.3% of the traced first login's 470. Of that, 4.5 ms is QEMU waiting for spin-machine's next command, and the commands' own run is ~1.2. A restore waits on 17 commands before `migrate-incoming`, 6.7/7.6 ms (5.2 of it waiting on the client), and 2.7 ms from the guest running to the restore's last answer, of a 114 ms first login. spin-machine's start and dial are off both paths: its first command waits 17.1 ms (cold) and 19.5 (restored) for QEMU to finish making the machine. query-status takes 131/142 µs from a Go client and 18 µs inside QEMU. A vsock round trip is 47.8 µs, 57.5 through a forwarder like spin's, and a login is 10 of them: 0.6 ms of a 32.8 ms warm login. *Why not double:* each QMP round trip on the path is ~0.25-0.9 ms where the command runs in ~0.02-0.35. The rest is the client's turn in a process that has just started, on a nested host. *Decided:* no change. If QMP cost nothing, the cold number would gain at most 6.2 ms and the restore at most ~9.4. Pipelining the bind gains at most 4.5 cold and 5.2 restored, and the read-ahead overlaps the restore's half. Dropping the round trips that can go gains ~1.3 cold and ~1.9 restored. Every vsock idea is bounded by 0.6 ms a login. All of these are under the noise at 20 boots (±7-9 ms cold, ±13 restored), so none was built (docs/boot-time.md, "QMP and vsock"). The laptop agreed (i9-13900HK, under load): 14 and 17 commands, vsock 13-16 µs, 10 turns a login. *Status:* the probe is kept so the split can be taken again. - -**11-21 · machine · the package starts and ends the QEMU it defines (labs 44912292706, 44912896763, 44914490616, 44914952228, this change).** Every caller assembled one QEMU's life itself: exec it, wait for the monitor's socket, dial, `qmp.New`, `Attach`, keep its output, kill and reap. In this tree there were ~7 such wrappers and ~8 dial loops, with poll intervals of 1, 5 and 20 ms, socket waits from 5 s to unbounded and handshake timeouts from 5 s to 2 min, and spin's runner had its own. `machine.Start(ctx, Spec, StartOptions)` now returns a `*machine.Process`: the `*machine.QEMU` its own monitor drives, with the process under it. Start opens and hands QEMU every descriptor the Spec implies (each monitor's socket, bound by Start, `/dev/kvm`, `/dev/vhost-vsock`, `/dev/vhost-net` per NIC, a `file:` console), so QEMU opens no path. The caller keeps its TAPs and disks, and shapes the process (uid, chroot, namespaces, cgroup) through `StartOptions.Cmd`, which runs after the opens. Readiness is Start's own monitor, bound and connected before QEMU exists and answered by QEMU's main loop once the machine is made. Nothing is polled. `Exit` holds the wait status, the last `SHUTDOWN`, the console's panic line when Start reads the console, and stderr's last 4 KiB. `Stop` presses the power button of a running guest, then quits, then sends SIGKILL, each step bounded. A monitor silent for 1 s (a QEMU loading a state) is killed. `machine.Dial` replaces the dial loops for a second monitor. `spin-machine boot` starts QEMU through Start and waits beside it, with Pdeathsig, instead of exec'ing it with a `_bind` helper. *Observed on real QEMU* (laptop, KVM and TCG, v20261121.01's QEMU): a held machine stopped is quit, `exit status 0` with SHUTDOWN host-qmp-quit. Killed, it reads `signal: killed` with no SHUTDOWN. A refused device fails the start at once with QEMU's line (`Property 'virtio-balloon-pci.no-such-property' not found`). `poweroff -f`, `Shutdown` under systemd and a panic end as guest-shutdown, guest-shutdown and guest-reset, exit status 0 (boot:record). *Measured* on the bench, spin's shape and login, v20261121.01 with its own spin-machine against the same tree with this branch's: ssh-first's first login +0.5 [−5.2, +8.3] at 20 boots (lab 44912292706) and −2.9 [−7.0, +5.0] at 40 (lab 44914952228), sshd accepting −3.5 [−6.8, +3.1], within noise. restore-first at 20 read the cached login +3.6 [+1.5, +4.5] (lab 44912896763), and at 40 +0.4 [−1.7, +3.1] evicted and +0.7 [−2.1, +3.1] cached, running +2.2 [−0.1, +5.2] and +0.4 [−1.1, +2.9], within noise (lab 44914490616). The cached cold login inside that run read +4.9 [+1.8, +9.5], where ssh-first's 40 cold logins read −2.9, so it is read as the probe's noise and left for the next release to confirm or not. *Why no gain:* the dial polls were never on the clock. A client polling the socket found it long before QEMU could answer, because QEMU makes the socket early in its start and answers only once the machine is made (the `transport` entry above: spin-machine's first command waits 17 ms on QEMU). *Status:* in place. spin follows, in place of its runner's own start, handover and shutdown. - -**11-21 · machine · the package opens a disk's chain, and the base only to read (this change).** A `machine.Disk` took open files, and each caller read the chain itself: `cmd/spin-machine/chain.go` from the qcow2 headers, the boot tests by hand, and spin's runner through `qemu-img info --backing-chain` under Landlock, refusing an image outside the disk's own. `machine.OpenDisk(DiskPath)` now opens the top read-write unless the disk is read-only and every image below it read-only. It reads the chain from the headers and refuses a backing file that is not a regular file under the caller's `Under` (files or directories), symbolic links resolved. A writable top that is one of `Under`'s images, the shared base, is refused (rule 1). Each backing file is opened `O_PATH`, checked through its descriptor and reopened through it, so no rename falls between the check and what QEMU is handed. A FIFO is never opened to find out what it is. A chain that comes back on itself, a missing backing format, an encrypted image, an external data file, a backing name over QEMU's 1023 bytes and a header that claims more than its first cluster are refused, each naming the file. `Image.Size` carries the size the guest sees, which spin bounds QEMU's writes by. `spin-machine --disk` takes the release's base as `Under` unless `--disk-under` names others, and `lab compat` names the previous release's. *Header parser vs qemu-img, measured* (laptop under load, one chain of overlay, overlay and the release's base): `qemu-img info -U --backing-chain` 3.4 ms p50 over 50 runs, `OpenDisk` 0.045-0.050 ms, the reader it replaces 0.015 ms. *Landlock:* not needed in process. It confined qemu-img's C parser to the images it was given. This reader executes nothing, opens nothing before checking it, and bounds every read by the first cluster (at most 2 MiB). *Goal numbers:* not run on the bench. The 0.03 ms the checks add to a boot's or a restore's disk open is under the ±7-9 ms a 20-boot interval resolves. boot:record passes on a tree of v20261121.01 with this spin-machine, its root disk now opened by `OpenDisk`. *Status:* in place. spin adopts it in place of `backingChain`, passing its disk's images other than the top as `Under`. - -**11-21 · machine · a host's record in one call, and where a checkpoint's state is synced (this change).** spin's runner started a held machine only to read `QEMU.Target` and kept the answer (spin-stack/spin#1416). spin also synced the state file every 100 ms while QEMU wrote it, synced it again inside the seal, and bounded a resume by the state's written blocks. *Built:* `machine.ReadTarget(ctx, Spec, StartOptions)` starts a machine of the Spec held, reads its `Target` and stops it. The caller's monitors are dropped. Each NIC is put on a hub port, so no TAP and no `/dev/vhost-net` is needed. The console writes to nothing, but the serial port is kept. *Measured* (laptop, v20261121.01, spin's shape, 2026-11-21): a machine whose NIC was on a real TAP with vhost read a record byte-identical to `ReadTarget`'s, and 25 589 bytes. One call took 72-76 ms p50 over 20 (QEMU's start 28, the record 11, its quit 37). It runs at a runner's start, off both goal clocks. boot:record now holds a machine's own checkpoint to `ReadTarget`'s record of its shape held for a checkpoint. Its first run failed with `device isa-serial: checkpoint isa-serial, here none`, because the test's Spec had no console. The record names the serial port, so the caller's Spec has to carry the console its machines have. The lab still reads a tree's record through that tree's `spin-machine target`, because the lab can drive a binary that predates `ReadTarget`. `restore` and the probes that resume into a machine they just started still ask that machine, which is the right call when there is no host constant. *Checkpoint sync, decided by measurement* (laptop ext4 NVMe, 99% full and shared; spin's shape plugged to 2 GiB, 1.5 GiB touched, 1.6 GiB written per save, mapped-ram with 8 channels; a seal that creates and syncs a file; 16 interleaved saves an arm, medians over the saves that did not stall on the disk): with the sync inside the seal, the pause's sync was 275 ms and the guest stopped 683 ms from seal to `cont`. Every 100 ms and then inside the seal gave 167 ms and 566. After `cont` gave 0 and 506. Over every save, the sync after `cont` beat the periodic arm in the pause by 183 ms [−1676, −160] and in QEMU's total by 232 [−2027, −124]. The guest's whole pause does not resolve over every save, because the stalls were seconds long and hit every arm. The sync after `cont` took 2-3 ms. QEMU syncs nothing itself (strace). The seal's file took 2-7 ms with ~830 MiB dirty, so spin's reason for the periodic sync did not reproduce on ext4. *Decided:* `Checkpoint` syncs nothing, and the caller fdatasyncs after `Continue`. The resume bound stays with the caller, because it rests on the host's slowest disk. `Resume` is unchanged, so restore-first was not re-run. Both decisions are written down in docs/memory-and-disk.md. `Cost.Paused`, QEMU's downtime, reads 200-250 ms under the caller's clock from the seal to `cont`. That gap is not yet traced. *Status:* in place. spin replaces `qemu.Target` with `ReadTarget` and moves its `fdatasync` after `Continue`/`Hold`. - -**11-21 · machine/image · the pressure probe (labs 44921602512, 44921841077, 44923048262, 44924252325, 44924755505, 44926664003, 44926917170, this change).** A runner hosts ~20 workspaces. The platform has to say which of them is short of CPU, memory or IO, which one causes it, and when QMP is slow, so that an agent can later act on one machine at a time. The machine now owns both ends of a probe. In every guest, `spin-machine-pressure.timer` starts a static sender 10 s after the boot. It runs at Nice 19, on the idle scheduler and IO class, as root, out of the OOM killer's way. It arms PSI triggers (150 ms in 1 s) on the guest's CPU, memory and IO, watches its OOM kills, and writes a line to host vsock port 1032 each time one fires. On the host, `machine.ListenPressure` routes each connection by the CID the kernel names. `StartOptions.Pressure` adds the same triggers on QEMU's cgroup, and times every QMP command against what that command took before. `Process.Usage` reads the counters that say who causes a stall: the cgroup, `query-blockstats`, and the balloon's OOM kills and allocation stalls. A prototype settled the shape first. Guest PSI is blind to the host taking a vCPU, and a fast OOM killed before any trigger fired. Host cgroup PSI tells the two apart, but a trigger with a window under 2 s is root's alone. No QMP event carries pressure, and a QEMU loading a state answers no command, so the timing follows the migration's events. *Observed on real QEMU* (task boot:pressure, laptop, v20261121.01, one vCPU, 1 GiB, QEMU pinned to one core, several runs). Three loops brought guest CPU stalls each second and no host ones. One loop with two host hogs on its core brought host CPU stalls each second, and `query-blockstats` took 536 ms against a 14 ms baseline, a `SlowCommand`. Two readers of the disk, 4 KiB at a time, brought guest IO stalls; 1 MiB reads from one reader stalled the guest only now and then. A working set reread through what a 700 MiB tmpfs left brought guest memory stalls. A stream read once did not, because clean cache is reclaimed without a stall. A 3000 MiB allocation brought `OOMKill{1}`. The lane found two bugs. The sender spun at ~0.8 s of the guest's CPU a second, because a kernfs file polls as changed until it is read again. And the OOM killer took the sender in the very OOM it was there to report. *Measured* on the bench, spin's shape and login, v20261121.01 against the same release with the sender put into its overlays (`--edit pressure`), interleaved. Ordered after multi-user.target, the sender started beside the first login. The first login read +0.5 [−2.6, +6.7] at 20 boots (lab 44921602512) and +2.5 [−2.1, +7.6] at 40 (lab 44924252325). With `Type=idle` it read +6.1 [+2.3, +10.0] (lab 44924755505), because the boot's jobs are done just before the login arrives. sshd accepting to the login read +2.6, +3.3 and +2.9 in those three runs, each excluding 0. Started by the timer, the first login read −0.5 [−3.6, +2.9] and accept-to-login −0.5 [−1.8, +0.9] (lab 44926664003, 40 boots). The restored login read +0.2 [−3.0, +2.7] evicted and +1.4 [−3.8, +4.7] cached at 20 (lab 44921841077), and +0.3 [−2.5, +3.2] and +1.1 [−3.6, +4.7] at 40 (lab 44923048262), with the sender running in the checkpoint. With the timer it read +1.8 [−2.0, +5.2] evicted and +0.9 [−2.5, +3.4] cached at 40 boots, the sender not yet started when the state was saved (lab 44926917170). *Status:* in place. A guest's first 10 s go unreported. spin follows with one listener and a watch per Start. Its guest supervisor's `POST /v2/memory-pressure` on port 1027 is then deleted in favour of `Stall{Guest, MemoryPressure}`. The actuators are #395 and #396, and the open questions #391-#394. - -**11-21 · lab · would a higher host priority for QEMU cut either goal number: the `run-delay` probe (labs 44925573288, 44927312303, this change).** A weight, a nice value or a real-time class changes only who runs when two threads want one CPU. So the most any of them can win is the time QEMU's threads spend runnable and not running, and that was measured before anything was built. `run-delay` samples every QEMU thread's `/proc/PID/task/TID/schedstat` every 5 ms, from before the exec to the first login, cold and restored (evicted). It keeps an exited thread's last sample and splits the wait at the guest's first run, from QEMU's trace. Its rows are crowds of workspaces already running, as `density` boots them. *The instrument sees what it claims:* the guest's steal time, which KVM takes from the vCPU thread's run_delay, read 330-340 ms cold on the busy host against the vCPU thread's 304-331. *Idle host* (bench, spin's shape and login, v20261121.01, 20 boots, 0 lost; lab 44925573288): QEMU's threads wait 0.2/1.1 ms in all to the cold first login (467/479) and 0.1/0.2 to the restored one (115). That is the ceiling of any priority change on the host the goal is measured on, and it is under the noise by ~40×. *Busy host,* 16 workspaces each keeping its vCPU busy on the bench's 16 CPUs: the cold first login reads 1184/1490 and the restored 306/321. QEMU's threads wait 824 ms cold, summed over threads that wait at the same time (331 of it the vCPU's, 248 the main thread's, the rest vhost and io_uring workers), and 282 restored, 224 of it before the guest runs. The host's own steal read 0 in every row, so the bench's hypervisor (L0) took nothing visible at 10 ms ticks. Only the host's (L1's) wait is in reach of a priority, and that is what was measured. *The arm* (lab 44927312303, 20 boots a row, interleaved): the crowd at nice 10 against the crowd at 0. The lab runs unprivileged, and 10 steps either way is the same ratio of weights (110:1024 against 1024:9548), so this is QEMU at −10 as the scheduler sees it. The restored first login fell −79.3 [−93.5, −71.0] (316 → 238) and its wait 290 → 116 ms. The cold first login moved −104.7 [−258.3, +150.9], within noise: the vCPU's wait fell 304 → 119 ms, but the main thread's rose 208 → 289 and the vhost workers' 90 → 122. QEMU's own CPU time grows from 503 ms idle to ~605 busy, which no priority wins back. *Decided:* nothing changes in the machine. On the idle host there is nothing to win. On a busy host, restores gain clearly, and the lever, a workspace's cgroup `cpu.weight`, is spin's runner's (machine.Start's `Cmd` places QEMU in it). That is a proposal for spin ("Open experiments"), to be measured there. The lab put every QEMU in one cgroup, where each thread competes on its own. In spin each workspace is a cgroup whose weight its threads share, which may give less. SCHED_FIFO was not tried, because a weight already shows the gain and a FIFO QEMU could starve the host. *Status:* the probe is kept, so the wait can be read again on a host whose load is spin's. - -**11-21 · machine · a machine held at its cgroup's limits (#403, this change).** spin sets `cpu.max`, `memory.high` or `memory.max`, and `io.max` on a workspace's cgroup, and the limit applied silently. A host CPU Stall could be the host squeezing the machine or spin's own `cpu.max`. *Built:* the host side of the probe reads QEMU's cgroup each second, beside its PSI triggers, and tells the watch a `Limited` each second a limit held: `cpu.max` when `nr_throttled` moved, `memory.high`, `memory.max` and its OOM kill when `memory.events` moved, and a key of `io.max` when a device's rate reached 90% of it. Each carries the limit, its device, the limit's value, what was used, how many times the kernel held the machine, and since when. The last reading is taken at QEMU's exit. `Usage` gains `CPU.Throttles` and `memory.events`' four counters. *Checked first:* cgroup v2 has no counter of what `io.max` throttled. `io.stat` gained no field on Linux 7.0 with `CONFIG_BLK_DEV_THROTTLING=y`, under an `io.max` that held `dd` for 6.4 s. *Observed on real QEMU* (task boot:pressure, laptop, v20261120.04 with this checkout's sender, one vCPU, 1 GiB). Under `cpu.max` of 0.2 CPU, one loop brought a `Limited` each second at 199,500-200,200 µs a second and 10 throttles, and a host CPU Stall each second with it. With `memory.high` 32 MiB above QEMU's memory, rereading a second disk brought 2,200-4,300 `high` events a second, `memory.current` within 0.1% of the limit. Under an `rbps` of 4 MiB/s, QEMU read at 4,188,788-4,189,940 B/s. Its cgroup's `io.pressure` total did not move in those 5 s, because io_uring leaves no QEMU thread waiting, so the rate is the one sign. No phase before the limits brought a `Limited`. *Not measured:* boot and restore. The limits are read in a watch's own goroutine, and neither goal measurement starts a watch. *Status:* in place. - -**11-21 · machine · a checkpoint and a resume tell their phases, and a checkpoint's guest no longer waits on ext4 (labs 44932635041, 44932944601, this change).** A checkpoint reported only at its end, with `Cost`. spin's snapshot showed nothing until then, and the guest stayed stopped 200-250 ms past `Cost.Paused` for no traced reason (#399). *Built* (#407): `SaveOptions.Phases` and `LoadOptions.Phases` take a func told each typed `machine.Phase` of one call. A save is `SaveStarted`, `RAMWritten` (a `query-migrate` every 100 ms while the guest runs), `GuestStopped`, `Sealed{Took}` and `SaveCompleted{Cost}`, then `GuestRunning` from `Continue` or `GuestHeld` from `Hold`. A load is `LoadStarted`, `StateLoaded{Bytes}` and `GuestRunning`, and after a fast load `Loaded` tells `StateLoaded`. The hook is per call and not per machine, because spin's timeline is per snapshot (spin-stack/spin#1481). Without `Phases`, a save and a load send the same commands as before. `spin-machine save` and `restore` print the timeline. *Observed on real QEMU* (boot:record, laptop, v20261121.01, a 128 MiB guest): a save told SaveStarted at 0, GuestStopped and Sealed at 45.4 ms, SaveCompleted at 50.2 and GuestHeld at 51.0. A load told LoadStarted at 0, StateLoaded at 35.3 and GuestRunning at 35.8. *#399 traced* (laptop ext4, spin's shape with 2 GiB plugged and 1.5 GiB of tmpfs filled, 1.6 GiB a save, 8 channels, every command and event timed): the gap fell between `remove-fd`'s answer and the next command. Each command took under a millisecond, and `cont` 2-3 ms. QEMU `ftruncate`s the state it writes, and ext4's `auto_da_alloc` writes a truncated file's dirty pages back on its last close. That last close was Checkpoint's copy of the file, closed before Checkpoint returned. Closed on a goroutine, with 16 saves an arm interleaved on one guest: `completed` to `cont`'s return fell from 238 ms p50 to 6, and the guest's stop to `cont` from 451 to 198, −252 [−4354, −33]. The caller's `fdatasync` after `Continue` rose from 3 ms to 259, so the time to a durable state did not change (−19 [−4088, +3963]). The phases also showed that the last `RAMWritten` before the stop was 0.3-0.9 GiB short of `Cost.RAM`. QEMU writes that RAM after the seal, with the guest stopped (#415). *Measured* (bench, spin's shape and login, v20261121.01's spin-machine against this branch's at cd966d5, which also carries main since the release; 20 each, interleaved): restore-first's login +2.5 [−0.2, +6.1] evicted and −2.3 [−5.0, +1.7] cached, within noise; `running` +2.3 [+1.7, +3.5] evicted and −0.1 [−1.2, +1.3] cached (#416). ssh-first's first login +0.3 [−4.9, +7.1], within noise. `StateLoaded.Bytes`, one `fstat`, came after these runs. *Status:* in place. spin takes `Phases` into its snapshot timeline, and syncs the state after `Continue` as before. - -**11-21 · boot · what a snapshot keeps: `boot:rollback` (#408, lab 44937567816, this change).** Nothing checked that a rollback brings back the same memory and disk, byte for byte. boot:record checked that a counter goes on after a restore, and boot:compat that a release's checkpoint resumes. *Built:* `TestARollbackBringsBackTheSameMemoryAndDisk` (`task boot:rollback`, lab.yml's `check:rollback`). It boots spin's shape plugged to 2 GiB to systemd, logs in as root over SSH through vsock, and runs the maintainer's terminal loop `while true; do date +%T.%N; sleep 0.1; done` detached, beside a Perl process that holds 4 MiB of random bytes and a counter and stamps each line with both of the guest's clocks on the serial console. Then it takes four steps. A checkpoint with memory is sealed as spin's storage seals a disk and continued in place. A rollback with memory goes onto the sealed disk after the guest changed the file and the bytes. A disk-only snapshot is `stop`, `blockdev-snapshot` and `cont`. A cold boot comes from the sealed disk. Left at 128 MiB, the guest's OOM killer took the SSH session, as the lab's Plug says. *Observed* (v20261121.01, 3 runs on the laptop and 1 on the bench, which agreed). The checkpoint stopped the guest 11-17 ms (`Cost.Paused` 11-14), inside one of the loop's sleeps, so the loop's largest step stayed at 101-105 ms. After the rollback the process had the same PID and the same bytes. The file matched from memory and again from the disk. The loop and the counter went on from their lines at the checkpoint, and the kernel reseeded its RNG (vmgenid). The cold boot had the synced file and not the later one. The loop's log, written 3 s and never synced, was not on the disk at all, because the seal is crash-consistent. The disk-only snapshot stopped the guest 7-14 ms. The guest's clocks stop with it. A stop held 1.00 s left the guest's wall clock 1.001 s further behind, and both clocks stepped 101 ms across it. The resumed guest read the checkpoint's time, 6.34 s behind 48 ms after the resume, and nothing in the machine corrected it, by the 09-10 decision. spin steps it at the supervisor's next registration, and after a snapshot continued in place nothing steps it (spin-stack/spin#1498). An SSH session open at the checkpoint did not survive the rollback. The restored sshd read `Transport endpoint is not connected` within 3 ms, its pty shell was gone at the first look, and the guest's kernel logged nothing of vhost-vsock's reset (spin-stack/spin#1483). *Status:* in place. `lab dispatch` takes no `check:TARGET` yet (#419). - -**11-21 · machine · a checkpoint plans a 30 ms pause, not QEMU's 300 (#415, lab 44940051596, this change).** The phases showed a 1.6 GiB checkpoint's guest stopping with 0.3-0.9 GiB still to write, and that remainder was most of `Cost.Paused`. *Explained:* QEMU stops the guest once what is left fits in `downtime-limit` times the rate it measured over the last 100 ms. The machine never set the limit, so it was the default 300 ms. Into the page cache the rate read 30-34 Gbit/s, so the guest stopped with up to ~1.2 GB to go. An idle guest stopped part-way through QEMU's first pass, and what was written after the stop was memory QEMU had not reached yet, not memory the guest had dirtied. Mapped-ram, multifd and pause-before-switchover leave that test as it is (QEMU 11.2's `migration/migration.c`). *Measured* (bench, nested KVM, v20261121.01, spin's shape plugged to 2 GiB, 20 saves an arm interleaved on one guest, branch `exp/415-downtime`): at 30 ms QEMU's downtime fell from 192 ms to 6 for an idle guest with 1.5 GiB of tmpfs filled, −186 [−189, −184], and the save's total did not move, +4 [−2, +6]. With a writer rewriting 64 MiB of a 512 MiB set every ~100 ms it fell from 221 ms to 8, −213 [−218, −208]. The total rose 39 ms [+33, +45] for one more pass and 195 MiB more written while the guest ran. The laptop agreed, at 238 to 12 and 209 to 11. A writer rewriting 256 MiB of a 1 GiB set with no pause converged at 30 ms in all 10 saves (laptop). *Rejected:* 100 ms (60 ms of downtime with the writer, laptop); auto-converge, whose throttle never engaged in any save; `avail-switchover-bandwidth`, not run, since it only stands in for the rate in the same test. *Found on the way:* `cont` right after `Checkpoint` once failed with "Migration is not finalized yet", because QEMU sends `completed` before it moves the run state to `postmigrate`. That is #421. *Status:* in place. A checkpoint is on neither goal clock, and `Resume` reads the same file, so restore-first was not re-run. boot:record resumed a checkpoint saved at 30 ms. - -**11-21 · machine · a checkpoint returns once QEMU has left finish-migrate (#421, this change).** `Continue` right after `Checkpoint` failed once in about 235 checkpoints with `cont: GenericError: Migration is not finalized yet`, and the guest stayed stopped. *Explained* (QEMU 11.2.0-rc0's `migration/migration.c`): the migration thread sets `completed`, sends `MIGRATION{completed}` and lets the BQL go in `migration_completion_end`, and moves the run state from `finish-migrate` to `postmigrate` only once it holds the BQL again, in `migration_iteration_finish`. `qmp_cont` refuses `finish-migrate` (`monitor/qmp-cmds.c`), and `runstate_set` sends no event. `blockdev-set-active` is not refused there, so a `Hold` in the window succeeded and left the machine in `finish-migrate`. *Reproduced* (laptop, real KVM, v20261121.01 with this checkout's spin-machine, spin's shape plugged to 2 GiB, a guest rewriting 600 MiB of tmpfs, Checkpoint then Continue in a loop): 0 refusals in 2000 checkpoints on an idle host. With QEMU and the test pinned to two host CPUs kept busy by two spin loops, 102 of 300 `cont`s were refused, `query-status` reading `finish-migrate` at the refusal, and with `Hold` first, 88 of 300 Holds left the machine in `finish-migrate` and 79 `cont`s were refused. *Built:* `Checkpoint` asks `query-status` after the cost's `query-migrate`, and again every millisecond while it reads `finish-migrate`, bounded by its context. Making `Continue` retry `cont` was rejected: `Hold` and `Status` would still see `finish-migrate`. *Measured:* under the same contention, 0 of 300 refused, and 0 of 300 with `Hold` first. The guest's stop to `GuestRunning`, 8 runs of 60 checkpoints an arm interleaved on the idle laptop, moved from 6.62 ms p50 to 6.82, +0.20 [+0.08, +0.33], one QMP round trip. *Status:* in place. A checkpoint is on neither goal clock. - -**11-21 · boot, lab · a checkpoint's pause is held under 50 ms: `boot:checkpoint-pause` (#423, #419, lab 44944984313, this change).** What re-measured `checkpointDowntime` lived only on `exp/415-downtime`, and `lab dispatch` took no `check:TARGET`, so that run was dispatched with `gh workflow run`. *Built:* `TestACheckpointPausesTheGuestBriefly` (`task boot:checkpoint-pause`, lab.yml's `check:checkpoint-pause`), from the experiment with its arms gone. It uses the two guests that decided 30 ms, saves each 10 times at the machine's own setting, continues and syncs after each, and logs the guest's stop to `GuestRunning`, QEMU's downtime, what was left at the stop and the total. The median of the larger of the stop and QEMU's downtime must stay under 50 ms. That is the 30 ms QEMU plans plus 20 for what it writes past the plan and for `cont`. QEMU's default read 199 and 231 ms. compat.yml runs it on every change to QEMU on main and before every release. `lab dispatch check:TARGET` now sends the check, waits, prints the last 60 lines of the `lab:ci` step from the job's log through the API, and exits 1 unless the run succeeded. *Measured* (bench, nested KVM, c8id.4xlarge, v20261121.01, spin's shape plugged to 2 GiB, 10 saves a guest, dispatched with `lab dispatch check:checkpoint-pause`): idle 13.3 ms p50 from the stop to `cont` returned, the slowest 14.8, QEMU's downtime 6 ms, nothing left at the stop, total 465 ms. Writer 18.9 ms p50, the slowest 25.8, downtime 7 ms, total 531 ms. Both agree with the experiment's 14 and 18 ms. *Found on the way:* on the laptop, with its disk busy and its swap full, the writer's pause reached 0.1-8.7 s in 4 and 6 of two runs' 10 saves, with at most 85 MiB left at the stop. QEMU's downtime was longer than the stop to `GuestRunning` (8.68 s against 5.81 s), so QEMU stopped the guest long before the host heard of it at `pre-switchover`. That is #426, and it is why the bound holds the larger of the two. *Status:* in place. - -**11-21 · machine · a per-disk IO limit, the first actuator (#395, this change).** A runner hosts about 20 workspaces, and spin has to hold back the one that saturates the shared disk, per disk and while it runs, without the guest learning of it. The prototype said every disk place sits behind a throttle node, so a limit would be one `qom-set` on its group. *Checked* in `machine/spec.go`: every place's node is a throttle filter, but all of them are in one group, `places`, and a group shares its limit among its members, so a limit there would hold all of a machine's disks together. A disk attached while the machine runs has no filter at all. A group per place would have changed the command line every machine boots with. *Built:* `QEMU.SetDiskLimit(serial, DiskLimit)` and `QEMU.DiskLimit(serial)`, where `DiskLimit` is bytes and requests a second, read and write, and its zero value is no limit. The command is `block_set_io_throttle`, sent to the backend of the disk's device, whose group is the device's alone and which a bind never replaces. It reaches a place and a hot-plugged disk alike, and is read back from `query-block`. `verify qemu`'s schema check covers both, and refused a misnamed field in each when one was tried. Bursts are left out: QEMU already lets a tenth of a second's worth through at once. The probe reports a held disk as `Limited{DiskReadBytes…}`, its serial in `Device`, from one `query-blockstats` a second, and only while a disk is held through Start's monitor. *Measured* (task boot:disk-limit, laptop KVM, v20261121.01 with this checkout's spin-machine, spin's shape with two disks beside the root, 3 runs): 8 MiB/s held 32 MiB of the guest's direct reads to 3.776-3.777 s, 50 writes a second held 150 direct 4 KiB writes to 2.881 s, and a disk attached at run time read at 8 MiB/s in 3.900-3.901 s. The other disk did the same in 2-6 ms beside each, and the held one read in 2-5 ms once cleared. `SetDiskLimit` took 1.8-5.5 ms. In task boot:pressure a 4 MiB/s limit brought a `Limited` each second with `Used` at 4.19-4.25 MB/s. *Decided:* a checkpoint carries no limit. A resumed machine reads `DiskLimit{}` and runs free until spin sets the limit again, which then holds (same lane). The limit is spin's policy for a neighbour, and a resumed machine may have other neighbours. No bench run: neither goal path sends a command it did not send before. *Status:* in place. That lane's `memlimit` phase fails on this laptop on main as well (#429). - -**11-21 · machine · what a host gives a machine: `Spec.Files`, `Spec.Overhead`, `Disk.Overhead` (this change).** spin hard-coded two facts that depend on the machine and its release. It linked a release's whole firmware directory into each QEMU's root, and it bounded each QEMU's cgroup at the guest's ceiling plus 768 MiB and at its vCPU ceiling plus 256 tasks. *Traced* (strace of a KVM and a TCG boot): QEMU opens by name its binary, the kernel, the initrd, and from the firmware directory the BIOS, `linuxboot_dma.bin` and `kvmvapic.bin`. It also opens `/dev/null` for its OFD lock probe. It reads `/proc`, `/sys`, `/dev/urandom` and `qemu.conf` only when they are there. `efi-virtio.rom` is never opened, since every NIC has `romfile=`. *Built:* `Spec.Files`, `Spec.Overhead() (Overhead{Memory, Tasks}, error)`, which reads the kernel's and the initrd's sizes, and `Disk.Overhead`, each qcow2 image's L2 cache (its whole L2 table up to 32 MiB) and four clusters of refcounts, from `read_cache_sizes`. Tasks are counted up to their most: one thread a vCPU slot, QEMU's four, a vhost worker for each device, a checkpoint's channels and their driver, QEMU's thread pool (64, and a thread it cannot start aborts QEMU) and io_uring's workers (the ring's 128 entries). Memory is 64 MiB of QEMU's own, the kernel and the initrd, 1 MiB a vCPU, 64 KiB a thread, and 1/256 of the ceiling for page tables. *Verified* (task boot:overhead, laptop, real KVM, v20261121.01): spin's shape with a NIC and a vsock started as nobody in a root holding only `Files` and `/dev/null`, in a cgroup of its own, and was taken to its ceiling. That is 16 vCPUs, 8192 MiB filled from `/dev/urandom`, and four disks attached beside its two, one of them a 64 GiB overlay the guest wrote a block of every 512 MiB, while the guest read, wrote and trimmed every disk. It was then checkpointed. Beyond the guest it held 31 MiB and 9 tasks at boot, 73 MiB and 27 tasks at the ceiling, and 79 MiB and 34 tasks (pids.peak) through the checkpoint. Of the 73 MiB, 27 were page tables, 16 the bzImage and 8 the big disk's L2 cache. `Overhead` for it, disks included, is 153 MiB and 223 tasks. *Found on the way:* the cgroup's `anon` is not QEMU's memory beyond the guest. A huge page the guest gave back in part stays charged until the kernel splits it, and it read 160 MiB above `smaps` just after the guest freed 1.4 GiB. The lane counts QEMU's own from `smaps`. In 2 of 5 runs, vCPUs plugged right after a checkpoint's `Continue` never reached the guest (#433). The lane plugs before it checkpoints. The checkpoint at the ceiling also got this laptop's QEMU OOM-killed once, by the host, with its swap full. *Not measured:* a restore and a QEMU that has run for days. spin adopts the root and the bounds through spin-stack/spin issues. *Status:* in place. - -**11-21 · boot · a contended checkpoint loop, how a qemu bump is checked for #421: `boot:finish-migrate` (#425, this change).** #424's wait for QEMU to leave `finish-migrate` was held in the tree only by a fake QEMU, and an idle host does not reach the window, so boot:record passed with the fix and without it. *Built:* `TestACheckpointIsContinuedAtOnceOnABusyHost` (`task boot:finish-migrate`), the scratch loop of #421: spin's shape plugged to 2 GiB with a guest rewriting 600 MiB of tmpfs, 300 checkpoints each continued at once, any refusal a failure. The target runs the test and QEMU under `taskset` on the host's last two CPUs, and the test keeps each of the CPUs it is given busy with a spin loop and refuses to run on more than four. It is not in CI. The qemu entry's note in versions.yaml names it beside boot:record and boot:compat, so a QEMU that reorders `migration_completion_end` and `migration_iteration_finish`, or adds a run state after `completed`, is caught at the bump. *Measured* (laptop, real KVM, v20261121.01 with this checkout's spin-machine): with `finished` made to return at once, 39 of 300 continues were refused, and 0 of 300 with it. QEMU alone pinned to the busy CPUs, the test free, refused 0 of 300 without the fix, which is why the test runs on them too. *Status:* in place. - -**11-21 · qemu, machine · a checkpoint's stop does not wait on the host's disk: `x-defer-disk-flush` (#426, lab 44958247487, 44962720682, this change).** On a busy disk, a checkpoint stopped the guest for 0.1-8.7 s on the laptop, and QEMU's downtime ran past the stop to `GuestRunning`. *Traced* (QEMU `-trace` on `runstate_set`, `vm_stop_flush_all`, `migrate_set_state` and `luring_co_submit`): from `finish-migrate` to `pre-switchover`, the time was `do_vm_stop`'s flush after the drain, one io_uring fsync of the overlay. It took 527 ms in one laptop save. On the bench, beside one host writer on `/tmp`, which is an overlayfs there, and with a guest that synced its own writes, nothing reproduced: Δ +0.9 [−2.6, +5.5] (lab 44957455283). Four writers on the instance store's ext4, with the guest writing its disk with `oflag=direct`, gave the fsync 13-79 ms and the guest's stop 42 ms p50 (lab 44958247487). *Built:* `qemu/patches/0003` adds the migration capability `x-defer-disk-flush`, and `Checkpoint` sets it. After the stop's drain, QEMU's own flushes write to the page cache only, and the guest's next flush forces them. The first version ended the deferral when the switchover ended, and the fsync came back in `cont`, since activating a qcow2 node closes and reopens it. The guest's stop to `GuestRunning` went from 19.6 to 50.3 ms p50 (lab 44958247487). The deferral now lasts until the VM runs (`vm_prepare_start`) or QEMU closes the disks (`bdrv_close_all`). *Measured* (bench, nested KVM, v20261121.01 with QEMU from parts run 44961949665, spin's shape plugged to 2 GiB, the busy-disk guest, 20 pairs interleaved on one guest, branch `exp-defer-ab`): the guest stopped at least 40.0 ms p50 (93.0 slowest) without the capability and 18.0 (28.8) with it, −22.0 [−29.2, −15.8]. QEMU's downtime went from 40 to 7 ms, −33 [−40, −27]. On QEMU's clock, `finish-migrate` to `running` read 8-20 ms against 20-95. `boot:checkpoint-pause` gains the busy-disk guest on the scratch disk, and read idle 13.9, writer 17.3 and busy disk 19.1 ms p50 (lab 44962720691). record and rollback pass on the patched QEMU (lab 44962720561, 44962720776). restore-first, with the spin-machine held at the release's and the QEMU binary as the only change: login −0.1 [−2.3, +2.4] evicted, −3.2 [−4.7, −0.5] cached (lab 44963610565). Main's spin-machine against the release's read +2.2 [+0.5, +4.0] evicted with the release's QEMU (lab 44963610916). That is #438, and it is why the run with both changes read +2.8 (lab 44962720850). *Contract:* a checkpoint's disk is in the page cache when `Checkpoint` returns, as its state is. A caller that keeps the sealed layer syncs it with the state after `Continue` (spin-stack/spin#1514). *Not fixed:* the laptop's other waits, 1.6-1.9 s in the drain with nothing to flush and 0.7-1.6 s for the last RAM, with its swap full (#437). *Status:* in place. - -**11-21 · machine · a QEMU without `x-defer-disk-flush` checkpoints as before (compat 44964906186, this change).** Compat on main 607797b failed for every release from v20261119.02 to v20261121.01 with `migrate-set-capabilities: GenericError: Parameter 'capability' does not accept value 'x-defer-disk-flush'`. #435 set the capability on every checkpoint, and only the QEMU `qemu/patches` builds has it. Compat checkpoints each release's QEMU with this checkout's spin-machine. spin does the same when a runner's machine library is upgraded while machines from an earlier release run, and none of those could have been checkpointed. *Fixed:* `Checkpoint` asks `query-migrate-capabilities` first and sets `x-defer-disk-flush` only when the QEMU lists it. That costs one round trip before the migration starts, with the guest running, and is on neither goal number's clock. A QEMU without it checkpoints as before #435, with the stop's flush on the host's disk. `qmpdef.Enum` still names the capability, so `verify qemu` fails a pinned QEMU that lost the patch. *Reproduced* (laptop, a tree of v20261121.01 with this checkout's spin-machine, boot:record's tests): main's `Checkpoint` failed `TestACheckpointedMachineIsHeldThenContinued` with compat's error, and this change passed all four of boot:record's tests. *Status:* in place. - -**11-21 · boot, machine · a workspace checkpointed and continued grows: `boot:cpu-plug` (#433, this change).** The overhead lane had seen vCPUs plugged right after a checkpoint's `Continue` never reach the guest in 2 of 5 runs, and plugged before its checkpoint since. *Traced* (a miss of the lane in #433's order, its states under `/var/tmp` on ext4, the laptop's disk busy and its swap full, QEMU `-trace` on `cpuhp_acpi_*`, `acpi_gpe_*` and `monitor_qmp_cmd_in_band`): QEMU received no command for 73 s after `cont`. The guest gave up after its 60 s, with `gpe02` at 0 events and no status bit and `sci` at 0, so QEMU had raised nothing. The `device_add`s came after, and the guest took all 15 insert events within 0.4 s. What held the plug was the lane's own helper, which closed the state between `Continue` and the plug. ext4 writes back a file QEMU truncated on its first close, and that close took 0.6 ms to 75 s across 9 checkpoints in the same lane. Nothing was lost in QEMU's hotplug or in the guest's GPE handling. *Ruled out* (laptop, real KVM, v20261121.01 with this checkout's spin-machine, states on tmpfs, so every close is free): 0 misses in 200 guests each way after a checkpoint, after a plain stop and cont, and with no pause. Also 0 in 100 each way after a checkpoint and a stop on two CPUs a spin loop keeps busy, 30 checkpoints with 1400 MiB of the guest filled there, 10 each way at 30% and at 5% of one CPU, 100 checkpoints with #417's close in the save's path again, and 100 each way in a guest whose PID 1 is a shell. The lane in #433's order missed 0 of 50. *Built:* `TestAWorkspaceCheckpointedAndContinuedGrows` (`task boot:cpu-plug`). spin's shape is booted to systemd at 2048 MiB and checkpointed and continued, then given 16 vCPUs, 8192 MiB and four disks at once. The guest must have all of them within 20 s, in 10 guests, and the state is closed once it has. compat.yml runs it, since a QEMU or kernel that lost a hotplug after a migration would leave a workspace at its size, and lab.yml's `check:cpu-plug` runs it on the bench. *Measured:* 10 guests grew in 0.31-0.71 s with the state on tmpfs. With it on ext4 written back at 10 MB/s while the guest grew (a scope's `IOWriteBandwidthMax`), 5 grew in 0.31-1.18 s. `Checkpoint`'s comment now says that the close or sync after `Continue` can take as long as the disk needs, and that a caller must not hold the next command behind it. The lane's comment that blamed the checkpoint is gone. *Status:* in place. - -**11-21 · qemu, machine, lab · a disk's counters without its backing chain: `x-flat` and the `usage` probe (#402, labs 44973302743, 44973302685, 44973726633, this change).** The question was whether a runner polling `Process.Usage` across ~20 machines, and the watch's read of a held disk each second, slow the machines. #402 said `query-blockstats` cost ~6 ms p50 "because every reply carries all 16 hotplug slots", and that one took 536 ms under host steal. *Explained* (laptop, spin's shape, the command timed beside query-status with QEMU's main thread's `schedstat` across each call). The hotplug targets are not in the reply, since an empty SCSI target has no block backend. What is in it is every image of each disk's backing chain, twice under a place's throttle filter (`bdrv_query_bds_stats` recurses into `parent` and `backing`). The reply was 12.6 KiB for a root of an overlay over the base plus a raw home. Each image added ~3.6 KiB and ~70 µs of the main loop, which also runs the disks' I/O: 0.37 ms of main loop at depth 1, 0.73 at 8 and 2.5 ms (124 KiB) at 32. Every seal of a workspace's disk adds an image. The 6 ms is a deep chain or a loaded host, not the slots. *The 536 ms is not the command.* Each call over 50 ms in the pressure probe's lane, sampled every 0.5 ms, had QEMU stalled in the host. At `memory.high` the main thread was in D state in its cgroup's reclaim (`reclaim_high` → swap writeout → `wbt_wait`) or a swap-in, for 170-195 ms, and query-status was as slow. In the memory and OOM phases it was in `mmap` waiting for the mmap lock while the vCPU faulted, 52-284 ms. Under `cpu.max` the monitor's thread was throttled for 80 ms. Two busy loops on QEMU's core cost a call 4-6 ms at most. A first run that traced QEMU to a file on ext4 caught its threads in the trace's own `writev`, so a stall measured with tracing to a busy disk can be the trace. *Built:* `qemu/patches/0004` adds `query-blockstats`' member `x-flat`, which leaves out `parent` and `backing`. `QEMU.DiskUsage`, Usage's QMP half and what the watch reads, asks with it. A QEMU without it (every release up to v20261121.01) refuses the member, so it is asked once and then only without it. The `usage` probe times DiskUsage on a running machine, quiet and pinned to one host CPU beside two busy loops, at a `depth`. *Measured* (bench, nested, spin's shape, v20261122.01 with QEMU from parts run 44972755256, 20 machines each × 200 calls): DiskUsage's main-loop time went from 293 to 96 µs p50, −197 [−202, −181], and its round trip from 573 to 390, −183 [−190, −158] (lab 44973302743). At depth 32 it went from 2991 to 94 µs, −2898 [−2917, −2895], and the round trip from 3377 to 391 (lab 44973302685). Against main's own parts build without 0004, depth 1 read −183 [−203, −176] µs, with query-status +8.1 [−55.5, +39.1] µs, within noise (lab 44973726633). So the +43 µs query-status read against the release is the build, not the patch. *Not explained:* pinned beside two busy loops, DiskUsage's p50 sat at 3.07 ms in every flat run against 2.2 at depth 1 and 4.3 at depth 32 without x-flat, and the slowest call did not change at depth 1. The 3 ms is about one scheduler slice on these hosts (#442). *Not built:* asking only for the held disks. With x-flat, each device costs ~20 µs of main loop (laptop, 2 against 11 places), so the ceiling is ~20 µs a second at spin's shape with one disk held. *Goal numbers:* untouched. DiskUsage has two callers, `Usage`, which spin calls when it chooses, and the watch, which asks only while a disk is held. Neither runs on a boot or a restore. 0004 changes only that command's handler and its HMP caller. boot:record passes on the patched QEMU (lab 44973302762, and on the laptop), and so does boot:pressure on the laptop. *Status:* in place. - -**11-21 · machine, spin-machine · a restore reads its state ahead before QEMU answers (lab 44976494418, this change).** restore-first's evicted login read 16 ms more than the cached one (111 against 95.2, main's spin-machine on v20261122.01's parts, 30 restores each). That gap is the disk. `Resume` started the read-ahead (lab 44809512339), but `spin-machine restore` calls Resume only after its dial, and the dial waits for QEMU's first answer, ~19.5 ms after its exec (`transport`, lab 44912471522). So the read began when QEMU was ready to load and never overlapped QEMU's start. `machine.ReadAhead` is the read-ahead with Resume's rule (a full load of a mapped-ram state), and `restore` calls it once the state is open, before the dial. Resume still calls it for callers that do not, and the kernel skips the pages a first call already asked for. *Measured* (bench, nested, spin's shape and login, 30 a side interleaved, lab 44976494418): evicted login 111 → 101, −9.3 [−12.2, −7.3], and `running` −8.1 [−9.4, −6.5]. The cached row read −0.2 [−2.2, +1.5], as it should with nothing left to read. The cold login read −7.5 [−12.8, +0.0], within noise, and no cold boot runs this code. *What limits it now:* the evicted row is 6 ms over the cached one. The read starts ~5 ms after QEMU's exec, once boot has bound the socket and `restore` has started, and a sequential reader takes ~60 ms for the state's 179 MiB (`read`, the same run). *Status:* in place. spin's runner, once it resumes through `machine.QEMU.Resume`, calls ReadAhead before `machine.Start`. - -**11-22 · boot · a checkpoint's stop on a host short of memory (#437, lab 44971162018, 44971787197, 44972838681, 44973775066, 44975130836, this change).** #437 guessed that the laptop's slowest saves, 1.6-1.9 s in the drain and 0.7-1.6 s for the last RAM, were QEMU's memory read back from a full swap. *Traced on the laptop* (QEMU `-trace` with wall-clock timestamps, each thread's `/proc` state, `wchan` and major faults every 2 ms): QEMU had nothing in swap and the host swapped in 167 pages in 11 minutes. The waits were a disk 60-80% full in `/proc/pressure/io`: guest writes in flight in `jbd2_log_wait_commit` and `rq_qos_wait`, which the drain waited for, and major faults on QEMU's own binary, evicted by reclaim (1.9 M file refaults) and read back from the disk that held the state, the overlay, the swap and the busy writers. A run without the busy writers, the disk still saturated by other work, waited 1.5 s once in the caller before `cont`. *Runners* have no swap (only spin's control plane gets a swap file, and it is never a runner) and give each machine's group `memory.swap.max` 0. *On the bench*, no swap and QEMU's binary on a disk apart from the state: with the host's memory taken but 1 GiB, the busy disk's dirty pages got the test killed. With 4 GiB left, the writer read 23.0 ms p50 (43.5 slowest) and with the busy disk 26.1 (44.4), against 18.5 beside the busy disk alone. QEMU took no major fault while the host reclaimed 26 M pages. `bpftrace` on `sched_switch` named the two slowest of 40 saves (139 and 188 ms): `balance_dirty_pages`, on a guest write in the drain and on one multifd channel's write of the last RAM, the other seven channels behind that file's `i_rwsem`. *Tried:* `direct-io` on the save's channels, with an `O_DIRECT` descriptor added to the state's set. Beside the busy disk it never converged, each pass ~2.5 s and ~520 MiB left, and was cancelled after 10 min. Rejected. `downtime-limit` 15: −6.0 [−11.9, −1.1] in 20 pairs short of memory, then −2.5 [−7.5, +3.0] in 25, −1.5 [−6.0, +2.8] with the writer, −0.2 [−0.5, +0.3] idle. Rejected. *Built:* `boot:checkpoint-pause`'s fourth guest is the busy-disk guest on a host whose available memory is taken but 4 GiB (`shortOfMemory`), measured and not held to the bound: on compat's kvm host, 118 GiB of it taken, the stop read 56.2 ms p50 against 25.2 on the bench (compat 44976542939, lab 44976542360). *Status:* the test is in place. A runner does not reach #437's seconds. Its stop on a host short of memory is the dirty limit's (#444). - -**11-22 · lab · a tree's spin-machine from any commit, and #438 bisected (lab 44976271054, this change).** #438 read restore-first's evicted login +2.2 ms [+0.5, +4.0] with main's spin-machine against v20261121.01's, and asked which commit moved it. A tree could hold only this checkout's spin-machine or a release's, so `--spin-machine commit:SHA` now builds one from any commit, fetched alone from origin as a release's is. *Measured* (bench, nested, spin's shape and login, v20261122.01's parts, 30 restores each, eight spin-machines interleaved): against v20261121.01's, main's read evicted login −0.1 [−2.7, +4.6] and `running` +0.6 [−2.3, +3.5]. Of the five commits between, only 8d04bd4's `running` excluded 0, +4.5 [+0.1, +7.9], and main contains it. `listening` read −4.2 from eb70cb8 on, because `machine.Start` binds the monitor's socket before QEMU exists, so `listening` no longer marks QEMU's start. That instance was noisy: its cached restores were as slow as its evicted ones. *Not reproduced.* The difference was on the evicted row only, the disk's, and the read-ahead before the dial, asked for from four goroutines, leaves the evicted row nothing to wait on (#446, #447). *Status:* the lever in place. #438 and #416 answered in their comments. - -**11-22 · lab · a probe's login is not preceded by a connection spin does not make (labs 44977850524, 44978246896, this change).** `Key.LoggedIn` polled `VsockAccepts(cid, 22)` until something accepted, then logged in. On spin's path (`login=spin`), that connection reached the forwarder, which opened one to 127.0.0.1:22, and sshd forked and exec'd `sshd-session` for it. The probe then closed it and logged in at once, so the guest's one vCPU ran that session beside the login being timed. spin's runner opens the user's connection once, through its supervisor, and asks nothing first (spin-stack/spin's `internal/runner/forward/forward.go`). LoggedIn now logs in until a login is done, with VsockAccepts' 50 ms connect timeout on the login's own connect, because a connect to a context id that does not exist yet waits 2 s. *Measured* as two rows of one tree, so one run compares the two probes (bench, nested, spin's shape and login, v20261122.01 with main's spin-machine, 40 each, lab 44978246896): restored login −4.1 [−6.0, −2.2], `running` −0.0 [−1.0, +0.9], the cold login before the save −3.6 [−7.2, +0.8], within noise. Only the restored login changed, in lab 44977850524 too: −3.6 [−7.3, −1.7] at 30. The number moves because the probe stops adding work, not because the machine changed, as with #341. LoggedIn is restore-first's, prestart's, restore-together's and density's. `ssh-first` keeps its own poll, because it times `accepts` with it, so its first login still carries the session (#450). *Status:* in place. - -**11-22 · image · ssh.service starts without `sshd -t` (lab 44977044826, this change).** Where PID 1 to sshd accepting goes, read from the guest after the first login (a `chain` probe on branch `exp/chain`, lab 44976328180, 10 boots, v20261122.01, spin's shape): PID 1 starts at 84.6 ms on the guest's clock, the first jobs dispatch at 139.3, sysinit.target at 280.5, basic.target 285.6 and the forwarder 286.6. The CPU used to the first login: the kernel's own 106 ms, PID 1 66, udevd 46, ssh.service 45 (both logins' sessions in it), journald 20, logind 16, the bus 11. One vCPU and no idle time, so the login waits for every exec before it. Ubuntu's ssh.service runs `sshd -t` as ExecStartPre: without it, the cold first login −3.2 [−7.2, −0.8] and sshd accepting −2.4 [−6.4, −1.1], 60 boots each interleaved, spin's shape and login. The same run took four other execs and settings out, one arm each, and none moved the login: systemd-udev-load-credentials masked −2.1 [−6.3, +0.3]; systemd-user-sessions' ExecStart emptied, its ExecStop kept, −0.6 [−5.2, +1.5]; sshd-socket-generator masked +0.8 [−4.0, +4.7]; and `DefaultMemoryAccounting=no` +4.1 [+0.8, +7.1], worse, with sshd accepting +6.2 [+2.2, +8.0], not explained. So an exec pair costs the login ~3 ms here, not the ~6 a getty's echo's 10 ms of CPU suggested. *Status:* `sshd -t` dropped at start (`ssh.service.d/20-no-config-test.conf`, asserted by build.sh, in the lab's lane edit); the restore unchanged (restore-first in the description). - -**11-22 · image · what a restored login waits on, and sshd's sleeps bounded (lab 44980029214, #457).** With the disk gone from the evicted restore, the login after `running` is restore-first's largest phase (~35 ms). A connection that timed each write and read of the login (laptop, v20261122.01, one restore at a time) split a 32 ms restored login into 4.6 ms to the server's banner, ~5 ms of key exchange, 14.5 ms from the signed `userauth` request to `USERAUTH_SUCCESS`, and ~4.7 ms for the channel, `exec` and exit. sshd at `LogLevel DEBUG3` said where the 14.5 ms went: "elapsed 0.903ms, delaying 6.180ms" after the key query and "elapsed 1.468ms, delaying 5.615ms" after the signed request. Both are `ensure_minimum_time_since` in OpenSSH 10.2's `auth2.c`, which waits until 5 ms plus 0-4.2 ms have passed since a userauth request arrived. It runs while `authctxt->authenticated` is 0, and `userauth_finish` sets that flag only after it, so the request that succeeds sleeps too. The query sleeps after sshd has already answered `PK_OK`, before it reads the signed request. spin's users meet the query from both clients: `golang.org/x/crypto/ssh` always asks first, and OpenSSH's `ssh` does for a key whose public half it holds. *Bound* (an `LD_PRELOAD` shim in ssh.service whose `nanosleep` returns at once, `--edit nosleep` on branch `exp-nosleep`, not for merge; bench, nested, spin's shape and login, #447's spin-machine on v20261122.01, 30 each, interleaved): restored login −13.4 [−15.2, −10.5] evicted and −13.5 [−15.6, −12.4] cached, `running` +0.7 [−0.8, +1.5], the cold login before the save −3.2 [−13.7, +2.7], within noise. The cold login hides the sleep behind the boot work its vCPU still has. A laptop check that the shim took: sshd and `sshd-session` mapped it, and the signed request's turn fell from ~14 to 2.9 ms. The shim first went in through the edit's `Files`, which the manifest keeps as JSON, and arrived 136 bytes longer and was ignored; it goes in by `Setup` in base64. *Status:* open (#457). The candidate is a patch that skips the sleep for a request answered with `PK_OK` or that succeeds, which tells the client nothing it does not know, and keeps it for failures. It needs openssh rebuilt from Ubuntu's source, as image/systemd does for systemd. - -**11-22 · ci, qmpdef, machine · compat in minutes, and its QMP half in go test (compat 44978948650, 44979352669, lab 44978556859, this change).** A compat run on #443's branch took ~10 minutes (run 44974499826): `boot:checkpoint-pause` 311 s, building QEMU and the kernel 239 s (QEMU's cache missed), the releases' checkpoints resumed 109 s, the rest ~40 s. It ran only on main after a merge, so #435, which sent `x-defer-disk-flush` to every QEMU, was found after it merged. *Moved:* `boot:checkpoint-pause` is a bound, not compatibility. It runs in release.yml's `pause` job on a bench host once a release is published, and the qemu entry's bump note names it. Its run there (lab 44978556859, v20261122.01) held idle 23.0, writing 16.8 and beside a busy disk 17.9 ms p50. *Built:* compat runs on every pull request beside CI. A `changed` job decides whether the change reaches the machine, QEMU or the kernel. A part it does not reach is not built: QEMU is main's published one (`fetch qemu`, 10 s) and the kernel the release's. A `compat` job at the end reports on every change, so a ruleset can require it as it requires `parts`. `changed` now compares from the merge base, so a dispatched branch is not charged with what main gained after it forked. *Built:* `go test` holds the machine package to every supported release's `query-qmp-schema` (`internal/qmpdef/testdata/released`, recorded from each tarball's `qemu-system-x86_64` by `spin-machine-dev releases schema`, which report.yml runs on each release). `CheckSupported` holds what the package sends unconditionally to every release. A value or member only newer QEMUs have is `qmpdef.Probed` or tagged `qmpdef:"probed"`. `TestTheMachineDrivesEverySupportedQEMU` drives `Checkpoint` and `DiskUsage` against a fake QEMU that refuses what each release's schema refuses, in QEMU's words. *Proved:* with #439's fix reverted, that test failed for v20261119.02 to v20261121.01 with `Parameter 'capability' does not accept value 'x-defer-disk-flush'`, compat 44964906186's error, in ~2 s. v20261122.01 and the pinned QEMU have the capability and passed. With DiskUsage's fallback removed it failed on all seven releases, since only the pinned QEMU has `x-flat`. *Measured:* compat dispatched on a change that reaches neither part took 4m02s wall, its KVM job 3m03s, of which resuming the seven releases' checkpoints was 103 s and fetching QEMU 10 s (44979352669). On this branch, which touches `internal/build` and so builds both parts from a warm cache, it took 3m57s (44978948650). *Status:* in place. - -**11-22 · machine · the read-ahead asks from four goroutines (lab 44976924478, this change).** With the read-ahead before the dial, restore-first's evicted login was still 6 ms over the cached one. The read-ahead was one goroutine making a `posix_fadvise(WILLNEED)` per 128 KiB piece, 1432 of them for the state's 179 MiB. Each call allocates its pages and submits their read before it returns, on a nested host. Four goroutines now ask, each for every fourth piece of each extent. *Measured* (bench, nested, spin's shape and login, 30 a side interleaved, against the read-ahead before the dial, lab 44976924478): evicted login 102 → 96.2, −6.2 [−9.1, −4.3], `running` −6.1 [−7.2, −4.8]. The cached row read −0.5 [−1.6, +1.9]. The evicted row is now level with the cached one (96.2 against 96.3), so the one goroutine asking was the limit and not the disk, and the restore has nothing left to win from reading. A test now holds a 64 KiB hole between two extents: a goroutine's last stride can end past it, inside the next extent, and without the reset to the extent's end over a third of that extent went unread. *Status:* in place. - -**11-22 · image/lab · udev after basic.target, and the no-systemd floor again (labs 44977226981, 44977605109, 44978034052, 44978079694, 44978927041).** In the `chain` probe's timeline sysinit.target waited for udevd's READY, at 280 ms against ssh.service's 237: udevd runs at the lowest weight while the boot runs, so its start came after every early unit, and basic.target and spin's forwarder after it. Copies of systemd-udevd.service and systemd-udev-trigger.service without `Before=sysinit.target`: cold first login −46.3 [−49.4, −39.8] (60 boots each), basic.target 286 → 242 ms on the guest's clock, udevd ready after the login at 342. Restored, ~30% of restores take ~530 instead of ~112 ms (p95 539-547), and one run read restored into prestarted +317. A journal dumped from the slow ones (branch `exp/restore-diag`): the guest resumes at 0.430 s, and the next login is accepted at 0.889 with nothing logged between, 0.04 s idle in the guest's whole uptime. It is the forwarder-early arm's tail and likely the coldplug arm's +463.7: a guest saved before the boot's deferred work is done (#452). The same change at udev's normal weight gains nothing (+0.7 [−5.0, +6.5]), so the gain is the weight and the order together. The serial getty at the lowest weight +2.7 [−4.3, +7.9], four unused varlink sockets masked −0.8 [−4.8, +4.3]. *The floor:* on v20261122.01, no systemd before sshd, the lane's first login 404 → 250 ms, −153.9 [−162.5, −151.2], sshd accepting 242 → 197 (20 boots). *Status:* udev after basic.target open, blocked by #452; the getty and sockets rejected. - -**11-22 · kernel · vmlinux BTF parsed on first use moves the parse, not the login (labs 44982285400, 44982285406).** kernel/Dockerfile says the first kfunc registration of the boot parses the 4.6 MB of vmlinux BTF, today xfrm's, and that only `DEBUG_INFO_BTF=n` removes it. A patch (branch `exp/btf-first-use`) keeps vmlinux's kfunc sets, destructors and struct_ops registered before the parse on a list, and the first `bpf_get_btf_vmlinux()` parses and registers them, in order, before any other caller gets the BTF; a struct_ops init that registers a kfunc set in turn (io_uring's) registers it at once. A program calling kfuncs of the common set loaded and ran on it. The kernel to "Freeing" −7.2 [−8.6, −6.2], inet_init 6.85 → 0.14 ms (10 boots), but the cold first login −1.5 [−3.1, +1.6] (60 boots): journald's `DeviceAllow=` and `IPAddressDeny=` load cgroup BPF programs at its start, and `bpf_check()` asks for vmlinux BTF for every program, so the parse lands in journald's start, before the login, on the same vCPU. *Status:* not carried. A verifier that asks for BTF only when a program needs it would let the parse leave the boot. - -**11-22 · image · the host key is Ed25519 alone (lab 44979726719, this change).** spin-machine-sshd-keygen made an Ed25519 and an ECDSA key, each with its own ssh-keygen, before ssh.service starts, on the one vCPU. Ed25519 alone: the cold first login −5.0 [−8.3, −1.8], sshd accepting −4.4 [−6.9, −1.9], 60 boots each interleaved, spin's shape and login. Every client since OpenSSH 6.5 takes Ed25519; one that accepts only ECDSA host keys no longer gets in. The same run took `pam_selinux` and `pam_mail` out of sshd's PAM stack, −1.9 [−4.9, +2.8], not separable. *Status:* Ed25519 alone; the restore unchanged (in the description). - -**11-22 · machine, boot · a resume takes its disks before the load (labs 44984233276, 44984233299, 44984162863, #459, this change).** A fast load in compat completed with no RESUME, and its guest never ran. QEMU's stderr said `Failed to get "write" lock` on the overlay. QEMU 11.2.0-rc0 adds a held machine's nodes inactive. Both run BHs, the full load's and the fast one's, activate them with `migration_block_activate(NULL)`. When that fails they skip `vm_start` and tell the monitor nothing, and the run state stays `inmigrate`. `Resume` returned nil for that, in a full load too. The lock came from the boot tests: `rootDisk` never closed its files, and QEMU's lock lives on the description the test's `*os.File` shares. So the lock outlived the killed "in full" machine until a garbage collection closed the file. `Resume` now sends `blockdev-set-active` before `migrate-incoming`, so QEMU's refusal is its error, before a byte of the state is read. `rootDisk` closes its files when the test ends. *Measured.* With `GOGC=off` on a laptop (KVM, userfaultfd on), main missed 10 of 10 fresh-process runs of the events test and the fix passed 50 of 50. On the bench (nested, v20261122.01, 100 fresh-process runs each), main missed 3 with #459's events and stderr, and the fix missed 0. restore-first, fix against main (bench, spin's shape and login, 30 a side interleaved, `fast=true`, lab 44984162863): evicted login −0.3 [−2.4, +4.8], `running` +0.2 [−1.6, +4.9], cached login −0.6 [−4.8, +1.7], all within noise. *Status:* in place. `boot:record`'s "a disk another machine holds" holds it on real KVM. - -**11-22 · image · sshd delays a failed userauth and not a login (labs 44983986606, 44983986575, #457, this change).** The image installs Ubuntu's openssh 1:10.2p1-2ubuntu3.8 rebuilt from its source package (`image/openssh`, versions.yaml `openssh-source`) with `userauth-delay-failures.patch`: `input_userauth_request` skips `ensure_minimum_time_since` for a request that authenticated, or for a public key query sshd answered with `PK_OK`, and keeps it for every other request but `none`. Ubuntu's package changes nothing on that path. It carries d43ba60 (CVE-2026-60001), whose keyboard-interactive and GSSAPI follow-ups delay only a failure, so the patch tests the method (`m == &method_pubkey`) and not `postponed` alone: those methods' first requests set `postponed` and keep their delay. The packages are `+spin1` and held, as systemd's. *Measured* (bench, nested, spin's shape and login, 30 a side interleaved, v20261122.01 against itself with this checkout's OpenSSH, `lab tree --openssh`): restored login 93.2 → 79.6, −13.6 [−14.9, −9.8] evicted and −13.6 [−16.2, −11.4] cached, `running` −0.3 [−1.9, +3.1] (lab 44983986606); the cold first login 467 → 457, −9.4 [−15.8, −2.6], sshd accepting −3.4 [−8.2, +0.6], accept to login −6.0 [−10.1, −4.8], the second login −10.9 [−12.3, −9.0] (lab 44983986575). The restore matches the `LD_PRELOAD` bound (−13.4). The cold login, which the bound read as within noise at −3.2 [−13.7, +2.7], moved too. *Checked* (`boot:sshd-delay`, laptop, 10 logins): the signed request of a login took 16.8 ms on the release's sshd and 1.9 ms on this image's; every refused key and unknown user still took 5.8-9.1 ms. The query's own turn shows no delay on either, because `PK_OK` goes out before it: the query's delay holds up the signed request. *Found on the way:* `debugfs cat | grep -q` on a binary fails under `pipefail` (debugfs takes SIGPIPE when grep stops at the match), so build.sh dumps sshd-auth to a file before it asks. *Status:* in place. The success half is upstream's intent and should be offered to OpenSSH (#457). - -**11-22 · machine · GuestRunning is QEMU running the resumed guest (labs 44987275584, 44987275543, #465, this change).** A fast load says `postcopy-active` in `qemu_loadvm_run_fast_snapshot_load` right after it schedules the run BH, and the BH starts the guest later, on QEMU's main loop (QEMU 11.2.0-rc0). `Resume` returned and told `GuestRunning` at `postcopy-active`, so #459's guest, which never ran, was told running at 6.80 ms. `Resume` now arms a wait on `RESUME` before `migrate-incoming` and returns, telling `GuestRunning`, once it arrives, in a full load too. A full load that leaves the machine neither running nor paused is now an error, where `Resume` returned nil. *Checked* (`boot:record` on the bench, lab 44987275584): the events test now asks QEMU's run state from inside the `GuestRunning` callback and finds it running, in full and fast. The fast load told `GuestRunning` at 8.77 ms and `StateLoaded` at 672 ms. *Measured* (bench, nested, spin's shape and login, v20261122.01, `fast=true`, 30 a side interleaved, against main's spin-machine, lab 44987275543): fast `running` −0.4 [−1.5, +1.3] and fast login −0.6 [−13.8, +22.0], both within noise. The cached row's login read −0.5 [−4.4, +4.3]. The evicted row's login read −2.7 [−5.1, −0.8] with its `running` −0.0 [−3.1, +2.7]. A full load's path changed only by a wait that has already matched, so that row is taken as noise until another run repeats it. *Status:* in place. `Resume` now returns when QEMU runs the guest, not when the load is merely handed over. - -**11-22 · lab · ssh-first logs in over the connection it timed (lab 44987441326, #450, this change).** `ssh-first` polled `VsockAccepts(cid, 22)` to time `accepts`, closed that connection, and logged in on a new one. On spin's path (`login=spin`) the closed connection had reached the forwarder, which opened one to 127.0.0.1:22, so sshd forked and exec'd `sshd-session` for it on the guest's one vCPU beside the first login timed. spin's runner opens the user's connection once. The probe now keeps the first connection accepted and runs the first login over it (`Key.LoginOn`); `accepts` is still that connect's return. If that login fails, the probe logs it and logs in again as before. `VsockAccepts` had no caller left and is gone. *Measured* as two rows of one tree, so one run compares the two probes (bench, nested, spin's shape and login, v20261122.01 with main's spin-machine, 40 each interleaved, lab 44987441326, branch `exp-ssh-first-rows`, not for merge): accept to login 69.6 → 65.3, −4.3 [−5.4, −3.0]; first login 463 → 458, −4.4 [−9.1, +0.3], within noise at 40, because `accepts` itself spreads ±4 ms; sshd accepting +1.8 [−3.7, +4.4]; the second login −0.6 [−2.0, +1.3]. The console prompt read −6.2 [−12.3, −2.2]: the echo getty runs after sshd accepts, on the same vCPU as the extra session. The size matches #451's −4.1 on the restored login. The number moves because the probe stops adding work, not because the machine changed. *Status:* in place. Compare a release measured before it only within one run, as the ladder does. - -**11-22 · CI · refresh.yml proposes the openssh source when Ubuntu moves it (#463, this change).** The archive serves only the openssh source resolute publishes now, so image/openssh stopped building the day Ubuntu moved it, and nothing moved the pin. `spin-machine-dev refresh openssh` is `versions refresh -propose -label openssh openssh-source`, and refresh.yml's `systemd` job is now `sources`, one matrix job each for systemd and openssh. The patches are checked where the build already checks them: the proposing pull request changes `openssh-source`, so parts.yml's `changed` builds the image, and `image/openssh/Dockerfile` applies every patch with `--fuzz=0`. *Checked.* With the pin set back to 10.2p1-2ubuntu3.7, `versions refresh openssh-source` committed 10.2p1-2ubuntu3.8 with the repository's pin, 5f83862e…. A moved `openssh-source` makes `changed` answer `build=true` for the image. The patch applies with `--fuzz=0` to the pinned source as `dpkg-source -x` lays it out. With one of its context lines in auth2.c changed, `--fuzz=0` refuses it (`Hunk #1 FAILED at 360`), where patch's default fuzz would have applied it. *Status:* in place. - -**11-22 · image · every login gets its user manager again (labs 44987167474, 44987167549, #462, this change).** `boot:logind` failed from v20261120.03 on: `systemctl --user` found no manager. Sessions have been of class `user-early-light` since 11-13, and logind starts no manager for one (`SESSION_CLASS_WANTS_SERVICE_MANAGER`, systemd v259.9). spin's linger had been the only thing that started `user@1000`, and e807038 (11-20, "spin does not linger") took it away. Root, the user spin logs in as, never had a manager on that path (inferred from the same code; not checked on a release). *Bisected* on the laptop, KVM, `boot:logind` against each release: v20261120.02 passes; v20261120.03, .04, v20261121.01 and v20261122.01 fail. e807038 is the only image commit between .02 and .03. v20261122.01 passes with `/var/lib/systemd/linger/spin` written back into the test's root. `lab tree --edit nolinger` did not reproduce it, because `boot:logind` boots its own raw copy of the base and never applies a tree's edits. *The fix.* `user-runtime-dir@`'s `20-manager.conf` wants `user@%i`. logind starts that unit for every session and waits for it alone, and the manager starts after it, so the login does not wait for the manager. *Measured* (bench, nested, spin's shape and login, 20 a side interleaved against v20261122.01, the drop-in and the class put into the overlay by experiment edits on branch exp/user-manager-462, 5ba7507): the drop-in first login +2.6 [−4.0, +8.7], restored login +0.8 [−1.5, +4.5] evicted and +1.0 [−1.1, +5.8] cached, cold login in the restore run +3.7 [−1.7, +10.5], all within noise. Accept to login +5.1 [+2.8, +6.5] and the second login +15.8 [+14.2, +16.6]: the manager runs while the second login does. Class `user-early`, which holds the login for its manager, cost the first login +36.2 [+32.0, +45.7], so it was rejected. *Checked:* `boot:logind` passes with the drop-in. With the console `su` login taken out of the check, the first SSH login's own `systemctl --user` still fails 3 of 3 with the drop-in, and passes 2 of 2 with class `user-early`. A command that needs the user bus at once in the first login can arrive before the manager. *Status:* in place. The manager's own cost is what would let a login wait for it (#467). - -**11-22 · qemu, image · a restored guest's TSC, and udev after basic.target (labs 44983495254, 44983967863, 44984395014, 44986512574, 44987412184, 44987412171, 44987412210, 44987584707, #452, this change).** The ~450 ms that blocked udev after basic.target and spin's forwarder early was not guest work. Sampled on the bench (branch `exp/452-diag`), a slow restore's vCPU thread ran ~17 ms after the resume and then sat in `kvm_vcpu_halt` for 281-450 ms, neither running nor waiting, and the guest's /proc/stat was missing that time. Traced with the host's kvm and vsock events, the guest answered the login's packets until it halted, and woke on its first local timer interrupt, with no TSC-deadline write before it: the slow login ended 528-555 ms after QEMU's exec however long the load took. kprobes on `kvm_synchronize_tsc` showed why. QEMU writes each vCPU's TSC before the load, zero after the vCPU is made and one at the reset, and KVM, having had a TSC from userspace, takes the migration's TSC within a second of it for a sync and keeps the offset (kernel bf328e22e472's case, undone). The guest's TSC counts from the new vCPU's creation, so its saved TSC deadline is met only after the saved uptime, ~0.5 s. A guest saved with its tick running (udev still at work) had that deadline a tick ahead and reprogrammed none of its later timers. One saved idle armed far ahead and reprogrammed, so the release's restores never showed it. The coldplug arm's restored +463.7 (lab 44818953987) was the same. QEMU 0005 writes an incoming machine's TSC only from the migration: the writes became the creation's and the checkpoint's, unmatched, and 16 of 16 restores read 84-94 ms (lab 44987412184). *Measured,* spin's shape, 30 a side against the release: udev after basic.target with 0005 cold −48.6 [−51.7, −42.6], restored −2.0 [−8.0, +4.7] with p95 114 against 114 evicted and 126 against 128 cached; without 0005 the same edit's restored p95 is 539-546 (lab 44987412171). In `prestart`, cold −44.7 [−53.4, −39.4], restored into prestarted −1.3 [−4.1, +3.6] with p95 98.8 against 101, and without 0005 413 (lab 44987412210). 0005 alone moves neither number (cold −3.0 [−5.8, +0.1], restored −1.9 [−7.6, +2.0]). spin's forwarder early with 0005: cold −60.4 [−63.3, −52.9], restored +3.3 [+1.0, +7.4], p95 104 against 101 (lab 44987584707), so it is spin's to take. The image now carries copies of systemd-udevd.service and systemd-udev-trigger.service without `Before=sysinit.target`, and image/build.sh checks them. *A first 0005 skipped only the zero:* the reset's one still set KVM's flag, and the tails stayed (labs 44986055383, 44986006042). - -**11-22 · qemu, qboot, kernel · every carried patch has a test that fails without it, and three are measured alone (labs 44993254745, 44993790452, 44993011539, 44993011448, #472, #481, #478).** A patch dropped at a bump, or rebased into applying and doing nothing, built and booted, and nothing said so: `patch --fuzz=0` refuses only a patch that no longer applies. *Built:* `verify args` asks the TCG QEMU what 0001-0004 do with no guest (`TestEachQEMUPatchDoesItsJob`): 163 flat views from QEMU's start to its first answer at spin's shape, a disk beyond `max_target` refused, a save's stop submitting one io_uring flush without `x-defer-disk-flush` and none with it, and `query-blockstats` without `parent` or `backing` under `x-flat`. `boot:patches`, which compat runs beside boot:record, asks a guest of spin's shape what only it sees: its SCSI host refuses a scan of target 16 (0002), the firmware enabled the MTRRs (qboot's `mtrr.patch`), and a guest restored 650 ms ahead of its new vCPU's TSC goes no more than 200 ms without a line (0005). On v20261122.01, before 0005, it went 625 ms (lab 44993011539); on v20261122.02, 12 ms (lab 44993011448). `kernel/Dockerfile` reads each kernel patch's effect in the vmlinux it built (#478). *Measured alone* (bench, spin's shape, `prestart`, against main's QEMU from parts run 44989641652): taking 0001 back read restored +11.7 [+0.9, +19.3] and cold +0.2 [−8.7, +7.1] (20 a side, lab 44993254745), so it earns on the restore. `pam.patch` read cold +3.9 [−3.4, +8.0] and `no-pci-walk.patch` +5.2 [−1.7, +9.2] (40 a side, lab 44993790452). Both are inside the noise with upper bounds over +5 ms, which rule 5 keeps. *Status:* every patch kept. - -**11-22 · kernel, boot · the host counts the port I/O exits 0004 and 0010 save (labs 45017602084, 45018204750, 45018204645, 45018410483, 45018410313, 45018410890, #486, this change).** The vmlinux check (#478) sees 0004 and 0010 compiled in, not earning. 0004 needs `raw_pci_ext_ops`, set from the ACPI MCFG table, and 0010 needs KVM's CPUID leaf, so a kernel that set up MMCONFIG after enumeration, or a machine without MCFG, would pass it. `boot:patches` now cold-boots spin's shape to `/bin/sh`, reads KVM's `io_exits` and `mmio_exits` for every vCPU through QEMU's `query-stats`, and holds the median of 3 boots' `io_exits` at or under 1,025 (`TestPCIConfigurationCostsNoPortExits`). *Calibrated* on the bench, 20 boots each, v20261122.02 with its own kernel and with kernels built without each patch (parts runs 45017420814, 45017423344, branches `exp/486-no0004` and `exp/486-no0010`, not for merge): the release 955-974, median 958, mmio 2,142; without 0010 1,075-1,097, median 1,094; without 0004 3,477-3,499, median 3,496, mmio 881. 0004 saves 2,520 port exits, not the issue's estimated 1,300: 1,261 configuration accesses move to ECAM, and mmio_exits falls by the same 1,261. 0010 saves ~120, clear of a spread of ~25, so both are guarded. *Checked:* the release passes (974/974/980). The guard fails without 0004 (median 3,481) and without 0010 (median 1,097). *Status:* in place, run by compat.yml with every change's kernel. - -**11-22 · qemu · 0003 says the same in fewer lines (#488, this change).** `x-defer-disk-flush`'s patch was 369 lines, most of them a `defer_flush` argument carried through `migration_stop_vm`, a second `vm_stop_force_state` and the stop's helpers. Now `do_vm_stop` and `vm_stop_force_state`'s stopped branch start the deferral themselves, after the drain, when the run state is `finish-migrate` and `migrate_defer_disk_flush()` (public in `include/migration/misc.h`) holds: 249 lines, 71 added and 3 removed in QEMU against 107 and 22 before. Postcopy's and CPR's stops are `finish-migrate` too, so the accessor is false with `postcopy-ram` or a CPR mode; the machine sets neither on a save, so what it does is unchanged. *Checked* on the rebuilt QEMU (parts run 45017732016): `verify args`' 0003 subtest, one flush without the capability and none with it; compat (run 45017731970); `boot:checkpoint-pause` on the bench, busy-disk guest p50 stopped 20.6 ms, 22.1 short of memory (lab 45018667678). *Status:* in place. - -**11-22 · CI · the coverage floor counts what CI can run (#410, this change).** `task test`'s floor counted every statement, and a function marked `mutate-lane:` runs only in a lane with root and KVM. Each probe the lab gained pulled the total down however well its testable half was tested: #406 passed at 79.96%, which `go tool cover -func` rounded to 80.0 before the comparison. `internal/coverfloor` reads coverage.out, leaves out each function whose doc comment carries the marker, as go-tools' mutate does, and compares the exact percentage. *Measured* locally on `140ebbb` with CI's conditions (no release tree, no root): 80.48% before it, 80.65% of 9298 statements with internal/coverfloor's own, and 93.36% of the 7697 left without the lane's 1601. The floor moves from 80 to 93, just under it, so it ratchets. *Status:* in place. - -**11-22 · lab · every release's record carries its no-systemd floor (this change).** AGENTS.md and docs/measuring.md (rule 8) ask for the bounds each release, the no-systemd floor first, and report.yml measured only the goal's numbers and the diagnostics: the floor was last measured by hand, on v20261122.01 (lab 44978079694). `releases measure` now boots the release beside its floor after the ladder, `ssh-first` with `login=lane` over the release and the release with `--edit floor --append init=/usr/local/sbin/spin-floor`, 20 boots each, interleaved, as the hand-made runs did. The record keeps both first logins as `floor-lane` and `floor`, and docs/releases.md tables them under "Bounds" once a record has them. Only the release a record is made for is measured beside its floor: the one it is against has none, and no Δ is read of a bound. It is the one bound docs/boot-time.md lists as each release's. *Checked* by report.yml on this branch against v20261122.02 (run 45018301368, record not proposed): first login by the lane 406.8 / 420.2, no systemd before sshd 240.5 / 245.5 (p50 / p95, 20 boots each, bench, spin's shape), beside the ladder's cold 420.0. *Status:* in place. - -**11-22 · kernel, qemu · every carried patch is git format-patch output (#487, this change).** Three hygiene items found while writing #478, none of which changes what a patch does. Kernel 0003 left `eval_map_work` and its `INIT_WORK` behind after `trace_eval_init()` came to call the copy directly, and its allocation-failure branch did what the success path did: the copy (now `trace_eval_defer()`) runs once, first, and `trace_init_wq` stays for `tracerfs_init_work`. Subjects said `[PATCH 7/11]` and the like after 0006, 0009 and 0011 were deleted; they say `[PATCH]`. Kernel 0007, 0008, 0010 and QEMU 0002, 0004 and 0005 had no `diff --git` lines (#488 had just remade QEMU 0003); all thirteen were remade with `git format-patch -N` from git trees of the pinned tarballs. *Checked* on the laptop, no build: each set, applied with `patch -p1 --forward --fuzz=0` as the builds do, gives the tree the series' commits do; the old and new kernel sets differ only in 0003's trace.c; every changelog is unchanged; checkpatch --strict reads the kernel patches clean but for 0002's citation of a commit the tarball has no history for. `gates/patches_test.go` holds both directories to the format. CI rebuilt the kernel and QEMU, and the vmlinux check still finds each patch. *Status:* in place. - -**11-22 · lab · the floor's gap is a Δ with its interval (#495, this change).** The record kept the floor as two p50/p95 pairs, and the gap a reader wants, what systemd costs at most, was their difference with no interval, so it could not be read by the one acceptance rule. A record now keeps `bounds.floor`, the floor's Δp50 against the release's lane login from the same run, drawn by `DeltaP50`, the bootstrap every release's Δ uses, and docs/releases.md shows it in "Bounds" beside the two pairs. A bound is still never read against the release before it. *Checked* on the floor's samples from report.yml run 45018301368 (v20261122.02, bench, spin's shape, 20 boots each), kept as `internal/lab/testdata/floor-45018301368.json`: −166.3 [−174.7, −160.3]. The floor keeps its own lane-login arm. Its sshd does not serve spin's path, which is spin's forwarder before sshd, and the floor has no systemd to run it. *Status:* in place. - -**11-22 · CI · the coverage floor is go-tools' coverfloor (go-tools #131, v20261122.02, #496, this change).** `internal/coverfloor` (#490) copied go-tools mutate's rule for lane code, which every spin-stack repository's `task test` should read the same way. go-tools' `coverfloor` reads it through mutate's own `LaneFunctions`, and it refuses a marker that names no test, as mutate does. `task test` runs it by name from go-tools' release, and the copy is deleted. *Checked:* both tools printed the same line on main's profile (93.38% of what CI runs, 80.66% with the 1606 lane statements). The same release copies no ignored directory into mutate's copies (go-tools #132, #129) and stops a run whose importer test fails unmutated (go-tools #133, #130): the `_output` guard in `task test` stays, for a plain `go test`, with its comment saying so. *Status:* in place. - -**11-22 · qemu · 0003 has no postcopy clause (#501, this change).** `migrate_defer_disk_flush()` was false with `postcopy-ram`, and no test could ask it: a save to a file cannot run with `postcopy-ram`, because the source opens a return path at connect and waits for the destination's SHUT at completion (11.2.0-rc0), so holding it needed a second QEMU as a destination. No caller can reach it either. The machine turns on `x-defer-disk-flush` only in `Checkpoint`, which also turns `postcopy-ram` off and migrates to `file:`. `postcopy-ram` is turned on only by `Resume`, on a destination, for a fast load, and a destination's stop is not a switchover's. spin moves a workspace by checkpoint, upload and resume (`moveFor`, spin#1487), with no live migration. The clause also guarded nothing that precopy's stop doesn't share. A deferred flush is safe when the migration's reader shares this host's page cache, which is what the capability says, and that holds or fails the same way whichever phase stops the VM. So the clause is gone, and postcopy's stop defers as precopy's does. CPR's exclusion stays, because cpr-reboot's stop can precede a host reboot that loses the page cache, and #499's subtest holds it. The patch adds 70 lines where it added 71, and every branch it carries is asked by `verify args`. *Checked:* the series applies with `patch --fuzz=0` to the pinned tarball, and `migration/options.c` and `qapi/migration.json` match the edited files, which `scripts/qapi-gen.py` reads without error. On the rebuilt QEMU (parts run 45030863541), `verify args`' 0003 subtest passes, and so does compat (run 45030863623). `boot:checkpoint-pause` passes on the bench with the busy-disk guest's p50 stopped at 19.7 ms, 29.5 when short of memory (lab 45031602785). What a checkpoint does is unchanged, since it never sets `postcopy-ram`. *Status:* in place. - -**11-22 · image · the first login waits for its user manager, which root starts in the boot (labs 45030778365, 45031248191, 45031644179, 45031644114, 45031687433, 45032247920, 45032247623, #467, this change).** Since #462 a login's manager started beside it, and the first login's own `systemctl --user` could arrive before it. On spin's login (root, bench, v20261122.03) it failed 10 of 10 (lab 45032247920, `ssh-first` with the first login's command `systemctl --user list-units`, archive tag archive/exp-user-manager-467). *Where the manager's time goes:* a diagnostic read root's manager's timestamps after the logins (`systemctl show` of `user@0` and the manager's own Generators/UnitsLoad timestamps). With class `user-early` the manager took ~48 ms from `user@0` starting to ready: ~11 PAM and exec, ~2.6 the manager's start, ~9 the XDG autostart and environment.d generators, ~2 unit load, ~8 building the first transaction (its lazy unit loads, a debug log showed), and ~15 sockets.target, which waits for dbus.socket's and ssh-agent.socket's `ExecStartPost=systemctl --user set-environment`. The user units are default.target, basic.target, sockets.target (dbus.socket, ssh-agent.socket, systemd-ask-password.socket), timers.target and paths.target with nothing in them, and app.slice. *Cuts* (bench, nested, spin's shape and login, 20 a side, against class `user-early`, lab 45030778365): the sockets' environment from `/etc/environment.d` and their ExecStartPost taken away −17.1 [−27.0, −10.7]; the XDG generator masked −4.8 [−11.2, +1.3]; both generators, a bound, −8.4 [−15.8, −1.0]; the PAM stack down to `pam_permit` and `pam_systemd`, a bound, −3.5 [−11.4, +2.5]. With the environment cut and the XDG mask, `user-early` still cost +29.8 [+17.2, +42.2] (lab 45031248191): what is left is systemd --user's own start. *Root lingering* moves that start into the boot, where the first login finds it done or nearly. Decided at 40 a side (lab 45031644179): `user-early`, the environment cut and root lingering, first login +4.7 [−0.2, +12.2], within noise; sshd accepting +5.6 [+1.1, +10.1]; the second login −16.7 [−17.7, −16.3]. Without the environment cut, +19.6 [+15.9, +25.6]. Restored login −10.8 [−15.9, −6.6] evicted and −12.3 [−15.1, −5.5] cached, 20 a side (lab 45031644114). The likely reason is that root's manager no longer stops 10 s after the cold login's session ends (`UserStopDelaySec`) and starts again beside the restored login (inferred, not measured). *Left out:* the XDG mask, which moved neither goal number. *The lane's login as spin* waits for spin's own manager: first login +29.7 [+22.8, +42.1], and shadowing Ubuntu's `user@` barrier on `systemd-user-sessions` changed nothing (+30.6, lab 45031687433). The lane is no goal number, and the no-systemd floor's Δ in the next release's record is read against it. *Changed:* class `user-early`, root's linger file, `environment.d/10-user-sockets.conf` and the two sockets' `10-env.conf`; `20-manager.conf` deleted, since logind starts the manager of every session of class `user-early` itself. `boot:logind` runs its SSH logins before the console `su`, so the first SSH login's `systemctl --user` is the first login's. `lab`'s lane edit carries the same. *Checked:* the first login's `systemctl --user` passed 10 of 10 on spin's login and on the lane's with these edits, the manager-wants drop-in removed (labs 45032247920, 45032247623). *Status:* in place. - -**11-22 · lab, report · a boot chart of every release and of any tree (labs 45035203882, 45036503632, 45037354657, this change).** A number said how long a boot took, and nothing showed what ran in it. The `bootchart` edit puts systemd-bootchart (Ubuntu's 235-2build1, pinned in versions.yaml) into a tree's overlays as PID 1, sampling at 200 Hz. The `bootchart` probe stops it with the first login and keeps its chart and `systemd-analyze plot` beside `result.json`. `releases measure` draws each release once, and its record links both charts from docs/releases.md. *Cost* (bench, spin's shape, 20 a side, v20261122.03, lab 45036503632): first login +10.4 [+4.5, +16.8], console prompt +15.7 [+12.3, +19.7], QEMU RSS +4.0 MiB. It is a diagnostic and never in the image. *Fixed on the way:* the sampler is named `init`, not systemd-bootchart (lab 45035203425 found none); the stop command's sudo and its forks drew themselves ~0.1 s past the login (labs 45036002014, 45036494125); 235 names processes from `/proc/PID/sched` as "9" on this kernel and reads cgroup v1, so it names them by command line and draws no cgroup. *What v20261122.03's chart shows* (lab 45037354657, 3 boots): PID 1 at 82 ms of the kernel's clock and the login at 320. From about 100 to 140 ms the vCPU is nearly idle while the disk reads ~230 MB/s, so systemd's first 40 ms wait on the image. From about 190 ms to the login the one vCPU is busy and every process waits to run. udevd (21.5 ms), journald (18.6) and logind (14.8) use the most CPU. In the plot, systemd-udevd.service activates for 189 ms and systemd-udev-trigger.service for 127. These are leads, and the log's 2.1 is why a chart's bar is not a saving. *Status:* in place. - -**11-22 · machine, lab · the machine loads a state fast above 1.5 GiB of data, and no caller chooses (labs 45034868686, 45035462371, 45035462478, 45034881876, 45034881433, 45034881366, 45035029887, 45035048486, #470, this change).** `LoadOptions.Fast` was the caller's choice, and spin offered it as a host policy, `fast_load`, off by default, whose comment cited 293 against 152 ms from before mapped-ram and multifd (lab 44585840498). A fast load reached the first login at ~400 ms against ~95 for a full one at today's state (lab 44987275543). *The crossover:* `restore-first` gained `touched=MIB`, which writes that many MiB of non-zero bytes into a tmpfs in the guest after its cold login and before its save. Bench, nested, spin's shape and login, plugged to 2048 MiB up to 1.5 GiB touched, then to 4096 and 8192, the state evicted, 20 a side interleaved, first login p50/p95 in full against fast: 179 MiB of data 95/105 against 489/563, +394 [+388, +420]; 825 MiB 258/310 against 431/446, +173 [+149, +195]; 1.2 GiB 374/510 against 476/534, +103 [+88, +120]; 1.7 GiB 570/763 against 441/498, −129 [−167, −76]; 3.7 GiB 1410/1804 against 451/518, −959 [−1008, −911]; 7.3 GiB 3152/3658 against 538/581, −2615 [−2642, −2589]. A full load costs the disk's read of the data, ~0.4 ms a MiB; a fast load's login barely moves. *Where a fast load's time goes* (branch `exp-470-blocktime`, `postcopy-blocktime` on, lab 45035029887): at 179 MiB ~2,500 faults, mean 69 µs, most 64-128 µs, blocked the vCPU 45 ms of the ~400 the login adds. With the state read ahead each fault took 5.5 µs and blocktime 3 ms, and the login was still 325 ms (−168 against no read-ahead, +234 over a full load). The postcopy lasted 0.8 s at 179 MiB and 2.4 s at 3.7 GiB: QEMU's eager thread places every 4 KiB page of the RAM blocks at their ceilings, 8 GiB, one ioctl each. That this is what slows the guest is inferred, not measured (#519). Postcopy's preempt channel is a second socket from a source, for pages queued behind the precopy stream, and a file load has neither. *Read-ahead during a fast load* (lab 45035048486, 10 a side, 3.7 GiB): faults 78 against 85 µs, login 436 against 458, p95 713 against 490, so it is not carried. *Changed:* `LoadOptions.Fast` and `spin-machine restore --fast` are gone. `Resume` loads fast a mapped-ram state with more than `machine.fastAbove` (1536 MiB) of data on a host that grants QEMU a userfaultfd (`/dev/userfaultfd` open to every user, spin's grant, or `vm.unprivileged_userfaultfd=1`), and in full otherwise. The read-ahead and the channels follow the same choice. `restore-first` lost its `fast` row; a bench runner grants the userfaultfd, so `touched` over 1.5 GiB measures the fast load. `boot:record`'s events test fills 1.6 GiB of a 2 GiB guest for the fast load's events. spin's `fast_load` is spin-stack/spin#1570. *Status:* in place. - -**11-22 · image · six unmeasured deviations measured, two reverted, and boot:workspace (labs 45034963004, 45036254377, #508, #517, this change).** The inventory (#508) and docs/image.md (#517) left six deviations with no measurement in spin's shape on spin's login. Each was taken back to what Ubuntu ships by a `lab` edit, one arm each, interleaved against v20261122.03 with `--edit lane`, 20 a side, 1 of 16 vCPUs, 128 MiB, `prestart` (lab 45034963004). Taking back, Δp50 cold: `nsswitch.conf` +0.8 [−8.4, +5.2]; the volatile journal +6.1 [+2.3, +15.8]; docker and containerd by socket +13.9 [+11.4, +18.2], restored +55.7 [+12.0, +73.9]; the manager's timeouts +0.3 [−5.2, +3.3]; logind, the bus and the user units early +16.5 [+9.8, +20.4]; the host keys from the first dispatch −0.8 [−10.5, +3.5]. *Kept:* the journal, docker (a deferred row, which says the first `docker` command waits for the daemons), and the lane's logind units, now measured in spin's shape. *Reverted:* `nsswitch.conf` and `fast-boot.conf`, which earned nothing; their edits went with them, and so did `carry-logging`, which edited `fast-boot.conf`. The host keys stay pending #515. `boot:workspace` checks what a workspace expects and asserts what the image gives up; on v20261122.03 (lab 45036254377) it found tracefs empty under `lockdown=confidentiality`, where docs/image.md said it mounted by hand, and the first `docker` command waiting 0.47 s on two vCPUs. It runs in release.yml's bench job on the release's own image, beside `boot:logind`. *Opened:* #509-#515. *Status:* in place. - -**11-22 · lab · the boot chart from spin-stack's systemd-bootchart (labs 45042034749, 45042509602, 45043434713, #525).** Ubuntu's 235 named processes "9", read cgroup v1 and so labelled none with its unit, and filtered out 62 of the processes that ran. The `bootchart` edit now compiles spin-stack/systemd-bootchart at the commit versions.yaml pins, in a container on the runner that makes the tree (`internal/lab/bootchart.Dockerfile`), with `ControlGroup=yes` and `Cmdline=no`, and the probe keeps the fork's JSON beside the chart. *What v20261122.03's chart shows at 78dc08c* (lab 45043434713, bench, spin's shape, 3 boots): CPU by unit p50 init.scope 134 ms (PID 1 118 to 123 ms, and the sampler, named `bootchart`, ~10 ms), systemd-udevd.service 25, systemd-journald.service 19, systemd-logind.service 15, the root cgroup's kernel threads 15, session-1.scope 13, ssh.service 11, dbus-broker.service 10. systemd-udevd waits ~120 ms to run and systemd-udev-trigger ~110. The sampler says it used ~10 ms of CPU, ~0.2 ms a sample. `first_login` 433 ms p50, `chart_end` 330. Leads, not savings. *Status:* in place. - -**11-22 · lab · the boot chart without the things a reader had to guess at (lab 45060814905, spin-stack/systemd-bootchart#9, #528).** The charts at 78dc08c (lab 45043434713) named one executor "9", gave idle kernel threads no cgroup in one boot of three (so "/" counted 15 processes there and ~50 in the others), showed "systemd-user-sessions.service (deleted)" as a unit of its own, and drew the header and top tables overlapping on a page ~340 px taller than its chart. The fork at 096d61a names a process whose comm is digits by its exe link's basename, says "/" for a process the kernel lists in no cgroup (before systemd mounts one), cuts " (deleted)", gives its font sizes a unit (CSS ignored them, so browsers drew every label at 16px), and sizes the page from what it draws. *What lab 45060814905 shows* (bench, spin's shape, v20261122.05, 3 boots): no process without a cgroup, "/" at 51 processes in each boot, no name of digits and no " (deleted)", and each page 40 px below its last row. The executor and the removed cgroup did not recur in these boots, so the fork's `--proc` tests are what show those two fixed. A name in parentheses such as "(systemd-user-)" is a child systemd forked, seen once before it exec'd: that is what it was then. *Status:* in place. - -**11-22 · lab · the boot chart's first sample, wait graph and legend (lab 45064083873, spin-stack/systemd-bootchart#10, #534).** The write graph in lab 45060814905 had the read graph's shape from 85 to 215 ms, in a boot whose tables said it wrote 0.0-0.1 MB. It read the right counter, `pgpgout`. As PID 1 the sampler starts before /proc is mounted, and its first samples held zeros. The first sample that read /proc then differed from zero by everything since the kernel started: 21 MB read, 124 KB written and 79 ms of CPU in one 5 ms interval. The IO graphs' 250 ms average spread that jump into a ramp, and the CPU and pressure graphs began with a full bar. The fork at 3125dea gives the samples before /proc the first counters it reads. It also drops the "CPU wait" graph, which summed every task's run delay, so on one vCPU it sat at its ceiling and read like a boot bound by IO (upstream #13). CPU pressure now sits under CPU utilization. The process graph's title says what its colours and dashed lines are (upstream #39), and the header's "Graph data" and "Sampler" lines are drawn at 12px instead of 8px. `--proc` tests hold three upstream reports that the fork already got right: a "(systemctl)" name kept whole (#44), no nameless process without /proc/PID/sched (#34), and a short-lived `@`/`:` template instance drawn (#40). Upstream #38's leaks are cppcheck not modelling `_cleanup_fclose_`. *What lab 45064083873 shows* (bench, spin's shape, v20261122.05, 3 boots, the fork's branch at 1f00a0f, whose tree 3125dea merged unchanged): `pgpgout` is 124 KB in every sample of every boot, and each write graph is empty. No chart has a wait graph, and each carries the legend and the 12px header lines. The read graph still starts ~20 ms before the first read, from its 250 ms average (#538). *Status:* in place. - -**11-22 · lab · a ledger of the boot to the first login, from a scheduler trace (labs 45062548343, 45062836688, 45062836494, 45063070048, #533, this change).** The boot chart samples every 5 ms, sees only processes and draws nothing of the login's ~65 ms after sshd's accept. The `ledger` probe records the scheduler's tracepoints from the kernel's start and cuts the kernel's clock into windows where the boot and the login change hands, each with its CPU by unit and its idle. The host's clock meets the kernel's through markers the guest writes on request, to ±0.15 ms. *The premise that broke:* the release kernel forces lockdown at confidentiality, which takes tracefs away (lab 45061089609), so the ledger runs on a kernel built from branch `ledger-533-kernel` with lockdown forced to none (parts run 45061289985), and no release gets a ledger until #536 decides how. *Cost* in spin's shape, 20 a side (lab 45063070048): first login +3.0 [−2.4, +15.9], within noise; console prompt +12.1 [+7.1, +17.6]; the kernel alone −1.0 [−9.5, +4.9]. *What six boots of v20261122.05 show* (labs 45062548343, 45062836688, bench, spin's shape): the kernel to PID 1's exec 83 ms, 72 of it in PID 1 before its exec, which is why the boot chart's init.scope (118-123 ms) is twice the ledger's 59 from PID 1's exec on. From PID 1 to the login's sshd-session, 171 ms: PID 1 55, idle 18, journald 18, unattributed (generators and executors) 17, logind 15. Between 110 and 151 ms, the stretch #521 read as the vCPU nearly idle on the disk, PID 1 runs 26 to 30 ms and the vCPU idles 7 to 13 while tasks wait on the disk. The login's 65 ms from sshd-session's exec to true's exit has no idle in it: sshd 20 ms, user@0.service 17, udevd 9, PID 1 4, journald 3. Root's manager (linger) starts as the connection arrives, and its 17 ms of CPU land inside the login's windows (#527). *Opened:* #536, #537. *Status:* in place. - -**11-22 · machine · a failed resume says whether the checkpoint is to blame, and a failed load does not (#516, this change).** spin decides from `Resume`'s error whether to drop a suspended workspace's memory, and only `*Refusal` was typed. *Read in QEMU 11.2.0-rc0's source:* `MIGRATION` carries the status alone, and every failure of a load ends at `process_incoming_migration_co`'s `fail:` label, its reason on stderr before QEMU exits: a section QEMU rejects, a file that ends early and a failed read on the host (both `-EIO` from `qemu_fill_buffer`), and userfaultfd refused to a fast load. So no new type was made for a failed load, and the cases `Resume` can pin on the checkpoint fold into `*Refusal`: a format QEMU does not read (part `format`) and a `Saved.Added` that does not parse (part `added`). A stream checkpoint asked to load on several channels is the caller's options, not the checkpoint, so it stays a plain error. `boot:record`'s truncated state asserts that it is not a `Refusal`. *Opened:* #546. *Status:* in place. - -**11-22 · image · root's manager without the XDG autostart generator (labs 45062836688, 45070208762, 45070150688, 45070973943, 45071003631, 45071003608, #527, this change).** v20261122.04's first login was +6.8 [+0.1, +13.6] over .03, and the cause is root's manager, which #467 starts in the boot and the first login waits for. That is correctness and stays. *What the manager does* (the ledger, lab 45062836688, v20261122.05, 3 boots, CPU before the login's end, p50): `user@0` 17.5 ms in all; systemd-executor and the PAM stack of `systemd-user` 4.6-5.0, of it `unix_chkpwd` 1.1; the manager from its exec to its generators 2.6; the environment.d generator 2.0; the XDG autostart generator 1.6; loading units 4.4; the first transaction to `Startup finished` 1.4. The rest of its 17-18 ms in the ledger runs after the login. The vCPU has no idle from ~155 ms to the login's end, so a millisecond of CPU cut there is a millisecond of the login's. A workspace needs the environment.d generator (it reads `10-user-sockets.conf`, the bus's address for user services, and `/etc/environment`), the sockets, and the PAM stack's account check, limits and audit uid. It does not need the XDG generator: a workspace has no graphical session. *Arms* (bench, spin's shape and login, against v20261122.06, 100 a side, interleaved, lab 45070150688): the XDG generator masked, first login −3.8 [−6.2, −0.7], accept to login −6.1 [−9.0, −0.3]; every cut above together, a bound, −9.6 [−13.3, −6.7]; no manager for root (`user-early-light`, no linger), a bound, −17.3 [−19.2, −12.4]. The two bounds match the ledger's CPU for what they remove, ~10 and ~17.5 ms, so the ledger's CPU is the login's time here. The ledger of the arms (lab 45070208762, 3 boots each) shows `user@0`'s CPU at 17.0-18.1 on the release, 15.5-15.7 with the XDG mask and 9.4-10.9 for the floor's cuts, so each edit removed what it named. The XDG arm's −3.8 is about twice the generator's 1.6 ms of CPU. Its disk wait went too: `user@0`'s disk time 11.9-16.2 against 8.8-10.6. The login waits for the manager to finish, so that wait is on its path (inferred from the two ledgers). The same mask measured −4.8 [−11.2, +1.3] at 20 a side in #467 (lab 45030778365), when the manager started inside the login, and was left out. Restored login −1.7 [−4.4, +2.2] evicted and −2.5 [−5.1, +1.9] cached, in noise (lab 45070973943, 20 a side). `boot:logind` and `boot:workspace` passed on the arm (labs 45071003631, 45071003608). *Changed:* optimize-systemd.sh masks `/etc/systemd/user-generators/systemd-xdg-autostart-generator`, and image/build.sh refuses a user generator's mask that masks nothing, as it does a system generator's. *Left:* what remains of #527 is function, and the cost of the correctness #467 bought. *Status:* in place. - -**11-22 · docs · spin's early login, each number against its own run's release (labs 44805051310, 44807457606, #363).** docs/boot-time.md set −59.4 from one run beside "the image's half alone −17.4" from another in one cell, and gave "−51 more" in a second cell, a difference between two arms rather than either against its release. They are two runs on two hosts, both against v20261120.03, 20 boots a side, spin's shape and login. Lab 44805051310 (spin-machine at 90a6543): `login-early` (ssh.socket, ssh.service, sshd-keygen and the probe's forwarder without default dependencies, logind and the broker without PrivateTmp) −10.8 [−16.3, −5.2], with `udev-startup` as well −59.4 [−65.9, −56.2]. Lab 44807457606 (at fbc7517): `--edit lane`, the image's half without the forwarder, −17.4 [−25.0, −8.5]; with `forwarder-early` as well −68.5 [−78.0, −61.8]. *Changed:* each cell names its run's arms beside their numbers, and no delta is taken between runs. - -**11-22 · lab · the boot's dependency view, and what fills the stretch before the first job (labs 45070438471, 45070718529, 45071125219, 45071549627, 45071102677, #521, #553, #554).** The bootchart probe now keeps `systemd-analyze critical-chain` of the login's units, the login user's manager's chain, and `systemd-analyze dot --order` among the chain's units, drawn by graphviz (docs/measuring.md, "Boot charts"). *The stretch from ~109 to ~146 ms* (debug boots with `systemd.log_level=debug systemd.log_target=kmsg systemd.log_ratelimit_kmsg=0`; without the last, systemd's own kmsg rate limit cut PID 1's lines at 118 ms): PID 1 loads every unit `multi-user.target` reaches, ~36 ms in those slowed boots, with 56 lookups of mount units that do not exist, and then computes a transaction of 79 jobs in ~0.4 ms. `UnitsLoadFinishTimestamp` is taken before that loading, so the plot's empty stretch is the loading. *dev-vda.device:* no unit queues a job for it, and nothing depends on it. It is `tentative` from PID 1's catchup (root is mounted from it) until udevd announces it, and the plot draws tentative as activating. *The chain to the login* on v20261122.06: the forwarder that stands for spin's supervisor waits for `basic.target`, 28-38 ms after `ssh.service` is active. Taken off it (`--edit forwarder-early`), it was active ~33 ms sooner, and the goal numbers did not move: cold +4.2 [+0.0, +11.0], restored −0.0 [−2.3, +2.3] (`prestart`, 20 a side). The login waits for systemd-logind next (#553). *Status:* the view in place. The forwarder row moved to "Measured and rejected". The release copy is open (#554). - -**11-22 · release/lab · each release's ledger, on a traceable kernel published beside it (parts run 45071066129, lab 45073394754, #536, #558, this change).** The ledger (#533) needs tracefs, which the release kernel's lockdown at confidentiality takes away, so it ran only on demand, on a kernel from a scratch branch kept as a run artifact that expires (`run:45061289985`). *Decided:* option 1 of #536 at release cadence. release.yml's `traceable` job builds the release's kernel source and config with `KERNEL_LOCKDOWN=none`. `release traceable-kernel` holds its config to the release kernel's, lockdown swapped and every other option equal. The job signs the bzImage and publishes it on the release as `…lab-only-traceable.bzImage`: in no tarball, in no SOURCES, in nothing spin boots. Options 2 (a `lockdown=` parameter) and 3 (on demand only) were not taken: 2 trades spin's compile-time guarantee for a command-line one, and 3 left no ledger per release. `lab tree --kernel traceable:TAG` checks the signature, `releases measure` takes one ledger of each release on that kernel beside its boot chart, and the record keeps it as `docs/releases/TAG-ledger.txt`. *Measured:* built as the `traceable` job builds it, the kernel passed the config check against the release kernel of the same job (parts run 45071066129). The ledger on it, with v20261122.06 and drawRelease's tree, gave 3 of 3 ledgers: 0 breaks, 0 events dropped, residue 0.6 ms p50 and first login 427 ms p50, in spin's shape (lab 45073394754). That release's record read 414.4 cold in the same shape, so the +13 is within the ledger's own ~16 ms. *Cost:* one cold kernel compile per release, 10 min after the release kernel's, in a job of its own so that pause and wake do not wait for it. report waits for it. A change that breaks the traceable build is first seen at release time (#558). *Status:* in place. The first release built with it is the first with a ledger. - -**11-22 · lab · the CPU weight while the boot runs, on user@0's chain and on two units off the login's chain (labs 45082870346, 45083184310, 45083106264, 45083184131, #553).** The cold login does not wait for logind on v20261122.07. In its ledger (lab 45082187351, 3 boots), logind is active within 1-13 ms of `basic.target`, before or after it. The login's session opens 2-4 ms after it is authenticated, and the session waits 0-5.6 ms for root's manager (`user-early`). The login waits for the forwarder's chain (journald → tmpfiles → `sysinit.target` → `basic.target`) and for the key exchange on a vCPU that idled 14 ms of the 185 from PID 1 to the connection (boot 2). The two arms were lab edits (`logind-weight`, `offpath-weight`), on the bench, spin's shape and login, interleaved against v20261122.07. *logind, `user-runtime-dir@` and `user@` at `StartupCPUWeight=1000`:* first login −9.2 [−16.1, −0.3] at 30 a side in a screening run of three arms (lab 45082870346). The run fixed in advance to decide it, the arm alone at 40 a side, read −3.6 [−10.3, +0.6] (lab 45083184310). Accept to login was −7.7 [−14.0, −4.0] and sshd accepting +8.8 [−1.1, +13.3]. In its ledgers (lab 45083106264), logind is active ~9 ms sooner and `sysinit.target` ~18 ms later (p50 of 3). The weight moves the vCPU from the forwarder's chain to the manager's, and the login needs both. Restored, in noise: −1.2 to +0.1 (lab 45083184131, 20 a side). *`spin-machine-sshd-keygen` and `systemd-udev-load-credentials` at `StartupCPUWeight=1`:* sshd accepting +22.6 [+15.9, +33.5], first login +3.4 [−3.2, +14.6]. ssh.service waits for the keygen, which finished 45-70 ms later (lab 45083106264), and the forwarder waits for ssh.service. The keygen is on spin's path, not off it. Both together +6.0 [+0.5, +15.1]. Under cgroup v2, a weight is shared with the unit's siblings: `user@0` competes in `user-0.slice`, and `user.slice` competes with `system.slice` and `init.scope`. `StartupCPUWeight=` holds until the boot's jobs are done, and on spin's path the getty's wait for `dev-ttyS0` keeps them running past the login. *Decided:* neither is kept, and both rows are in "Measured and rejected". On one busy vCPU, a weight only changes which chain waits. What the login needs before it is the CPU it takes. *Status:* the edits are removed. - -**11-22 · machine · what a guest sends on the pressure port is bounded in time (#559, spin-stack/spin#1597, this change).** spin's security review, adopting the probe, found the guest's bytes bounded in size (128-byte lines) and count (one connection per CID) but not in time, which spin's I7 asks for: a guest's root writing `stall memory 1 1 1` in a loop kept a host goroutine busy on the runner's CPU, a dial-and-drop loop left one goroutine and timer per connection waiting `answerWait` with one `GuestLost` each, and `hello oom=0` then `oom 18446744073709551615`, again on each connection, reset the base and wrapped the reported kills. *Changed:* each watch paces its guest's lines (64 at once, 16 a second) and connections (4 at once, 1 a second) with a token bucket, sized from the sender: a Stall at most once a 1 s window for each of three resources, an OOM line only in an OOM storm, and a dial 1 s after an end. A guest over the line pace is cut off with `ErrGuestTooFast` rather than having lines dropped and counted: the counters are totals, so its next hello and Stall lose nothing, and the end needs no new field to say what happened. A connection over the accept pace is closed and the one held stays. One `GuestLost` waits per watch, and later ends give it their error. A count or `Total` below the last heard is ignored, and `internal/pressure` saturates microseconds past a `time.Duration`. *Measured:* nothing; no guest's path changes, since the sender starts 10 s after boot. *Status:* in place. - -**11-22 · machine · CPUID leaf 2 with QEMU's cache descriptors (#565, labs 45082640147, 45082640186, 45083473855, 45083473790, 45083754801, this change).** *Why:* nesting costs ~50 ms of the cold first login, and #565 profiles a boot's exits by reason on both hosts with the new `exits` probe. Both hosts make the same ~10,400 exits, and nested ones cost more. CPUID was the most frequent: 3805 exits, 3549 of them below the guest kernel's half. Every process glibc starts asks for its cache sizes 12 times (glibc 2.42, `dl-cacheinfo.h`, `handle_intel`), and QEMU's leaf 2 answered 0xFF ("see leaf 4"), so each query walked leaf 4's subleaves, 1797 exits. *Changed:* `-cpu` carries `x-consistent-cache=off`, so leaf 2 holds QEMU's descriptors for the same caches leaf 4 describes (`env->cache_info`), and glibc reads them there. (Not under `host`: leaf 2 described `legacy_intel_cpuid2_cache_info`, a 2 MiB 8-way L2 against leaf 4's 4 MiB 16-way, corrected 11-23, #586.) *Measured* (bench, nested, spin's shape, against v20261122.06 with spin-machine `exp/cpuid2-descriptors` at ee005ce): CPUID exits 3727 → 2176, every exit −1541 [−1695, −1380] (3 a side). First login −10.3 [−14.2, −4.0] at 40 a side, a second login −1.1 [−1.6, −0.7]. The restored login +1.0 [−3.9, +4.4] evicted and −0.4 [−4.6, +1.6] cached, both within noise, at 30 a side. That is ~6.7 µs an exit removed, against 1.94 µs in the nested L1, so the two L0 trips around an exit cost ~4.7 µs (inferred). *The record:* `machine.CPU` reads feature bits, and `x-consistent-cache` is a switch, so the record does not move. A guest moved across the change reads the same cache sizes from either leaf. *Opened:* #566 (the MMIO accesses), #567 (HZ), #568 (memory's first touch). *Status:* in place. - -**11-22 · image/lab · no host key made when spin hands over its own (labs 45086250796, 45085877480, 45085877238, 45085886063, 45086216266, #515, spin-stack/spin#1650, #573).** spin already makes, pins and hands over the workspace's host key. vminitd makes an Ed25519 key, the launch claim carries its public half, the control plane connects with it fixed, and before it execs systemd vminitd writes it to `/run/spin/ssh/ssh_host_ed25519_key` with a drop-in naming it sshd's only `HostKey`. The image's `spin-machine-sshd-keygen` still ran on ssh.service's path, 6.2 ms of CPU (ledger, v20261122.07), for a key nothing loads. So the brief's plan (a systemd credential through fw_cfg, a Spec field and a kernel option to read it, spin making the key on the host) was not needed. *Changed:* the unit carries `ConditionPathExists=!/run/spin/ssh/ssh_host_ed25519_key`, read back by build.sh. `ssh.service.wants/spin-machine-sshd-keygen.service`, a symlink checked in since `2df3dbf` that #515 could not trace, wanted the unit a second time and is gone. The sysinit want stays for the lane. The lab's `--edit spin-handoff` stands in for vminitd's handoff: a fresh key per boot, made on the host, and a shell as PID 1 that places it and execs systemd. *Measured:* on the bench, spin's shape and login, against v20261122.07, both arms with the handoff. At 60 a side the first login read −6.8 [−11.8, +0.2] (lab 45085877480), under the ~6 ms ceiling's noise, so the run that decided it took 120 a side: first login −6.9 [−9.6, −2.4], sshd accepting −6.8 [−10.4, −1.8]. In the same run, the ssh.service want taken away read −1.6 [−3.7, +4.3], which rule 5 deletes (lab 45086250796). Restored, 20 a side: restored login −0.6 [−3.1, +4.7], cold −9.0 [−16.3, +2.8], within noise (lab 45085877238). `boot:logind` and `boot:workspace` passed on the arm (labs 45085886063, 45086216266). *Opened:* #575, because `login=spin` does not hand over a key, so its probes still pay the keygen. spin-stack/spin#1650 records `HostKeyPath` as the image's contract. *Status:* in place. The arms' edits (`keygen`, `keygen-unwanted`) are removed. - -**11-23 · lab · `login=spin` hands over spin's host key (labs 45088516505, 45088516571, 45088516492, #575, this change).** Since #573 the image's host-key generation steps aside when spin's handoff has placed spin's key, and spin's vminitd always does. `login=spin` did not, so every probe on spin's path paid the keygen spin's own path skips, ~7 ms (#515's −6.9). *Decided* (the maintainer, #575's first option): the handoff is part of `login=spin`. Its overlay carries the drop-in naming `/run/spin/ssh/ssh_host_ed25519_key` sshd's only `HostKey` and a fresh key per boot, made on the host, and every boot on spin's path runs a shell as PID 1 that places the key and execs systemd (`Key.Init`). The `spin-handoff` edit is gone, and a tree's own `--append init=` still comes after the handoff's. *The stand-in's cost:* the shell runs three execs (two mounts and a `mkdir`) and writes the key with builtins. The ledger gives it a window of its own, `handoff`: 6.3, 7.3 and 7.9 ms from its exec to systemd's in three boots (lab 45088516505, bench, spin's shape, v20261123.01 on its traceable kernel). Of the 7.3, 3.3 ms was idle on cold reads of the shell, `mount` and their libraries, 2.7 the mounts and the `mkdir`, and 1.1 the shell. systemd mounts `/proc` and `/run` itself when no one has, so part of that is work moved, not added. vminitd does more before systemd on spin's path, and the lab measures none of it. *What moves:* a release that skips the keygen now reads it on spin's path. v20261123.01 does not carry #573 yet, so the first release that does will read ~7 ms against the one before it, from the image, not from the probe. Every probe ran with the handoff: ssh-first on v20261122.07 and v20261123.01, 20 a side, first login 430 and 416 (lab 45088516571), restore-first on v20261123.01, restored 82.3 evicted (lab 45088516492). *Status:* in place. - -**11-23 · image · systemd's first patch: drop-in candidate names derived once (labs 45090299768, 45090326943, 45091690423, #574, this change).** #574's second experiment. PID 1 spends most of its loading in `unit_file_find_dirs()`, once for every unit name or alias, lookup directory (~12) and drop-in suffix (4), and each call worked out the unit's candidate names again: the name, its template, its "-" prefixes. Upstream's #42858 (Eric Curtin, merged 2026-07-25, in v262) works them out once per name, `manager_enumerate()` 45.35 → 38.81 ms in its author's container (50 runs, ~270 units). Yocto backported it to 259.5, with an unrelated `CONF_FILES_WARN` change beside it, so the backport here is upstream's commit with one removed line's context moved to 259's `set_get()`. *Measured* (bench, spin's shape and login, v20261123.01, each arm systemd rebuilt on the runner, against a control rebuilt with a comment and no code changed, so both install their packages the same way): first login −6.5 [−9.9, −1.3] at 100 a side, sshd accepting −6.1 [−10.0, −1.1] (lab 45090299768). PID 1's CPU from its exec to the login's sshd-session, 55.1-57.8 ms on the control and 48.1-53.4 with the patch, 5 ledgers each (lab 45090326943). Restored, 20 a side: −0.9 [−4.3, +3.0] evicted, −1.4 [−5.0, +2.1] cached, within noise (lab 45091690423). *Changed:* image/systemd carries its first patch, applied without fuzz after Ubuntu's, as image/openssh does; the Dockerfile fails when it does not apply or its function is not in the source; the release ships it under `usr/share/spin-stack/systemd/` and names it in SOURCES, NOTICE and the SBOM's pedigree. A bump to 262 drops it. *In the same run:* #574's third experiment, no unit made for a `RequiresMountsFor=` prefix with no unit file, read −1.0 [−4.3, +3.9], and PID 1's CPU did not move: rejected, in "Measured and rejected", with the patch and an upstream draft kept in #580. *Status:* in place. - -**11-23 · lab · a probe saves once the guest's boot has finished (lab 45095349849, #578, this change).** Every probe that restores took its checkpoint right after the cold login, while the boot's last jobs still ran, and each restore of that state ran them beside the login it timed. *Decided* (the owner, #578): spin checkpoints an empty workspace, a project's workspace or a prebuild long after its boot, never mid-boot, and restore-first measures that. `bootFinished` now waits, over SSH as the probe's user, for `systemctl is-system-running --wait`, then for `multi-user.target` active with no job queued, then for the user manager's own `is-system-running --wait`. The middle step is there because the manager calls its start finished when its queue first empties, which a `Type=idle` unit starting the rest of the boot (#581) finds. docs/measuring.md, "When a checkpoint is taken", is the definition. restore-first, prestart, restore-together, run-delay and transport wait for it. restore-first records it as `finished`. *Measured* as three rows of one tree, so one run compares the probes (bench, nested, spin's shape and login, v20261123.01 with its own spin-machine, 40 each interleaved, lab 45095349849, branch `exp-save-rows`, not for merge): saved finished against saved at the login, restored login 83.8 → 79.0, −4.9 [−7.3, −3.8], `running` +0.3 [−0.6, +1.4], the state +4.5 MiB [+4.3, +4.9], save −13.5 [−15.2, −12.2]. The boot finished 85.6 ms after the login it used to be saved at. A further 3 s settle moved neither the state (−0.0 [−0.4, +0.3]) nor the restored login (+0.4 [−0.6, +1.3]), so the probe waits for nothing after finished. *What moves:* the restore rows step down ~5 ms at this change, from the probe and not the machine, as with #451. The ladder boots every release with the probe of the run, so a ladder stays comparable within itself. Compare a restore measured before this change only within one run. *Status:* in place. - -**11-23 · image · the first login's target (labs 45089584735, 45089584596, 45090246240, 45090246267, 45091658603, 45091658388, 45098372930, 45098372897, 45098372904, 45098373025, #574, #578, spin-stack/spin#1653, this change).** #574's first experiment. On one vCPU every unit started before the first login is on its clock, so the boot's default target becomes `spin-machine-login.target`, which wants only the login's units (ssh, its keygen, the vsock socket, journald, logind and its Varlink socket, the bus, `/tmp`, spin's supervisor by name), each without default dependencies, and `spin-machine-boot-rest.service` starts `multi-user.target` once the boot's first jobs are done (`Type=idle`). Every unit still runs. *Bound* (the rest 3 s later, the forwarder off `basic.target`): −55.5 [−63.0, −51.6] at 20 a side (lab 45089584596); in its ledgers PID 1's CPU before the login 55 → 38 ms, and udevd, its trigger, tmpfiles, sysctl and user-sessions gone from before the login (lab 45089584735). *Triggers,* the supervisor early, 20 a side (lab 45090246267): idle −59.2, a 2 s timer −66.5, sshd's PAM stack −52.0 with accept to login +15.3; the same PAM trigger with the supervisor as spin orders it −20.8. Idle is kept: it is systemd's own "after the boot's jobs", and the timer's 2 s is arbitrary. *Found:* logind's Varlink socket has to be in the target, since systemd refuses to start a socket whose service runs; without it `boot:logind` failed (lab 45090950033). `lab check` now boots a tree's edits, made in an image of its own: before, a check booted the tree's base image and ignored them. *Carried form,* against v20261123.01, 40 a side (lab 45091658603): cold −17.7 [−26.2, −11.7], accept to login −11.8; with the supervisor off `basic.target` −42.6 [−50.2, −38.4]. Restored, 20 a side (lab 45091658388): +3.1 [+0.9, +5.4] evicted, +2.2 [−1.6, +5.4] cached; an earlier run read +8.1 and +4.6 (lab 45090776228). `boot:workspace` and `boot:logind` pass (labs 45091658629, 45091658828). *Decided* on v20261123.02, with the probe that saves once the boot has finished (the entry above), bench, nested, spin's shape and login, 40 a side, branch `exp-581-finished` (this change and that probe), tagged `archive/exp-581-finished`. ssh-first (lab 45098372930): first login −21.5 [−26.4, −15.5], sshd accepting −10.0 [−16.2, −3.7], accept to login −10.7 [−12.9, −8.2], second login +0.0 [−0.8, +0.6], QEMU's RSS −1.9 MiB. restore-first (lab 45098372897): restored login +1.1 [−6.0, +5.2] evicted, +2.2 [−10.6, +12.9] cached, both within noise; the state and the save within noise; `finished` +35.2 ms, since the rest of the boot runs after the login. The earlier run's restored +3.1 was the probe saving while the rest of the boot still ran (#578). `boot:workspace` and `boot:logind` pass on it (labs 45098372904, 45098373025). *The console prompt* +15.5 [+11.5, +19.0]: the serial getty is in `multi-user.target` and now follows the login. It does not count against the change: nothing a workspace does waits for the getty, and no goal number moves with it. *spin's supervisor off `basic.target`* (the same run, the probe's forwarder with `forwarder-early`'s drop-in): first login −45.3 [−50.2, −39.4], sshd accepting −66.3, but accept to login +21.0 and the second login +43.7 [+41.1, +46.1]. The first login then comes before the boot's first jobs are done, and `Type=idle` starts the rest exactly when the second login comes, so its cost moves from the first login to the second. Restored within noise (evicted +0.4). That half is spin's to decide (spin-stack/spin#1653); on a release with this target, `--edit forwarder-early` reruns it. *Removed:* the lab's `login-target` and `login-target-spin-early` edits, which put this checkout's target into a release that lacked it; the open row for unit loading at boot, which this answers. *Status:* in place. - -**11-23 · lab · each MMIO exit put on the guest code that made it (labs 45098316459, 45098579511, 45098880914, 45098879979, #566, this change).** `exits` now keys the MMIO and port exits by `guest_rip` and names each one's function through the guest's own kallsyms. A tree booting the traceable kernel with `ftrace=` keeps the guest's trace, so the accessors' callers come with stacks. The trace does not move the counts: 3,104-3,129 EPT_MISCONFIG exits with it and without it. *Found* (bench, nested, spin's shape, v20261123.01): IOAPIC 625, ~576 of them in `apic_intr_mode_init`, where the 24-pin table is read four times and written twice (#590). ECAM 1,078 exits: enumeration 469 accesses, virtio-pci's capability walk 258, `pci_save_state` at add 128, ACPI AML 65, MSI-X enable 64 (#591). virtio's BARs: ~527 emulated at device setup and ~205 MSI-X table writes. About 650 ioeventfd notifications, ~500-650 of them the root disk's requests and ~95 vsock resets to the probe's dials (#592). Port I/O: `rtc_cmos_read` 106, ACPI's ports 137, serial 83, firmware and decompressor 277. *Measured and rejected:* a 1 MiB readahead on the root disk (`opt_io_size=524288`) left the notifications as they were (895 → 927) and the first login at +1.4 [−2.7, +8.0], 40 a side. *Status:* the probe's change is in place. Every lever left is a kernel patch of ~1-3 ms, each in its issue. - -**11-23 · machine · the record holds the vCPU's properties that shape CPUID (#569, CI run 45099128633, this change).** *Why:* #565's `x-consistent-cache=off` changed CPUID leaf 2, and the record did not move: `machine.CPU` read feature bits only, so a checkpoint taken on one side of the change resumed on the other without a refusal. *Read* (QEMU 11.2.0-rc0's `target/i386/cpu.c`, `host-cpu.c`, `kvm/kvm-cpu.c`, 2026-11-22): the vCPU's properties that shape CPUID without being a feature bit, and of those, the ones `-cpu` sets or the host model takes from the host. #565's claim that a guest reads the same caches from either leaf does not hold under `host`. `legacy-cache` is on there, so with the switch off leaf 2 describes `legacy_intel_cpuid2_cache_info` (L2 2 MiB 8-way) while leaf 4 describes `legacy_intel_cache_info` (L2 4 MiB 16-way). glibc reads a 2 MiB L2 since v20261123.01 (#586). *Changed:* `CPU.Properties` holds `cpuidProperties`, read off the vCPU in the qom-list-get `CPU` already made: `x-consistent-cache`, `l3-cache`, `legacy-cache`, `host-cache-info`, `family`, `model`, `stepping`, `model-id`, `level`, `xlevel`, `phys-bits`, `guest-phys-bits` and `pmu`. `CanResume` refuses each difference as `cpu `, and refuses a property only one side has. `TestTheRecordHoldsWhatTheCPUIsGiven` fails a `-cpu` option that is neither a feature, a feature filter (`migratable`, `enforce`) nor held. *Compatibility:* a record written before this change holds no property, and is refused by each, `cpu x-consistent-cache: checkpoint none, here false` among them. The record names no release, and v20261122.07 (switch on) and v20261123.01 (off) run the same QEMU, 11.2.0-rc0, so nothing in an old record says which side of the switch it was taken on. Reading it as either value would let the other side's checkpoints through. Every checkpoint saved by a released spin-machine boots cold once. `boot:compat` saves each release's checkpoint with this tree's spin-machine, so it reads each release's own switch. With this change alone, v20261123.02 and v20261123.01 resumed and v20261122.07 was the first it refused, `cpu x-consistent-cache: checkpoint true, here false` (CI run 45099128633). The entry below rides in the same record change, and moves the first refused release to the newest. *Opened:* #586 (leaves 2 and 4 disagree under host), #587 (`Unshared` ignores the properties), #588 (leaf 0xA is the host's PMU and nothing holds it). *Status:* in place. - -**11-23 · lab · `login=spin`'s forwarder is `spin-supervisor.service` (release run 45100012702, labs 45103075446, 45103442674, 45103464996, #598, this change).** The release run's ladder read v20261123.03, the first release with the login's target (#581), about +50 ms worse cold than v20261123.02: first login ~446 against ~396, sshd accepting ~402 against ~340, the restore unmoved (release run 45100012702, its record in #598). The lab had measured #581 at −21.5 [−26.4, −15.5] (lab 45098372930). *Found:* the edit that measured #581 linked the probe's forwarder into the new target, "as spin's would", and was removed with #581's merge. The target wants spin's supervisor by its name, `spin-supervisor.service`, which spin's vminitd links into `/run/systemd/system` before systemd starts (spin-stack/spin's `internal/guest/vminit/handoff`). `login=spin`'s stand-in was `spin-lab-forward.service`, wanted by `multi-user.target` alone, so on .03 it started only once `spin-machine-boot-rest.service` queued the rest of the boot. Bootchart of .03 on main's probe (lab 45103075446, bench, spin's shape, 1 boot): the forwarder active at 221 ms of PID 1's clock, `ssh.service` at 78, nothing on its chain between them. The ladder measured the stand-in's wiring, not the machine. *Changed:* the stand-in is installed as `spin-supervisor.service`, with spin's unit's default dependencies and `WantedBy=multi-user.target`, and `TestTheImageStartsLoginSpinsSupervisorWithTheLogin` fails when the image's login target does not want the unit `login=spin` installs. With it, the forwarder was active at 160 ms, behind `sysinit.target` as spin's unit is (lab 45103464996, 1 boot). *Measured again* through `releases measure v20261123.03` on this change (report run 45103442674, bench, nested, spin's shape and login, 20 a side): first login −17.8 [−27.9, −8.1], sshd accepting −9.5, accept to login −10.0, second login −0.7 within noise, restored login +0.4 [−1.4, +2.6] within noise; the console prompt +20.4, the serial getty following the login as #581 says. *The record:* #598 carries the stand-in's reading. `releases propose` does not propose a release twice, so once this is on main #598 is closed, its branch deleted, and report.yml dispatched on main with `versions=v20261123.03 record=true`. *Status:* in place. - -**11-23 · machine, qemu · leaf 2 describes the caches leaf 4 does (#586, labs 45100482399, 45101932202, 45101932224, 45101932173, 45101932449, 45101932412, 45101932286, #594, this change).** *Why:* #565 claimed that with `x-consistent-cache=off` leaves 2 and 4 describe the same caches. *Seen in a guest* (bench, nested, spin's shape, v20261123.02, lab 45100482399): leaf 2 EDX 0x2c307d, ECX 0x4d, so glibc read a 2 MiB 8-way L2 (descriptor 0x7D) while leaf 4 and the guest's kernel said 4 MiB 16-way. L1 and L3 agreed, and so did every threshold glibc derives (`shared_cache_size` 16 MiB, `non_temporal_threshold` 8 MiB, the same before #570), because QEMU's legacy L3 is inclusive and glibc adds the L2 to the shared size only for a non-inclusive one. What moved is `sysconf(_SC_LEVEL2_CACHE_*)`. The host's caches (Xeon 6975P-C, read on the runner) are L2 2 MiB 16-way, L3 480 MiB: neither leaf is the host's, and neither was before #570. *Options read and run:* `legacy-cache=off` is refused under `host` (`CPU model 'host' doesn't support legacy-cache=off`), since only a named model has a cache model of its own. `host-cache-info=on` passes the host's leaf 2 through, 0x00feff01, whose 0xFF sends glibc round leaf 4 again: CPUID exits 2371 → 4087, every exit +1693 [+1657, +1825] (lab 45101932224). No option keeps the descriptors and makes them agree. *Changed:* `qemu/patches/0006` (#594) adds `x-legacy-cpuid2-cache`, default on as QEMU is; off, leaf 2 encodes `env->cache_info` (0x2C, 0x30, 0x49, 0x4D). `-cpu` sets it off and `cpuidProperties` holds it, in the same record change as #569. *Measured* (bench, nested, spin's shape, against v20261123.03, whose leaves disagree, with ctl = #569's spin-machine on the patched QEMU): leaf 2 EDX 0x2c3049, ECX 0x4d, and glibc's L2 4194304/16, the kernel's 4194304/16, its thresholds unchanged (labs 45101932202, 45101932412). CPUID exits 2371 → 2406-2449, leaf 2 and leaf 4 still 12 and 4 a process: two more processes in the fix's boots, not a dearer one (inferred); every exit +13 [−143, +96] (3 a side). First login +0.6 [−6.1, +5.5] against the release, +0.4 [−7.5, +5.8] for ctl, 40 a side (lab 45101932173). Restored login evicted −2.1 [−6.1, +5.2], cached −1.7 [−4.3, +1.7], 30 a side (lab 45101932449). *Compatibility:* no release's QEMU has the switch, so the record refuses every release's checkpoints by it; #569 already refused every checkpoint a released spin-machine wrote, so spin's checkpoints boot cold once. `boot:compat` refuses v20261123.03, the newest release, first: `cpu x-legacy-cpuid2-cache: checkpoint none, here false (same)` (CI run 45104443218). *Status:* in place. - -**11-23 · release · a regressed release is withdrawn, never deleted (#595, spin-stack/go-tools#139, spin-stack/ship-it#45, this change).** Releases come several times a day, and report.yml measures each one once it is published. Until now nothing stopped a consumer from adopting one that measured slower. *Decided:* a withdrawal marks the release and deletes nothing. The release becomes a GitHub prerelease titled "(withdrawn)", with the reason and the issue at the top of its notes. Its record gets `withdrawn`, the page names it, and the newest release not withdrawn becomes GitHub's latest (`releases withdraw`/`restore`, `withdraw.yml`, run only by a person). Assets, `SOURCES`, signatures, provenance, the record and its charts stay, and compat goes on resuming the release's checkpoints, because a withdrawal says nobody should adopt it, not that it does not resume. The next release is measured against the newest release not withdrawn, and its `against` says which. *The rule* (docs/releasing.md, "Withdrawing a release"): either goal number's Δp50 against the release before it, with its interval wholly above 0, or a failed functional check, unless docs/log.md accepts the cost, as #505 did for v20261122.04's +6.8. At 20 boots a side about 1 in 40 flags of each number is noise, so report.yml's `releases flag` opens an issue with the Δs and the commits between the two releases, and a person decides. A prerelease is what the consumers already skip, read 2026-11-23. go-tools' `github-release` track reads GitHub's `/releases/latest`, which is never a prerelease. ship-it's release list leaves prereleases out. Here, `LatestRelease` and the notes' "what changed since" leave them out too. go-tools#139 is the pin already on a release that was then withdrawn, which `versions check` reads as behind an older release. ship-it#45 is spin's proposal, opened at publish, before the withdrawal. #595 is the `pause` job's functional checks, which open no issue yet. - -**11-23 · image · the inventory's blind spot was mkosi (#518, image build on #517, this change).** #518 asked the inventory to tell a path a package ships from one it only lists, because `/etc/systemd/system-generators/systemd-gpt-auto-generator` is in `systemd.list` and an image built without `optimize-systemd.sh`'s link to it had none. *Read* (2026-11-23): Ubuntu's `debian/rules` makes that link with `dh_link`, and `systemd_259.9-0ubuntu0.1_amd64.deb` carries it (`dpkg-deb -c`), so the package ships it and a `.list` holds only what the package's data does. mkosi 27.1's `installer/apt.py` unlinks it after every install, to turn gpt-auto on in mkosi's own images. The image's link puts back Ubuntu's mask, so the inventory is right not to list it, and it did see the deletion, as `deleted /etc/systemd/system-generators/`. Comparing against md5sums would have done harm: md5sums lists no symlinks, so every link a package ships would read as added. *Changed:* docs/image.md's inventory note and generator row say so; nothing in `image/`. *Status:* #518 closed without a change to the inventory. - -**11-23 · kernel · `CONFIG_HZ_250` removes 587 exits and no time from the login (#567, parts run 45110306519, labs 45111418504, 45111452844, this change).** *Why:* #565's profile counted 1043 TSC-deadline writes and 827 preemption-timer exits at HZ=1000, and #567 inferred ~3.5 ms from ~500 of them at ~7 µs a nested exit. Firecracker's x86_64 guest configs and Cloud Hypervisor's `ch_defconfig` build at 250, with no number published for it. *Measured* (bench, nested, spin's shape and login, v20261123.04 against the same release with a kernel built at `HZ_250`, branch `exp/567-hz250`): every exit −587 [−608, −445] at 3 a side, of them MSR writes 1018 → 755, preemption-timer exits 691 → 482, HLT 332 → 298 and external interrupts 396 → 360; the host's KVM handled them in −0.6 [−8.1, +7.3] ms less. The first login −0.6 [−5.9, +3.1], sshd accepting −1.4 [−7.7, +3.2] and the console prompt +4.7 [+0.4, +7.8] at 60 a side. *Why the inference missed:* a tick's MSR write and its preemption-timer exit take 1.0-1.5 µs each in the L1, against ~10 µs for an MMIO exit and ~18 for a port exit in the same profile, so ~7 µs an exit is the price of an exit handed to QEMU, not of every exit. *Status:* rejected; `HZ_1000` stays. Archived as tag `archive/exp-567-hz250`. - -**11-23 · image · Docker's packages pinned (#511, #609, Parts run 45111218531).** `install-dev-tools.sh` installed Docker's packages at whatever Docker's repository served that day and fetched its signing key with no hash. *Changed:* each `.deb` in Docker's resolute pool is a `download` in `versions.yaml`, by version and SHA-256, handed in as build arguments with no default and checked before apt installs it. There are six, not the five #511 named, because `docker-ce-rootless-extras` came in unpinned as docker-ce's recommend. The pins are v20261123.04's versions, and each SHA-256 is the one in Docker's `Packages` index, whose `InRelease` verifies against Docker's key. The build no longer reads Docker's repository. The key and the apt source a workspace's `apt upgrade` uses are files in `rootfs/`, the key unchanged from what Docker serves (fingerprint `9DC858229FC7DD38854AE2D88D81803C0EBFCD88`, no expiry). It is not a `versions.yaml` entry, because a `download` needs a version in its URL and the key's has none. *Proved:* one changed character in docker-compose-plugin's pin stops the image build at `sha256sum: WARNING: 1 computed checksum did NOT match` (Parts run 45111218531, branch archived as `archive/511-wrong-pin`). *Status:* in place. - -**11-23 · image · containerd's config is containerd.io's own (#510, labs 45111391250, 45111705358, 45112037022, this change).** The image replaced containerd.io's `/etc/containerd/config.toml`, which disables CRI, with one that enabled it, a v3 schema with the v2 plugin name, with no consumer named since `2afac47`. dockerd does not use CRI. *Decided* by the owner (#510, option b): containerd.io's file. *Measured* with an overlay edit that wrote the package's setting over the image's (bench, nested, spin's shape and login, against v20261123.04, 20 a side): first login −4.9 [−12.2, +1.6], sshd accepting −5.0 [−12.1, +1.2], both within noise (lab 45111391250). Restored login: evicted −0.6 [−2.1, +1.5], cached −0.5 [−2.1, +0.9], both within noise (lab 45112037022). Neither number can see the file, because containerd starts at a workspace's first docker command (inferred). `boot:workspace` passed on that tree, with docker running a container (lab 45111705358). *Changed:* the image's file is deleted. A workspace that wants CRI, for crictl or a kubelet, writes its own config. *Status:* in place; the experiment branch is archived as `archive/510-containerd`. - -**11-23 · image · docker.socket is Docker's own, 0660 and group docker (#509, labs 45111147182, 45111147449, 45111146715, 45111146865, 45111146854, 45111146735, 45111708456, this change).** *Why:* the image carried its own `docker.socket` since the first commit (`2afac47`), with no recorded reason, at `SocketMode=0666`, `SocketGroup=root`. Any local uid reached dockerd, which is root on the guest: a service's DynamicUser, `nobody`, a sandboxed command running as another uid. Docker's own unit is 0660, group docker, and `spin` is in docker. *Changed:* the image's unit and `optimize-systemd.sh`'s link to it are deleted, so the link docker-ce's postinst made to its own unit stands. `boot:workspace` asserts the socket is `660 root:docker`, that `spin` runs a container through the group, and that uid 65534 with no groups is refused. On v20261123.04 as released the two new checks fail (`666 root:root`, the refusal not refused; lab 45111708456) and with the change they pass (lab 45111146854). *Measured* (bench, nested, spin's shape and login, against v20261123.04, the change as an overlay edit, 20 a side): first login +1.7 [−5.3, +10.0], sshd accepting +1.5 (lab 45111147182); restored login +0.4 [−0.6, +1.3] evicted, +0.3 [−0.3, +0.8] cached (lab 45111147449). Both within noise, so it goes in on function. *Second arm, rejected:* the image's `containerd.socket` out of the boot transaction, against Docker's socket alone: first login +7.4 [−4.7, +15.3] (lab 45111146715), prestart within noise in every row (lab 45111146865). Both sockets start in `sockets.target`, after the first login since #581, so there was nothing on the clock to take. `boot:workspace` passed on that arm too (lab 45111146735). Prior art: upstream containerd binds its own socket and its unit has none; SUSE carried a `containerd.socket` from a 2016 socket-activation patchset never merged upstream. In "Measured and rejected". The experiment edits lived on `exp-509`, tagged `archive/exp-509`. *Status:* in place. - -**11-23 · lab · the ledger splits the span before the kernel's clock (lab 45110630795, #537, #611, this change).** The ledger had one span from the moment before QEMU is exec'd to the kernel's 0, ~20 ms longer than `boot:firmware-stages`' 73.7 ms, and docs/measuring.md read the 20 ms as spin-machine's start and the held start, inferred. Now the host watches spin-machine's children for QEMU's exec (a bracket of ±0.11 to 0.14 ms), and the kernel's "kvm-clock: using sched offset" line puts the guest's first instruction at the kernel's 0 less it. *Six boots of v20261123.04 on its traceable kernel* (bench, spin's shape): spin-machine to QEMU's exec 2.1 ms, QEMU's exec to the guest's first instruction 49.4, the guest's first instruction to the kernel's clock 47.4 (63.2 on the run's first boot: its ~15 ms more are all in that part). *The premise that broke:* the 20 ms are not before QEMU. They are after its exec, on a machine that firmware-stages does not boot (#611). *Status:* in place. - -**11-23 · lab · the boot chart's IO graphs draw each 5 ms on one scale (spin-stack/systemd-bootchart#11, labs 45110751133, 45113479570, #538, this change).** The fork averaged 250 ms around each IO bar and scaled each graph to its own peak. A 5 ms read burst came out as a plateau over the whole chart, and the boot's one 164 KB write filled the write graph for 150 ms. The three boots of lab 45110751133 were replayed through `--proc` and drawn both ways. Unsmoothed on one scale, the ~8 MB burst at the chart's start, the later read bursts and the write each appear where they happened and at their sizes against one another. The other drawing shows none of that, so the fork now draws this one. Lab 45113479570 is the pinned fork's chart of v20261123.04, three boots. *Status:* in place. - -**11-23 · kernel · the IOAPIC's table read once takes 384 exits and no time the login can show (#590, parts run 45111505269, labs 45113437048, 45114405201, 45115330128, #627, this change).** *Why:* #565's profile put 576 IOAPIC MMIO exits in `apic_intr_mode_init`: the 24 redirection entries read four times and written twice (the x2APIC path's save and restore, the ExtINT search, `clear_IO_APIC`'s read, mask and verify). *Built:* a patch (branch `exp/590-ioapic-once`) that reads each entry once for the ExtINT search and the clear, skips the clear's write and verify for an entry already masked and clear, and has `enable_IR_x2apic` restore only when `mask_ioapic_entries` masked something. Every entry is still read, so a kexec'd kernel or other firmware is handled as before. The last 96 reads, reusing the save's copy, were left: the copy goes stale when remapping masks entries. *Measured* (bench, nested, spin's shape and login, against v20261123.04): IOAPIC accesses 589 → 205 (`native_io_apic_read` 397 → 205, `__ioapic_write_entry` and `ioapic_mask_entry` 96 → 0), every exit −322 [−394, −222], the host's KVM handled them in −3.1 [−6.2, −1.1] ms less (3 a side). The first login −4.5 [−7.8, +0.4] at 60 a side and −2.0 [−4.3, +0.6] at 120, both within noise. They are KVM's in-kernel IOAPIC, ~11 µs each in the L1, so ~384 of them are 4-6 ms at most (inferred), and the 120-boot interval reaches −4.3. The five exit patches of #590-#592 together, a bound, read −7.4 [−12.1, −2.8] at 60 a side; #627 asks whether they are one change. *Status:* rejected. Archived as tag `archive/exp-590-ioapic-once`. - -**11-23 · kernel · two levers on the boot's ECAM reads remove what they claim and no time the login shows (#591, parts runs 45111902862, 45111905648, labs 45113437048, 45114405201, 45115330128, #627, this change).** *Why:* since 0004 every configuration read is an MMIO exit, and #591 counted the reads by caller. *(a)* `pci_bus_add_device()` saves every device's state at its add (upstream a2f1e22390ac, v6.19, for error recovery), 16 reads for each of 8 functions. A patch (branch `exp/591a-no-save-state`) keeps the save only where something can restore it without the driver's own save: AER (and DPC and EDR, which need it), EEH, s390, Xen's pcifront, and a root-bus device whose host bridge sets `reset_root_port`. CONFIG_PCIEAER alone was not a safe gate, because the same commit took out `pci_restore_state()`'s refusal of a state never saved, and those mechanisms call drivers' error handlers without AER. *(b)* `vp_modern_probe()` walked the vendor capabilities once for each of four types; a patch (branch `exp/591b-virtio-caps-once`) walks them once and keeps the first usable one of each type, as before. *Measured* (bench, nested, spin's shape and login, against v20261123.04): (a) MMIO exits −128 exactly, the host's handling −3.3 [−6.2, −2.1] ms; (b) −114 exactly, both at 3 a side and both the counts the source gave. The first login at 60 a side: (a) −4.3 [−6.8, +0.5], within noise; (b) −5.8 [−8.2, −0.6], outside it, but 114 exits at ~15 µs each (10 in the L1 and ~4.7 for the L0's trips) are ~1.7 ms, a third of that. A run of 120 a side, made because both arms straddled the noise, read (a) −1.3 [−3.5, +1.3] and (b) +0.9 [−1.8, +2.7]. The larger run decides, and it was chosen after the first was read, which this entry says. *Status:* both rejected. With #590 and #592's patches, as a bound, −7.4 [−12.1, −2.8] (#627). Lever 3, BAR sizing from the firmware, was not tried: it needs a new reason over the rejected configuration-space snapshot (11-13). Archived as tags `archive/exp-591a-no-save-state` and `archive/exp-591b-virtio-caps-once`. - -**11-23 · kernel · virtio-pci's queue selection and MSI-X rewrites: exits removed, no time on the login, and spin's dialer filed (#592, parts runs 45111690155, 45111693255, 45113393915, labs 45113437048, 45114428660, 45114405201, 45115330128, spin-stack/spin#1661, #627, this change).** *Lever 1:* every `vp_modern_*` queue accessor writes `queue_select` first, so setting up 13 queues wrote it 91 times. The same patch as 0011 (deleted with two others in a group arm, #345), here alone (branch `exp/592-l1-queue-select`), writes it 23 times. The MSI-X vector read-back after writing a queue's vector stays: virtio 1.2 §4.1.5.1.2 says a device refuses a vector by reading back NO_VECTOR and the driver must check, and `vp_find_vqs` falls back to shared vectors on it. *Lever 2:* each MSI-X message was written at activation and again by x86's `msi_set_affinity` before startup (`IRQCHIP_AFFINITY_PRE_STARTUP`, ff363f480e59), with the same vector and destination. A patch (branch `exp/592-l2-msix-once`) returns without the write when neither changed; a skip in `__pci_write_msi_msg` would have broken the restore of MSI state after resume. *Measured* (bench, nested, spin's shape and login, against v20261123.04, 3 a side for exits): lever 1 MMIO exits −68, lever 2 −56 (14 messages of 4 accesses, not the 19 inferred). The first login: lever 1 −2.8 [−6.6, +3.4] at 60 a side and +0.6 [−1.8, +2.3] at 120; lever 2 −0.1 [−3.1, +4.5] at 60. *The bound:* #590's, #591's and these patches in one kernel (branch `exp/batch2-bound`, 0017 refreshed to apply after 0016): every exit −838, MMIO −366, the host's handling −5.2 [−11.2, +1.2] ms (lab 45114428660); first login −7.4 [−12.1, −2.8] and sshd accepting −10.5 [−14.9, −4.1] at 60 a side (lab 45114405201); the restored login +0.0 [−5.4, +4.9] evicted (lab 45115341056). A bound is not a candidate; #627 asks whether the five are one change. *Lever 3:* spin's runner redials vminitd's RPC port every ≤2 ms until it listens (spin-stack/spin `internal/runner/qemu/guest_rpc.go`, `connectVsockRPC`), so spin's path pays refused-dial resets as the probe's dial did; how many is spin's to count (spin-stack/spin#1661). *Status:* levers 1 and 2 rejected. Archived as tags `archive/exp-592-l1-queue-select`, `archive/exp-592-l2-msix-once` and `archive/exp-batch2-bound`. - -**11-23 · machine · what SetMemory down and one vCPU cost (labs 45113957566, 45117940800, #549, this change).** `boot:actuators` boots spin's shape to systemd at 2048 MiB and times each actuator until the guest shows it, 10 times each. Its first reading counted the 128 MiB memory blocks online, and 19 of 20 unplugs to 1024 MiB stood at 1536 MiB for the whole 2 minutes. virtio-mem's own log said QEMU had all 1024 MiB back. The driver takes back its smaller blocks from inside a memory block, and the block stays online until all of it is gone. So the check now reads MemTotal. *Bench, spin's shape:* SetMemory 2048 → 1024 MiB 21.2 ms idle and 53.7 with 1180 MiB of page cache; back up 9.1; a vCPU added 13.2 and removed 14.8. docs/machine.md's actuators table has them. *Status:* in place. - -**11-23 · image · tzdata, e2fsprogs and fuse3 are installed (#512, labs 45112622373, 45112622091, 45112622071, 45113946185, image jobs on #616 and #625, this change).** *Decided* (the owner, #512, option b): the three a workspace cannot work around from inside, a zone loaded by name, a disk attached to a running workspace formatted and checked, and FUSE, which the kernel has. python3, lsb-release and the smaller tools stay out. *Changed:* `image/mkosi.conf` names them; `deviations.py` counts `/etc/localtime`, tzdata's postinst link to `Etc/UTC`, as a file a maintainer script writes on every Ubuntu, so the inventory is unchanged at 118 lines. `boot:workspace` loads `Europe/Madrid` by name, asserts the default zone is still UTC, finds `fusermount3` and `/dev/fuse`, and formats, mounts, writes and fscks an empty disk the host attaches while the guest runs; all pass with the packages in an overlay of v20261123.04 (lab 45112622373). *Measured* (bench, nested, spin's shape and login, the packages installed into the release's overlay by its own apt, branch `exp-512`, tagged `archive/exp-512`): first login −2.9 [−9.7, +3.6], sshd accepting −3.4 [−8.6, +4.0], 20 a side (lab 45112622091). Restored, 20 a side: evicted −0.3 [−1.8, +1.1], cached +1.8 [+0.3, +2.9], all of it in `running`, before any guest code (lab 45112622071); at 60 a side evicted −0.9 [−3.9, +2.0], cached +0.3 [−10.4, +12.5], within noise (lab 45113946185). The boot finishes +9.8 ms later and the state is +0.8 MiB, from `e2scrub_reap.service` in `multi-user.target` after the login; the console prompt +8.5. None is a goal number. *Size:* 217 → 224 packages, the tree +5.1 MiB (987408 → 992672 KiB), the qcow2 1013587968 → 1019158528 bytes (+5.3 MiB). *Status:* in place. - -**11-23 · kernel · vmlinux BTF is parsed when a program first needs it, not before the login (#460, parts runs 45112032746, 45116894547, labs 45113437048, 45114405201, 45115330128, 45115341056, 45118194310, this change).** *Why:* 0012, parsing vmlinux BTF on first use instead of at the first kfunc registration (11-22, archived as `archive/exp-btf-first-use`), took 7 ms out of the kernel and put it into journald's start, because `bpf_check()` asked for the BTF for every program, journald's cgroup device and skb programs (`DeviceAllow=`, `IPAddressDeny=`) among them. *Changed:* 0012 as measured, and 0013, which has the verifier ask for the BTF only where a kernel type first enters a program: a program with its own BTF or a BTF-typed attach point, the first kfunc call, a vmlinux BTF id in ld_imm64, a map pointer access, a helper argument or return typed by vmlinux BTF, `bpf_find_vma()`'s callback, and `bpf_snprintf_btf()` / `bpf_seq_printf_btf()`. Prior art: Jay Wang's bpf-next series of 2026-09-23 (LWN 1096093, not merged) chose the same points; the eager fetch came with 8580ac9404f6 (2019). *Reviewed* (an independent read of both patches, every `btf_vmlinux` reader in kernel/bpf): two bugs found and fixed before the patch was carried. The printf-BTF helpers read the BTF as the program runs, in atomic or NMI context, and with no trigger at load they could have started the parse there; they now ask for it at load. A parse that failed for memory in whichever task asked first (an unprivileged bpffs mount's `delegate_*` options can choose that task) latched the error for the whole boot; it is now tried again by the next user, and only a malformed BTF is final. vmlinux BTF now has no object id until it is parsed. *Measured* (bench, nested, spin's shape and login, against v20261123.04): no exit moves (3 a side, lab 45113437048). The first login −10.0 [−12.7, −3.3] at 60 a side and −6.3 [−9.1, −4.6] at 120 before the fixes; the kernel carried −6.4 [−9.4, −1.0] at 60, sshd accepting −6.7 [−9.5, −2.2]. Restored −1.0 [−6.0, +4.2] evicted and +1.7 [−9.1, +10.2] cached, 30 a side, the state 1.3 MiB smaller (the BTF is not in it). The build asserts both (kernel/README.md). *Status:* in place; reaches the goal number with the next release. - -**11-23 · image · the update stamps written at build, the five units of `ConditionNeedsUpdate` unmasked (#513, labs 45120950183, 45120950314, 45120950141, this change).** The image had no `/etc/.updated` or `/var/.updated`, so `ldconfig`, `systemd-sysusers`, `systemd-hwdb-update`, `systemd-journal-catalog-update` and `systemd-update-done` were masked: without the stamps they rebuild the caches in every boot (+260 ms, laptop, 11-21). *Changed:* `image/build.sh` writes both stamps last, with `/usr`'s mtime and `TIMESTAMP_NSEC=`, as `systemd-update-done` does, and fails an image whose stamps' mtime is not `/usr`'s; the five masks are gone from optimize-systemd.sh; `boot:workspace` asserts each unit checked its condition and skipped. `/usr`'s mtime in the release is 0 (`SOURCE_DATE_EPOCH`), which first failed the arm's setup through `expr`'s exit status on a result of 0. *Measured* (bench, nested, spin's shape and login, against v20261123.04 with the stamps and the unmasks in its overlay, branch `exp-batch3`): first login −0.3 [−6.8, +4.5], sshd accepting −1.3 [−7.7, +1.1], 20 a side (lab 45120950183); restored +0.2 [−2.1, +0.9] evicted, −1.3 [−4.5, −0.4] cached, cold login +1.2 [−2.6, +7.3] (lab 45120950314); `boot:workspace` on the overlay: the five units' conditions false and no unit failed (lab 45120950141, whose other failures are #509's and #512's checks, which v20261123.04 predates). The overlay measures the stamps and unmasks as files of the overlay, not of the base, which only changes where their few blocks are read from. *Status:* in place, a functional change: a `/usr` change made later is applied at the next boot. - -**11-23 · image · the pressure sender started by the boot's rest, its timer deleted (#401, labs 45120950183, 45120950314, 45120692382, 45120950141, this change).** The sender waited for a timer 10 s after the boot because, ordered after `multi-user.target` alone, it started beside the first login and cost it 2.6-3.3 ms (11-21). Since #581, `multi-user.target` is started by `spin-machine-boot-rest.service` once the first login's units are up, the first of #401's arms. *Changed:* `spin-machine-pressure.service` is `WantedBy=multi-user.target`, enabled by optimize-systemd.sh; `spin-machine-pressure.timer` is deleted; build.sh checks the want and refuses the timer; the lab's `pressure` edit makes the same want; `boot:workspace` asserts the sender runs. *Measured* (bench, nested, spin's shape and login, against v20261123.04 with the change in its overlay, branch `exp-batch3`): first login −0.8 [−7.8, +4.8], sshd accepting −0.2 [−9.1, +3.6], 20 a side (lab 45120950183); restored −0.8 [−2.9, +2.1] evicted, −0.4 [−3.6, +0.8] cached, the state +2.1 MiB because the sender is running at the save (lab 45120950314). In 5 ledgers it started at 0.37-0.38 s on the kernel's clock, after the login's end at ~0.29 s (lab 45120692382); in `boot:workspace` on two vCPUs at 0.29 s (lab 45120950141). *Status:* in place. A guest's first ~0.4 s go unreported, not its first 10 s. - -**11-23 · machine · `Unshared` refuses a pool whose CPUs differ in what taking features away leaves as it is (#587, this change).** *Why:* `Unshared` compared only the vendor and the model, so a pool whose hosts differ in stepping or physical address bits got a `CPUWithout` as if it made them share one CPU, and every cross-host resume was then refused by `CanResume`. *Read* (QEMU 11.2.0-rc0's `target/i386/cpu.c`, `host-cpu.c`, `kvm/kvm-cpu.c`, 2026-11-23): under `host`, `family`, `model`, `stepping` and `model-id` are the host's (`host_cpu_instance_init`), `phys-bits` and `guest-phys-bits` the host's and KVM's whenever `lm` is on, `pmu` is set by `kvm_cpu_max_instance_init`, and the cache switches by the machine type and `-cpu`. No feature taken away moves any of them. `level` and `xlevel` can move: `kvm_cpu_max_instance_init` starts the minimum leaves at KVM's, and `x86_cpu_expand_features` raises them for each feature word that is on (AVX10 to 0x24, APX to 0x29, SVM to 0x8000000A). Two hosts' levels can then agree or differ either way once `CPUWithout` is applied, and the record does not hold KVM's own leaf to say which. *Changed:* `Unshared` refuses, naming each, a pool whose hosts differ in any property but `level` and `xlevel`, and leaves those two to the records of the machines started with `CPUWithout`. *Status:* in place; spin-stack/spin#1417 told. - -**11-23 · machine · a state of another length than its checkpoint wrote is refused before QEMU reads it (#546, CI run 45111149822, this change).** *Why:* a failed load says only that it failed. QEMU 11.2.0-rc0 ends every failure at `process_incoming_migration_co`'s `fail:` label, and `qemu_fill_buffer` reports a file that ends early and a host's failed read both as `-EIO` (read 2026-11-22). So spin kept a truncated state's memory and retried it forever. *Changed:* `Checkpoint` records the state file's length in `Saved.Length`. `Resume` fstats the file it is handed after `CanResume` and returns a `*Refusal` (part `state length`) before QEMU is asked anything. It costs one `fstat`. It does not catch bytes changed in place, which stay a plain error. `boot:record`'s "a truncated state" now wants that refusal and the state never read. *Compatibility:* the field is new and optional. A `Saved` without it, every checkpoint a released spin-machine wrote, resumes without the check, and the machine's record (`Saved.From`) does not move. In CI run 45111149822, `boot:record` refused a real state cut to half its length, `state length: checkpoint 8597660207, here 4298830103 (same)`, with the state never read. `boot:compat` resumed v20261123.04 and refused v20261123.03 first, by `cpu x-legacy-cpuid2-cache` as before (#586), so this change refuses no release main did not. *Status:* in place. - -**11-23 · lab · a workspace's memory at boot beats the same memory plugged during it (#561, labs 45110554589, 45111507862, 45110570912, 45110562994, 45110580480, spin-stack/spin#1660, this change).** spin boots 128 MiB and plugs 2048 through virtio-mem right after the start. #561's lead (−15 nested, −8 metal) came from separate runs, so a tree now takes probe options of its own (`--opt` in a tree spec), and the two shapes ran as two trees of one interleaved run: `plug` (the release, `memory=128 plugged=2048`) and `start` (`memory=2048 plugged=0`), v20261123.04, 1 of 16 vCPUs, ceilings kept, spin's login. *Cold first login:* nested −2.5 [−7.3, +2.0] at 40 a side (lab 45110554589), within noise, then −5.5 [−10.9, −0.7] at 80 a side (lab 45111507862); metal −7.0 [−11.4, −3.4] at 40 (lab 45110570912). sshd accepting −8.3 nested and −7.6 metal, accept to login and the second login unmoved. *Restore* (nested, 20 a side, lab 45110562994): the state −17.6 MiB [−17.8, −17.3], `running` −2.4 [−3.5, −0.8], the restored login −2.5 [−3.7, −1.0] evicted and −2.2 cached. QEMU's RSS at the cold login −26 MiB. *Where it goes* (ledger, traceable kernel, 3 boots each, lab 45110580480): plugged, `kworker/0:1` runs ~7.8-8.0 ms of the vCPU in the kernel's window before PID 1, inferred to be the onlining of the plugged blocks; at boot it runs 0.3 ms, the kernel's own setup (`swapper/0`) takes ~4.5 ms more for the larger memory map, and PID 1 comes 3.4 [−5.9, −2.1] ms sooner. The rest of the cold gain is after PID 1 and the ledger does not pin it at 3 boots. *Decided:* a gain on both goal numbers, and the boot shape is spin's: spin-stack/spin#1660 proposes `canonicalMemory` at the workspace's least, 2048 MiB, with virtio-mem kept for growth to 8 GiB (invariant 3). Base RAM is in the machine's record, so checkpoints from before the change boot cold once. The probes keep spin's shape until spin changes it. *Status:* the tree option is in place; #561 closes here and the decision is spin's. - -**11-23 · lab · where a cold boot's EPT violations land (#568, lab 45111606645, this change).** #565 counted 172 EPT violations in a cold boot at ~115 µs each nested and asked whether prefaulting the base memory in a QEMU started ahead would take them off the path. `exits` now keeps a histogram of `kvm_page_fault` by guest-physical address in 128 MiB buckets. *Found* (bench, nested, spin's shape and login, v20261123.04, 3 boots, the same in each): 171 violations, 18.9 ms of the L1's time. 52 in the base (0-128 MiB) and 6 in the bucket above it, 48-51 in the memory virtio-mem plugs (QEMU puts its device memory at 4 GiB when there is no RAM above 4 GiB), 39 in the PCIe ECAM at 0xB0000000, 9 in 0xF8000000-0xFFFFFFFF (IOAPIC, local APIC, flash) and 17 in the 64-bit BARs at 12 GiB. The MMIO ones are inferred from the addresses: KVM's first fault on an MMIO page installs the misconfigured entry that every later access exits through. *Decided:* closed as off the goal's clock. Prefaulting the base could win only the base's ~58 faults, ~6 ms at most, and only in `prestart`, because `ssh-first` starts before QEMU's exec and a prefault there is on its path. The plugged faults cannot be prefaulted without zeroing all that is plugged. With the memory at boot (#561) they become base faults, and the split is the same question. *Status:* the histogram is kept in `exits`. - -**11-23 · lab · a guest that drops its page cache before its save does not make a smaller state (#276, lab 45110967817, branch archived as `archive/drop-caches-276`).** #276's last idea: most of a restored state might be the guest's clean page cache, so a guest asked to drop it right before spin's save would leave less for the restore to load. *Measured* with a `restore-first` option on the experiment's branch, a tree each: `drop=0` ran `sync; echo 1 > /proc/sys/vm/drop_caches` as root after the boot had finished and saved at once, `drop=3` waited 3 s first, which leaves free page reporting its 2 s delay (bench, nested, spin's shape and login, v20261123.04, 20 a side). The state read 183 MiB on all three trees: −0.1 [−0.4, +0.3] at once, −0.0 [−0.3, +0.4] after 3 s. `running` did not move, −0.9 [−2.0, +0.9]. The restored login was worse, +4.7 [+3.5, +7.3] evicted at once, +5.6 [+4.6, +7.6] after 3 s, +6.5 and +6.4 cached. *The instrument saw the drop:* the restored login is the side that moved, as a guest whose cache was emptied must read the login's files from its disk again (inferred: the probe does not read the guest's cache). *Why the state does not shrink* (inferred, not measured): a save writes every page that is not zeros, and a freed page keeps its bytes until something gives it back to the host. Free page reporting gives back only free blocks of `page_reporting_order` (2 MiB here), and a page cache freed 4 KiB at a time beside the boot's live pages leaves few whole ones, even after 3 s. Waiting 3 s with no drop had moved nothing either (docs/measuring.md, "When a checkpoint is taken"). *Decided:* rejected, with its row in docs/boot-time.md. Nothing is asked of spin before a checkpoint. #276's three ideas are answered, and the restore stands at 78-80 ms, under the goal. - -**11-23 · lab · a guest's synced writes on a saturated host disk do not stall QMP on the bench (#391, labs 45111443524, 45112573850, probe archived as `archive/qmp-stall-391`).** On a laptop with a 97% full disk, query-status reached 175-950 ms beside small synced writes, and #402 did not reproduce that case. A `stall` probe on the experiment's branch booted spin's shape, logged in, started a row's load, and timed 200 query-status round trips 100 ms apart, sampling QEMU's main thread and its monitor's I/O thread (`stat` and `wchan`) every 0.5 ms across each, with both kernel stacks taken past 20 ms. The rows: the guest's 4 KiB `dd oflag=dsync` writes (fio's `--bs=4k --fsync=1`; the image has no fio); four host streams of 1 MiB O_DIRECT writes on the scratch NVMe the overlay is on; both; and the guest's writes beside four buffered host streams flushed each GiB, so that dirty-page throttling and writeback are in play. *Measured* (bench, nested, spin's shape and login, v20261123.04, 3 boots a row, two runs): the slowest round trip of all 2,400 was 1.2 ms, and none passed 20 ms. p50 0.24-0.37 ms with the guest writing alone, 0.41-0.56 with the host disk busy. *The load was real:* the disk read 99-100% busy from its io_ticks in every busy row, and the guest's writes fell from 113,700-118,400 a row to 2,700-3,100 beside O_DIRECT and 1,500-2,100 beside buffered writes. QEMU's disks are `aio=io_uring` on the main loop's ring, so a slow write waits in the kernel and not in the main thread. *Decided:* the case does not stall QMP on the host kind the goal is measured on, so no `iothread=` arm was measured and the probe was removed with its question. The laptop's stalls stand as #402 explained them: the main thread blocked in the host, in cgroup reclaim at `memory.high`, waiting for the mmap lock under reclaim, or with QEMU's cgroup throttled by `cpu.max`. - -**11-23 · lab · density on metal, and a CPU-bound crowd on the bench (#563 section 2, labs 45110655407, 45110663095, 45110670764, 45110678888, 45110688511, this change).** #273 measured an idle crowd on the bench up to 16. #563 asks what a metal host carries, for spin's metal-or-nested cost model, and needs no new code: `density` as it stands, spin's shape and login, v20261123.04. *Bench, nested, 16 CPUs, `load=cpu`, 10 a row:* the first login read 387/417 empty, 378/431 beside 4 busy workspaces, 441/450 beside 8, 1015/1215 beside 16, 941/1196 beside 24. *Metal, c8i.metal-48xl, 192 CPUs:* `load=cpu`, 337/447 empty, 331/488 at 16, 335/344 at 32, 336/341 at 48 (10 a row), and in a second run 342/363 empty, 327/366 at 64, 466/486 at 96 (8 a row; a crowd of 96 took 83 s to boot, past what 10 rows fit in bench-metal's 60 minutes). `load=idle`: 345/368, 336/343, 329/341, 334/352 at 0-48, and 342/356, 328/350, 331/340 at 0, 64 and 96. *Read* by #563's line, a p95 within 25% of the empty host's in the same run: nested, up to 8 busy workspaces of 16 CPUs; metal, up to 64 busy of 192, not 96, and every idle crowd measured. The rows of one host are two runs, so a row compares only with the empty row of its own run. The empty metal row's 447 p95 in the first run is one slow boot of ten. *Not measured:* busy crowds between 64 and 96, and workspaces of more than one vCPU. *Status:* rows in docs/boot-time.md ("The bench fleet is nested, not metal"). Section 1 of #563 (the I/O tax) needs new probes and equal storage on both hosts, and stays open in #563. - -**11-23 · systemd · the executors' sandbox, a bound: −14 ms (#574 experiment 4, labs 45120692382, 45121038332, #637, #638, this change).** Read first, a release ledger (v20261123.04, spin's shape and login, 5 boots): before the first login the executors spend journald 6.0 ms, logind 10.3 and `user@0` 2.8, p50, beside the units' own binaries. *The bound:* one drop-in each for journald, logind and `user@` emptying `SystemCallFilter=`, `SystemCallArchitectures=`, `SystemCallErrorNumber=`, `RestrictAddressFamilies=`, `RestrictNamespaces=`, `RestrictRealtime=`, `RestrictSUIDSGID=`, `MemoryDenyWriteExecute=`, `LockPersonality=` and every `Protect*=`; `PrivateTmp=`, `IPAddressDeny=` and `DeviceAllow=` kept. udevd was left out: it starts after the first login since #581. *Measured* (bench, nested, 60 a side, branch `exp-batch3`): first login 374 → 360, −14.1 [−18.5, −11.5]; sshd accepting −13.2 [−16.0, −10.9]; accept to login −2.1 [−3.1, −0.1]. *Status:* a bound, not carried. #637 splits it into the seccomp and namespace halves and proposes one seccomp filter per unit in systemd. #574 closed with its five experiments: #579 in (−6.5), #580 rejected, #581 in (−21.5), #460 in (the kernel's), this bound to #637. The runner-up, the dynamic linker's share, is #638. - -**11-23 · image · the volatile journal holds 8 MB, not 4 (#514, labs 45121159504, 45121159741, 45121159883, 45120692139, this change).** *Found:* `/run` is a tmpfs of 20% of the RAM at its mount, and the guest mounts it at 128 MiB, before spin sizes it to 2 GiB: 19 MiB in spin's shape, whatever the guest grows to. Ubuntu's default cap, 10% of `/run`, would be ~2 MB there. *Measured* (bench, nested, spin's shape: 1 vCPU, 128 MiB sized to 2048 right after the start, a guest running `docker build --no-cache` of 20 `RUN` steps for 10 minutes, branch `exp-batch3`'s `boot:exp-journal`): the journal grows ~0.4 MB a minute, mostly systemd's and dockerd's lines for each build step. At 4 MB the oldest entry was the kernel's first line for 8 minutes, then the boot's first 90 s were gone by the end (lab 45121159741). At 8 MB the whole journal was kept, 3.6 MB used (lab 45121159883). A first try at 16 MB was left: it is 84% of `/run`, near journald's 15% keep-free. The first login, 8 MB against 4 MB in v20261123.04's overlay: −2.2 [−12.1, +6.4], 20 a side (lab 45121159504), and 16 MB −0.2 [−5.6, +9.1] (lab 45120950183). *Status:* in place; a busy workspace keeps ~15-20 minutes. - -**11-23 · image · the dynamic linker's share of PID 1, journald, logind and `user@0` is ~1 ms (labs 45180400607, 45180856158, #638, this change).** #574's runner-up: the four map and relocate `libsystemd-shared` (PID 1 and `user@0` also `libsystemd-core`), and nobody had measured ld.so's share before porting to v262's multicall build (#42304) or a static one (#42820). *Instrument* (branch `exp-ldso`, tagged `archive/exp-ldso`, its `ldso` edit): `LD_DEBUG=statistics` for PID 1 from spin's handoff, which execs it (`systemd.setenv=` does not reach PID 1), and for journald, logind and `user@0` from a drop-in each. PID 1 and journald report on `/dev/kmsg` with `printk.devkmsg=on`, logind and `user@0` on their stderr, the journal: the first run had logind's on `/dev/kmsg` too, its `DevicePolicy=` refused the executor the open, and logind failed at STDERR (lab 45180400607, discarded). glibc 2.43 counts in TSC cycles, 2700 MHz in every boot. *Measured* (bench, nested, spin's shape and login, v20261123.05 on its traceable kernel, the ledger with and without the edit, 8 a side, lab 45180856158), ld.so's total start-up, p50 [range]: PID 1 0.48 [0.46, 0.56] ms, of it loading objects 0.32 and relocation 0.08; journald 0.20 [0.14, 0.31]; logind 0.20 [0.11, 0.31]; `user@0` 0.21 [0.15, 0.36]. Relocations: PID 1 and `user@0` 2,522 symbol (911 from cache) and 16,589 relative; journald 1,157 and 10,518; logind 1,238 and 11,297. Objects at start, from the release's image (`ldd`): 7 for PID 1 and `user@0` (the binary, libsystemd-core, libsystemd-shared, libc, libm, libcrypt, ld.so), 6 for journald and logind, all `BIND_NOW`. The four come to ~1.1 ms, under #638's ~5 ms, so no build was made. *The instrument:* against the ledger alone in the same run, first login +3.4 [−23.0, +11.9], PID 1's CPU −1.1 [−5.1, +0.6], unattributed +0.3 [−0.1, +1.1]; each ld.so total is well inside the trace's wall time from the process's exec to its first sleep. It does not see the kernel's execve before ld.so runs, nor the libraries' pages faulted in later by `main`, which a static build would partly pay too (not measured). `user@0`'s environment generator inherits the variable and reports 0.13 ms more. *Inferred:* the multicall build would not reach even that: it keeps libsystemd-core and libsystemd-shared dynamic, leaves journald and logind alone and makes the executor, static here, dynamic. *Status:* measured and rejected; #638 closed. - -**11-23 · qemu · a bzImage mapped, not read into QEMU's heap (#646, labs 45182382388, 45182382864, 45183618987, this change).** `x86_load_linux` read the whole 16.7 MB bzImage into a buffer that only fw_cfg reads, 6.2-6.9 ms of QEMU's init traced (labs 45177818419, 45177817516, #611), and qboot copies the same bytes again by fw_cfg DMA. `qemu/patches/0007` maps the file read-only (`g_mapped_file_new_from_fd`), as upstream has mapped the initrd since 4.2; a kernel with a dtb appended keeps its buffer. The setup header QEMU patches is already a copy of its own, so nothing writes to the mapping. The QEMU build asserts that a held TCG machine's maps name a stub bzImage given to it; the published QEMU fails that check. *Prior art* is in docs/boot-time.md's row: Garzarella's 2019 series mapped the ELF kernel and the initrd but not the bzImage. *Measured* (bench, nested, spin's shape and login, v20261123.05 against the same release with the patched QEMU, parts run 45180746171, 40 a side, interleaved): first login 380 → 367, −13.4 [−16.9, −7.3], sshd accepting −13.3 [−18.7, −7.5], the console prompt −10.6 [−14.2, −6.3]; QEMU's anonymous RSS −15.9 MiB and its file RSS +16.1, total unmoved (lab 45182382388). Restored, 40 a side: login −9.3 [−11.2, −6.1] evicted and −7.7 [−8.9, −5.1] cached, `running` −8.8 and −7.9, the state unmoved (lab 45182382864): a restore starts QEMU, which loads the kernel into fw_cfg there too. The gain is twice the traced read; what else the anonymous buffer cost nested (its page faults, presumably) was not measured. *A lead, not a decision:* an uncompressed payload (#326's kernel patch, renumbered, branch `exp/646-uncompressed`, parts run 45180892535) against LZ4, both on the patched QEMU: first login −4.0 [−7.9, +0.3], within noise at 40, QEMU's RSS +32 MiB (lab 45183618987). The mapping removes the "+6-7 in QEMU's start" half of #326's rejection; whether the rest is a gain needs more boots, which is #645's. *Status:* in place; the record does not move, as the kernel reaches the guest through fw_cfg. - -**11-23 · systemd · the executors' sandbox costs its system call allow-list, not its number of filters (labs 45228294512, 45229454155, 45231419187, 45235103665, 45235485857, 45238003981, 45239372741, #637, #673, #686, this change).** #637 split #574's bound and asked for one seccomp filter per unit. *The split* (bench, nested, spin's shape and login, v20261123.06, 60 a side, branch `exp/637-split`, tag `archive/exp-637`): the seccomp settings emptied in journald, logind and `user@` read first login −12.0 [−21.8, −2.1], sshd accepting −13.8 [−19.4, −4.9]; the namespace ones (`ProtectSystem=`, `ProtectHome=`, `ProtectControlGroups=`, `ProtectKernelTunables=`, `ProtectProc=`) +0.3 [−9.4, +7.2] (lab 45228294512). *Fewer filters:* the executor applies `SystemCallArchitectures=` after seven other settings, so each of those loads a filter for i386 and x32 too, which the architecture filter then kills; the kernel has neither ABI. Applied first, journald carries 8 filters, not 17, and logind 13, not 26. `boot:seccomp` (on the tag) runs a probe as each unit's `ExecStartPost=`, with the unit's sandbox, over 3435 calls: every native number with zero arguments and no capabilities, each x32 number, and the calls the settings decide by argument; the table was the release's (labs 45235103665, 45235485857). First login −0.4 [−6.1, +2.7] against systemd rebuilt with a comment only (lab 45231419187). *Where it goes:* an instrument patch timing the executor's steps (thread CPU, one boot, 2 vCPUs): journald's executor 6.7-7.2 ms, `SystemCallFilter=@system-service` 3.7-4.0 of it, its `seccomp_load()` 1.1-1.2; the other seccomp settings ~0.6 together (labs 45238003981, 45239372741). So one filter per unit would reach about the 0.6 ms (inferred). *Found on the way:* the lab's packages edit gave `/usr` the package's mtime, newer than the image's update stamps (#513), so every `--systemd` tree ran ldconfig, sysusers, the hwdb and the catalog before the login: both arms ~658 ms (lab 45229454155); fixed in #673. *Status:* rejected, #637 closed; building the allow-list once is #686. - -**11-23 · machine, qemu · QEMU's start and the held start's QMP, split and rejected (#647, #649, labs 45177818419, 45230790902, 45231358105, #669, this change).** #611's split left two cold phases without an owner. *#649, the held start's 14 commands, 6.1 ms on bench:* QEMU waited 4.5 ms p50 for the client, 0.9 of it busy with the probe's plug monitor (the memory spin sizes right after the start), so spin-machine's own share is ~3.6 ms, ~0.28 ms a round trip (24 boots, lab 45177818419). The candidate sent the bind ahead of its answers (`qmp.Send`): the run state with the places, every serial at once, each image's two nodes together, the reopen with the placeholder's delete, 13 round trips to 9; add-fd still holds the connection until its answer and `cont` waits for the bind. *Measured* (bench, nested, spin's shape and login, v20261123.06's parts, spin-machine main at f273377 against the candidate at c966407, 60 a side): first login −1.7 [−5.6, +2.6], sshd accepting −2.4 [−5.5, +2.8] (lab 45230790902); restored login −0.3 [−3.8, +3.7] evicted, +0.9 [−10.6, +7.5] cached (lab 45231358105). Rejected: the four round trips it removes are ~1.1 ms (inferred), and even all of spin-machine's 3.6 ms is under what 60 boots a side resolve. The code is on `archive/exp-649-held-start`. *#647, QEMU's exec to its first trace event, 9.7 ms on bench:* the release's QEMU is static-pie on musl, so there is no dynamic loader and `LD_DEBUG` has nothing to report; musl relocates its 59,700 relative relocations itself. The split, on the laptop as a lead (exec to the first `flatview_new`, 40 starts a row, 4.7-5.4 ms p50): a trivial static-pie binary 0.23, QEMU's `-version` 2.0, `-sandbox` −0.7 to −0.9, the rest option parsing, trace and main-loop start and the machine object. perf on an unstripped build of the same Dockerfile: relocation 7% of `-version`, page faults ~15%, nothing else over 2%. No candidate's ceiling is over ~2 ms on bench (inferred at ~2× the laptop): a seccomp filter compiled at build time (Firecracker's seccompiler), a non-PIE binary (which gives up ASLR), DT_RELR. None was built. The allocator, musl's mallocng, is ~2.3 of the 17 ms of CPU QEMU's main thread spends from exec to held, a lead across QEMU's whole start, opened as #669. *Status:* rejected, both. - -**11-23 · kernel, qemu, machine · the kernel entered as its vmlinux through PVH, moving itself to a random base (#645, parts runs 45192017068, 45216245888, labs 45213668842, 45213683698, 45219768990, 45219785493, 45219801969, 45221660056, 45225297602, parts run 45222305257, #660, this change).** *Why:* a bzImage's decompressor spent ~21 ms (bench) on a copy, LZ4 and parse_elf before the kernel's clock, and it was the only thing that randomized the kernel; PVH skipped it and left the kernel at its linked address (11-19). *The bound first*, a vmlinux through PVH with no KASLR at all, against the same build as a bzImage: first login −18.9 [−22.8, −12.4], restored −3.6 [−5.1, −2.1] evicted, at 40 a side. *Two paths with KASLR kept:* QEMU applying the relocations (Holmes et al., EuroSys '22; Firecracker's design) or the kernel applying its own (Hou Wenlong's RFC, 2026-01-26). The kernel's own was chosen: no relocation format for QEMU to parse, nothing on QEMU's command line, the decompressor's entropy code (#645, issuecomment-7106937337). *Carried:* the RFC as kernel 0014-0018, made checkpatch --strict clean with each change noted in its header; 0019, which sets `KASLR_FLAG` once the kernel moved (without it `RANDOMIZE_MEMORY` left the regions where they were: the lowest vmalloc address ffffc90000000000 and the direct map ffff888000000000 at every one of 10 boots, lab 45225297602; with it, 10 distinct bases of each, lab 45221660056); 0020, because the RFC reads RDRAND from CPUID leaf 1's EDX and the TSC from its ECX, the wrong way round, so its virtual base was drawn from the i8254 and a hash of `boot_params` alone, on a guest that has `rdrand` and `tsc` and no `ds_cpl` (lab 45225297602); QEMU 0008, a random physical base from `XEN_ELFNOTE_PHYS32_RELOC`. The relocation table needs 0xc7000 bytes of the 1 MiB reserved: a 512 KiB reserve failed the link naming that size (parts run 45222305257). The machine boots a release's vmlinux when it carries both Xen notes and its bzImage otherwise, so a release from v20261119.02 to v20261123.06 boots as it did. *Measured* (bench, spin's shape and login, against v20261123.06, 60 a side, the kernel without 0020): first login 368 → 352, −16.8 [−20.9, −13.0], sshd accepting −16.7 [−20.2, −12.7], QEMU's RSS −13.8 MiB (lab 45219785493); restored −4.4 [−17.5, −2.0] evicted, −4.3 [−14.0, +10.2] cached, the state −31.9 MiB, the save −14.6 (lab 45219801969). *Status:* kept. What the bzImage, `KERNEL_LZ4` and QEMU 0007 still serve is #660. - -**11-23 · release · v20261123.07 holds #645's cold gain; its record's 20 a side did not see it (labs 45252584128, 45219785493, release run 45241645340, #694).** *Why:* the record read the cold first login at −3.5 [−12.9, +2.9], within noise, against #645's −16.8 [−20.9, −13.0], and spin was about to be told what the bump gains. *Ruled out* (read from the artefacts): the lab arm and the release boot the same machine. QEMU (`f271a946…`), qboot, `pvh.bin` and `linuxboot_dma.bin` are byte-identical, `spin-machine args` prints one command line but for paths, and both vmlinux files are stripped, 40,165,128 bytes, with the same two LOAD segments and the same config; the release's adds 0020. QEMU's RSS moves the same in both (anonymous −34.0 MiB, file +19.9/+20.1). *Measured* (bench, nested, spin's shape and login, both releases as published, each with its own spin-machine, 60 a side, interleaved): first login 378 → 359, −18.6 [−23.6, −14.0], sshd accepting −15.3 [−21.2, −12.6], the console prompt −18.7 [−24.0, −12.8] (lab 45252584128). The record's run disagreed with itself: its `restore-first` cold boot, the same boot at 40 a side, read −14.2 [−19.9, −8.6]; its 20 `.07` boots sat at a p50 of 370 where the lab's sit at 352-359, and 20 a side drawn from lab 45219785493's samples reach −3.5 in 5 of 100,000 draws. *Status:* the gain stands at ~−17 to −19 ms cold. How many boots the record takes is #694. - -**11-23 · lab · the ledger's kernel_zero on the kernel's sched clock (#644, labs 45229897350, 45230233764, this change).** The ledger's `kernel_zero` landed 19.5 ms (bench) and 12.6 ms (metal) after a port write at the sched clock's 0 (#611). *Found:* the ledger took CLOCK_MONOTONIC's 0, the trace's clock, for the kernel's. CLOCK_MONOTONIC runs on jiffies from timekeeping_init until the switch to kvm-clock and loses the ticks it misses. The kernel prints both clocks at one tick at late_initcall ("sched_clock: Marking stable"), and their difference was the whole error in all 24 boots of labs 45177818419 and 45177817516, to within 0.15 ms. *Changed:* the ledger moves the trace and the journal forward by that lag (`monotonic_lag`, 18-25 ms nested, 11-14 metal) and refuses a journal without the line. *Checked:* with the marker kernel, `kernel_zero` lands 0.03 to 0.14 ms before QEMU's trace stamps the marker, 10 boots on bench and 10 on metal (spin's shape, v20261123.04). *What moved*, recomputed from the runs' kept journals: docs/measuring.md's split of lab 45110630795, `kernel_zero` 97-114 → 77-95 and `qemu_start` 49.4 → 29.3 (`before_qemu` and `guest_to_zero` do not move); QEMU's exec to the kernel's clock untraced on the workspace's machine is 73.4 ms on bench and 68.7 on metal (labs 45177818419, 45177817516), against firmware-stages' 73.7; PID 1 in #561's ledgers −3.4 → −4.0 ms; the pressure sender's start 0.37-0.38 → 0.39-0.40 s (docs/image.md). #611's comment is corrected. No cold-budget row used the ledger's anchor. Two of its rows use clocks with errors of their own, now noted beside them: firmware-stages' anchor is ~2.8 ms late on bench (#665), and dmesg's clock reads the kernel 13-15 ms short from late_initcall on (#666). *Status:* in place. - -**11-23 · qemu · the vmlinux copied into guest RAM beside QEMU's main loop (#698, labs 45257214350, 45260098299, 45260694485, parts run 45257975711, this change).** *Why:* since #645 QEMU loads the vmlinux through `load_elf`. #698 asked whether it read the 40 MB file into ROM blobs at start, as `x86_load_linux` read a bzImage before 0007. It does not: `load_elf` has mapped the file since QEMU 4.2 (816b9fe450, Garzarella, 2019), and the blobs point into the mapping. What it does is copy the 37.4 MB of segments into guest RAM at the machine's first reset, on the main thread, before the main loop answers the monitor. *The phase,* a probe that traces QEMU's reset (`romcopy`, branch `exp/698-romcopy`, never merged): 9.1 ms p50, p95 9.3, 20 boots, bench, spin's shape (lab 45257214350); the ledger read the vmlinux's QEMU start +8.4 against a bzImage's (lab 45260129735, #697). On a laptop half the copy is faulting in the destination's huge pages and half the copy, and a `pread` into guest RAM was no faster than the mapping's `memcpy`, so no cheaper copy was built. *Carried:* QEMU 0009 copies the segments 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; a machine made for an incoming migration copies nothing at reset, as before. *Measured* (bench, spin's shape and login, v20261123.07 against the same release with 0009's QEMU, interleaved): first login 351 → 342, −8.6 [−11.0, −4.0], sshd accepting −9.1 [−12.4, −5.9], the console prompt −7.7 [−11.4, −5.5], QEMU's RSS unmoved, 60 a side (lab 45260098299); restored −0.1 [−1.1, +0.7] evicted, −0.3 [−2.1, +0.9] cached, the state unmoved, the same run's cold login −6.9 [−12.9, −0.8], 40 a side (lab 45260694485). The gain is the whole traced copy. The record does not move: the patch adds no device, property or RAM block, and `boot:record` passed on the patched tree (lab 45261567066). A stub ELF whose notes have `p_align` 0 kills QEMU 11.2 with SIGFPE in `load_elf`, found while writing the build check (#705, not affected). *Status:* kept. - -**11-23 · qemu · QEMU 0007 deleted: no release from v20261123.07 boots a bzImage (#660, parts run 45256311661, labs 45258887660, 45258106255, this change).** 0007 mapped a bzImage given to `-kernel` instead of reading it into QEMU's heap (#646, the 11-23 entry above). Since #645 the machine enters a release's vmlinux through PVH (`machine.OpenRelease` picks it by its two Xen notes), and QEMU's ELF loader maps that file without 0007. A release from .06 or before boots its bzImage with the QEMU it shipped, which carries 0007; only a lab tree of a new QEMU with an old release's kernel pays the read again. *Measured* (bench, nested, spin's shape and login, v20261123.07 against the same release with QEMU built without 0007, 40 a side, interleaved): first login +3.6 [−3.3, +7.8], sshd accepting −1.6 [−6.7, +5.6], QEMU's RSS +0.3 [−1.6, +2.1] MiB, its file RSS +0.2 [+0.2, +0.3], a different binary's pages (inferred) (lab 45258887660); restored login −0.4 [−1.5, +0.9] evicted, −0.1 [−0.9, +0.9] cached, the state unmoved (lab 45258106255). Neither number moves, as #660 expected: 0007 touched nothing on the PVH path. The QEMU build's check of the mapping goes with it. *Status:* deleted. The bzImage and `CONFIG_KERNEL_LZ4` stay until spin's `hack/machine/place.go` stops requiring `kernel/bzImage` (spin-stack/spin#1689). - -**11-23 · lab · the traceable kernel is a vmlinux entered through PVH, as the release's (#697, lab 45260129735, this change).** *Why:* since #645 the release boots its vmlinux through PVH, and its traceable kernel was still a bzImage, so v20261123.07's published ledger read firmware, entry and setup at 47.1 ms against .06's 45.0, where the release had dropped its decompressor. *Changed:* `release traceable-kernel` publishes a self-randomizing vmlinux, checked as the release's, and no bzImage; `traceable:TAG` places whichever the release published; the ledger records `pvh` and names the window by it. *Proof* (bench, spin's shape, v20261123.07, 10 boots a tree, interleaved, the old traceable bzImage against the new traceable vmlinux): firmware, entry and setup 44.3 → 19.4, −24.9 [−25.8, −23.4]; QEMU's start and held start 41.9 → 50.3, +8.4, the vmlinux's load (#698); the kernel's 0 −16.8 [−18.2, −15.1]; first login −21.6 [−32.9, −11.0]. *Status:* in place. - -**11-23 · kernel · the boot's device-setup exits as one change: kernel 0021-0025 (#627, parts run 45256426877, labs 45260781177, 45261629539, this change).** *Why:* five patches each removed the VM exits their changelogs counted (#590, #591, #592), and none moved the first login alone; as a bound the five read −7.4 [−12.1, −2.8] at 60 a side (lab 45114405201). #627 asked whether "the boot's MMIO exits in device setup" is one change and, if so, for one arm at 120 a side, the set chosen before the run. *Changed:* the bound's five, from `archive/exp-batch2-bound`, as 0021-0025 after #645's 0014-0020; they apply to 7.3.6 with no fuzz. The build asserts each on its vmlinux (kernel/README.md); checkpatch `--strict` and sparse pass. 0022 keeps the risk #627 named: upstream a2f1e22390ac took out `pci_restore_state()`'s refusal of a state never saved, so its gate (AER, EEH, s390, Xen pcifront, `reset_root_port`) has to grow by hand with whatever calls error handlers next; it stayed in the set because the set was fixed before the run. *Measured* (bench, nested, spin's shape and login, against v20261123.07, interleaved): first login −9.4 [−14.2, −5.7], sshd accepting −9.5 [−14.4, −5.5], console prompt −10.4 [−14.2, −7.8], second login +0.3 [−0.1, +0.6], QEMU RSS −1.7 MiB [−1.8, −0.1], 120 a side (lab 45260781177). `restore-first`, 60 a side (lab 45261629539): restored login −0.4 [−2.0, +1.7] evicted and +0.2 [−6.6, +7.3] cached, the state +0.0 MiB [−0.1, +0.2], all within noise; its cold row −11.8 [−18.5, −3.2] evicted. The same set against v20261123.06 had read −9.2 [−12.2, −6.0] (lab 45231943664), before 7.3.6 and #645. *Status:* in place; reaches the goal number with the next release. - -**11-23 · kernel, release · the release is its vmlinux alone: no bzImage, no `KERNEL_LZ4`, no kernel 0018 (#660, lab 45262046768, spin-stack/spin#1689, this change).** *Why:* since #645 (v20261123.07) the machine boots a release's vmlinux through PVH, and the bzImage beside it was booted by nothing: spin's `hack/machine/place.go` still asked for it, and its runner reads the vmlinux and `pvh.bin`. The maintainer decided not to wait for spin. *Done:* `kernel/Dockerfile` makes `vmlinux` instead of `all`; `CONFIG_KERNEL_LZ4` and the builder's `lz4` go, and the compression mode is Kconfig's default (gzip), which compresses nothing shipped; kernel 0018, the RFC's change to the decompressor, is deleted, as nothing compiles `arch/x86/boot/compressed/` any more, and with it sparse's rebuild of the bzImage to check that file; CodeQL's kernel analysis builds `vmlinux` for the relocs tool where it built the bzImage. The release packs, hashes (SBOM) and describes (SOURCES) `kernel/vmlinux` alone, and `verify kernel` reads no setup header. `machine.OpenRelease` still boots the bzImage of a release from v20261119.02 to v20261123.06: the lab (`--from release:TAG`) and compat open them. Compat stopped at the first release with no bzImage, which every release from this one on is, and now stops at the first `OpenRelease` refuses. *Measured* (bench, nested, spin's shape and login, 20 a side, interleaved): the boot path is unchanged, first login −4.3 [−14.4, +7.4] at 20 a side, within noise, sshd accepting −5.3 [−11.1, +7.0], QEMU's RSS −1.7 MiB (the arm's kernel is also 7.3.6, main's, against .07's 7.3.5). *Left:* spin's place.go must stop requiring `kernel/bzImage` before it takes a release from this one on (spin-stack/spin#1689). - -## 2. Rework cycles - -Each cycle: the sequence, what each step measured, and the lesson. - -### 2.1 udev: masked, unmasked, then argued over for weeks -1. Initial import: udev masked "to save boot time" (`8aee03a`). The serial getty could not start, so a debug init was written to work around it (`5e7d60e`, `8aee03a`, `24c8a06`). -2. 09-10 `4cbd229`: masking buys nothing (826 vs 829). The first harness had left `systemd-udev-trigger` masked and read "udev changes nothing". -3. 09-10 `722d468`: unmasked. `b5f361f`: the harness's udev row was itself a no-op. -4. 09-10 `064c4f4`: unmasking udev quietly enabled the serial getty that the console unit existed to avoid. This was left open as "a decision". -5. 09-26 `adc52cd`/`e2f6b8f`: udev's 46 ms "overlaps" the boot; removing devices, rules or VT gives 0. -6. 11-12 `3c8da99`: the memory half of the hot-add rule, added 09-10, raced the kernel and was removed. - -**Lesson:** an optimisation imported without its measurement survived 3 days and cost a debug init, a console unit and a harness. Measure before inheriting a mask, and make a variant fail when its edit matches nothing (`e2f6b8f` added that check). - -### 2.2 logind: out of the boot, then back in -1. 09-10 `6aba37b`: logind 63 ms on the chain, worth 24 ms to the console prompt (laptop). -2. 09-12 `bb6bb89` (#5): logind is started at the first login through the seats directory, worth 24 ms (249 vs 273). Two dead ends were recorded, and `boot:logind` was written to hold it. -3. 11-12 #240: back in the boot, with spin lingering. First SSH login 570 → 510 (lab 43308825692). The comment says the 09-12 change "moved logind, dbus-broker and user@1000.service into the first login instead, which is what a workspace waits for." -4. 11-13: the side effect, console prompt +77 ms, was fixed with getty Type=simple (#241), and that fix was removed the same day (#249). -5. #240's notes: the `SPIN_LOGIND_NO_SEATS=1` control "was written to fail, and on this image … it passes". `10-seats.conf` may now be unnecessary. Not settled. - -**Lesson:** the 09-12 decision optimised the console prompt, a metric nobody waits for, and paid for it in the first login, which was not measured until 11-12. Name the metric that matters before optimising. The first SSH login probe arrived two months after the change it would have rejected. - -### 2.3 Serial getty Type=idle / Type=simple -1. 09-10 `80f984b`: removing Type=idle was within noise against agetty's `sleep(1)`. -2. 09-10 `064c4f4`: Type=idle worth 25 ms (291/344 vs 266/283), read as "systemd's job queue draining". -3. 09-26 `b9707e3`/`7b08e5a`: Type=idle was eliminated as the cause of the 340 ms console-swap cost. -4. 11-13 #241: Type=simple shipped, 346/358 vs 423/441, after linger made the idle hold 91.8 ms. -5. 11-13 #249: removed, since the console prompt is not a workspace metric. - -**Lesson:** the value of this setting depends on what else is in the boot transaction. It was re-measured each time something upstream changed (linger), and its worth turns on a metric (the console prompt) that does not matter (#249). Decide which metrics count before shipping fixes for the others. - -### 2.4 SSH host key generation (moved 5 times) -1. 09-07 `8aee03a`: ssh fails five times per boot; "SSH keys are identity and belong wherever the rest of a VM's identity comes from" (not fixed). -2. 09-07 `2df3dbf`: generated per boot, hung off ssh.service. Hanging it off ssh.socket made an ordering cycle. -3. 09-24 `a01c847`: RSA dropped (309 ms in blame). -4. 11-12 #240 `28823fb`: `sshd@` must wait for the keys. Before this, SSH over vsock "worked not at all"; nothing had tested vsock SSH since the socket path changed. -5. 11-12 lab 43312419007: keygen wanted by multi-user.target, 518 vs 514. Nothing gained, because default dependencies kept it after basic.target. Not shipped. -6. 11-13 #247 → #248: wanted by sysinit.target with `DefaultDependencies=no`, 489 → 468 (lab 43483372488). Consumer consequence: a checkpoint taken after boot always carries host keys, so the restorer must re-key (`image/README.md`). - -**Lesson:** the per-connection vsock path ran without host keys until a probe logged in over it. A functional probe of the real login path (`boot:ssh-first`) should come before timing work on it. Step 5 failed for a reason (`DefaultDependencies`) that reading the unit's ordering would have shown. - -### 2.5 Save/restore and templates in the CLI; restore measurement; mapped-ram (proposed twice) -1. 09-07 `656d55b`: save/resume added; reverted the same day as lifecycle (`b882171`). -2. 09-26 `20e14d9`/`ab4844c`: TEMPLATES.md, template restore 24 ms, `drop-cache=off`. -3. 09-28 `c202568`: `save --template`/`restore`, plus `boot:restore`. -4. 09-30 #51: templates removed upstream (spin #194). `boot:restore` deleted, two days after it was written. -5. 11-13 #242: restore measured again, and mapped-ram proposed with `--channels`. Its numbers (lab 43364516874) were contaminated by leaked VMs. -6. 11-13 #246: mapped-ram in the contract. The fleet shows no win (385 vs 386); closed. - -**Lesson:** the product's path (template restore, then checkpoint resume) changed outside this repository, and probes were built and deleted around it within days. Restore of a checkpoint was not measured at all between 09-30 and 11-13. The mapped-ram decision had a fleet result and was reopened with a new reason: on 11-19 `machine.VM` writes every checkpoint in mapped-ram (`FormatMappedRAM`), and on 11-20 multifd channels on it took the restore under 100 ms (#320). A restore with more RAM is still unmeasured (#242's checklist). - -### 2.6 Fingerprint: what it hashes (rewritten ~8 times) -1. Binaries plus shape (09-07). -2. Plus device topology, `b476f6d`. -3. Topology corrected to exclude disks and NICs, `b882171`. -4. NIC count and MTU back in, `6599829`/`2b46d78`. -5. Root ports, then virtio-scsi, in. -6. Firmware by content in, `f2f4da0`. -7. Templates removed, `a9d6083`. -8. One hash, `c5baaa7`. -9. **Contract, not binaries**, `fa3041c` (10-13), after the QEMU 11.1.2 bump stranded every checkpoint (`f0ec1e0`). -10. **No hash at all** (11-21): a record read from the running QEMU, compared part by part (`QEMU.Target`, `CanResume`). - -Each step moved every fingerprint. Comments that said "a QEMU or kernel bump strands checkpoints" survived until `e452afc` (11-12). The verdict tool was blind to `machine/` changes until #98. - -**Lesson:** a prediction of the machine has to be kept honest by a test of its own (boot:roms) and still cannot say what differs. Since 11-21 the record is asked of QEMU, and a refusal names each difference. Check claims about which checkpoints resume against `CanResume`, boot:record and boot:compat, not against older comments. - -### 2.7 Console unit (spin-machine-console.service) -Sequence: created 09-07 (`24c8a06`); made redundant by udev 09-10 (`064c4f4`); measured 340 ms worse as a swap; TERM=dumb fixed it, 09-26 (`7b08e5a`); "viable", but the exposure question was left open; deleted 11-12 (`3a7864d`). - -**Lesson:** two months of a unit nothing enabled. Delete as soon as nothing references a unit. - -### 2.8 Debug init and diagnostic initrds -`cmd/spin-machine-init` was created 09-07 and deleted 09-10 (`8eeb01c`). Diagnostic initrds came back as `boot/probeinit` (09-29, `a81b6b5`), now allowed by CLAUDE.md as isolated diagnostics. - -**Lesson:** the rule ("no init in a release") was clarified rather than broken. AGENTS.md no longer carries that rule. Its "Experiments" section keeps diagnostic initrds apart from release outputs. - -### 2.9 Probes added then deleted (short-lived) -- `boot:matrix` (09-10 → 09-10) -- `kernel/minimal` + `boot:floor` (09-26 → 09-30) -- `boot:kernel-pages` (09-30 → 09-30) -- `boot:memory-unplug` (09-30 → 09-30) -- cache bench (09-11 → 09-30) -- `boot:restore` (09-28 → 09-30) -- `boot:unitload` (09-26 → 10-01) -- `boot:memory-policy` (09-28 → 10-01) -- page-cache sub-probes (09-30 → 10-01) -- bench rows (09-10 … → 10-01) -- console-swap variants (09-26 → 09-30) -- `boot:exits`, `boot:mmio`, `boot:jobs` (11-12 → 11-13, #249) -- `boot:bench`, `boot:trace`, `boot:userspace`, `boot:systemd`, `boot:ssh-load` (→ 11-13, #250) - -This is the cycle AGENTS.md asks for ("Remove an experiment once its question is answered"). The cost is that the answers live only in commit messages and comments. - -**Lesson:** this log, or `docs/memory-and-disk.md`-style records, is where an answered probe's result should land. Before writing a probe, check docs/boot-time.md's "Measured and rejected" and the row comments in `internal/lab/sshfirst.go`. - -### 2.10 /tmp and tmpfiles; erofs; BPF_LSM; chrony -- **/tmp:** masked by the imported optimizer; unmasked 09-26 (`f36ae13`, noise); capped at a quarter 09-28. -- **erofs:** removed from the kernel 09-26 (`5a3d509`); the build assertion relaxed 09-30 (#66) for the pmem/DAX experiment, which was rejected (#63, #65). -- **BPF_LSM:** off 09-07 ("a boundary inside the boundary"); on 10-01 (`1400f6a`), and the stale note was fixed 10-05 (`ebe2a6e`). -- **chrony:** added 09-07, removed 09-10. - -**Lesson:** the imported scripts carried decisions without numbers. Each has been re-decided one at a time. - -### 2.11 CI cache and runners (rebuilt ~5 times) -- gha cache that stored nothing (`c767cd5`, 09-15); -- Blacksmith (09-20); -- the builder's silent fallback (`aa157cf`/`1ef95d1`, 09-26); -- export from main only (`bdec6cc`); -- GitHub runners for builds plus the bench/kvm fleets (10-24); -- the gha cache unreadable on the fleet, so a registry cache (`1666cb5`, 11-12). - -Also the reusable builder, added and reverted on 10-13. - -**Lesson:** each move was taken without checking that the cache was actually hit. A cache-hit assertion would have caught `c767cd5` and `1666cb5` on day one. - -### 2.12 apk locks broke three times -`6e7ba47` (11-03), `8d495c5` (11-09), release run 43157106109 / `ec2c7fb` (11-12); fixed by a daily refresh (`c6c29b5`), which then compiled QEMU cold twice every move. It was fixed structurally on 11-20 by pinning builder images instead of packages. - -**Lesson:** a mirror that serves only the newest build cannot be pinned. Pin something that keeps its contents, such as an image, and move it when the move is wanted.
x<y