Skip to content

HMM profiler interface

Philip Yang amd-gfx 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest11 patches 8 repliesIn review
  2. v49 patches 1 replySuperseded
  3. v38 patches 0 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v28 patches7 repliesSuperseded
v15 patches3 repliesSuperseded

Changes in v5 from the cover letter

* Fix multi-thead profiling support
* Added user space usage example Thunk and ROCr patch

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11drm/amdkfd: Add KFD SMI event IDs and triggersinclude/uapi/linux/kfd_ioctl.h+37 -01 reply
2/11drm/amdkfd: Enable per process SMI eventdrivers/gpu/drm/amd/amdkfd/kfd_smi_events.c+26 -110 replies
3/11drm/amdkfd: Add GPU recoverable fault SMI eventdrivers/gpu/drm/amd/amdkfd/kfd_smi_events.c drivers/gpu/drm/amd/amdkfd/kfd_smi_events.h drivers/gpu/drm/amd/amdkfd/kfd_svm.c +1 more+36 -62 replies
4/11drm/amdkfd: Add migration SMI eventdrivers/gpu/drm/amd/amdkfd/kfd_migrate.c drivers/gpu/drm/amd/amdkfd/kfd_migrate.h drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c +2 more+83 -211 reply
5/11drm/amdkfd: Add user queue eviction restore SMI eventdrivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +6 more+69 -151 reply
6/11drm/amdkfd: Add unmap from GPU SMI eventdrivers/gpu/drm/amd/amdkfd/kfd_smi_events.c drivers/gpu/drm/amd/amdkfd/kfd_smi_events.h drivers/gpu/drm/amd/amdkfd/kfd_svm.c+30 -71 reply
7/11drm/amdkfd: Asynchronously free smi_clientdrivers/gpu/drm/amd/amdkfd/kfd_smi_events.c+10 -41 reply
8/11drm/amdkfd: Bump KFD API version for SMI profiling eventinclude/uapi/linux/kfd_ioctl.h+2 -11 reply
9/11libhsakmt: hsaKmtGetNodeProperties add gpu_idinclude/hsakmttypes.h src/fmm.c src/libhsakmt.h +1 more+18 -200 replies
10/11libhsakmt: add open SMI event handleinclude/hsakmt.h include/hsakmttypes.h src/events.c +1 more+93 -00 replies
11/11ROCR-Runtime Basic SVM profilersrc/CMakeLists.txt src/core/inc/amd_gpu_agent.h src/core/inc/runtime.h +4 more+458 -00 replies

Reviews trailers per patch

8 of 11 patches have a Reviewed-by or Acked-by.

PatchFelix Kuehling
1/11R-b
2/11R-b
3/11R-b R-b
4/11R-b
5/11R-b
6/11R-b
7/11R-b
8/11R-b
9/11
10/11
11/11

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 0/11] HMM profiler interface

This implements KFD profiling APIs to expose HMM migration and recoverable page fault profiling data. The ROCm profiler will shared link with application, to collect and expose the profiling data to application developers to tune the applications based on how the address range attributes affect the behavior and performance. Kernel perf and ftrace requires superuser permission to collect data, it is not suitable for ROCm profiler.

The profiling data is per process per device event uses the existing SMI (system management interface) event API. Each event log is one line of text with the event specific information.

For user space usage example:
patch 9/11, 10/11 Thunk libhsakmt is based on
https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface

patch 11/11 ROCr Basic-SVM-profiler patch is based on
https://github.com/RadeonOpenCompute/ROCR-Runtime

v5:
* Fix multi-thead profiling support
* Added user space usage example Thunk and ROCr patch

v4:
* Add event helper function
* Rebase to 5.16 kernel

v3:
* Changes from Felix's review

v2:
* Keep existing events behaviour
* Use ktime_get_boottime_ns() as timestamp to correlate with other APIs
* Use compact message layout, stick with existing message convention
* Add unmap from GPU event

Philip Yang (8):
drm/amdkfd: Add KFD SMI event IDs and triggers drm/amdkfd: Enable per process SMI event drm/amdkfd: Add GPU recoverable fault SMI event drm/amdkfd: Add migration SMI event
drm/amdkfd: Add user queue eviction restore SMI event drm/amdkfd: Add unmap from GPU SMI event drm/amdkfd: Asynchronously free smi_client drm/amdkfd: Bump KFD API version for SMI profiling event

 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h    |   2 +-
 .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c  |  12 +-
 drivers/gpu/drm/amd/amdkfd/kfd_chardev.c      |   4 +-
 drivers/gpu/drm/amd/amdkfd/kfd_device.c       |   4 +-
 drivers/gpu/drm/amd/amdkfd/kfd_migrate.c      |  53 +++++--
 drivers/gpu/drm/amd/amdkfd/kfd_migrate.h      |   5 +-
 drivers/gpu/drm/amd/amdkfd/kfd_priv.h         |   2 +-
 drivers/gpu/drm/amd/amdkfd/kfd_process.c      |  15 +-
 drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c   | 134 ++++++++++++++++--
 drivers/gpu/drm/amd/amdkfd/kfd_smi_events.h   |  21 ++-
 drivers/gpu/drm/amd/amdkfd/kfd_svm.c          |  64 ++++++---
 drivers/gpu/drm/amd/amdkfd/kfd_svm.h          |   2 +-
 include/uapi/linux/kfd_ioctl.h                |  40 +++++-
 13 files changed, 293 insertions(+), 65 deletions(-)