提交 79b2c54f 编写于 作者: P Philip Yang 提交者: Alex Deucher

drm/amdgpu: Allow TTM to evict svm bo from same process

To support SVM range VRAM overcommitment, TTM should be able to evict
svm bo of same process to system memory, to get space to alloc new svm
bo.
Signed-off-by: NPhilip Yang <Philip.Yang@amd.com>
Reviewed-by: NFelix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 1f83db6b
...@@ -159,11 +159,14 @@ static void amdkfd_fence_release(struct dma_fence *f) ...@@ -159,11 +159,14 @@ static void amdkfd_fence_release(struct dma_fence *f)
} }
/** /**
* amdkfd_fence_check_mm - Check if @mm is same as that of the fence @f * amdkfd_fence_check_mm - Check whether to prevent eviction of @f by @mm
* if same return TRUE else return FALSE.
* *
* @f: [IN] fence * @f: [IN] fence
* @mm: [IN] mm that needs to be verified * @mm: [IN] mm that needs to be verified
*
* Check if @mm is same as that of the fence @f, if same return TRUE else
* return FALSE.
* For svm bo, which support vram overcommitment, always return FALSE.
*/ */
bool amdkfd_fence_check_mm(struct dma_fence *f, struct mm_struct *mm) bool amdkfd_fence_check_mm(struct dma_fence *f, struct mm_struct *mm)
{ {
...@@ -171,7 +174,7 @@ bool amdkfd_fence_check_mm(struct dma_fence *f, struct mm_struct *mm) ...@@ -171,7 +174,7 @@ bool amdkfd_fence_check_mm(struct dma_fence *f, struct mm_struct *mm)
if (!fence) if (!fence)
return false; return false;
else if (fence->mm == mm) else if (fence->mm == mm && !fence->svm_bo)
return true; return true;
return false; return false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册