AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu/userq: update the vm task info during signal ioctl
@ 2026-05-12 10:32 Sunil Khatri
  2026-05-12 10:39 ` Christian König
  0 siblings, 1 reply; 3+ messages in thread
From: Sunil Khatri @ 2026-05-12 10:32 UTC (permalink / raw)
  To: Alex Deucher, Christian König; +Cc: amd-gfx, 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.

Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
index 008330a0d852..1dcde9b35f8b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
@@ -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;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/amdgpu/userq: update the vm task info during signal ioctl
  2026-05-12 10:32 [PATCH] drm/amdgpu/userq: update the vm task info during signal ioctl Sunil Khatri
@ 2026-05-12 10:39 ` Christian König
  2026-05-12 10:49   ` Khatri, Sunil
  0 siblings, 1 reply; 3+ messages in thread
From: Christian König @ 2026-05-12 10:39 UTC (permalink / raw)
  To: Sunil Khatri, Alex Deucher; +Cc: amd-gfx

On 5/12/26 12:32, Sunil Khatri wrote:
> 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.
> 
> Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
> index 008330a0d852..1dcde9b35f8b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
> @@ -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.

>  	r = amdgpu_userq_fence_read_wptr(adev, queue, &wptr);
>  	if (r)
>  		goto put_queue;


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/amdgpu/userq: update the vm task info during signal ioctl
  2026-05-12 10:39 ` Christian König
@ 2026-05-12 10:49   ` Khatri, Sunil
  0 siblings, 0 replies; 3+ messages in thread
From: Khatri, Sunil @ 2026-05-12 10:49 UTC (permalink / raw)
  To: Christian König, Sunil Khatri, Alex Deucher; +Cc: amd-gfx


On 12-05-2026 04:09 pm, Christian König wrote:
> On 5/12/26 12:32, Sunil Khatri wrote:
>> 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.
>>
>> Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
>> index 008330a0d852..1dcde9b35f8b 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
>> @@ -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.

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

>
> Regards,
> Christian.
>
>>   	r = amdgpu_userq_fence_read_wptr(adev, queue, &wptr);
>>   	if (r)
>>   		goto put_queue;

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-05-12 10:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-12 10:32 [PATCH] drm/amdgpu/userq: update the vm task info during signal ioctl Sunil Khatri
2026-05-12 10:39 ` Christian König
2026-05-12 10:49   ` Khatri, Sunil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox