mirror of
https://github.com/utmapp/virglrenderer.git
synced 2026-12-01 14:02:17 -10:00
proxy_context_submit_fence() sent the request and then blocked in proxy_socket_receive_reply_with_fds() waiting for the answer. The server runs the backend's fence work before it replies, so that wait is an IPC round trip plus host GPU work -- and QEMU calls in from its virtio-gpu handler with the BQL held, so every vCPU in the guest queues behind it. Measured on CP2077: 19.8-21.5 us per call at ~4000 calls/s, which made virtio_gpu_gl_handle_ctrl hold the BQL for 33-37 us at a time, 13-19% of wall. The reply exists only to carry `ok` -- which the proxy has always ignored -- and an optional fence fd for the VMM-side virgl_fence table, feeding virgl_renderer_export_fence and the in-fence path of virgl_renderer_submit_cmd2. Neither has a user behind the proxy: Venus (vkr) never registers a fence fd, fence sharing is wired only to the in-process drm native contexts and vrend (the render server cannot host them, and proxy_context never sets supports_fence_sharing), and QEMU calls none of the export entry points. Retirement rides the shmem timeline and the fence eventfd, never the reply. Drop the reply from the protocol: the client sends and returns, exactly like the out-of-band event-ring channel already does, and the ordered main socket keeps its dispatch-order guarantee. With no consumer left, the Neptune fd hand-off that fed the reply goes too: pair_event_fence's register_fd, the dispatch and fence-thread take_fd, and the belt-and-braces retire in npt_queue_sync_retire. Removing the stall does not change CP2077's frame rate at either 4 or 10 vCPUs -- it was real but is not what sets that title's frame time. Assisted-by: Claude:claude-fable-5