State queue sharing's residual stall and the unshared form for queues that must never wait
What: docs/FAST-PATHS.md's queue sharing row, docs/API.md's policy bullet and the runtime README's new_command_queue_unshared entry now state the residual stall exactly: once per logical queue that goes long, for a queue that joined its VkQueue during its short phase, about one long command buffer's length. They also say a queue that must never wait (a compositor's) is made with Device::new_command_queue_unshared. The row's cost column carries the measured rates. The queue_share example's rates mode takes --threads, --in-flight and --one-vk-queue for one shape. It prints each command buffer's GPU end and commit to its completed handler, the submission, scheduler and wake counts per command buffer, and the busiest threads' CPU from /proc (Linux). Why: on the RTX 5080 Laptop GPU (NVIDIA 615.71.09, release, 3 runs a side), the trap and slow-alternating shapes cost a shared compositor 64 completions over 10 ms, at most 29.4 to 30.6 ms, in every run, with one join each. That is the first long command buffer of the application it joined during the application's short phase. PerQueue had none in 5 of those 6 runs and 4 in the sixth (at most 3.7 to 10.7 ms). An unshared compositor had none over 10 ms in any run. No join rule built on what a queue has shown can avoid the first one: the long command buffer gives no sign before it runs. A re-pick at submission would not either: the compositor holds about 4 uncompleted command buffers at each commit (p50 commit to handler 0.78 to 0.87 ms at a 208 us period), and the stall is all or nothing in a queue's own order. So the docs name the unshared form as the answer for such a queue. The probe settled the 2 threads x 3 in flight drop (15.4k against 26.0k a second in one run): it was the lock hold's warm-up. In the hold's first runs both policies ran slow (11.1k and 10.4k), and later runs gave Adaptive 46.5k and 39.7k against PerQueue's 25.2k and 26.5k. Two queues on one forced VkQueue ran 38.1k to 46.6k under PerQueue and 41.4k to 49.9k pinned under Adaptive, so one VkQueue is not slow in the runtime's path. No runtime thread was busy in the slow runs (scheduler 10%, handler threads 5%, waiters 3%), and every shape made one vkQueueSubmit per command buffer. Verified: tests::fast_paths, degradation_catalogue and degradation_sites (25 passed); clippy of the example with all features. (cherry picked from commit b1dbea95dad3a5a156191df01084db0f86cb67a0) (cherry picked from commit 24af60dbf8175da8e60ea24f38f9103c20c23e8b)
This commit is contained in:
1 parent
4fc55c4758
commit
be47523f80
4 files changed
+167
-13
No files matched your search
+8
-5
@@ -227,11 +227,14 @@ compile does. `DevicePolicy::default()` is `DevicePolicy::UNTRUSTED`:
|
||||
family whose oldest batch has run under 0.5 ms, so short command buffers of several queues run
|
||||
with no switch between them. A queue whose batch ran over 2 ms as its `VkQueue`'s oldest is
|
||||
long: no queue joins its `VkQueue`, and it moves once more, at its next such make, to an idle
|
||||
`VkQueue` of its own. The first long command buffer of a queue that shared holds the command
|
||||
buffers committed behind it there for its whole length, announced `queue-sharing` at the
|
||||
device's first join (section 9). A queue made with `Device::new_command_queue_unshared` never
|
||||
moves, and no queue joins its `VkQueue`: a compositor's, whose command buffers must not wait
|
||||
behind an application's. Presenting queues, and a queue that lent its `VkQueue`
|
||||
`VkQueue` of its own. So a queue waits behind another's long command buffer once per queue
|
||||
that goes long, about that command buffer's length: the first long command buffer of a queue
|
||||
that shared holds the command buffers committed behind it there for its whole length,
|
||||
announced `queue-sharing` at the device's first join (section 9). A queue made with
|
||||
`Device::new_command_queue_unshared` never moves, and no queue joins its `VkQueue`: the form
|
||||
for a queue whose command buffers must never wait behind another's (a compositor's beside an
|
||||
application's; on the RTX 5080 Laptop GPU none of its completions took over 10 ms in any run,
|
||||
where a shared one's had one stall of 30 ms beside 30 ms command buffers). Presenting queues, and a queue that lent its `VkQueue`
|
||||
(`CommandQueue::with_vk_queue`), never move. Before the check answers, and on a device whose
|
||||
check finds no idling or that has no two `VkQueue`s of one family (MoltenVK, RADV, lavapipe),
|
||||
each queue keeps the `VkQueue` it took at its creation, round robin.
|
||||
|
||||
Reference in new issue
Block a user