Should we even consider not evicting all PDs/PTs, busy or not. See PDs/PTs only 
use a tiny bit (roughly ~0.05%) of the total memory. You really don't get much 
memory when you evict them. But I doubt the evict/restore performance penalty 
is big.

Thanks,
Oak

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Christian 
König
Sent: Friday, March 8, 2019 9:32 AM
To: [email protected]
Subject: [PATCH 3/3] drm/amdgpu: stop evicting busy PDs/PTs

Otherwise we won't be able to cleanly handle page faults.

Signed-off-by: Christian König <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index cd0ccfbbcb84..c1240bf243ba 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -1371,6 +1371,13 @@ static bool amdgpu_ttm_bo_eviction_valuable(struct 
ttm_buffer_object *bo,
        struct dma_fence *f;
        int i;
 
+       /* Don't evict VM page tables while they are busy, otherwise we can't
+        * cleanly handle page faults.
+        */
+       if (bo->type == ttm_bo_type_kernel &&
+           !reservation_object_test_signaled_rcu(bo->resv, true))
+               return false;
+
        /* If bo is a KFD BO, check if the bo belongs to the current process.
         * If true, then return false as any KFD process needs all its BOs to
         * be resident to run successfully
-- 
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to