drm/amdkfd: Don't over commit vram while xnack is off
Subsystems (3)
PATCH 1/1 drm/amdkfd: Don't over commit vram while xnack is off
For xnack is off, the application should ensure the vram not overcommit.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c +6 -0
@@ -171,11 +171,17 @@ static void amdkfd_fence_release(struct dma_fence *f)bool amdkfd_fence_check_mm (struct dma_fence *f,struct mm_struct *mm) {struct amdgpu_amdkfd_fence *fence =to_amdgpu_amdkfd_fence (f); +struct kfd_process *p;if (!fence)return false;else if (fence->mm == mm && !fence->svm_bo)return true; +else if (fence->svm_bo) { + p =kfd_lookup_process_by_mm (mm); +if (p && !p->xnack_enabled) +return true; + }return false; }
Signature · 1 line
2.36.1
Felix Kuehling
maintainerQuoted 1 line · Emily Deng
For xnack is off, the application should ensure the vram not overcommit.
This is incorrect. SVM ranges in VRAM can always be evicted to system memory even with XNACK off. During the migration the user mode queues are stopped by the MMU notifier. We apply system memory limits for SVM to ensure that all SVM ranges can fit into system memory. VRAM is used opportunistically while it's available.
A VRAM allocation for non-SVM should be able to evict SVM ranges from the same process. This does not stop forward progress of the application because the application can continue after the migration with the data in system memory. This patch breaks that.
Regards,
Felix
Quoted 28 lines
Signed-off-by Emily Deng <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c | 6 ++++++ 1 file changed, 6 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c +6
-0@@ -171,11 +171,17 @@ static void amdkfd_fence_release(struct dma_fence *f)bool amdkfd_fence_check_mm (struct dma_fence *f,struct mm_struct *mm) {struct amdgpu_amdkfd_fence *fence =to_amdgpu_amdkfd_fence (f); +struct kfd_process *p;if (!fence)return false;else if (fence->mm == mm && !fence->svm_bo)return true; +else if (fence->svm_bo) { + p =kfd_lookup_process_by_mm (mm); +if (p && !p->xnack_enabled) +return true; + }return false; }