Repository navigation
drm/asahi: g17: run drm_sched submit workqueues at WQ_HIGHPRI - #3391
Conversation
When a G17 command cannot publish inline (for example, query-accessing compute commands host-waiting on a pending timestamp writer, or commands queued behind a backlog), drm_sched wakes its ordered submit workqueue after the blocking fence signals. Previously Scheduler::new() either let drm_sched allocate a default normal-priority ordered workqueue (single-die M5) or allocated OwnedQueue::new_ordered_reclaim() without WQ_HIGHPRI. Under heavy game CPU load (GTA V, BeamNG), the normal-priority submit worker waited 30-140 us in CFS behind userspace threads, letting the GPU go idle and incur a ~55 us firmware cold-start penalty on top. Add OwnedQueue::new_ordered_highpri_reclaim() (WQ_MEM_RECLAIM | WQ_HIGHPRI, preserving highpri across workqueue_restrict()) and use it for G17 scheduler submit queues while keeping cluster restriction gated on creator_cluster_scheduling(). Add a compiled host test with 3 mutation traps verifying WQ_MEM_RECLAIM, WQ_HIGHPRI, highpri tracking for workqueue_restrict(), and G17 wiring. Signed-off-by: DjDeveloperr <[email protected]>
There was a problem hiding this comment.
Code approved at the reviewed head. The ordered allocator preserves ordering and reclaim flags, while publishing its high-priority attribute to the queue wrapper. The existing creator-cluster condition still controls affinity. I ran the exact-head host harness and it passed. Keep hosted CI, the isolated A/B, and peer evidence as merge gates. The existing game run combines three scheduler changes.
|
J700 (MacBook Neo, Apple A18 Pro
|
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
What: Run G17
drm_schedsubmit workqueues atWQ_HIGHPRI | WQ_MEM_RECLAIMinstead of normal CFS priority.OwnedQueue::new_ordered_highpri_reclaim()inrust/kernel/workqueue.rs(WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_HIGHPRIwithmax_active = 1).g17/job.rs::Scheduler::new()while keepingrestrict(cluster)gated oncreator_cluster_scheduling().When a G17 command waits on a host fence (such as a
query_accesscompute or a render behindRENDER_DEPTH = 32),drm_schedwakes its ordered submit workqueue to publish the ready job. Under CPU-heavy game workloads (GTA V / BeamNG), normal-prioritydrm_schedworkers wait behind game/Wine threads (14-143 uspub - donewakeup lag) while the GPU sits idle.Tested:
cfe3bf649a598:tools/asahi/g17-highpri-sched-wq-tests.py(4/4pass including 3 mutation traps) andg17-m5-multiqueue-contention(7/7pass).scripts/checkpatch.pl --strict0 errors, 0 checks. Localasahi.configbuild ofrust/kernel.oanddrivers/gpu/drm/asahi/aurora.osucceeds cleanly.inst-A), same-DTB (origin/mainDTB, MCC/SLC disabled) A/B (notsws2-rescanvsslot3-directaddingcfe3bf649a598+ inline cross-engine pub + direct staged/compute render overorigin/main + #3319 + #3330 + #3380):1.4.7.1):594/594executed passed,0failures (synchronization2.op.single_queue.barrier.*_read_image_compute*:412/412;occlusion_query.copy_*:152/159+ 7 NS;multiview.queries.*:16/16;synchronization.smoke.*:12/12;concurrent_queries.*:2/2).3024x1964native, Preset 2 Very High, TAA On, 10 s 24 MHz trace):HOST_WAIT(FR->CO)cut-25.1%(169.1 ms, med179.7 us->126.7 ms, med162.0 us), GPU busy92.86%->94.72%(+1.86 pp),P454.27->55.07 FPS,0GPU faults,0new kernel errors.wcusa(3024x1964):0>1 msGPU-idle blackouts,0GPU faults,0new kernel errors.Risk: Two-way door ·
WQ_HIGHPRIon ordered per-scheduler G17 submit workqueues only, matching the existingWQ_HIGHPRI | WQ_MEM_RECLAIMpriority ofaurora_g17_events.Not yet: Isolated single-commit J714s A/B (measured combined in
slot3-direct), G17P/G17C/G17D hardware rows, and CI.