[PATCH] amd/amdkfd: remove unused parameter

2024-02-28 Thread Eric Huang
The adev can be found from bo by amdgpu_ttm_adev(bo->tbo.bdev), and adev is also not used in the function amdgpu_amdkfd_map_gtt_bo_to_gart(). Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 3 +-- driv

[PATCH] drm/amdkfd: fix TLB flush after unmap for GFX9.4.2

2024-03-20 Thread Eric Huang
TLB flush after unmap accidentially was removed on gfx9.4.2. It is to add it back. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd

[PATCH] drm/amdgpu: fix NULL pointer in amdgpu_reset_get_desc

2024-06-06 Thread Eric Huang
amdgpu_job_ring may return NULL, which causes kernel NULL pointer error, using another way to print ring name instead of ring->name. Suggested-by: Lijo Lazar Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c | 6 ++ 1 file changed, 2 insertions(+), 4 deleti

[PATCH] drm/amdkfd: add reset cause in gpu pre-reset smi event

2024-05-31 Thread Eric Huang
reset cause is requested by customer as additional info for gpu reset smi event. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c| 34 + drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h| 17 +++-- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c| 9 ++- drivers

Re: [PATCH] drm/amdkfd: add reset cause in gpu pre-reset smi event

2024-06-03 Thread Eric Huang
- From: amd-gfx On Behalf Of Eric Huang Sent: Friday, May 31, 2024 8:38 PM To: amd-gfx@lists.freedesktop.org Cc: Kasiviswanathan, Harish ; Huang, JinHuiEric Subject: [PATCH] drm/amdkfd: add reset cause in gpu pre-reset smi event reset cause is requested by customer as additional info for gpu

[PATCH 1/2] drm/amdgpu: add reset sources in gpu reset context

2024-06-03 Thread Eric Huang
reset source or reset cause is very useful info for reset context, it will be used by events API. Suggested-by: Lijo Lazar Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c | 34 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h | 13 + 2 files

[PATCH 2/2] drm/amdkfd: add reset cause in gpu pre-reset smi event

2024-06-03 Thread Eric Huang
reset cause is requested by customer as additional info for gpu reset smi event. v2: integerate reset sources suggested by Lijo Lazar Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 3 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 10 +++--- drivers/gpu/drm

Re: [PATCH 2/2] drm/amdkfd: add reset cause in gpu pre-reset smi event

2024-06-04 Thread Eric Huang
Thanks for your review Lijo, I will send a patch with reset source in another places. Regards, Eric On 2024-06-04 03:26, Lazar, Lijo wrote: On 6/3/2024 11:42 PM, Eric Huang wrote: reset cause is requested by customer as additional info for gpu reset smi event. v2: integerate reset sources

[PATCH] drm/amdgpu: add reset source in various cases

2024-06-04 Thread Eric Huang
To fullfill the reset event description. Suggested-by: Lijo Lazar Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 1 + 3 files changed, 3 insertions(+) diff --git a

Re: [PATCH] drm/amdkfd: Copy HW exception data to user event

2023-11-17 Thread Eric Huang
On 2023-11-17 00:20, David Yat Sin wrote: Fixes issue where user events of type KFD_EVENT_TYPE_HW_EXCEPTION do not have valid data Signed-off-by: David Yat Sin --- drivers/gpu/drm/amd/amdkfd/kfd_events.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_e

Re: [PATCH] drm/amdkfd: fix mes set shader debugger process management

2023-12-12 Thread Eric Huang
MES on process termination. Note that the flush call and the MES debugger calls use the same MES interface but are separated as KFD calls to avoid conflicting with each other. Signed-off-by: Jonathan Kim Tested-by: Alice Wong Reviewed-by: Eric Huang --- drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c

[PATCH] drm/amdkfd: fix NULL ptr for debugger mes flush on non-mes asics

2023-12-14 Thread Eric Huang
The field adev->mes.funcs is NULL in function amdgpu_mes_flush_shader_debugger on non-mes asics, add mes enabling check for call this func to resolve the error. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 3 ++- 1 file changed, 2 insertions(+)

Re: [PATCH] drm/amdkfd: only flush mes process context if mes support is there

2023-12-14 Thread Eric Huang
Signed-off-by: Jonathan Kim Reviewed-by: Eric Huang --- drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manag

[PATCH] drm/amdkfd: Restore all process on post reset

2021-07-28 Thread Eric Huang
gpus can't be evicted. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_process.c | 24 +--- 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/g

Re: [PATCH] drm/amdkfd: Restore all process on post reset

