mbox series

[v5,0/6] DRM_SET_CLIENT_NAME ioctl

Message ID 20241003124506.470931-1-pierre-eric.pelloux-prayer@amd.com (mailing list archive)
Headers show
Series DRM_SET_CLIENT_NAME ioctl | expand

Message

Pierre-Eric Pelloux-Prayer Oct. 3, 2024, 12:43 p.m. UTC
v5 of this series which is adding a new ioctl to let userspace associate
a free-form name to a drm_file.

Having this name is useful when debugging or tracking resource usage; in
particular when using virtio native-context driver, where a single process
(say QEMU), uses 1 drm_file per-guest application.
With this change, fdinfo and other tools can map each drm_file activity to
the guest application.

virglrenderer MR using this new ioctl to associate the context "debug_name"
to the fd: 
https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/1428

Changes since v4:
* patches 1, 4 and 6 were slightly reworked based on Tvrtko' suggestions.

v4: https://lists.freedesktop.org/archives/dri-devel/2024-September/471695.html


Pierre-Eric Pelloux-Prayer (6):
  drm: add DRM_SET_CLIENT_NAME ioctl
  drm: use drm_file client_name in fdinfo
  drm/amdgpu: delay the use of amdgpu_vm_set_task_info
  drm/amdgpu: alloc and init vm::task_info from first submit
  drm/amdgpu: make process_name a flexible array
  drm/amdgpu: use drm_file::name in task_info::process_desc

 Documentation/gpu/drm-usage-stats.rst         |  5 ++
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h    |  1 +
 .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c  |  3 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c        |  6 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c   |  2 +-
 .../gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c  |  4 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_job.c       |  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c        | 67 +++++++++++++------
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h        |  4 +-
 drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c        |  2 +-
 drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c        |  2 +-
 drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c        |  2 +-
 drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c         |  2 +-
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c         |  2 +-
 drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c        |  2 +-
 drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c      |  2 +-
 drivers/gpu/drm/amd/amdkfd/kfd_events.c       |  2 +-
 drivers/gpu/drm/amd/amdkfd/kfd_process.c      |  3 +
 drivers/gpu/drm/drm_debugfs.c                 | 14 ++--
 drivers/gpu/drm/drm_file.c                    | 10 +++
 drivers/gpu/drm/drm_ioctl.c                   | 51 ++++++++++++++
 include/drm/drm_file.h                        |  9 +++
 include/uapi/drm/drm.h                        | 17 +++++
 23 files changed, 172 insertions(+), 42 deletions(-)

Comments

Christian König Oct. 8, 2024, 8:27 a.m. UTC | #1
Hi guys,

I've pushed the first two patches to drm-misc-next.

@Alex any objections to merge the amdgpu changes through drm-misc-next 
as well?

Thanks,
Christian.

Am 03.10.24 um 14:43 schrieb Pierre-Eric Pelloux-Prayer:
> v5 of this series which is adding a new ioctl to let userspace associate
> a free-form name to a drm_file.
>
> Having this name is useful when debugging or tracking resource usage; in
> particular when using virtio native-context driver, where a single process
> (say QEMU), uses 1 drm_file per-guest application.
> With this change, fdinfo and other tools can map each drm_file activity to
> the guest application.
>
> virglrenderer MR using this new ioctl to associate the context "debug_name"
> to the fd:
> https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/1428
>
> Changes since v4:
> * patches 1, 4 and 6 were slightly reworked based on Tvrtko' suggestions.
>
> v4: https://lists.freedesktop.org/archives/dri-devel/2024-September/471695.html
>
>
> Pierre-Eric Pelloux-Prayer (6):
>    drm: add DRM_SET_CLIENT_NAME ioctl
>    drm: use drm_file client_name in fdinfo
>    drm/amdgpu: delay the use of amdgpu_vm_set_task_info
>    drm/amdgpu: alloc and init vm::task_info from first submit
>    drm/amdgpu: make process_name a flexible array
>    drm/amdgpu: use drm_file::name in task_info::process_desc
>
>   Documentation/gpu/drm-usage-stats.rst         |  5 ++
>   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h    |  1 +
>   .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c  |  3 +-
>   drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c        |  6 +-
>   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c   |  2 +-
>   .../gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c  |  4 +-
>   drivers/gpu/drm/amd/amdgpu/amdgpu_job.c       |  2 +-
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c        | 67 +++++++++++++------
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h        |  4 +-
>   drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c        |  2 +-
>   drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c        |  2 +-
>   drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c        |  2 +-
>   drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c         |  2 +-
>   drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c         |  2 +-
>   drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c        |  2 +-
>   drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c      |  2 +-
>   drivers/gpu/drm/amd/amdkfd/kfd_events.c       |  2 +-
>   drivers/gpu/drm/amd/amdkfd/kfd_process.c      |  3 +
>   drivers/gpu/drm/drm_debugfs.c                 | 14 ++--
>   drivers/gpu/drm/drm_file.c                    | 10 +++
>   drivers/gpu/drm/drm_ioctl.c                   | 51 ++++++++++++++
>   include/drm/drm_file.h                        |  9 +++
>   include/uapi/drm/drm.h                        | 17 +++++
>   23 files changed, 172 insertions(+), 42 deletions(-)
>
Alex Deucher Oct. 8, 2024, 6:54 p.m. UTC | #2
[Public]

