📝 Record the device's QMP and BQL waits as a lesson [ci skip]
QMP's screendump held every QMP monitor while the display read it waited for never ended, and the teardown's release under the BQL waited for a route call that took the BQL. Both are traps of the same kind: a host call that waits on device work while holding what other parties wait for. The lesson says how each showed and how to spot the next one.
This commit is contained in:
1 parent
1cb207d09e
commit
7fc3deed4e
1 file changed
+1
@@ -93,6 +93,7 @@ one. A new trap found the same way goes here.
|
||||
- A device's reset runs only when the guest reboots inside one QEMU, which no cold boot does, so a reset that keeps state passes every boot check. Under HVF, `vmapple`'s in-kernel GIC kept every SPI's enable, pending and active bit across a guest reboot (its put wrote each SPI's bits 32 IRQs low and its clears as 0), and the AES engine kept the words of an unfinished command in its FIFO: a macOS 27.2.1 restore OS that panicked and rebooted in a loop met AES errors in 234 of 391 boots from boot 31 and AppleVirtIO data aborts in 8 from boot 111, and never on a first boot. A reset is checked with a reboot loop in one QEMU, counted over hundreds of boots against the unfixed build in the same harness.
|
||||
- A walk holds its GPU and its RAM, not the host's CPUs, so another job's load reads as the change's cost. An after-walk on the 780M (pin 64, macOS 26.7.2) lost frames through six steps in a row, up to half of them (autoscroll 44.8 to 33.0 presents a second, gl3d 40.1 to 28.4, safari-video 25.4 to 18.0, heic 3.6 to 1.9), and its surface asks' p99 went from 2.3 to 9.0 ms; another lane's full build ran on the host through exactly those steps' four minutes, and the driver's submit stalls rose with it (`submit_stalls_on_work` 6 to 945 in gl3d, which made 12 asks). The same build walked again with the host to itself matched the before-walk in every step (6246 presents against 6211). How to spot the next one: a loss confined to a run of consecutive steps, while the steps around it match; before reading it as the change's, list the node's jobs over the walk's clock window (`steps.tsv`), and walk again alone once.
|
||||
- A guest failure that only the harness's device configuration reaches belongs to the harness, so walks run reims-ctl's devices. The appwalk harness kept one virtio sound device with an output and an input stream after reims-ctl moved to a playback-only device and a capture-only one (bca8c6e7f). On it, macOS 11.7.11's coreaudiod died in 1 of 4 walks at the tip, and the crash read as a new fault in our virtio-snd: AppleVirtIOSound starts and stops the input stream with every output there, and frees a stopped input ring while its four receive buffers are still posted, so each sound could crash it (12 rounds of system sounds did, m3-max-25374, as on vendor/qemu from before our capture changes, m3-max-25417), where on reims-ctl's two devices 60 rounds started no input stream and it lived (m3-max-25414; [qemu.md](qemu.md), "x86-64 macOS guests: audio"). How to spot the next one: before reading a failure as the product's, diff the harness's QEMU command against `reims-ctl`'s (`crates/reims-ctl/src/qemu.rs`) and boot once with reims-ctl's.
|
||||
- A QMP command that waits for a device holds every QMP monitor, and a release under the BQL waits for every callback that takes it. QMP's `screendump` is a coroutine command: it waits until the console's update is done, and QMP's dispatcher runs one command at a time for every monitor, so reims-graphics-pci's read of the display waiting for a GPU that never answered (NVIDIA's Xid 109, RTX 2080 and RTX 3090, 2026-11-12) left `query-status`, `system_powerdown` and every other screendump unanswered until the quit, while HMP, the vCPUs and the guest went on. And the device's teardown at the quit held the BQL across the library's release of its last device, which waits up to 5 s for the library's threads, while `route_doorbell`, which one of those threads calls as a command queue is made or ends, takes the BQL: a queue made or destroyed as the VM quit held the quit for the 5 s, read in review (commitpath2). A late read now answers the update with what the console shows (`REIMS_GRAPHICS_PCI_READ_LATE_MS`), and the release at the quit runs with the BQL let go. Before a device answers QEMU later than at once, bound what the answer waits for; before a host call that waits for the library's threads runs under a lock, list the callbacks that take that lock. The next one shows as QMP silent while HMP answers, or as a quit that takes 5 s and logs that "the GPU device stays for the process".
|
||||
|
||||
## Tools and worktrees
|
||||
|
||||
|
||||
Reference in new issue
Block a user