drm/amdgpu/userq: update the vm task info during signal ioctl
Subsystems (2)
PATCH 1/1 drm/amdgpu/userq: update the vm task info during signal ioctl
Pagefaults does not have process information correctly populated as vm->task is not set during vm_init but should be updated while real submission. So setting that up during signal_ioctl to get the correct submission process details.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c +3 -0
@@ -514,6 +514,9 @@ int amdgpu_userq_signal_ioctl(struct drm_device *dev, void *data, goto put_gobj_write; } +/* Update VM owner at userq submit-time for page-fault attribution. */ +amdgpu_vm_set_task_info (&fpriv->vm); + r =amdgpu_userq_fence_read_wptr (adev, queue, &wptr);if (r) goto put_queue;
Signature · 1 line
2.34.1
Christian König
maintainerQuoted 15 lines · Sunil Khatri
Pagefaults does not have process information correctly populated as
vm->taskis not set duringvm_initbut should be updated while real submission. So setting that up duringsignal_ioctlto get the correct submission process details.Signed-off-by Sunil Khatri <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c int amdgpu_userq_signal_ioctl(struct drm_device *dev, void *data, · line 519
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c +3
-0@@ -514,6 +514,9 @@ int amdgpu_userq_signal_ioctl(struct drm_device *dev, void *data, goto put_gobj_write; } +/* Update VM owner at userq submit-time for page-fault attribution. */ +amdgpu_vm_set_task_info (&fpriv->vm); +
Doing that in the signal IOCTL is probably a bit overkill since it is used quite often during the lifetime of the queue.
We can't add it to the userq manager creation because that is often done by X/Wayland instead of the final application, but I think we can just add it to the queue creation.
That should always be done in the process which is going to use the queue.
Regards,
Christian.
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c +0
-0r =amdgpu_userq_fence_read_wptr (adev, queue, &wptr);if (r) goto put_queue;
Quoted 19 lines · Christian König
Quoted 18 lines · Sunil Khatri
Pagefaults does not have process information correctly populated as
vm->taskis not set duringvm_initbut should be updated while real submission. So setting that up duringsignal_ioctlto get the correct submission process details.Signed-off-by Sunil Khatri <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c +0
-0@@ -514,6 +514,9 @@ int amdgpu_userq_signal_ioctl(struct drm_device *dev, void *data, goto put_gobj_write; }
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c int amdgpu_userq_signal_ioctl(struct drm_device *dev, void *data, · line 519
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c +3
-0+/* Update VM owner at userq submit-time for page-fault attribution. */ +amdgpu_vm_set_task_info (&fpriv->vm); +Doing that in the signal IOCTL is probably a bit overkill since it is used quite often during the lifetime of the queue.
We can't add it to the userq manager creation because that is often done by X/Wayland instead of the final application, but I think we can just add it to the queue creation.
That should always be done in the process which is going to use the queue.
True i also thought of it and it is definitely a overkill, that's why i thought to have a check if its not NULL then set it else just pass it. But i agree during queue create time also it is fine. Let me send the new patch with queue create time.
Regards
Sunil Khatri
Quoted 7 lines
Regards,
Christian.Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c +0
-0r =amdgpu_userq_fence_read_wptr (adev, queue, &wptr);if (r) goto put_queue;