> -----Original Message-----
> From: Koenig, Christian <Christian.Koenig@amd.com>
> Sent: Tuesday, October 8, 2024 4:27 AM
> To: Deucher, Alexander <Alexander.Deucher@amd.com>
> Cc: robdclark@gmail.com; amd-gfx@lists.freedesktop.org; Pelloux-Prayer, Pierre-
> Eric <Pierre-eric.Pelloux-prayer@amd.com>; dri-devel@lists.freedesktop.org;
> dmitry.osipenko@collabora.com; jani.nikula@linux.intel.com; tursulin@igalia.com;
> simona.vetter@ffwll.ch
> Subject: Re: [PATCH v5 0/6] DRM_SET_CLIENT_NAME ioctl
>
> Hi guys,
>
> I've pushed the first two patches to drm-misc-next.
>
> @Alex any objections to merge the amdgpu changes through drm-misc-next as
> well?

That's fine with me.

Alex

>
> Thanks,
> Christian.
>
> Am 03.10.24 um 14:43 schrieb Pierre-Eric Pelloux-Prayer:
> > v5 of this series which is adding a new ioctl to let userspace
> > associate a free-form name to a drm_file.
> >
> > Having this name is useful when debugging or tracking resource usage;
> > in particular when using virtio native-context driver, where a single
> > process (say QEMU), uses 1 drm_file per-guest application.
> > With this change, fdinfo and other tools can map each drm_file
> > activity to the guest application.
> >
> > virglrenderer MR using this new ioctl to associate the context "debug_name"
> > to the fd:
> > https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/14
> > 28
> >
> > Changes since v4:
> > * patches 1, 4 and 6 were slightly reworked based on Tvrtko' suggestions.
> >
> > v4:
> > https://lists.freedesktop.org/archives/dri-devel/2024-September/471695
> > .html
> >
> >
> > Pierre-Eric Pelloux-Prayer (6):
> >    drm: add DRM_SET_CLIENT_NAME ioctl
> >    drm: use drm_file client_name in fdinfo
> >    drm/amdgpu: delay the use of amdgpu_vm_set_task_info
> >    drm/amdgpu: alloc and init vm::task_info from first submit
> >    drm/amdgpu: make process_name a flexible array
> >    drm/amdgpu: use drm_file::name in task_info::process_desc
> >
> >   Documentation/gpu/drm-usage-stats.rst         |  5 ++
> >   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h    |  1 +
> >   .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c  |  3 +-
> >   drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c        |  6 +-
> >   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c   |  2 +-
> >   .../gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c  |  4 +-
> >   drivers/gpu/drm/amd/amdgpu/amdgpu_job.c       |  2 +-
> >   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c        | 67 +++++++++++++------
> >   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h        |  4 +-
> >   drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c        |  2 +-
> >   drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c        |  2 +-
> >   drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c        |  2 +-
> >   drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c         |  2 +-
> >   drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c         |  2 +-
> >   drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c        |  2 +-
> >   drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c      |  2 +-
> >   drivers/gpu/drm/amd/amdkfd/kfd_events.c       |  2 +-
> >   drivers/gpu/drm/amd/amdkfd/kfd_process.c      |  3 +
> >   drivers/gpu/drm/drm_debugfs.c                 | 14 ++--
> >   drivers/gpu/drm/drm_file.c                    | 10 +++
> >   drivers/gpu/drm/drm_ioctl.c                   | 51 ++++++++++++++
> >   include/drm/drm_file.h                        |  9 +++
> >   include/uapi/drm/drm.h                        | 17 +++++
> >   23 files changed, 172 insertions(+), 42 deletions(-)
> >