Repository navigation
drm/asahi: finish an exiting client's work before its mappings go - #1360
Merged
Merged
Conversation
Killing a Vulkan client with rendering in flight on T8112 (and once on T6000) gave a firmware timeout with a read fault on an unmapped address of the client's VM (UL1C or dVDM_CSD), then recovery. SIGTERM of gpubench-vk render.heavy fill 1080p at depth 4 reproduces it on the first try. The legacy (G13/G14) VMs carry no job lifetime. When the client's DRM file goes away, DRM first closes its GEM handles, and closing a handle unmaps the object from the client's VMs at once; File then drops the VMs, which unmaps the rest of the user range, before its queues. All of it happens while the client's jobs still run in the firmware. Give the queue trait a drain() hook. The legacy queue waits there, for at most 5 s, on the finished fence of its last submitted job; the jobs of one queue complete in order, so that fence covers all of them. The first GEM handle close of an exiting task drains every queue of the file once, and the queues now drop before the VMs and wait the same way (also when destroyed by ioctl). G15 and later VMs keep user mappings until their jobs release them, so their queues keep the no-op drain. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
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.
Killing a Vulkan client with rendering in flight on T8112 (and once seen on T6000) gives a firmware timeout with a read fault on an unmapped address of the client's VM (
UL1CordVDM_CSD,reason: Unmapped), then GPU recovery. SIGTERM ofgpubench-vk --test render.heavy --param kind=fill --param res=1080p --depths 4about 0.5 s into the run reproduces it on the first kill.The legacy (G13/G14) VMs carry no job lifetime. When the client's DRM file goes away,
drm_file_free()closes its GEM handles first, andAsahiObject::close()unmaps each object from the client's VMs at once;Filethen drops the VMs, which unmaps the rest of the user range, before its queues. All of this happens while the client's jobs still run in the firmware.drain()hook. The legacy queue waits there, for at most 5 s, on the finished fence of its last submitted job (the jobs of one queue complete in order).PF_EXITING, which covers exit, SIGTERM and SIGKILL) drains every queue of the file once.Filedrops its queues before its VMs, and a legacy queue waits the same way when it is dropped, also when it is destroyed by ioctl.drain().Results (M2, T8112)
🤖 Generated with Claude Code