notes

The first QEMU soak measurements, and what a soak build costs

Name: ratified 2026-10-18 (calef, "Yes") Refused qemu-baselines.

An appendix to notes/soak.md. It holds the QEMU numbers of 2026-09-01 and 2026-09-02, and the measurement of how far a --features soak_test build is from the one that ships.

First measurements, 2026-09-01, patagonia, QEMU

These were taken with script/soak --for 30s, four groups per machine except x86. The x86 runner defaulted to one core on the day; it defaults to two since 2026-09-23 (see the parent's BUGS). That command is script/soak-test since 2026-09-14, from milestone 297 (soak becomes soak-test). The name is left as it was typed here, and everywhere else that says how a number was taken, because how a measurement was made is an account of a day.

These are QEMU numbers on a loaded laptop. They are a baseline for comparison, not a benchmark; script/bench is the instrument for cost.

Architecture Cores Workers Round trips/s Cross-core handoffs in 25s
aarch64 4 20 ~58,000 17
riscv64 4 20 ~24,000 21
x86_64 1 10 ~3,900 0

With the tick route, 2026-09-02, patagonia, QEMU (milestone 221 (the soak never crosses cores, so build the hook that makes it))

Same command, same host, one day later. These rows are not comparable with the rows above, for a reason larger than the date: the build changed. Each pair below was measured back to back. The "before" leg came from the exact commit this work branched from, on an otherwise idle machine. Each was read at the 25-second beat (20 seconds on x86, whose beat count is lower).

Architecture Cores Round trips before after Crossings before after
aarch64 4 1,623,764 and 1,630,605 1,632,746 and 1,632,803 15, frozen from beat 1 1,452 and 3,779, both rising linearly
riscv64 4 871,047 and 886,428 662,787 and 823,783 10 and 14, frozen 2,573 and 4,358, rising
x86_64 1 77,372 51,749 0 0, and one core is the whole reason

There are two runs of each leg on the multicore architectures, because one would have been misleading. The first pass of these measurements was misleading. It was taken while another lane's test suite was running on the same laptop. The numbers it produced (aarch64 47,864 against 43,031 a second) were the host's load rather than this change. Everything above is from an idle machine.

What the numbers support:

The round-trip rate fell far less than DECISIONS 138's spike saw. The spike reported about 30% on aarch64 and about 55% on riscv64. That difference is recorded rather than explained away. The spike was thrown away and cannot be re-measured, so why it was slower is not recoverable. The worker mix is the obvious candidate, and it is a guess.

wakes and crossings are the two figures milestone 221 added, and neither is a throughput number. The tick route wakes at TICK_HERTZ times the core count, which is a property of the machine rather than of the workload. The crossings are however many of those wakes wake_load_aware chose to place on another core. That is somewhere between a seventh and a half of them, varying by run more than by architecture. That ratio is a fact about the placement policy under this load, and nothing in this tree yet says what it should be.

Which build these came from, and it is not the one that ships

Every figure above is from a --features soak_test kernel. That is the only build in which the counters and Thread::last_cpu exist at all. It is not free, and the size of it is measured rather than assumed:

Architecture ipc_fastpath, production with --features soak_test
aarch64 5,788 bytes 6,120 1.06x
riscv64 5,106 bytes 5,344 1.05x
x86_64 6,639 bytes 6,995 1.05x

So a soak build is not a production build. Its IPC path is five to six percent larger, and its round-trip rates are therefore soak-build rates. Compare a soak number with another soak number, which is what the three comparisons above are. Never compare one with script/bench, and never use one as a statement about how fast this kernel does IPC.

Milestone 221 added nothing to that table, and it was checked rather than assumed. Its kernel change is a #[cfg(feature = "soak")] call in sched::on_tick and a module that is not compiled otherwise. So a production build should be untouched, and "should be" is what this tree does not accept. It was built at the base commit and at the merge candidate, on all three architectures, without the feature. Every symbol has the same size. Every section has the same size except .strtab, which is not loaded. ipc_fastpath and system_call_entry are unchanged at 6,687 and 1,637 bytes.

The loadable image (llvm-objcopy -O binary) differs by 45 bytes on aarch64. All of them are core::panic::Location line numbers below the insertion point, each larger by exactly the ten lines added to that file. The proof is a rebuild of the base commit with ten comment lines at the same point. It gives an image byte-for-byte identical to the merge candidate's, on all three architectures. Any comment added to sched.rs would move those bytes. A hash comparison that called that a change would be measuring the file's line count.

That the instrumentation is behind a feature at all is a thing this milestone got wrong first, and a gate caught it. Shipping the counters and the last_cpu write unconditionally put ipc_fastpath 5.7% over the 5% bound of milestone 132 (fast) on aarch64 (5,788 -> 6,120). riscv64 and x86_64 grew 4.7% and 4.6% behind it: one cause, three effects, and aarch64 merely the one that tipped. The last_cpu write sits in schedule()'s switch, the hottest line of the hottest function. script/lint now runs clippy on --features soak_test on both ISAs, because a cfg-gated instrument that nothing lints is one that rots. The first run of that check found two real warnings in kernel/src/soak.rs, which had never been linted.