RUNTIME 2275: the unshared hold's budget is 2 ms only while the unshared queue committed within 50 ms, else 16 ms

The unshared-isolation hold kept other queues' batches to about 2 ms of expected work ahead of an
unshared (compositor) queue on the same VkQueue at all times. On the 780M that stretched Super
Resolution's command buffers (reims gbo-780m A/B with isolation Off: SR 27.78 -> 24.78 s; 5772 holds).
Now the 2 ms budget applies only while an unshared queue on that VkQueue committed within the last
50 ms; otherwise the budget is 16 ms (the intolerable-wait line), so a quiet compositor's first
frame waits at most about 16 ms plus one batch.

- SlotShare::unshared_committed: one relaxed atomic store per VkQueue at the commit call.
- Flight::ahead takes the budget; Flight::room returns Room::Idle where only the 16 ms budget let a
  batch go; batches enter the flight either way, so the 2 ms bound is exact from the compositor's
  next commit.
- WorkCounts::heads_let_go_unshared_idle (new). No new Degradation kind, no refusal change.
- docs: FAST-PATHS unshared-isolation row (both budgets, reasons, trade, a replay over reims's
  hold-off trace: SR at 2 ms would hold 3,168 of 6,855 CBs, at 16 ms 0), API.md, the
  UnsharedIsolationPolicy::Bounded and new_command_queue_unshared docs.
- queue_share_device: the held-work runs settle their queue's expected run before measuring.

Verified (isohold): lavapipe m3-max-28760 at 337f244d25: unshared_hold, queue_share_device,
scheduler_held_wakes 28/28; quiet compositor: second long CB let go 13.5 ms before the first ended,
the compositor's CB ran between the second and third; active compositor: ran before the second long
CB (Off: after the third). Negative control (window check removed) m3-max-28762: CONTROL_EXIT=100
(device test + 2 unit tests fail). The SR A/B on a 780M is owed. Clippy and the suites run after landing.
This commit is contained in:
Anees Iqbal committed 2026-11-14 02:30:03 -08:00
1 parent 49d0f2a71c
commit 3b2443c8fe
13 files changed
+467 -81

No files matched your search

+8 -1
View File
@@ -282,7 +282,14 @@ compile does. `DevicePolicy::default()` is `DevicePolicy::UNTRUSTED`:
in time, and the unshared queue's command buffer waits behind about one batch of theirs: the
whole of one, however long, as a submission runs to its end. A scheduler pass that finds a held
batch let go and the unshared queue's command buffer ready together (a pass the host ran late)
sends the unshared one first. Beside an application keeping three
sends the unshared one first. The 2 ms holds while an unshared queue there committed a command
buffer within the last 50 ms, so a compositor drawing 20 frames a second or more (a 24-frame
video's, a 30-frame game's) keeps it; while none has, the budget is 16 ms: an application
keeping less queued beside a quiet compositor is not held, and the compositor's first command
buffer after its quiet stretch waits behind at most about 16 ms of the other queues' expected
work and one batch, the 2 ms applying from that commit on
(`WorkCounts::heads_let_go_unshared_idle` counts the heads the 16 ms let go where 2 ms would
hold them). Beside an application keeping three
30 ms command buffers in flight, a compositor's median wait fell from 75 to 17.5 ms on the Iris
Xe and from 71-84 to 18 ms on the Radeon 780M, with no throughput lost on a quiet host; under
the host's CPU load the GPU idles more (docs/FAST-PATHS.md has the numbers). Counted: