Skip to content

drm/asahi: g15: keep a queued poll when rearm adds its backup - #3676

Closed
malik-na wants to merge 1 commit into
aurora-silicon:mainfrom
malik-na:g15-rearm-keep-queued-poll-7.3
Closed

malik-na wants to merge 1 commit into
aurora-silicon:mainfrom
malik-na:g15-rearm-keep-queued-poll-7.3

Conversation

@malik-na

Copy link
Copy Markdown
Member

What it fixes

rearm() ended with mod_delayed_work_on(.., 1). Say the mailbox IRQ had already queued the poll work to run now (kick() goes through poll_now() with delay 0). A submit that rearmed right after then pushed that poll out by a jiffy. The poll that would have restarted the resnap timer didn't run either. A completion could be noticed up to a resnap interval (100 µs) late.

Now the one-jiffy backup is queued only if no poll is pending, as G17's backup poll does. The resnap timer's poll_now() still brings a later pending poll forward, such as the idle PB reclaim expiry that rearm used to replace. Nothing waits longer than the timer. The resnap timer restart stays. A poll that is already queued rearms after it, so the timer starts again with the new flight in view.

One file, drivers/gpu/drm/asahi/g15/poll.rs, +9/−4. First written on 7.2 (c474b886b5fc) and rebased here. Only a context line differs.

Tested

MacBook Pro 16" M3 Max (J516C, T6031). Lab boots alternated main (972a566) and this commit, with aurora.debug_flags bit 49 on, two boots each. On screen means vkmark cube and shading, fullscreen on Hyprland at 120 Hz with FIFO, 70 s each.

vkmark headless score GPU time per frame On-screen p50 / p95 / p99 / max Frames over 12.5 ms
main 3187 (3137–3233) 567.1 µs 8.333 / 8.359 / 8.427 / 12.560 ms 3 of 30555
this PR 3272 (3219–3323) 551.9 µs 8.333 / 8.354 / 8.388 / 8.982 ms 0 of 32639
  • No GPU faults, recoveries or hang kills on any boot.
  • Throughput is neutral. Scores move about 6% from boot to boot. An earlier set of four boots had this commit 2.3% slower, so neither direction is real.
  • On-screen p99 was about 0.04 ms lower on all four of this commit's on-screen runs (cube and shading, two boots). That's consistent but small.
  • Main's three long frames had the GPU fence already signalled. The app was waiting in vkAcquireNextImageKHR on the compositor. They don't point at this path.

Limit of the measurement

A vkmark frame takes about 0.3 ms of an 8.3 ms budget here. A completion noticed up to 100 µs late can't show up in frame times. A workload with one frame in flight near the budget wasn't tried. This is a correctness fix that measured neutral, not a performance change.

🤖 Generated with Claude Code

rearm() ended with mod_delayed_work_on(.., 1). When the mailbox IRQ had
already queued the poll work to run now (kick() goes through poll_now()
with delay 0), a submit that rearmed right after pushed that poll out a
jiffy, and the poll that would have restarted the resnap timer did not
run either. A completion could then be noticed up to a resnap interval
(100 us) late.

Queue the one-jiffy backup only if no poll is pending, as G17's backup
poll does. The resnap timer's poll_now() still brings a later pending
poll forward, such as the idle PB reclaim expiry that rearm used to
replace, so nothing waits longer than the timer.

The resnap timer restart stays: a poll that is already queued rearms
after it, so the timer is started again with the new flight in view.

Rebased from c474b886b5fc (written on 7.2) onto aurora-silicon/linux
main: g15_repoll_us.value() is no longer dereferenced there, so that
context line differs. The change itself is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@malik-na
malik-na requested review from a team and DjDeveloperr as code owners November 30, 2026 02:32

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: FINISH, then merge at 16fd20ed58c6

Blockers:

  1. Missing DCO sign-off: commit 16fd20ed58c6 has no human Signed-off-by: trailer.
  2. Prohibited attribution trailers: remove the AI co-author trailer from the commit message and the generated-by footer from the PR description (project policy forbids AI attribution in commits and PR text).
  3. PR description & CI: add the required Risk: line to the PR body so pr-text passes, and wait for hosted CI (apple-build, host-tests, pr-text, and KUnit suites) to finish green on the updated head.

Checked:

  • drivers/gpu/drm/asahi/g15/poll.rs (Shared::rearm()): code logic is clean — switching the one-jiffy backup from self.mod_poll(1) to workqueue::system_highpri().enqueue_delayed::<Arc<Self>, POLL_WORK>(self.clone(), 1) avoids pushing an already-queued poll_now() (delay 0 from mailbox kick()) out by a jiffy while relying on the resnap hrtimer (poll_now() -> mod_poll(0)) to pull forward any later pending idle PB reclaim expiry.
  • Verified run_poll() comment update accurately reflects that resnap's poll_now() replaces the idle PB reclaim expiry.
  • Verified J516c (M3 Max, T6031) alternating A/B hardware measurements (0 GPU faults/recoveries/hangs, neutral throughput, consistent minor on-screen p99 improvement).
Evidence
  • Head: 16fd20ed58c63f4a483ce34ce457a20eef88a841 (base: main, MERGEABLE, +9/-4, 1 file, 1 commit).
  • Verified mod_poll() and poll_now() call sites in drivers/gpu/drm/asahi/g15/poll.rs: enqueue_delayed drops its cloned Arc<Self> cleanly when work is already pending and leaves any delay-0 work untouched.

@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) ci-failing A check failed at the PR head (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks Tested or Risk (bot) labels Nov 30, 2026
@github-actions

Copy link
Copy Markdown

Merge readiness at 16fd20ed: not ready yet

Check Detail
CI at head no failing: pr-text / pr-text
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head no no line with the head SHA 16fd20ed, a Mac and a result in the PR body or a comment
Conflicts ok none
PR text no add a 'Risk:' line (door and Macs) (guide)

Areas: area:gpu

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@malik-na

Copy link
Copy Markdown
Member Author

Replaced by #3702: same change, with a clean commit (Signed-off-by, no trailer) and the PR template.

@malik-na malik-na closed this Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:gpu Area from CODEOWNERS (bot) ci-failing A check failed at the PR head (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks Tested or Risk (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant