Skip to contentSkip to conversation

drm/amdgpu/userq: update the vm task info during signal ioctl

PATCH Superseded Sunil Khatri 3 participants 3 messages May 12

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

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
index 008330a0d852..1dcde9b35f8b 100644
@@ -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
maintainer
#1 lore raw
Quoted 15 lines · Sunil Khatri

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 +0 -0
index 008330a0d852..1dcde9b35f8b 100644

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 -0
 	r = amdgpu_userq_fence_read_wptr(adev, queue, &wptr);
 	if (r)
 		goto put_queue;
#2 lore raw
Quoted 19 lines · Christian König
Quoted 18 lines · Sunil Khatri

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 +0 -0
index 008330a0d852..1dcde9b35f8b 100644
@@ -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 -0
  	r = amdgpu_userq_fence_read_wptr(adev, queue, &wptr);
  	if (r)
  		goto put_queue;