Skip to content

vm: inspect builds its device, disk, fs and balloon views from one vm.info - #327

Merged
CMGS merged 1 commit into
masterfrom
perf/vm-inspect-one-vminfo
Nov 9, 2026
Merged

CMGS merged 1 commit into
masterfrom
perf/vm-inspect-one-vminfo

Conversation

@CMGS

@CMGS CMGS commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

vm inspect on a running CH VM called vm.info four times: FsList, DeviceList and DiskList each went through listWith, and BalloonStatus did a fourth, with five record loads among them. This PR adds hypervisor.RunningViewer: one RunningVMClient (a single record load) and one vm.info, from which the fs, vfio, disk and balloon views are all built with the extractors the list methods already use. Inspect uses it when the backend implements it; Firecracker keeps the old path.

Behavior is the same whenever vm.info succeeds. When it fails, the old path dropped each block separately; the new path drops them together and logs one warning.

Measured on test2 (1 vCPU / 1 GiB guest, NUMA-pinned slice), interleaved ABBA, 8 rounds x 4 blocks x 30 calls:

n median p90
master 480 21.74 ms 22.47 ms
this PR 480 20.14 ms 20.81 ms

That is -7.4% (Mann-Whitney p<0.0001), measured against master with an extra record load in the PR arm that this version no longer makes, and every block of the PR arm was faster than every block of master. strace showed 4 api.sock connects on master and 1 here. The inspect JSON was byte-identical between arms (1580 B, balloon block included).

The same measurement also tried reusing the boot poll's vm.info in direct-boot start (3 vm.info calls down to 2). That gave +0.02% (p=0.98), so it is left out.

Gates: make lint (0 issues on linux and darwin), make fmt-check, asl, go build ./... on both GOOS, and go test -race ./cmd/... ./hypervisor/... on darwin and in a Linux arm64 container.

@CMGS
CMGS merged commit d560144 into master Nov 9, 2026
4 checks passed
@CMGS
CMGS deleted the perf/vm-inspect-one-vminfo branch November 9, 2026 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant