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
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
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
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
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
: 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
/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
/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
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
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 ++
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
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
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
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
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
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
@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
] 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
: 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
/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
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
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
/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
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
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
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
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
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
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
: 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 - 100 of 552 matches
Mail list logo