[PATCH v1 1/2] drm/amdgpu: add pid and name of the process with userq manager
Christian König
christian.koenig at amd.com
Tue Apr 8 13:07:00 UTC 2025
Am 08.04.25 um 14:41 schrieb Sunil Khatri:
> Add the pid and the process name of the process
> with the userq manager which could be used in
> debugging and understanding error messages better.
That should be unnecessary.
We already have that in the DRM file as well as the VM which is also updated when the fd moves from the X server to the client.
Regards,
Christian.
>
> Signed-off-by: Sunil Khatri <sunil.khatri at amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 8 ++++++++
> drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.h | 2 ++
> 2 files changed, 10 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> index 4262c320ad1d..f73bcca35287 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> @@ -1357,6 +1357,7 @@ int amdgpu_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
> {
> struct amdgpu_device *adev = drm_to_adev(dev);
> struct amdgpu_fpriv *fpriv;
> + struct task_struct *task;
> int r, pasid;
>
> /* Ensure IB tests are run on ring */
> @@ -1426,6 +1427,13 @@ int amdgpu_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
>
> amdgpu_ctx_mgr_init(&fpriv->ctx_mgr, adev);
>
> + task = get_pid_task(rcu_access_pointer(file_priv->pid), PIDTYPE_PID);
> + if (task) {
> + fpriv->userq_mgr.pid = task->pid;
> + fpriv->userq_mgr.process_name = kstrdup(task->comm, GFP_KERNEL);
> + put_task_struct(task);
> + }
> +
> r = amdgpu_userq_mgr_init(&fpriv->userq_mgr, adev);
> if (r)
> DRM_WARN("Can't setup usermode queues, use legacy workload submission only\n");
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.h
> index ec1a4ca6f632..a495b24165f9 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.h
> @@ -77,6 +77,8 @@ struct amdgpu_userq_mgr {
> struct amdgpu_device *adev;
> struct delayed_work resume_work;
> struct list_head list;
> + pid_t pid;
> + char *process_name;
> };
>
> struct amdgpu_db_info {
More information about the amd-gfx
mailing list