Repository navigation
SCGPU doorbell: the guest sleeps on a virtio-input device instead of polling - #29
Merged
Merged
Conversation
… instead of polling The mailbox was polled on both sides: the guest spun 300 us and then napped in 20 us steps (delay_for_interval, which XNU's timer slack stretches), the app's thread spun while commands came (12% of a core). Now a virtio-input device named "scion-scgpu", the app's, is a doorbell both ways. The app rings with an input event (an interrupt here). The guest rings with a status event, which crosvm writes into the app's socket. Each side spins briefly, then says it sleeps (host_sleeping, guest_waiting) and looks once more after a full barrier, and a side rings only when the other has said so: no ring is lost, and none is sent during a burst. - hakios.scgpu.h: host_sleeping, guest_waiting, SCGPU_BELL_NAME. - hakios.vgpu3d_xnu.c: hakios_scgpu_bell_attach (event and status queues, the service thread wakes the waiter), bell_ring, and scgpu_ctrl spins 60 us, then sleeps on the doorbell (5 ms safety). Without the device it waits as before. - 1305: the virtio-input driver hands the device named scion-scgpu to SCGPU instead of making it a touch screen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The guest half of the SCGPU doorbell (Scion PR, same name): a virtio-input device named scion-scgpu, handed to SCGPU by the input driver (patch 1305), rings both ways. scgpu_ctrl spins 60 us and then sleeps until the app's ring interrupt, with a 5 ms safety timeout. Each side rings only when the other has said it sleeps (host_sleeping/guest_waiting, Dekker with full barriers).
On the Pixel, under YouTube in Safari: 4-10K commands/s, the guest rang 165-263/s and the app 1600-2200/s, and it held up for the whole session.
🤖 Generated with Claude Code