2021-08-03 Thread Eric Huang
On 2021-07-30 5:26 p.m., Felix Kuehling wrote: Am 2021-07-28 um 1:31 p.m. schrieb Eric Huang: It is to fix a bug of gpu_recovery on multiple GPUs, When one gpu is reset, the application running on other gpu hangs, because kfd post reset doesn't restore the running process. This will r

[PATCH] drm/amdkfd: add parameter force in kfd_process_evict_queues

2021-08-03 Thread Eric Huang
It is to differenciate case scenario for proper behavior when calling evict queues, such as GPU reset doesn't need to roll back restoring partial evicted queues. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h

[PATCH 1/2] drm/amdkfd: change MTYPEs for Aldebaran's HW requirement

2021-04-09 Thread Eric Huang
Due to changes of HW memory model, we need to change Aldebaran MTYPEs to meet HW changes. Signed-off-by: Eric Huang Reviewed-by: Harish Kasiviswanathan --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers

[PATCH 2/2] drm/amdkfd: change SVM MTYPEs for Aldebaran's HW requirement

2021-04-09 Thread Eric Huang
From: Philip Yang Due to changes of HW memory model, we need to change Aldebaran MTYPEs to meet HW changes. Change-Id: I0b566ccd1d406abe93ee84da91216794fc650ed4 Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling --- drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 11 --- 1 file changed, 4

[PATCH] drm/amdkfd: add ACPI SRAT parsing for topology

2021-04-28 Thread Eric Huang
In NPS4 BIOS we need to find the closest numa node when creating topology io link between cpu and gpu, if PCI driver doesn't set it. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 94 ++- 1 file changed, 91 insertions(+), 3 deletions(-) diff

Re: [PATCH] drm/amdkfd: add ACPI SRAT parsing for topology

2021-04-30 Thread Eric Huang
ping... On 2021-04-28 11:11 a.m., Eric Huang wrote: In NPS4 BIOS we need to find the closest numa node when creating topology io link between cpu and gpu, if PCI driver doesn't set it. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 94 ++

Re: [PATCH] drm/amdkfd: add ACPI SRAT parsing for topology

2021-05-03 Thread Eric Huang
Thanks Felix for your review. I will send another patch. Eric On 2021-04-30 7:42 p.m., Felix Kuehling wrote: Am 2021-04-28 um 11:11 a.m. schrieb Eric Huang: In NPS4 BIOS we need to find the closest numa node when creating topology io link between cpu and gpu, if PCI driver doesn't s

[PATCH] drm/amdkfd: add ACPI SRAT parsing for topology

2021-05-03 Thread Eric Huang
In NPS4 BIOS we need to find the closest numa node when creating topology io link between cpu and gpu, if PCI driver doesn't set it. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 95 ++- 1 file changed, 93 insertions(+), 2 deletions(-) diff

Re: [PATCH] drm/amdkfd: add ACPI SRAT parsing for topology

2021-05-03 Thread Eric Huang
acpi_table_parse_srat) and the acpi subsystem should expose APIs for rest drivers to query such numa information. Regards, Oak On 2021-04-28, 11:12 AM, "amd-gfx on behalf of Eric Huang" wrote: In NPS4 BIOS we need to find the closest numa node when creating topology io link b

Re: [PATCH] drm/amdkfd: add ACPI SRAT parsing for topology

2021-05-03 Thread Eric Huang
On 2021-05-03 3:13 p.m., Felix Kuehling wrote: Am 2021-05-03 um 10:47 a.m. schrieb Eric Huang: In NPS4 BIOS we need to find the closest numa node when creating topology io link between cpu and gpu, if PCI driver doesn't set it. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/a

Re: [PATCH] drm/amdkfd: add ACPI SRAT parsing for topology

2021-05-04 Thread Eric Huang
also will avoid parsing ACPI_SRAT_TYPE_CPU_AFFINITY structs. Thanks, Lijo -Original Message- From: amd-gfx On Behalf Of Eric Huang Sent: Wednesday, April 28, 2021 8:42 PM To: amd-gfx@lists.freedesktop.org Cc: Huang, JinHuiEric Subject: [PATCH] drm/amdkfd: add ACPI SRAT parsing for to

Re: [PATCH] drm/amdkfd: add ACPI SRAT parsing for topology

2021-05-04 Thread Eric Huang
so will avoid parsing ACPI_SRAT_TYPE_CPU_AFFINITY structs. > > Thanks, > Lijo > > > -Original Message- > From: amd-gfx On Behalf Of Eric Huang > Sent: Wednesday, April 28, 2021 8:42 PM > To: amd-gfx@lists.freedesktop.org > Cc: Huang, JinHuiEric > Subject:

Re: [PATCH] drm/amdkfd: add ACPI SRAT parsing for topology

2021-05-05 Thread Eric Huang
On 2021-05-03 3:34 p.m., Felix Kuehling wrote: Am 2021-05-03 um 3:27 p.m. schrieb Eric Huang: On 2021-05-03 3:13 p.m., Felix Kuehling wrote: Am 2021-05-03 um 10:47 a.m. schrieb Eric Huang: In NPS4 BIOS we need to find the closest numa node when creating topology io link between cpu and gpu

[PATCH] drm/amdkfd: add ACPI SRAT parsing for topology

2021-05-05 Thread Eric Huang
In NPS4 BIOS we need to find the closest numa node when creating topology io link between cpu and gpu, if PCI driver doesn't set it. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 91 +++ 1 file changed, 91 insertions(+) diff --git a/driver

[PATCH] drm/amdkfd: enable heavy-weight TLB flush on Arcturus

2022-01-18 Thread Eric Huang
SDMA FW fixes the hang issue for adding heavy-weight TLB flush on Arcturus, so we can enable it. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 8 +--- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 3 ++- 2 files changed, 7 insertions(+), 4 deletions

[PATCH] drm/amdkfd: enable heavy-weight TLB flush on Arcturus

2022-01-18 Thread Eric Huang
SDMA FW fixes the hang issue for adding heavy-weight TLB flush on Arcturus, so we can enable it. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 8 +--- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 3 ++- 2 files changed, 7 insertions(+), 4 deletions

Re: [PATCH] drm/amdkfd: enable heavy-weight TLB flush on Arcturus

2022-01-18 Thread Eric Huang
The SDMA fix is generic and not in a specific version of FW, so we don't have to check. Thanks, Eric On 2022-01-18 11:35, Alex Deucher wrote: On Tue, Jan 18, 2022 at 11:16 AM Eric Huang wrote: SDMA FW fixes the hang issue for adding heavy-weight TLB flush on Arcturus, so we can enab

Re: [PATCH] drm/amdkfd: enable heavy-weight TLB flush on Arcturus

2022-01-18 Thread Eric Huang
e Only] I think what he means is that if we are using SDMA v17, this will cause issues, won't it? Should we check that SDMA version is >=18 before enabling it? Or am I misunderstanding the fix? Yes, that was my concern. Alex Kent -Original Message- From: amd-gfx On Behalf

[PATCH] drm/amdkfd: enable heavy-weight TLB flush on Arcturus

2022-01-18 Thread Eric Huang
SDMA FW fixes the hang issue for adding heavy-weight TLB flush on Arcturus, so we can enable it. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 9 ++--- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 4 +++- 2 files changed, 9 insertions(+), 4 deletions

[PATCH] drm/amdkfd: enable heavy-weight TLB flush on Arcturus

2022-01-18 Thread Eric Huang
SDMA FW fixes the hang issue for adding heavy-weight TLB flush on Arcturus, so we can enable it. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 6 -- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 10 -- 2 files changed, 8 insertions(+), 8

Re: [PATCH] drm/amdkfd: enable heavy-weight TLB flush on Arcturus

2022-01-19 Thread Eric Huang
*From:* amd-gfx on behalf of Felix Kuehling *Sent:* Tuesday, January 18, 2022 6:36 PM *To:* Huang, JinHuiEric ; amd-gfx@lists.freedesktop.org *Subject:* Re: [PATCH] drm/amdkfd: enable heavy-weight TLB flush on Arcturus Am 2022-01-18 um 5:45 p.m. schrieb Eric Huang: SDMA FW fixes the

[PATCH] drm/amdkfd: enable heavy-weight TLB flush on Vega20

2022-01-21 Thread Eric Huang
It is to meet the requirement for memory allocation optimization on MI50. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd

Re: [PATCH] drm/amdkfd: enable heavy-weight TLB flush on Vega20

2022-02-07 Thread Eric Huang
] drm/amdkfd: enable heavy-weight TLB flush on Vega20 On Fri, Jan 21, 2022 at 11:17 AM Eric Huang wrote: It is to meet the requirement for memory allocation optimization on MI50. Signed-off-by: Eric Huang Assuming there is no firmware version requirement, the patch is: Acked-by: Alex De

[PATCH] drm/amdkfd: move flushing TLBs from map to unmap

2021-05-25 Thread Eric Huang
It it to optimize memory allocation latency. Signed-off-by: Eric Huang diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c index 960913a35ee4..ab73741edb97 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +++ b/drivers/gpu/drm/amd/amdkfd

[PATCH] drm/amdgpu: Don't flush HDP on A+A

2021-05-25 Thread Eric Huang
With XGMI connection flushing HDP on PCIe is unnecessary, it is also to optimize memory allocation latency. Signed-off-by: Eric Huang diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c index ac45d9c7a4e9..aefb3d2927d5 100644 --- a/drivers/gpu

Re: [PATCH] drm/amdkfd: move flushing TLBs from map to unmap

2021-05-26 Thread Eric Huang
tee it done before memory is remapped? if remapping depends on it, then more latency will be introduced in map. Regards, Eric Regards,   Felix Am 2021-05-25 um 1:53 p.m. schrieb Eric Huang: It it to optimize memory allocation latency. Signed-off-by: Eric Huang diff --git a/drivers/g

Re: [PATCH] drm/amdkfd: move flushing TLBs from map to unmap

2021-05-28 Thread Eric Huang
On 2021-05-28 11:23 a.m., Christian König wrote: Am 27.05.21 um 16:05 schrieb philip yang: On 2021-05-26 5:25 p.m., Felix Kuehling wrote: Am 2021-05-26 um 3:21 p.m. schrieb Eric Huang: On 2021-05-25 3:16 p.m., Felix Kuehling wrote: Similar to a recent fix by Philip Yang 76e08b37d0aa

[PATCH 3/3] drm/amdkfd: optimize memory mapping latency

2021-05-28 Thread Eric Huang
1. conditionally flush TLBs after map. 2. add heavy weight TLBs flushing after unmap. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h| 1 + .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 2 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_object.h| 1 + drivers/gpu/drm

[PATCH 1/3] drm/amdpgu: add a function to get vm page talbe entry

2021-05-28 Thread Eric Huang
it is for large bar/xgmi which has cpu update function, for small bar that has sdma update function it will be done later. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c | 21 - drivers/gpu/drm

[PATCH 2/3] drm/amdgpu: fix a bug for flag table_freed

2021-05-28 Thread Eric Huang
table_freed will be always true when mapping a memory with size bigger than 2MB. Using a check of turnning valid PDE into PTE will resolve the issue. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff

Re: [PATCH 3/3] drm/amdkfd: optimize memory mapping latency

2021-05-29 Thread Eric Huang
Please ignore those patches, I find a better resolution and will send it out later. Regards, Eric On 2021-05-28 4:49 p.m., Eric Huang wrote: 1. conditionally flush TLBs after map. 2. add heavy weight TLBs flushing after unmap. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdgpu

[PATCH 2/2] drm/amdkfd: optimize memory mapping latency

2021-05-29 Thread Eric Huang
1. conditionally flush TLBs after map. 2. add heavy weight TLBs flushing after unmap. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h| 1 + .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 2 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_object.h| 1 + drivers/gpu/drm

[PATCH 1/2] drm/amdgpu: Fix a bug on flag table_freed

2021-05-29 Thread Eric Huang
table_freed will be always true when mapping a memory with size bigger than 2MB. The problem is page table's entries are always existed, but existing mapping depends on page talbe's bo, so using a check of page table's bo existed will resolve the issue. Signed-off-by: Eric Huang -

Re: [PATCH 1/2] drm/amdgpu: Fix a bug on flag table_freed

2021-05-30 Thread Eric Huang
On 2021-05-30 12:54 p.m., Christian König wrote: Am 30.05.21 um 00:51 schrieb Eric Huang: table_freed will be always true when mapping a memory with size bigger than 2MB. The problem is page table's entries are always existed, but existing mapping depends on page talbe's bo, so usi

Re: [PATCH 1/2] drm/amdgpu: Fix a bug on flag table_freed

2021-05-31 Thread Eric Huang
On 2021-05-31 10:08 a.m., Christian König wrote: Am 30.05.21 um 20:29 schrieb Eric Huang: On 2021-05-30 12:54 p.m., Christian König wrote: Am 30.05.21 um 00:51 schrieb Eric Huang: table_freed will be always true when mapping a memory with size bigger than 2MB. The problem is page table&#

[PATCH] drm/amdgpu: Don't flush HDP on A+A

2021-05-31 Thread Eric Huang
With XGMI connection flushing HDP on PCIe is unnecessary, it is also to optimize memory allocation latency. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdgpu/amdgpu_hdp.h | 1 + drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 1 + drivers/gpu/drm/amd/amdgpu/hdp_v4_0.c | 3 +++ 3 files

[PATCH v2 1/2] drm/amdgpu: Fix a bug on flag table_freed

2021-05-31 Thread Eric Huang
table_freed will be always true when mapping a memory with size bigger than 2MB. The problem is page table's entries are always existed, but existing mapping depends on page talbe's bo, so using a check of page table's bo existed will resolve the issue. Signed-off-by: Eric Huang -

[PATCH v2 2/2] drm/amdgpu: Don't flush HDP on A+A

2021-05-31 Thread Eric Huang
With XGMI connection flushing HDP on PCIe is unnecessary, it is also to optimize memory allocation latency. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdgpu/amdgpu_hdp.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 3 ++- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 1 + drivers/gpu

Re: [PATCH v2 2/2] drm/amdgpu: Don't flush HDP on A+A

2021-06-01 Thread Eric Huang
On 2021-06-01 3:05 a.m., Christian König wrote: Am 01.06.21 um 02:06 schrieb Eric Huang: With XGMI connection flushing HDP on PCIe is unnecessary, it is also to optimize memory allocation latency. Signed-off-by: Eric Huang ---   drivers/gpu/drm/amd/amdgpu/amdgpu_hdp.h | 1 +   drivers/gpu/drm

[PATCH v2] drm/amdkfd: optimize memory mapping latency

2021-06-01 Thread Eric Huang
1. conditionally flush TLBs after map. 2. add heavy weight TLBs flushing after unmap. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h| 2 +- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 21 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_object.h| 1

[PATCH v3] drm/amdkfd: optimize memory mapping latency

2021-06-01 Thread Eric Huang
1. conditionally flush TLBs after map. 2. add heavy weight TLBs flush after unmap. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h| 2 +- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 19 +++-- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c| 6

[PATCH 2/4] drm/amdkfd: Add heavy-weight TLB flush after unmapping

2021-06-01 Thread Eric Huang
It is a part of memory mapping optimization. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c index 4da8aff3df27..98f1d2b586c5 100644

[PATCH 1/4] drm/amdkfd: Add flush-type parameter to kfd_flush_tlb

2021-06-01 Thread Eric Huang
It is to provide more tlb flush types opotion for different case scenario. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 6 +++--- drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 2

[PATCH 3/4] drm/amdgpu: Add flush_tlb parameter to amdgpu_vm_bo_update

2021-06-01 Thread Eric Huang
It is to pass the flag to KFD, and optimize table_freed in amdgpu_vm_bo_update_mapping. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 6 +++--- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 10 +- drivers/gpu/drm

[PATCH 4/4] drm/amdkfd: Make TLB flush conditional on mapping

2021-06-01 Thread Eric Huang
It is to optimize memory mapping latency, and to aviod a page fault in a corner case of changing valid PDE into PTE. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h| 2 +- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 19 -- drivers/gpu/drm/amd/amdkfd

[PATCH v3] drm/amdgpu: Don't flush/invalidate HDP for APUs and A+A

2021-06-01 Thread Eric Huang
Integrate two macros into two generic functions and add no_flush flag to determine if HDP flush is needed for all Asics. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdgpu/amdgpu.h| 9 --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 29 ++ drivers/gpu/drm

Re: [PATCH v3] drm/amdgpu: Don't flush/invalidate HDP for APUs and A+A

2021-06-02 Thread Eric Huang
On 2021-06-02 3:00 a.m., Christian König wrote: Am 02.06.21 um 04:04 schrieb Eric Huang: Integrate two macros into two generic functions and add no_flush flag to determine if HDP flush is needed for all Asics. Yes that starts looks like it should work, just a few comments below. Signed

[PATCH v4] drm/amdgpu: Don't flush/invalidate HDP for APUs and A+A

2021-06-02 Thread Eric Huang
Integrate two generic functions to determine if HDP flush is needed for all Asics. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdgpu/amdgpu.h| 5 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 33

Re: [PATCH v4] drm/amdgpu: Don't flush/invalidate HDP for APUs and A+A

2021-06-04 Thread Eric Huang
On 2021-06-04 7:31 a.m., Christian König wrote: Am 02.06.21 um 21:18 schrieb Eric Huang: Integrate two generic functions to determine if HDP flush is needed for all Asics. Signed-off-by: Eric Huang Nice work, just one more idea below. But patch is Reviewed-by: Christian König either

[PATCH] drm/amdgpu: Fix warning of Function parameter or member not described

2021-06-07 Thread Eric Huang
Add the parameter table_freed description on function description. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index b4f189ab672e

[PATCH] drm/amdkfd: Add memory sync before TLB flush on unmap

2021-06-10 Thread Eric Huang
It is to fix a failure for SDMA updating PTEs. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 26 +--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd

[PATCH] drm/amdkfd: Set iolink non-coherent in topology

2021-06-16 Thread Eric Huang
Fix non-coherent bit of iolink properties flag which always is 0. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd

[PATCH] drm/amdkfd: Set p2plink non-coherent in topology

2021-06-17 Thread Eric Huang
Fix non-coherent bit of p2plink properties flag which always is 0. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c index

[PATCH] drm/amdkfd: Only apply TLB flush optimization on ALdebaran

2021-06-30 Thread Eric Huang
It is based on reverting two patches back. drm/amdkfd: Make TLB flush conditional on mapping drm/amdgpu: Add table_freed parameter to amdgpu_vm_bo_update Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers

[PATCH v2] drm/amdkfd: Only apply TLB flush optimization on ALdebaran

2021-06-30 Thread Eric Huang
It is based on reverting two patches back. drm/amdkfd: Make TLB flush conditional on mapping drm/amdgpu: Add table_freed parameter to amdgpu_vm_bo_update Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a

[PATCH] drm/amdkfd: Only apply heavy-weight TLB flush on Aldebaran

2021-07-08 Thread Eric Huang
It is to workaround HW bug on other Asics and based on reverting two commits: drm/amdkfd: Add heavy-weight TLB flush after unmapping drm/amdkfd: Add memory sync before TLB flush on unmap Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 37 +--- 1

Re: [PATCH] drm/amdgpu: further lower VRAM allocation overhead

2021-07-13 Thread Eric Huang
I am converting codes into amd-staging-drm-next. Theoretically it will improve a lot on the latency, the size of the array allocated is 24 (PAGE_SIZE/struct drm_mm_node) with this patch, and it was 8192 before. So the latency should be reduced by 98 us. Regards, Eric On 2021-07-13 12:11 p.m.,

[PATCH] drm/amdgpu: further lower VRAM allocation overhead

2021-07-13 Thread Eric Huang
ff-by: Eric Huang Reviewed-by: Felix Kuehling --- drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 71 +++- 1 file changed, 53 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c index be4261c

Re: [PATCH] drm/amdgpu: further lower VRAM allocation overhead

2021-07-13 Thread Eric Huang
Hi Christian/Felix, If you don't have objection, it will be pushed into amd-staging-dkms-5.11 and amd-staging-drm-next. Thanks, Eric On 2021-07-13 3:17 p.m., Eric Huang wrote: For allocations larger than 48MiB we need more than a page for the housekeeping in the worst case resulting i

Re: [PATCH] drm/amdkfd: Only apply heavy-weight TLB flush on Aldebaran

2021-07-14 Thread Eric Huang
Aldebaran as well, so this workaround is still invalid. Regards, Guchun -Original Message- From: amd-gfx On Behalf Of Eric Huang Sent: Friday, July 9, 2021 3:54 AM To: amd-gfx@lists.freedesktop.org Cc: Huang, JinHuiEric ; Kuehling, Felix Subject: [PATCH] drm/amdkfd: Only apply heavy-weight

Re: [PATCH] drm/amdkfd: Only apply heavy-weight TLB flush on Aldebaran

2021-07-14 Thread Eric Huang
Correction inline. On 2021-07-14 11:22 a.m., Eric Huang wrote: Hi Felix, I was not able to reproduce the VM fault issue of SWDEV-292611(not SWDEV-249241), which is the only regression reported on MI200. So the patch is valid to review. Please take a look. Thanks, Eric On 2021-07-09 1:45

Re: [PATCH] drm/amdgpu: further lower VRAM allocation overhead

2021-07-15 Thread Eric Huang
gards, Christian. Am 13.07.21 um 21:19 schrieb Eric Huang: Hi Christian/Felix, If you don't have objection, it will be pushed into amd-staging-dkms-5.11 and amd-staging-drm-next. Thanks, Eric On 2021-07-13 3:17 p.m., Eric Huang wrote: For allocations larger than 48MiB we need more than

[PATCH 1/2] drm/amd/pm: add a new sysfs entries for default power limit

2021-03-12 Thread Eric Huang
Driver doesn't keep the default bootup power limit and expose it to user. As requested, we add it in driver. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/pm/amdgpu_pm.c| 43 ++- drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h | 2 + drivers/gpu/drm/amd/p

[PATCH 2/2] drm/amd/pm: fix incorrect default power limit in powerplay

2021-03-12 Thread Eric Huang
There is no difference betweeen max and default to get power limit in powerplay, adding a new parameter in the funciton fixes it. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/include/kgd_pp_interface.h | 3 ++- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 12 drivers

Re: [PATCH 2/2] drm/amd/pm: fix incorrect default power limit in powerplay

2021-03-13 Thread Eric Huang
Please ignore those two patches. I found a mistake and will send new ones for review. Regards, Eric On 2021-03-12 4:03 p.m., Eric Huang wrote: There is no difference betweeen max and default to get power limit in powerplay, adding a new parameter in the funciton fixes it. Signed-off-by: Eric

[PATCH] drm/amd/pm: add a new sysfs entry for default power limit

2021-03-13 Thread Eric Huang
Driver doesn't keep the default bootup power limit and expose it to user. As requested we add it in driver. Signed-off-by: Eric Huang --- .../gpu/drm/amd/include/kgd_pp_interface.h| 3 +- drivers/gpu/drm/amd/pm/amdgpu_pm.c| 53 +-- drivers/gpu/drm/amd/p

Re: [PATCH] drm/amdkfd: fix add queue process context clear without runtime enable

2023-09-14 Thread Eric Huang
that do not support the current exception handling and running KFD tests. The only time ADD_QUEUE.skip_process_ctx_clear is required is for debugger use cases where a debugged process is always runtime enabled when adding a queue. Tested-by: Shikai Guo Signed-off-by: Jonathan Kim Reviewed-by: Eric

Re: [PATCH] drm/amdkfd: Fix a race condition of vram buffer unref in svm code

2023-09-27 Thread Eric Huang
On 2023-09-26 23:00, Xiaogang.Chen wrote: From: Xiaogang Chen prange->svm_bo unref can happen in both mmu callback and a callback after migrate to system ram. Both are async call in different tasks. Sync svm_bo unref operation to avoid random "use-after-free". Signed-off-by: Xiaogang.Chen -

Re: [PATCH] drm/amdkfd: only allow heavy-weight TLB flush on some ASICs for SVM too

2022-04-14 Thread Eric Huang
On 2022-04-14 04:19, Lang Yu wrote: The idea is from commit a50fe7078035 ("drm/amdkfd: Only apply heavy-weight TLB flush on Aldebaran") and commit f61c40c0757a ("drm/amdkfd: enable heavy-weight TLB flush on Arcturus"). Otherwise, we will run into problems on some ASICs when running SVM applica

[PATCH 2/3] drm/amdkfd: change svm range evict

2022-06-24 Thread Eric Huang
Two changes: 1. reducing unnecessary evict/unmap when range is not mapped to gpu. 2. adding always evict when flags is set to always_mapped. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers

[PATCH 1/3] drm/amdkfd: add new flags for svm

2022-06-24 Thread Eric Huang
It is to add new options for always keeping gpu mapping and custom of coarse grain allocation intead of fine grain as default. Signed-off-by: Eric Huang --- include/uapi/linux/kfd_ioctl.h | 4 1 file changed, 4 insertions(+) diff --git a/include/uapi/linux/kfd_ioctl.h b/include/uapi/linux

[PATCH 3/3] drm/amdkfd: add custom svm range flags setting

2022-06-24 Thread Eric Huang
It is to give a chance for user to change default flags setting, such as fine grain to coarse grain. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c b/drivers/gpu/drm

Re: [PATCH 1/3] drm/amdkfd: add new flags for svm

2022-06-27 Thread Eric Huang
http://gerrit-git.amd.com/c/compute/ec/libhsakmt/+/697296 Regards, Eric On 2022-06-27 11:33, Alex Deucher wrote: On Fri, Jun 24, 2022 at 12:03 PM Eric Huang wrote: It is to add new options for always keeping gpu mapping and custom of coarse grain allocation intead of fine grain as default

Re: [PATCH 1/3] drm/amdkfd: add new flags for svm

2022-06-27 Thread Eric Huang
No. There is only internal link for now, because it is under review. Once it is submitted, external link should be in gerritgit for libhsakmt. Regards, Eric On 2022-06-27 11:58, Alex Deucher wrote: On Mon, Jun 27, 2022 at 11:36 AM Eric Huang wrote: https://nam11

Re: [PATCH 1/3] drm/amdkfd: add new flags for svm

2022-06-28 Thread Eric Huang
Thank you, Felix. I will send all libhsakmt changes and amdkfd changes to amd-gfx. Regards, Eric On 2022-06-28 16:44, Felix Kuehling wrote: Am 2022-06-27 um 12:01 schrieb Eric Huang: No. There is only internal link for now, because it is under review. Once it is submitted, external link

[PATCH 1/2] drm/amdkfd: add new flag for svm

2022-06-28 Thread Eric Huang
It is to add new option for always keeping gpu mapping. Signed-off-by: Eric Huang --- include/uapi/linux/kfd_ioctl.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/uapi/linux/kfd_ioctl.h b/include/uapi/linux/kfd_ioctl.h index fd49dde4d5f4..eba04ebfd9a8 100644 --- a/include/uapi

[PATCH 0/4] Unified memory for CWSR save restore area

2022-06-28 Thread Eric Huang
amdkfd changes: Eric Huang (2): drm/amdkfd: add new flag for svm drm/amdkfd: change svm range evict drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 10 -- include/uapi/linux/kfd_ioctl.h | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) libhsakmt(thunk) changes: which are

[PATCH 3/4] libhsakmt: add new flags for svm

2022-06-28 Thread Eric Huang
It is to add new option for always keeping gpu mapping. Signed-off-by: Eric Huang Change-Id: Iebee35e6de4d52fa29f82dd19f6bbf5640249492 --- include/linux/kfd_ioctl.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/kfd_ioctl.h b/include/linux/kfd_ioctl.h index 8a0ed49..5c45f58

[PATCH 4/4] libhsakmt: allocate unified memory for ctx save restore area

2022-06-28 Thread Eric Huang
To improve performance on queue preemption, allocate ctx s/r area in VRAM instead of system memory, and migrate it back to system memory when VRAM is full. Signed-off-by: Eric Huang Change-Id: If775782027188dbe84b6868260e429373675434c --- include/hsakmttypes.h | 1 + src/queues.c

[PATCH 2/2] drm/amdkfd: change svm range evict

2022-06-28 Thread Eric Huang
Two changes: 1. reducing unnecessary evict/unmap when range is not mapped to gpu. 2. adding always evict when flags is set to always_mapped. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers

[PATCH 4/4] libhsakmt: allocate unified memory for ctx save restore area

2022-06-28 Thread Eric Huang
To improve performance on queue preemption, allocate ctx s/r area in VRAM instead of system memory, and migrate it back to system memory when VRAM is full. Signed-off-by: Eric Huang Change-Id: If775782027188dbe84b6868260e429373675434c --- include/hsakmttypes.h | 1 + src/queues.c

[PATCH 3/4] libhsakmt: add new flags for svm

2022-06-28 Thread Eric Huang
It is to add new option for always keeping gpu mapping. Signed-off-by: Eric Huang Change-Id: Iebee35e6de4d52fa29f82dd19f6bbf5640249492 --- include/linux/kfd_ioctl.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/kfd_ioctl.h b/include/linux/kfd_ioctl.h index 8a0ed49..5c45f58

Re: [PATCH 2/2] drm/amdkfd: change svm range evict

2022-06-29 Thread Eric Huang
On 2022-06-29 18:20, Felix Kuehling wrote: On 2022-06-28 17:43, Eric Huang wrote: Two changes: 1. reducing unnecessary evict/unmap when range is not mapped to gpu. 2. adding always evict when flags is set to always_mapped. Signed-off-by: Eric Huang ---   drivers/gpu/drm/amd/amdkfd

Re: [PATCH 2/2] drm/amdkfd: change svm range evict

2022-06-30 Thread Eric Huang
On 2022-06-29 19:29, Felix Kuehling wrote: On 2022-06-29 18:53, Eric Huang wrote: On 2022-06-29 18:20, Felix Kuehling wrote: On 2022-06-28 17:43, Eric Huang wrote: Two changes: 1. reducing unnecessary evict/unmap when range is not mapped to gpu. 2. adding always evict when flags is set to

[PATCH 0/5] Unified memory for CWSR save restore area

2022-06-30 Thread Eric Huang
amdkfd changes: Eric Huang (3): drm/amdkfd: add new flag for svm drm/amdkfd: change svm range evict drm/amdkfd: optimize svm range evict drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 13 +++-- include/uapi/linux/kfd_ioctl.h | 2 ++ 2 files changed, 13 insertions(+), 2 deletions

[PATCH 2/5] drm/amdkfd: change svm range evict

2022-06-30 Thread Eric Huang
Adding always evict queues when flag is set to KFD_IOCTL_SVM_FLAG_GPU_ALWAYS_MAPPED as if XNACK off. Signed-off-by: Eric Huang --- drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c b/drivers/gpu

  1   2   3   >