summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Kuehling <felix.kuehling@amd.com>2024-04-18 19:56:42 +0200
committerAlex Deucher <alexander.deucher@amd.com>2024-04-24 05:23:28 +0200
commitb0b13d532105e0e682d95214933bb8483a063184 (patch)
tree851f82a2efca61cb164e2b7f3d38de8a6d2597b7
parentdrm/amdgpu/vpe: fix vpe dpm setup failed (diff)
downloadlinux-b0b13d532105e0e682d95214933bb8483a063184.tar.xz
linux-b0b13d532105e0e682d95214933bb8483a063184.zip
drm/amdgpu: Update BO eviction priorities
Make SVM BOs more likely to get evicted than other BOs. These BOs opportunistically use available VRAM, but can fall back relatively seamlessly to system memory. It also avoids SVM migrations evicting other, more important BOs as they will evict other SVM allocations first. Signed-off-by: Felix Kuehling <felix.kuehling@amd.com> Acked-by: Mukul Joshi <mukul.joshi@amd.com> Tested-by: Mukul Joshi <mukul.joshi@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_object.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index 2099159a693f..ce733e3cb35d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -605,6 +605,8 @@ int amdgpu_bo_create(struct amdgpu_device *adev,
else
amdgpu_bo_placement_from_domain(bo, bp->domain);
if (bp->type == ttm_bo_type_kernel)
+ bo->tbo.priority = 2;
+ else if (!(bp->flags & AMDGPU_GEM_CREATE_DISCARDABLE))
bo->tbo.priority = 1;
if (!bp->destroy)