Repository navigation
drm/asahi: mmu: translate an IOVA under the VM reservation alone - #1860
Merged
DjDeveloperr merged 1 commit intoNov 14, 2026
Conversation
Vm::translate_iova() took the GPUVM exec lock through lock_vm(), which locks every external object of the VM (drm_gpuvm_exec_lock() -> drm_gpuvm_prepare_objects()). Reading the page tables of this DRM_GPUVM_RESV_PROTECTED VM needs only the VM's own reservation, which GpuVm::exec_lock_vm() takes; the VA update paths already use it for the same reason. On G18 every submission audits its mappings (audit_render_mappings(), audit_application(), application_aliases(), audit_job_mappings()) by translating each mapped page. With a few dozen external objects in the VM (imported dma-bufs and the compositor's buffers) that was some 800,000 reservation lock/unlock pairs a second during video playback, and the job worker spent about 7 ms per job, holding the submitting ioctls in their ticket wait. Take that lock in translate_iova(). On the J873g (M6, G18G) with mpv playing a 4K60 H.264 clip under sway: the job worker's time per job goes from 6.9 ms to 1.9 ms, the submit wait from mostly 3-10 ms to mostly 1-3 ms, and dropped frames over 20 s from 889 to about 350. Signed-off-by: Thomas Glanzmann <[email protected]>
This was referenced Nov 13, 2026
Merged
DjDeveloperr
merged commit Nov 14, 2026
5d112b1
into
aurora-silicon:integration/aurora
1 check passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On G18, every submission audits its mappings by translating each mapped page through
Vm::translate_iova(). That function took the full GPUVM exec lock throughlock_vm(), which also locks every external object of the VM (drm_gpuvm_exec_lock()→drm_gpuvm_prepare_objects()).A page-table read of this
DRM_GPUVM_RESV_PROTECTEDVM needs only the VM's own reservation. That isGpuVm::exec_lock_vm(), which the map, unmap and bind paths already take. This change makestranslate_iova()take it too.The audits that call it are
audit_render_mappings(),audit_application(),application_aliases()andaudit_job_mappings().Why it matters on the M6
During mpv playback under sway the VM holds about 60 external objects: imported dma-bufs and the compositor's buffers. Every translated page therefore locked and unlocked all of them. The G18 job worker spent about 7 ms per job, and the submitting ioctls waited behind it. This explains the extra frame drops of integration kernels compared with the j873 line on the same firmware and Mesa.
Testing
On the M6 (J873g, G18G B1, macOS 27.2 firmware), with mpv
--vo=gpu --gpu-api=openglplaying a 4K60 H.264 clip for 20 s under sway, using aurora-silicon/mesa aurora-wip:The picture is intact (checked by screenshot), and dmesg shows no new GPU or GPUVM messages.
The "after" drop counts come from three runs on a normal (non-tracing) integration kernel with this commit; the timings come from a tracing build.
With the same firmware and Mesa, the j873 line drops 242–271 frames. The remaining drops are shared with it, mainly the per-page audits themselves, so they are a separate problem.