Internal microbenchmarks

The flush-wall probe compared on the same test platform, the merge-gate Tier 1 bands, and the switch-cost anatomy · the pbench same-test platform comparison is being captured and will join · Canonical: docs/development/perf-gate-baseline.md

§1The flush wall (the mmap2time2 probe, 128MB full-sync writeback, same-test platform comparison)

PhaseRuxLinux (same test platform)Ratio
buffered write 128MB (s)0.2100.029Linux 7.2×
fsync (s)3.5231.142Linux 3.1×
memset + msync(MS_SYNC) (s)0.087 + 0.5720.028 + 0.022Linux 13.9× (msync)
sync (s)0.4870.001Linux 487× (basis caveat)
total wall clock (s)4.8961.223Linux 4.0×

The same probe binary, the same 128MB working set, the same virtio-blk backend; the Rux gap concentrates in the msync/sync phases (the mapped-dirty-page writeback path) and fsync (the journal-commit path) — consistent with the fsync row on the fio page, the storage stack's current main shortfall. The sync-phase 487× is a basis difference: Rux's writeback was not exhausted at msync — the probe basis is shown as measured.

§2Tier 1: the quiet-boot census bands (the merge gate, current bands)

MetricBaseline / band
TERM-DESCHED census8 ± 2
WAKE-REFUSED census32 ± 4
WAKE-STRANDED5–31 organic, no 1001 ms grid class
Per-CPU tick rate≥99.5/s to window end
panics / new OOM classes0
Syscall volume (780 s)126.0M ± 10%
clock_gettime avg3–4 µs (±20% or better)
nanosleep avg158–203 ms family, ≤244 ms one-sided
IF=0 share20.4% ± 3pp
Longest closed cli segment≤10 ms

Notes: TERM-DESCHED read exactly 8/32 across 4+ consecutive boots; the current arc reads 104–124/s ticks; the syscall volume is the same-lineage basis; the p7_sleep1ms probe reads 15.8 µs on the same core (the sleep cost is unchanged); the IF=0 share is the official EFLAGS-pair probe if0 v3; the longest cli segment now runs 6–9 ms (the one-shot 594–599 ms class is gone).

§3The context-switch cost anatomy (cctx segments, a mechanism note)

  • The x86_64 switch machinery ~620 ns (schedule 125 + the GRQ lock wait 102 + pick 96 + the mm switch 202–295 + FPU 34 + FS/GS 54 + GPRs ~22) — Linux's native switch machinery ~910 ns; the "GRQ lock wait" is the KVM tax on cross-vCPU locked instructions (Linux's per-rq lock pays it too — it does not mean the GRQ is slow), while the GRQ's in-lock work is counted separately: ≈60 ns production / 75–80 ns minimal bracket (tree work ~20–30 ns + D-1 bookkeeping). After the fdget borrow + getppid O(1), the pbench p2_ctxsw pipe ping-pong reads 0.090–0.105 µs.
  • The wake-side segments (WK_SEL/WK_ENQ/WK_DISP/IPI_N/IPI_NS) and the GRQ-hold decomposition are on scheduler §8; the NOHZ hostile-load A/B (0/10→11/12) on interrupts & timers §6.
Canonical: docs/development/perf-gate-baseline.md (anchors and bands), docs/development/perf-report.md (the pbench design). The Linux columns of pbench and the flush wall come from the two-sided suite runs (run/bench-pair-1117/, pbench-pair); each row carries its newest measured value.