Commit 820086b
feat: MSI-X interrupt-driven GPU wake + zero-spin SUBMIT_3D + frame pacing
Three changes that together reduce BWM kernel CPU from ~20% to ~10%:
1. MSI-X interrupt-driven GPU wake: GPU completion fires MSI-X interrupt
which immediately unblocks the compositor thread via scheduler. Matches
Linux virtio-gpu driver pattern (wait_event_timeout). Zero spin cycles
wasted waiting for SUBMIT_3D completion.
2. Zero-spin path: When MSI-X is active, send_command_3desc blocks the
thread immediately after notifying the device (no 5k spin warmup).
The interrupt handler wakes the thread at precisely 3.4ms. Polling
fallback with spin+timer preserved for non-MSI-X configurations.
3. Frame pacing in compositor_wait: Enforces 5ms minimum inter-frame
interval to prevent the compositor from saturating the CPU when GPU
wake is fast. Uses plain timer block (not compositor block) to avoid
consuming dirty-wake signals meant for the main blocking section.
Performance (Parallels, bounce demo running):
- Kernel GPU busy: ~16% (was 20% with spin, 70% before blocking)
- submit_cpu: ~700us (real VirGL work, zero spin waste)
- sleep: ~2600us (72% of frame time truly idle)
- FPS: ~280 (not artificially capped)
- 23/23 bcheck tests passing
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent e3f2942 commit 820086b
3 files changed
Lines changed: 427 additions & 82 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
125 | 129 | | |
126 | 130 | | |
127 | 131 | | |
| |||
0 commit comments