pool: bring a claim's volumes up concurrently - #77
Conversation
Cocoon serializes the attach itself per VM, so the win is overlapping the CLI spawns, device settle waits, and guest mounts across volumes. Single-volume claims run inline; per-volume ordering (marker before attach before mount) is unchanged and pinned.
Hardware A/B on bare metal — the win is gated on guest vCPU countBare metal (16 core), cocoon master-07f1d69, CH v54, template rt:24.04, Four-volume claim, default mounts, all four mounts asserted per sample:
Marginal cost of volumes 2–4,
Single-volume control (the inline
Release is unchanged on every tier (|A−B| mean 0.72 / 1.32 / 0.91 ms) — as Why the default tier shows nothingAn instrumented build (diagnostic only) logged per-volume offsets: on main the Pre-existing bring-up race, surfaced by this round
|
Multi-volume claims paid a strictly sequential attach+settle+mount per
volume (~60-90ms marginal each, measured on bare metal in the #72 round).
The per-volume pipeline — write-ahead marker (rw), disk attach, sysfs
settle, guest mount — now runs concurrently across a claim's volumes via
errgroup; cocoon serializes the hypervisor attach per VM internally, so
what overlaps is the CLI subprocess spawns, the 5-10ms device settle
waits, and the guest mount execs.
1 → inline, no goroutine).
ordering (marker strictly before attach before mount) is unchanged.
claim fails, the VM is destroyed, holds release through the existing
defer. One deliberate delta, pinned by test: a failed multi-rw claim
now leaves every rw image marked (all markers are written up front),
not just those before the failure point — the conservative direction
of the block-don't-heal contract.
attach on a rendezvous that deadlocks under sequential apply (verified
by temporarily reverting to a loop — the test times out — then
restoring).
Gates: build, -race across the module (20x on the apply tests, no
flakes), dual-GOOS golangci-lint 0 issues, gofmt clean, asl dual-GOOS
zero findings. Bare-metal A/B for the multi-volume latency claim follows
as a comment.
Hardware verdict (see the A/B comment for full data): the win is gated on
guest vCPU count — the overlapped work is guest-CPU-bound. 1.00x on the
1-vCPU
smalltier, 1.33x at 2 vCPU, 1.70x (2.55x marginal per-volume) at4 vCPU. Single-volume and release paths unchanged on every tier. The round
also surfaced pre-existing #78 (sysfs-vs-devtmpfs bring-up race), fixed
separately.