Skip to content

drm/asahi: cut the G17 cross-queue hop tail - #468

Merged
DjDeveloperr merged 2 commits into
integration/aurorafrom
perf/g17-doorbell-tail-20261026
Oct 27, 2026
Merged

DjDeveloperr merged 2 commits into
integration/aurorafrom
perf/g17-doorbell-tail-20261026

Conversation

@DjDeveloperr

Copy link
Copy Markdown
Contributor

Summary

This follows up #423 and cuts the tail of the G17 cross-queue hop. #423 withholds a compute doorbell while two or more unretired commands of its queue are ahead. On Neo, about a third of the remaining doorbells and most of the slow hops came from two cases:

  • keep withholding G17 compute doorbells while a stamp is awaited. retire_pending counted as settling even when the front command already had its completion record and was only waiting for its completion stamp. That front then rang the next publication at once, or released a withheld doorbell early. It now counts as settling only when the front has no completion record.
  • restart a withheld G17 compute doorbell another doorbell covered. When another doorbell has already announced every slot a withheld doorbell covered, the next publication starts the withheld one over. Before this, almost half the releases announced a single slot.

The median hop already matched macOS after #423. These changes move the tail.

Measurements

Neo, same boot, three rounds (ABC/CBA/ABC), with Mesa from aurora-silicon/mesa#62. "Before" is #423's tested head.

row before after
doorbells in the traced ping-pong 7409 4625 (−38%)
slow hops 19.6% 13.9%
sync.signal hop, timeline (µs) 23.40 22.83 (−2.4%)
sync.signal hop, binary (µs) 23.35 22.67 (−2.9%)
compute.light queue d64 (µs/submit) 13.89 13.11 (−5.6%)
compute.light queue d1 / d2, compute queues d1/d2/d4, render.light d1 / d32 within 1%

A second same-boot run gave the binary hop −6.1%, compute queue d3 +0.2% and d4 −0.2%.

Testing

The module built from exactly these two commits on #423's tested head:

  • regression gate (performance-regression.sh): PASS;
  • targeted CTS: 22847 Pass, 791 NotSupported, 0 Fail;
  • no asahi or G17 kernel errors.

The commits apply unchanged on integration/aurora. The #423 merge didn't touch g17/queue/compute.rs or g17/runtime.rs, and its merged module was checked against #423's in the gate, the targeted CTS and the light rows.

A third change, releasing a withheld doorbell only once no predecessor lacks a completion record, cut slow hops further. It regressed compute queue d4 by 21%, so it is not included.

…aited

A queue whose retirement stops at a command with a completion record but
no covering stamp yet sets retire_pending, which counted as leaving
ordinary retirement: the next publication rang its doorbell at once, and
a withheld doorbell was released whatever its predecessors. That happens
after most completions. Each doorbell makes the firmware read the work
ring, and a hop between queues whose producer ends 30-80 us after one is
slowed by 12-24 us.

The withheld doorbell already counts only predecessors without a
completion record, which covers a front waiting for its stamp. Count
retire_pending as settling only when the front has no record, the case
of a command the firmware finished without one.

In a two-queue semaphore ping-pong (gpubench sync.signal, 0.6 s traced),
doorbells rung at publication fall from 2006 to 96 and releases forced
by settling from 1280 to 23; all doorbells fall from 8035 to 6707.
…overed

A doorbell announces every work slot written on its ring, so a withheld
doorbell of one queue is often covered by a doorbell another queue rings.
Publications of the first queue after that kept the withheld doorbell's
first publication, whose predecessors had long retired: the doorbell was
due at once and rang for one or two new slots. In a two-queue semaphore
ping-pong almost half of all releases announced a single slot.

When a publication finds that another doorbell announced every slot the
withheld one covered, it starts the withheld doorbell over from itself,
so the doorbell waits for this command's own predecessors.

Measured on Neo with this and the previous change against the base in
the same boot, alternating, three rounds (us, medians):

  sync.signal ping-pong doorbells     7409 -> 4625
  hops slowed by more than 7 us      19.6% -> 13.9%
  sync.signal timeline, per hop       23.40 -> 22.83
  sync.signal binary, per hop         23.35 -> 22.67
  compute.light queue d64             13.89 -> 13.11

The median hop is unchanged; compute.light queue d1/d2/d3/d4, queues
d1/d2/d4 and render.light d1/d32 stay within 1%.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant