Re: [RFC PATCH 1/2] drm/amdkfd: Move TLB flushing logic into amdgpu

2023-03-10 Thread Daniel Phillips
On 3/10/23 14:16, Felix Kuehling wrote: > +static inline void kfd_flush_tlb(struct kfd_process_device *pdd, >enum TLB_FLUSH_TYPE type) Whitespace damage? Regards, Daniel

[PATCH 1/1] amdkfd: Fix memory availability double accounting of kfd pinned objects

2023-03-05 Thread Daniel Phillips
pinned by kfd and add it back to kfd availability to remove the double accounting. Signed-off-by: Daniel Phillips --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 7 +++ 2 files changed, 8 insertions(+) diff --git a/drivers/gpu/drm

[PATCH 1/1] amdkfd: Memory availability can never be negative

2023-03-01 Thread Daniel Phillips
Our assumptions about how much KFD memory is currently available for allocation may be violated by various complexities so we define the reported value as advisory, however we should never report negative availability. Signed-off-by: Daniel Phillips --- drivers/gpu/drm/amd/amdgpu

[PATCH 1/1] amdkfd: Memory availability can never be negative

2023-03-01 Thread Daniel Phillips
Our assumptions about how much KFD memory is currently available for allocation may be violated by various complexities so we define the reported value as advisory, however we should never report negative availability. Signed-off-by: Daniel Phillips --- drivers/gpu/drm/amd/amdgpu

[PATCH 1/1] kfdtest: Also detect under-reporting of available memory

2022-10-31 Thread Daniel Phillips
more than or too much less than reported available. Signed-off-by: Daniel Phillips Change-Id: Ib418f0aa26e8db80590a6c5f2578da56a4b60f2b --- tests/kfdtest/src/KFDMemoryTest.cpp | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tests/kfdtest/src

Re: [PATCH 0/2] Use kfd_lock/unlock_pdd helpers

2022-08-29 Thread Daniel Phillips
On 2022-08-24 13:38, Felix Kuehling wrote: > Do you mind squashing the two patches. It would make them easier to review > because it makes it easier to see that the same functions are using both. Will do. Regards, Daniel

[PATCH 0/2] Use kfd_lock/unlock_pdd helpers

2022-08-25 Thread Daniel Phillips
Patch 1 adds kfd_lock_pdd_by_id and patch 2 adds kfd_unlock_pdd helpers, broken out this way to reduce noise in the first patch, which is a bit tricky because of modifying a lot of error paths. Patch 2 is trivial. Daniel Phillips (2): drm/amdgpu: Use kfd_lock_pdd_by_id helper in more places

[PATCH 1/2] drm/amdgpu: Use kfd_lock_pdd_by_id helper in more places

2022-08-25 Thread Daniel Phillips
Signed-off-by: Daniel Phillips Reviewed-by: Felix Kuehling --- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 96 1 file changed, 32 insertions(+), 64 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c index 2b

[PATCH 2/2] drm/amdgpu: Use kfd_unlock_pdd helper

2022-08-25 Thread Daniel Phillips
Trivially changes kfd_lock_pdd_by_id ... mutex_unlock to use the kfd_unlock_pdd helper. Signed-off-by: Daniel Phillips --- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 38 +++- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd

[PATCH 1/1] drm/amdgpu: Use kfd_lock_pdd_by_id helper in more places

2022-08-22 Thread Daniel Phillips
Signed-off-by: Daniel Phillips --- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 96 1 file changed, 32 insertions(+), 64 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c index 2b3d8bc8f0aa..bb5528c55b73 100644 --- a/d

[PATCH 2/2] drm/amdgpu: Pessimistic availability based on rounded up allocations

2022-07-28 Thread Daniel Phillips
Seperately accumulate a statistic of rounded up allocations to use to report availability, with a view to increasing the likelihood a buffer object can be successfully allocated at exactly the size reported by the availability API. --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 1 +

[PATCH 1/2] drm/amdgpu: Remove rounding from vram allocation path

2022-07-28 Thread Daniel Phillips
Rounding up allocations in the allocation path caused test regressions, so now just round in the availability path. --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c

[PATCH 1/1] drm/amdgpu: Remove rounding from vram allocation path

2022-07-25 Thread Daniel Phillips
Rounding up allocations in the allocation path caused test regressions, so now just round in the availability path. --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c

Re: [RFC] Add KFD available memory ioctl thunk support (rev 1)

2022-03-23 Thread Daniel Phillips
On 2022-03-22 11:20, Yat Sin, David wrote: > I think this should check for minor version 9 to match #define > KFD_IOCTL_MINOR_VERSION 9 in kfd_ioctl.h Fixed. include/hsakmt.h | 11 +++ include/linux/kfd_ioctl.h | 18 -- src/memory.c | 23

Re: [RFC] Add KFD available memory ioctl thunk support

2022-03-23 Thread Daniel Phillips
On 2022-03-22 11:20, Yat Sin, you wrote: >> +CHECK_KFD_MINOR_VERSION(7); > > I think this should check for minor version 9 to match #define > KFD_IOCTL_MINOR_VERSION 9 in kfd_ioctl.h Right you are. Regards, Daniel

[RFC] Add KFD available memory ioctl thunk test

2022-03-22 Thread Daniel Phillips
Hi all, This patch adds at unit test to thunk for the new KFD memory availability ioctl. KFDMemoryTest.cpp | 25 + 1 file changed, 25 insertions(+) Regards, Daniel diff --git a/tests/kfdtest/src/KFDMemoryTest.cpp b/tests/kfdtest/src/KFDMemoryTest.cpp index

[RFC] Add KFD available memory ioctl thunk support

2022-03-22 Thread Daniel Phillips
Hi all, This patch adds thunk support for the new KFD memory availability ioctl. I am posting this patch inline with Thunderbird just for now, to establish the principle that I can post patches/code old school style without mangling whitespace. Please bear with me while I get that sorted out. I

[RFC] Add KFD available memory ioctl

2022-03-21 Thread Daniel Phillips
/linux/kfd_ioctl.h   |   16 +--- 4 files changed, 43 insertions(+), 3 deletions(-) Signed-off-by: Daniel Phillips diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h index 4cb14c2fe53f..0a4c9187cba1 100644 --- a/drivers

[PATCH 1/1] Add test for new hsaKmtAvailableMemory library call

2022-01-10 Thread Daniel Phillips
library call. This is a standalone test, does not modify any of the other tests just to be on the safe side. More elaborate tests coming soon. Signed-off-by: Daniel Phillips Change-Id: I645006a89bd8d55ef7b1605611e8ef0c010dad1a --- tests/kfdtest/src/KFDMemoryTest.cpp | 20 1 file

[PATCH 1/1] Add available memory ioctl for libhsakmt

2022-01-10 Thread Daniel Phillips
/2022-January/073352.html Signed-off-by: Daniel Phillips --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 1 + .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c| 14 ++ drivers/gpu/drm/amd/amdkfd/kfd_chardev.c| 17 + include/uapi/linux/kfd_ioctl.h

[PATCH 1/1] Add test for hsaKmtAvailableMemory available memory inquiry

2022-01-10 Thread Daniel Phillips
Basic test for the new hsaKmtAvailableMemory library call. This is a standalone test, does not modify any of the other tests just to be on the safe side. More elaborate tests coming soon. Change-Id: I738600d4b74cc5dba6b857e4c793f6b14b7d2283 Signed-off-by: Daniel Phillips --- tests/kfdtest/src

[PATCH 1/1] Add hsaKmtAvailableMemory available memory inquiry to libhsakmt

2022-01-10 Thread Daniel Phillips
Add a library call to inquire memory available for allocation per node. Uses the AMDKFD_IOC_AVAILABLE_MEMORY ioctl available in KFD ioctl version 1.7 Change-Id: Id770fc2261e9e076f2fbce7dcdac640a6354ddbe --- include/hsakmt.h | 11 +++ include/linux/kfd_ioctl.h | 18

[PATCH 1/1] Add available memory ioctl for libhsakmt

2022-01-10 Thread Daniel Phillips
From: Daniel Phillips Add an ioctl to inquire memory available for allocation by libhsakmt per node, allowing for space consumed by page translation tables. --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 1 + .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c| 14 ++ drivers