drm/amdkfd: track unified memory reservation with xnack off
authorAlex Sierra <alex.sierra@amd.com>
Tue, 17 May 2022 22:43:06 +0000 (17:43 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 28 Jul 2022 20:05:16 +0000 (16:05 -0400)
commitf9af3c16bfe19d145cf0588afa06d7f1070cbe2d
tree36c90cf5d364103744b1b23f6fb86af68b512860
parent06ac561fb0edf868f7b292fb4a3c8ffbbb1e14bb
drm/amdkfd: track unified memory reservation with xnack off

[WHY]
Unified memory with xnack off should be tracked, as userptr mappings
and legacy allocations do. To avoid oversuscribe system memory when
xnack off.
[How]
Exposing functions reserve_mem_limit and unreserve_mem_limit to SVM
API and call them on every prange creation and free.

Signed-off-by: Alex Sierra <alex.sierra@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
drivers/gpu/drm/amd/amdkfd/kfd_svm.c