Skip to content

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

Merged
RyanTheTide merged 1 commit into
aurora-silicon:mainfrom
malik-na:g15-rearm-keep-queued-poll-7.3-v2
Dec 1, 2026
Merged

RyanTheTide merged 1 commit into
aurora-silicon:mainfrom
malik-na:g15-rearm-keep-queued-poll-7.3-v2

Conversation

@malik-na

Copy link
Copy Markdown
Member

What: Don't let rearm() push an already-queued G15 poll out by a jiffy. When the mailbox IRQ had queued the poll to run now, a submit that rearmed right after delayed it and the resnap timer restart, so a completion could be noticed up to 100 µs late. The one-jiffy backup is now queued only if no poll is pending, as G17's backup poll does.
Tested: J516C M3 Max at 4a65f0d1 (same tree as the measured 16fd20e): 2 lab boots, no GPU faults, throughput and frame times neutral vs main 972a566.
Risk: two-way · M3 (G15: T8122, T6030, T6031, T6034)
Not yet: M3 base and M3 Pro. A workload with one frame in flight near the frame budget, where the 100 µs could show.

Details

rearm() ended with mod_delayed_work_on(.., 1). kick() goes through poll_now() with delay 0, so when the mailbox IRQ had already queued the poll work, a submit that rearmed right after pushed that poll out a jiffy, and the poll that would have restarted the resnap timer didn't run either.

The backup is now queued only if no poll is pending. 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 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.

Evidence

MacBook Pro 16" M3 Max (J516C, T6031). Lab boots alternated main (972a566) and this change (16fd20e, same tree as 4a65f0d1), 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 change 2.3% slower, so neither direction is real.
  • On-screen p99 was about 0.04 ms lower on all four of this change'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.
  • A vkmark frame takes about 0.3 ms of an 8.3 ms budget here, so a completion noticed up to 100 µs late can't show up in frame times. This is a correctness fix that measured neutral, not a performance change.

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.

Signed-off-by: Naeem Malik <malik2015naeem@gmail.com>
@malik-na
malik-na requested review from a team and DjDeveloperr as code owners November 30, 2026 17:14
@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) blast:m3 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 30, 2026
@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Merge readiness at 4a65f0d1: not ready yet

Check Detail
CI at head ok 22 checks passed
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok in the PR body at 4a65f0d1
Conflicts ok none
PR text ok Risk: two-way · M3 (G15: T8122, T6030, T6031, T6034)

Areas: area:gpu

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

@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: HOLD at 4a65f0d1

Blockers:

  • Hosted CI at 4a65f0d1 is still running (apple-build, host-tests, KUnit suites).
  • Pending second G15 variant hardware row (M3 base or M3 Pro) listed under Not yet before merge.

Checked:

  • drivers/gpu/drm/asahi/g15/poll.rs: verified replacing self.mod_poll(1) with workqueue::system_highpri().enqueue_delayed::<Arc<Self>, POLL_WORK>(self.clone(), 1) keeps POLL_WORK on system_highpri_wq, drops the cloned Arc<Self> cleanly on Err when already pending, prevents rearm() from pushing an IRQ-queued poll_now() (delay = 0) out by a jiffy, and still relies on the unconditionally armed resnap hrtimer (poll_now() -> mod_poll(0)) to pull forward any later idle PB reclaim work.
  • Exact-head J516C (M3 Max, T6031) testing at 4a65f0d1 (same tree as 16fd20ed): 2+2 alternating boots vs main, headless + 120 Hz Hyprland vkmark neutral with 0 GPU faults/recoveries/hang kills.
Evidence
  • rearm() unconditionally restarts self.resnap_handle with Delta::from_micros(us as i64) before enqueue_delayed(..., 1), so an earlier idle PB reclaim work item (Ok(false) branch at g15/poll.rs:93-95) is always pulled forward by resnap's poll_now() (mod_poll(0)).
  • Code is clean; ready once hosted CI finishes green and a second G15 variant row (M3 base or M3 Pro) is posted.

@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: MERGE at 4a65f0d14441

Blockers:

  • None.

Checked:

  • Audited the full 1-file diff (drivers/gpu/drm/asahi/g15/poll.rs, +9/-4, MERGEABLE against main): replaces self.mod_poll(1) in Shared::rearm() with workqueue::system_highpri().enqueue_delayed::<Arc<Self>, POLL_WORK>(self.clone(), 1), leaving an already-queued immediate poll undisturbed while preserving the one-jiffy backup when idle (and keeping resnap timer forwarding of a later idle PB reclaim poll intact).
  • Hosted CI is completely green at 4a65f0d14441 (20/20 passed: apple-build, host-tests, pr-text, readiness, and all 16 KUnit suites including KUnit asahi).
  • Hardware verified on the affected G15 family (J516C MacBook Pro 16" M3 Max, T6031): 2 alternated lab boots each vs main (972a5665), vkmark headless + 120 Hz fullscreen Hyprland FIFO (32,639 frames, 0 frames over 12.5 ms vs 3 on main), 0 GPU faults/recoveries/hang kills.
Evidence
  • Head: 4a65f0d14441c8ad5e3025df8379b5b3a6173ec8 (base main, MERGEABLE).
  • Scoped strictly to G15 (drivers/gpu/drm/asahi/g15/poll.rs); meets the merge bar cleanly on the audited diff, green CI, and G15 hardware proof without requiring extra single-generation sub-variant rows.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Merging at 4a65f0d14441 (B2 merge train, 12-01 merge bar). Approval at this head: aurora-silicon-review[bot]. Row: the hardware row at 4a65f0d1 that the readiness check found (PR body or comment). CI: linux train L4 = main (after L3) + 34 approved PRs (#3419 dropped: conflicts): Apple driver compile pass, Apple DTBs W=1 pass, planned KUnit ane-boot/clpc/ane-pm/dcp-fabric/dcp-topology/dcp-display/macaudio/asahi/sep all pass, host tests apple-dcp + apple-scaler-recovery pass (the red host-tests on some heads were base failures since fixed on main). The rest of the hosted run is queued behind the backlog. Revert: git revert -m 1 <merge commit>.

@RyanTheTide
RyanTheTide merged commit 325579c into aurora-silicon:main Dec 1, 2026
25 checks passed
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) blast:m3 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants