Re: [PATCH v2 1/4] drm/amdkfd: Document and define SVM events message macro

2024-08-22 Thread James Zhu
On 2024-07-30 16:15, Philip Yang wrote: Document how to use SMI system management interface to enable and receive SVM events. Document SVM event triggers. Define SVM events message string format macro that could be used by user mode for sscanf to parse the event. Add it to uAPI header file to ma

Re: [PATCH v2 3/4] drm/amdkfd: Increase SMI event fifo size

2024-08-22 Thread James Zhu
On 2024-07-30 16:15, Philip Yang wrote: SMI event fifo size 1KB was enough to report GPU vm fault or reset [JZ] There is a typo here. it should be NOT enough. event, increase it to 8KB to store about 100 migrate events, less chance to drop the migrate events if lots of migration happened in t

Re: [PATCH v2 4/4] drm/amdkfd: SMI report dropped event count

2024-08-22 Thread James Zhu
On 2024-07-30 16:15, Philip Yang wrote: Add new SMI event to report the dropped event count when the event kfifo is full. When the kfifo has space for two events, generate a dropped event record to report how many events were dropped, together with the next event to add to kfifo. After readin

Re: [PATCH v3 0/4] Improve SVM migrate event report

2024-08-27 Thread James Zhu
error code if migration failed. 4. Report dropped event count if fifo is full. v3: Simplify event drop count handling (James Zhu) Philip Yang (4): drm/amdkfd: Document and define SVM events message macro drm/amdkfd: Output migrate end event if migrate failed drm/amdkfd: Increase SMI event

Re: [PATCH 2/2] drm/amdkfd:Add kfd function to config sq perfmon

2024-09-13 Thread James Zhu
Reviewed-by:JamesZhufortheseries. On 2024-09-13 04:32, Feifei Xu wrote: Expose the interface for kfd to config sq perfmon. Signed-off-by: Feifei Xu Suggested-by: Hawking Zhang Reviewed-by: Lijo Lazar --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 15 +++ drivers/gpu/drm/amd/amd

[PATCH v4 00/24] Support Host Trap Sampling for gfx941/gfx942

2024-02-06 Thread James Zhu
: add pc sampling support drm/amdkfd: enable pc sampling query drm/amdkfd: enable pc sampling create drm/amdkfd: Set debug trap bit when enabling PC Sampling James Zhu (19): drm/amdkfd: add pc sampling mutex drm/amdkfd: add trace_id return drm/amdkfd: check pcs_entry valid drm/amdkfd

[PATCH v4 02/24] drm/amdkfd: add pc sampling support

2024-02-06 Thread James Zhu
From: David Yat Sin Add pc sampling functions in amdkfd. Co-developed-by: James Zhu Signed-off-by: James Zhu Signed-off-by: David Yat Sin --- drivers/gpu/drm/amd/amdkfd/Makefile | 3 +- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 45 +++ drivers/gpu/drm/amd/amdkfd

[PATCH v4 03/24] drm/amdkfd: enable pc sampling query

2024-02-06 Thread James Zhu
From: David Yat Sin Enable pc sampling to query system capability. Co-developed-by: James Zhu Signed-off-by: James Zhu Signed-off-by: David Yat Sin --- drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 65 +++- 1 file changed, 64 insertions(+), 1 deletion(-) diff --git a

[PATCH v4 04/24] drm/amdkfd: add pc sampling mutex

2024-02-06 Thread James Zhu
Add pc sampling mutex per node, and do init/destroy in node init. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 12 drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 7 +++ 2 files changed, 19 insertions(+) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c

[PATCH v4 07/24] drm/amdkfd: check pcs_entry valid

2024-02-06 Thread James Zhu
Check pcs_entry valid for pc sampling ioctl. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 33 ++-- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c b/drivers/gpu/drm/amd/amdkfd

[PATCH v4 10/24] drm/amdkfd: trigger pc sampling trap for gfx v9

2024-02-06 Thread James Zhu
Implement trigger pc sampling trap for gfx v9. Signed-off-by: James Zhu --- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c | 36 +++ .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.h | 7 2 files changed, 43 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu

[PATCH v4 01/24] drm/amdkfd/kfd_ioctl: add pc sampling support

2024-02-06 Thread James Zhu
From: David Yat Sin Add pc sampling support in kfd_ioctl. The user mode code which uses this new kfd_ioctl is linked to https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface with master branch. Co-developed-by: James Zhu Signed-off-by: James Zhu Signed-off-by: David Yat Sin --- include

[PATCH v4 08/24] drm/amdkfd: enable pc sampling destroy

2024-02-06 Thread James Zhu
Enable pc sampling destroy. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 20 +--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c b/drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c index

[PATCH v4 14/24] drm/amdkfd: trigger pc sampling trap for arcturus

2024-02-06 Thread James Zhu
Implement trigger pc sampling trap for arcturus. Signed-off-by: James Zhu --- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_arcturus.c| 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_arcturus.c b/drivers/gpu/drm/amd/amdgpu

[PATCH v4 13/24] drm/amdgpu: add sq host trap status check

2024-02-06 Thread James Zhu
Before fire a new host trap, check the host trap status. Signed-off-by: James Zhu --- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c | 35 +++ .../amd/include/asic_reg/gc/gc_9_0_offset.h | 2 ++ .../amd/include/asic_reg/gc/gc_9_0_sh_mask.h | 5 +++ 3 files changed, 42

[PATCH v4 06/24] drm/amdkfd: add trace_id return

2024-02-06 Thread James Zhu
Add trace_id return for new pc sampling creation per device, Use IDR to quickly locate pc_sampling_entry for reference. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 2 ++ drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 20 +++- drivers/gpu/drm/amd

[PATCH v4 16/24] drm/amdkfd: use bit operation set debug trap

2024-02-06 Thread James Zhu
1st level TMA's 2nd byte which used for trap type setting, to use bit operation to change selected bit only. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_process.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/a

[PATCH v4 20/24] drm/amdkfd: enable pc sampling start

2024-02-06 Thread James Zhu
Enable pc sampling start. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 27 +--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c b/drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c index

[PATCH v4 05/24] drm/amdkfd: enable pc sampling create

2024-02-06 Thread James Zhu
From: David Yat Sin Enable pc sampling create. Co-developed-by: James Zhu Signed-off-by: James Zhu Signed-off-by: David Yat Sin --- drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 59 +++- drivers/gpu/drm/amd/amdkfd/kfd_priv.h| 10 2 files changed, 68 insertions

[PATCH v4 11/24] drm/amdkfd/gfx9: enable host trap

2024-02-06 Thread James Zhu
Enable host trap. Signed-off-by: James Zhu --- .../gpu/drm/amd/amdkfd/cwsr_trap_handler.h| 63 +++ .../drm/amd/amdkfd/cwsr_trap_handler_gfx9.asm | 24 --- 2 files changed, 52 insertions(+), 35 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler.h b

[PATCH v4 17/24] drm/amdkfd: add setting trap pc sampling flag

2024-02-06 Thread James Zhu
Add setting trap pc sampling flag. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_priv.h| 2 ++ drivers/gpu/drm/amd/amdkfd/kfd_process.c | 13 + 2 files changed, 15 insertions(+) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd

[PATCH v4 09/24] drm/amdkfd: add interface to trigger pc sampling trap

2024-02-06 Thread James Zhu
Add interface to trigger pc sampling trap. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/include/kgd_kfd_interface.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/amd/include/kgd_kfd_interface.h b/drivers/gpu/drm/amd/include/kgd_kfd_interface.h index

[PATCH v4 15/24] drm/amdkfd: trigger pc sampling trap for aldebaran

2024-02-06 Thread James Zhu
Implement trigger pc sampling trap for aldebaran. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.c b/drivers/gpu/drm/amd/amdgpu

[PATCH v4 18/24] drm/amdkfd: enable pc sampling stop

2024-02-06 Thread James Zhu
Enable pc sampling stop. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 29 ++-- drivers/gpu/drm/amd/amdkfd/kfd_priv.h| 4 +++ 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c b

[PATCH v4 19/24] drm/amdkfd: add queue remapping

2024-02-06 Thread James Zhu
the queues either waits for the waves to drain, or preempts them with CWSR, which itself executes a trap and waits for previous traps to finish. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 11 +++ drivers/gpu/drm/amd/amdkfd

[PATCH v4 21/24] drm/amdkfd: add pc sampling thread to trigger trap

2024-02-06 Thread James Zhu
Add a kthread to trigger pc sampling trap. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 91 +++- drivers/gpu/drm/amd/amdkfd/kfd_priv.h| 1 + 2 files changed, 89 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd

[PATCH v4 22/24] drm/amdkfd: add pc sampling release when process release

2024-02-06 Thread James Zhu
Add pc sampling release when process release, it will force to stop all activate sessions with this process. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 25 drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.h | 1 + drivers/gpu/drm/amd/amdkfd

[PATCH v4 23/24] drm/amdkfd: Set debug trap bit when enabling PC Sampling

2024-02-06 Thread James Zhu
KFD_RUNTIME_ENABLE_MODE_ENABLE_MASK flag on exit. It is also not valid to have the debugger attached to a process while PC sampling is enabled so adding some checks to prevent this. Signed-off-by: David Yat Sin Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 30

[PATCH v4 24/24] drm/amdkfd: bump kfd ioctl minor version for pc sampling availability

2024-02-06 Thread James Zhu
Bump the minor version to declare pc sampling feature is now available. Signed-off-by: James Zhu --- include/uapi/linux/kfd_ioctl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/kfd_ioctl.h b/include/uapi/linux/kfd_ioctl.h index ec1b6404b185

[PATCH v4 12/24] drm/amdgpu: use trapID 4 for host trap

2024-02-06 Thread James Zhu
Since TRAPSTS.HOST_TRAP won't work pre-gfx943, so use TTMP1 (bit 24: HT) and (bit 16-23: trapID) to identify the host trap. Signed-off-by: James Zhu --- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c |2 + .../gpu/drm/amd/amdkfd/cwsr_trap_handler.h| 2117 + .../dr

Re: [PATCH v4 00/24] Support Host Trap Sampling for gfx941/gfx942

2024-02-12 Thread James Zhu
Ping . Best Regards! James Zhu On 2024-02-06 10:58, James Zhu wrote: PC sampling is a form of software profiling, where the threads of an application are periodically interrupted and the program counter that the threads are currently attempting to execute is saved out for profiling

Re: [PATCH] drm/amd/amdxcp: Use unique name for partition dev

2024-04-30 Thread James Zhu
On 2024-04-30 07:36, Lijo Lazar wrote: amdxcp is a platform driver for creating partition devices. libdrm library identifies a platform device based on 'OF_FULLNAME' or 'MODALIAS'. If two or more devices have the same platform name, drm library only picks the first device. Platform driver core us

Re: [PATCH] drm/amdkfd: Remove arbitrary timeout for hmm_range_fault

2024-05-02 Thread James Zhu
On 2024-05-01 18:56, Philip Yang wrote: On system with khugepaged enabled and user cases with THP buffer, the hmm_range_fault may takes > 15 seconds to return -EBUSY, the arbitrary timeout value is not accurate, cause memory allocation failure. Remove the arbitrary timeout value, return EAGAIN

Re: [PATCH 22/24] drm/amdkfd: add pc sampling release when process release

2023-11-13 Thread James Zhu
/amdkfd: add pc sampling release when process release Add pc sampling release when process release, it will force to stop all activate sessions with this process. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 26 drivers/gpu/drm/amd/amdkfd

Re: [PATCH 19/24] drm/amdkfd: enable pc sampling stop

2023-11-13 Thread James Zhu
/amdkfd: enable pc sampling stop Enable pc sampling stop. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 28 +-- - drivers/gpu/drm/amd/amdkfd/kfd_priv.h| 2 ++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd

Re: [PATCH 22/24] drm/amdkfd: add pc sampling release when process release

2023-11-13 Thread James Zhu
4] drm/amdkfd: add pc sampling release when process release Add pc sampling release when process release, it will force to stop all activate sessions with this process. Signed-off-by: James Zhu <mailto:james@amd.com> --- drivers/gpu/d

Re: [PATCH 19/24] drm/amdkfd: enable pc sampling stop

2023-11-13 Thread James Zhu
sampling stop Enable pc sampling stop. Signed-off-by: James Zhu <mailto:james@amd.com> --- drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 28 +-- - drivers/gpu/drm/amd/amdkfd/kfd_priv.h    |  2 ++

Re: [PATCH 00/24] Support Host Trap Sampling for MI200

2023-11-16 Thread James Zhu
Ping ... On 2023-11-03 09:11, James Zhu wrote: PC sampling is a form of software profiling, where the threads of an application are periodically interrupted and the program counter that the thread is currently attempting to execute is saved out for profiling. David Yat Sin (5): drm/amdkfd

[PATCH v2 03/24] drm/amdkfd: enable pc sampling query

2023-11-20 Thread James Zhu
From: David Yat Sin Enable pc sampling to query system capability. Co-developed-by: James Zhu Signed-off-by: James Zhu Signed-off-by: David Yat Sin --- drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 54 +++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a

[PATCH v2 07/24] drm/amdkfd: check pcs_enrty valid

2023-11-20 Thread James Zhu
Check pcs_entry valid for pc sampling ioctl. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 30 ++-- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c b/drivers/gpu/drm/amd/amdkfd

[PATCH v2 10/24] drm/amdkfd: trigger pc sampling trap for gfx v9

2023-11-20 Thread James Zhu
Implement trigger pc sampling trap for gfx v9. Signed-off-by: James Zhu --- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c | 36 +++ .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.h | 7 2 files changed, 43 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu

[PATCH v2 12/24] drm/amdgpu: use trapID 4 for host trap

2023-11-20 Thread James Zhu
Since TRAPSTS.HOST_TRAP won't work pre-gfx943, so use TTMP1 (bit 24: HT) and (bit 16-23: trapID) to identify the host trap. Signed-off-by: James Zhu --- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c |2 + .../gpu/drm/amd/amdkfd/cwsr_trap_handler.h| 2117 + .../dr

[PATCH v2 13/24] drm/amdgpu: add sq host trap status check

2023-11-20 Thread James Zhu
Before fire a new host trap, check the host trap status. Signed-off-by: James Zhu --- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c | 35 +++ .../amd/include/asic_reg/gc/gc_9_0_offset.h | 2 ++ .../amd/include/asic_reg/gc/gc_9_0_sh_mask.h | 5 +++ 3 files changed, 42

Re: [PATCH 15/24] drm/amdkfd: trigger pc sampling trap for aldebaran

2023-11-20 Thread James Zhu
@lists.freedesktop.org Cc: Kuehling, Felix ; Greathouse, Joseph ; Yat Sin, David ; Zhu, James Subject: [PATCH 15/24] drm/amdkfd: trigger pc sampling trap for aldebaran Implement trigger pc sampling trap for aldebaran. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.c | 11

Re: [PATCH 16/24] drm/amdkfd: use bit operation set debug trap

2023-11-20 Thread James Zhu
] drm/amdkfd: use bit operation set debug trap 1st level TMA's 2nd byte which used for trap type setting, to use bit operation to change selected bit only. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_process.c | 16 +--- 1 file changed, 13 insertions(+), 3 dele

[PATCH v2 22/24] drm/amdkfd: add pc sampling release when process release

2023-11-20 Thread James Zhu
Add pc sampling release when process release, it will force to stop all activate sessions with this process. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 21 drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.h | 1 + drivers/gpu/drm/amd/amdkfd

Re: [PATCH 23/24] drm/amdkfd: add pc sampling capability check

2023-11-23 Thread James Zhu
On 2023-11-22 17:40, Felix Kuehling wrote: On 2023-11-03 09:11, James Zhu wrote: From: David Yat Sin Add pc sampling capability check. This should be squashed into patch 2. Or if you want to keep it separate, put this patch before patch 2 and define AMDKFD_IOC_PC_SAMPLE with

Re: [PATCH 21/24] drm/amdkfd: add queue remapping

2023-11-23 Thread James Zhu
On 2023-11-22 17:35, Felix Kuehling wrote: On 2023-11-03 09:11, James Zhu wrote: Add queue remapping to force the waves in any running processes to complete a CWSR trap. Please add an explanation why this is needed. [JZ] Even though the profiling-enabled bits is turned off, the CWSR trap

Re: [PATCH 20/24] drm/amdkfd: enable pc sampling work to trigger trap

2023-11-23 Thread James Zhu
On 2023-11-22 17:31, Felix Kuehling wrote: On 2023-11-03 09:11, James Zhu wrote: Enable a delay work to trigger pc sampling trap. Signed-off-by: James Zhu ---   drivers/gpu/drm/amd/amdkfd/kfd_device.c  |  3 ++   drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 39

Re: [PATCH 21/24] drm/amdkfd: add queue remapping

2023-11-23 Thread James Zhu
On 2023-11-23 14:02, Felix Kuehling wrote: On 2023-11-23 11:25, James Zhu wrote: On 2023-11-22 17:35, Felix Kuehling wrote: On 2023-11-03 09:11, James Zhu wrote: Add queue remapping to force the waves in any running processes to complete a CWSR trap. Please add an explanation why this

Re: [PATCH 20/24] drm/amdkfd: enable pc sampling work to trigger trap

2023-11-23 Thread James Zhu
On 2023-11-23 14:08, Felix Kuehling wrote: On 2023-11-23 13:27, James Zhu wrote: On 2023-11-22 17:31, Felix Kuehling wrote: On 2023-11-03 09:11, James Zhu wrote: Enable a delay work to trigger pc sampling trap. Signed-off-by: James Zhu ---   drivers/gpu/drm/amd/amdkfd/kfd_device.c

Re: [PATCH 18/24] drm/amdkfd: enable pc sampling start

2023-11-23 Thread James Zhu
On 2023-11-22 17:27, Felix Kuehling wrote: On 2023-11-03 09:11, James Zhu wrote: Enable pc sampling start. Signed-off-by: James Zhu ---   drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 26 +---   drivers/gpu/drm/amd/amdkfd/kfd_priv.h    |  2 ++   2 files changed, 25

Re: [PATCH 07/24] drm/amdkfd: check pcs_enrty valid

2023-11-23 Thread James Zhu
On 2023-11-22 17:15, Felix Kuehling wrote: On 2023-11-03 09:11, James Zhu wrote: Check pcs_enrty valid for pc sampling ioctl. Signed-off-by: James Zhu ---   drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 30 ++--   1 file changed, 27 insertions(+), 3 deletions(-) diff --git

Re: [PATCH 06/24] drm/amdkfd: add trace_id return

2023-11-23 Thread James Zhu
On 2023-11-22 16:56, Felix Kuehling wrote: On 2023-11-03 09:11, James Zhu wrote: Add trace_id return for new pc sampling creation per device, Use IDR to quickly locate pc_sampling_entry for reference. Signed-off-by: James Zhu ---   drivers/gpu/drm/amd/amdkfd/kfd_device.c  |  2

Re: [PATCH 05/24] drm/amdkfd: enable pc sampling create

2023-11-23 Thread James Zhu
On 2023-11-22 16:51, Felix Kuehling wrote: On 2023-11-03 09:11, James Zhu wrote: From: David Yat Sin Enable pc sampling create. Co-developed-by: James Zhu Signed-off-by: James Zhu Signed-off-by: David Yat Sin ---   drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 54

Re: [PATCH 01/24] drm/amdkfd/kfd_ioctl: add pc sampling support

2023-11-23 Thread James Zhu
On 2023-11-22 16:14, Felix Kuehling wrote: On 2023-11-03 09:11, James Zhu wrote: From: David Yat Sin Add pc sampling support in kfd_ioctl. Co-developed-by: James Zhu Signed-off-by: James Zhu Signed-off-by: David Yat Sin ---   include/uapi/linux/kfd_ioctl.h | 57

Re: [PATCH 18/24] drm/amdkfd: enable pc sampling start

2023-11-23 Thread James Zhu
On 2023-11-23 15:21, Felix Kuehling wrote: On 2023-11-23 15:01, James Zhu wrote: On 2023-11-22 17:27, Felix Kuehling wrote: On 2023-11-03 09:11, James Zhu wrote: Enable pc sampling start. Signed-off-by: James Zhu ---   drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 26

Re: [PATCH 07/24] drm/amdkfd: check pcs_enrty valid

2023-11-23 Thread James Zhu
On 2023-11-23 15:32, Felix Kuehling wrote: On 2023-11-23 15:18, James Zhu wrote: On 2023-11-22 17:15, Felix Kuehling wrote: On 2023-11-03 09:11, James Zhu wrote: Check pcs_enrty valid for pc sampling ioctl. Signed-off-by: James Zhu ---   drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c

Re: [PATCH 21/24] drm/amdkfd: add queue remapping

2023-11-23 Thread James Zhu
On 2023-11-23 18:01, Felix Kuehling wrote: On 2023-11-23 17:41, Greathouse, Joseph wrote: [Public] -Original Message- From: Zhu, James Sent: Thursday, November 23, 2023 1:49 PM On 2023-11-23 14:02, Felix Kuehling wrote: On 2023-11-23 11:25, James Zhu wrote: On 2023-11-22 17:35

Re: [PATCH 01/24] drm/amdkfd/kfd_ioctl: add pc sampling support

2023-11-27 Thread James Zhu
On 2023-11-27 14:11, Alex Deucher wrote: On Fri, Nov 3, 2023 at 9:22 AM James Zhu wrote: From: David Yat Sin Add pc sampling support in kfd_ioctl. Co-developed-by: James Zhu Signed-off-by: James Zhu Signed-off-by: David Yat Sin For any new IOCTL interfaces, please provide a link to the

[PATCH v2 00/23] Support Host Trap Sampling for gfx941/gfx942

2023-12-07 Thread James Zhu
: add pc sampling support drm/amdkfd: enable pc sampling query drm/amdkfd: enable pc sampling create James Zhu (19): drm/amdkfd: add pc sampling mutex drm/amdkfd: add trace_id return drm/amdkfd: check pcs_enrty valid drm/amdkfd: enable pc sampling destroy drm/amdkfd: add interface to

[PATCH v2 02/23] drm/amdkfd: add pc sampling support

2023-12-07 Thread James Zhu
From: David Yat Sin Add pc sampling functions in amdkfd. Co-developed-by: James Zhu Signed-off-by: James Zhu Signed-off-by: David Yat Sin --- drivers/gpu/drm/amd/amdkfd/Makefile | 3 +- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 44 +++ drivers/gpu/drm/amd/amdkfd

[PATCH v2 01/23] drm/amdkfd/kfd_ioctl: add pc sampling support

2023-12-07 Thread James Zhu
From: David Yat Sin Add pc sampling support in kfd_ioctl. The user mode code which uses this new kfd_ioctl is linked to https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface with master branch. Co-developed-by: James Zhu Signed-off-by: James Zhu Signed-off-by: David Yat Sin --- include

[PATCH v2 04/23] drm/amdkfd: add pc sampling mutex

2023-12-07 Thread James Zhu
Add pc sampling mutex per node, and do init/destroy in node init. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 12 drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 7 +++ 2 files changed, 19 insertions(+) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c

[PATCH v2 05/23] drm/amdkfd: enable pc sampling create

2023-12-07 Thread James Zhu
From: David Yat Sin Enable pc sampling create. Co-developed-by: James Zhu Signed-off-by: James Zhu Signed-off-by: David Yat Sin --- drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 53 +++- drivers/gpu/drm/amd/amdkfd/kfd_priv.h| 10 2 files changed, 62 insertions

[PATCH v2 07/23] drm/amdkfd: check pcs_enrty valid

2023-12-07 Thread James Zhu
Check pcs_entry valid for pc sampling ioctl. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 33 ++-- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c b/drivers/gpu/drm/amd/amdkfd

[PATCH v2 03/23] drm/amdkfd: enable pc sampling query

2023-12-07 Thread James Zhu
From: David Yat Sin Enable pc sampling to query system capability. Co-developed-by: James Zhu Signed-off-by: James Zhu Signed-off-by: David Yat Sin --- drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 54 +++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a

[PATCH v2 10/23] drm/amdkfd: trigger pc sampling trap for gfx v9

2023-12-07 Thread James Zhu
Implement trigger pc sampling trap for gfx v9. Signed-off-by: James Zhu --- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c | 36 +++ .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.h | 7 2 files changed, 43 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu

[PATCH v2 06/23] drm/amdkfd: add trace_id return

2023-12-07 Thread James Zhu
Add trace_id return for new pc sampling creation per device, Use IDR to quickly locate pc_sampling_entry for reference. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 2 ++ drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 20 +++- drivers/gpu/drm/amd

[PATCH v2 08/23] drm/amdkfd: enable pc sampling destroy

2023-12-07 Thread James Zhu
Enable pc sampling destroy. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 20 +--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c b/drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c index

[PATCH v2 09/23] drm/amdkfd: add interface to trigger pc sampling trap

2023-12-07 Thread James Zhu
Add interface to trigger pc sampling trap. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/include/kgd_kfd_interface.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/amd/include/kgd_kfd_interface.h b/drivers/gpu/drm/amd/include/kgd_kfd_interface.h index 6d094cf3587d

[PATCH v2 14/23] drm/amdkfd: trigger pc sampling trap for arcturus

2023-12-07 Thread James Zhu
Implement trigger pc sampling trap for arcturus. Signed-off-by: James Zhu --- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_arcturus.c| 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_arcturus.c b/drivers/gpu/drm/amd/amdgpu

[PATCH v2 11/23] drm/amdkfd/gfx9: enable host trap

2023-12-07 Thread James Zhu
Enable host trap. Signed-off-by: James Zhu --- .../gpu/drm/amd/amdkfd/cwsr_trap_handler.h| 63 +++ .../drm/amd/amdkfd/cwsr_trap_handler_gfx9.asm | 24 --- 2 files changed, 52 insertions(+), 35 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler.h b

[PATCH v2 13/23] drm/amdgpu: add sq host trap status check

2023-12-07 Thread James Zhu
Before fire a new host trap, check the host trap status. Signed-off-by: James Zhu --- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c | 35 +++ .../amd/include/asic_reg/gc/gc_9_0_offset.h | 2 ++ .../amd/include/asic_reg/gc/gc_9_0_sh_mask.h | 5 +++ 3 files changed, 42

[PATCH v2 20/23] drm/amdkfd: enable pc sampling start

2023-12-07 Thread James Zhu
Enable pc sampling start. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 26 +--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c b/drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c index

[PATCH v2 17/23] drm/amdkfd: add setting trap pc sampling flag

2023-12-07 Thread James Zhu
Add setting trap pc sampling flag. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_priv.h| 2 ++ drivers/gpu/drm/amd/amdkfd/kfd_process.c | 13 + 2 files changed, 15 insertions(+) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd

[PATCH v2 16/23] drm/amdkfd: use bit operation set debug trap

2023-12-07 Thread James Zhu
1st level TMA's 2nd byte which used for trap type setting, to use bit operation to change selected bit only. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_process.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/a

[PATCH v2 18/23] drm/amdkfd: enable pc sampling stop

2023-12-07 Thread James Zhu
Enable pc sampling stop. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 28 +--- drivers/gpu/drm/amd/amdkfd/kfd_priv.h| 4 +++ 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c b

[PATCH v2 15/23] drm/amdkfd: trigger pc sampling trap for aldebaran

2023-12-07 Thread James Zhu
Implement trigger pc sampling trap for aldebaran. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_aldebaran.c b/drivers/gpu/drm/amd/amdgpu

[PATCH v2 19/23] drm/amdkfd: add queue remapping

2023-12-07 Thread James Zhu
the queues either waits for the waves to drain, or preempts them with CWSR, which itself executes a trap and waits for previous traps to finish. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 11 +++ drivers/gpu/drm/amd/amdkfd

[PATCH v2 23/23] drm/amdkfd: bump kfd ioctl minor version for pc sampling availability

2023-12-07 Thread James Zhu
Bump the minor version to declare pc sampling feature is now available. Signed-off-by: James Zhu --- include/uapi/linux/kfd_ioctl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/kfd_ioctl.h b/include/uapi/linux/kfd_ioctl.h index 1bd1347effea

[PATCH v2 21/23] drm/amdkfd: add pc sampling thread to trigger trap

2023-12-07 Thread James Zhu
Add a kthread to trigger pc sampling trap. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 68 +++- drivers/gpu/drm/amd/amdkfd/kfd_priv.h| 1 + 2 files changed, 68 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdkfd

[PATCH v2 12/23] drm/amdgpu: use trapID 4 for host trap

2023-12-07 Thread James Zhu
Since TRAPSTS.HOST_TRAP won't work pre-gfx943, so use TTMP1 (bit 24: HT) and (bit 16-23: trapID) to identify the host trap. Signed-off-by: James Zhu --- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c |2 + .../gpu/drm/amd/amdkfd/cwsr_trap_handler.h| 2117 + .../dr

[PATCH v2 22/23] drm/amdkfd: add pc sampling release when process release

2023-12-07 Thread James Zhu
Add pc sampling release when process release, it will force to stop all activate sessions with this process. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 21 drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.h | 1 + drivers/gpu/drm/amd/amdkfd

[PATCH 2/2] drm/amdgpu: make an improvement on amdgpu_hmm_range_get_pages

2023-12-08 Thread James Zhu
Needn't do schedule for each hmm_range_fault, and use cond_resched to replace schedule. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c b/drivers/gpu/drm/amd/a

[PATCH 1/2] drm/amdgpu: increase hmm range get pages timeout

2023-12-08 Thread James Zhu
When application tries to allocate all system memory and cause memory to swap out. Needs more time for hmm_range_fault to validate the remaining page for allocation. To be safe, increase timeout value to 1 second for 64MB range. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdgpu

Re: [PATCH 2/2] drm/amdgpu: make an improvement on amdgpu_hmm_range_get_pages

2023-12-11 Thread James Zhu
On 2023-12-11 05:38, Christian König wrote: Am 09.12.23 um 00:01 schrieb James Zhu: Needn't do schedule for each hmm_range_fault, and use cond_resched to replace schedule. cond_resched() is usually NAKed upstream since it is a NO-OP in most situations. [JZ] then let me change ba

Re: [PATCH v2 00/23] Support Host Trap Sampling for gfx941/gfx942

2023-12-11 Thread James Zhu
Ping ... On 2023-12-07 17:53, James Zhu wrote: PC sampling is a form of software profiling, where the threads of an application are periodically interrupted and the program counter that the threads are currently attempting to execute is saved out for profiling. David Yat Sin (4): drm

[PATCH v3 07/23] drm/amdkfd: check pcs_entry valid

2023-12-11 Thread James Zhu
Check pcs_entry valid for pc sampling ioctl. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 33 ++-- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c b/drivers/gpu/drm/amd/amdkfd

[PATCH v3 00/23] Support Host Trap Sampling for gfx941/gfx942

2023-12-11 Thread James Zhu
/zhums/ROCT-Thunk-Interface/tree/zhums/ROCT-Thunk. David Yat Sin (4): drm/amdkfd/kfd_ioctl: add pc sampling support drm/amdkfd: add pc sampling support drm/amdkfd: enable pc sampling query drm/amdkfd: enable pc sampling create James Zhu (19): drm/amdkfd: add pc sampling mutex drm/amdkfd

[PATCH v2 2/2] drm/amdgpu: make an improvement on amdgpu_hmm_range_get_pages

2023-12-11 Thread James Zhu
Only schedule when hmm_range_fault returns error. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c index b24eb5821fd1

Re: [PATCH 1/2] drm/amdgpu: increase hmm range get pages timeout

2023-12-13 Thread James Zhu
Ping ... On 2023-12-08 18:01, James Zhu wrote: When application tries to allocate all system memory and cause memory to swap out. Needs more time for hmm_range_fault to validate the remaining page for allocation. To be safe, increase timeout value to 1 second for 64MB range. Signed-off-by

Re: [PATCH v2 03/23] drm/amdkfd: enable pc sampling query

2023-12-13 Thread James Zhu
/amdkfd: enable pc sampling query From: David Yat Sin Enable pc sampling to query system capability. Co-developed-by: James Zhu Signed-off-by: James Zhu Signed-off-by: David Yat Sin --- drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 54 +++- 1 file changed, 53 insertions(+), 1

Re: [PATCH 1/2] drm/amdgpu: increase hmm range get pages timeout

2023-12-13 Thread James Zhu
On 2023-12-13 11:23, Felix Kuehling wrote: On 2023-12-13 10:24, James Zhu wrote: Ping ... On 2023-12-08 18:01, James Zhu wrote: When application tries to allocate all system memory and cause memory to swap out. Needs more time for hmm_range_fault to validate the remaining page for

[PATCH v3 01/24] drm/amdkfd/kfd_ioctl: add pc sampling support

2023-12-15 Thread James Zhu
From: David Yat Sin Add pc sampling support in kfd_ioctl. The user mode code which uses this new kfd_ioctl is linked to https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface with master branch. Co-developed-by: James Zhu Signed-off-by: James Zhu Signed-off-by: David Yat Sin --- include

[PATCH v3 05/24] drm/amdkfd: enable pc sampling create

2023-12-15 Thread James Zhu
From: David Yat Sin Enable pc sampling create. Co-developed-by: James Zhu Signed-off-by: James Zhu Signed-off-by: David Yat Sin --- drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 53 +++- drivers/gpu/drm/amd/amdkfd/kfd_priv.h| 10 2 files changed, 62 insertions

[PATCH v3 02/24] drm/amdkfd: add pc sampling support

2023-12-15 Thread James Zhu
From: David Yat Sin Add pc sampling functions in amdkfd. Co-developed-by: James Zhu Signed-off-by: James Zhu Signed-off-by: David Yat Sin --- drivers/gpu/drm/amd/amdkfd/Makefile | 3 +- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 44 +++ drivers/gpu/drm/amd/amdkfd

[PATCH v3 03/24] drm/amdkfd: enable pc sampling query

2023-12-15 Thread James Zhu
From: David Yat Sin Enable pc sampling to query system capability. Co-developed-by: James Zhu Signed-off-by: James Zhu Signed-off-by: David Yat Sin --- drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 54 +++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a

[PATCH v3 06/24] drm/amdkfd: add trace_id return

2023-12-15 Thread James Zhu
Add trace_id return for new pc sampling creation per device, Use IDR to quickly locate pc_sampling_entry for reference. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 2 ++ drivers/gpu/drm/amd/amdkfd/kfd_pc_sampling.c | 20 +++- drivers/gpu/drm/amd

[PATCH v3 00/24] Support Host Trap Sampling for gfx941/gfx942

2023-12-15 Thread James Zhu
: add pc sampling support drm/amdkfd: enable pc sampling query drm/amdkfd: enable pc sampling create drm/amdkfd: set debug trap bit when enabling PC Sampling James Zhu (19): drm/amdkfd: add pc sampling mutex drm/amdkfd: add trace_id return drm/amdkfd: check pcs_entry valid drm/amdkfd

  1   2   3   4   5   6   >