Skip to contentSkip to conversation

drm/amd/amdgpu: fix performance drop when VRAM pressure

PATCH In review Roger.He 2 participants 4 messages Mar 28, 2017 2 messages not in the archive

Subsystems (3)
lore
Share & tools
lore

Roger.He

author
#0 lore raw

PATCH 1/2 drm/amd/amdgpu: fix performance drop when VRAM pressure

When VRAM pressue and trigger huge evictions there is performance drop, this patch fix it.

Change-Id Idcd2db65be69d62bcbd7dfaa3bcf9bc964d6d122
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +1 -3
index 434c931..d6b2de9 100644
@@ -405,10 +405,8 @@ int amdgpu_bo_create_restricted(struct amdgpu_device *adev,
 	if (unlikely(r != 0))
 		return r;
 
-	bo->tbo.priority = ilog2(bo->tbo.num_pages);
 	if (kernel)
-		bo->tbo.priority *= 2;
-	bo->tbo.priority = min(bo->tbo.priority, TTM_MAX_BO_PRIORITY - 1);
+		bo->tbo.priority = 1;
 
 	if (flags & AMDGPU_GEM_CREATE_VRAM_CLEARED &&
 	    bo->tbo.mem.placement & TTM_PL_FLAG_VRAM) {
Signature · 6 lines
2.7.4

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

A message that is not in the archive (sent off-list or not yet received): 1490665930-19814-1-git-send-email-Hongbo.He-5C7GfCeVMHo@public.gmane.org

author
#2 lore raw

PATCH 2/2 drm/amd/amdgpu: decrease ttm bo priority number

decrease and also reserve priority number for KFD using

Change-Id I9e36d292c920c034ddca53d0ec282c17b7a3cf16
---
 include/drm/ttm/ttm_bo_driver.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/drm/ttm/ttm_bo_driver.h +1 -1
index c3d74be..7777d14 100644
@@ -42,7 +42,7 @@
 #include <linux/spinlock.h>
 #include <linux/reservation.h>
 
-#define TTM_MAX_BO_PRIORITY	16U
+#define TTM_MAX_BO_PRIORITY	4U
 
 struct ttm_backend_func {
 	/**
Signature · 6 lines
2.7.4

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

A message that is not in the archive (sent off-list or not yet received): 1490665930-19814-2-git-send-email-Hongbo.He-5C7GfCeVMHo@public.gmane.org

Reviewed-by Alex Deucher
#4 lore raw

RE: [PATCH 2/2] drm/amd/amdgpu: decrease ttm bo priority number

Quoted 6 lines

-----Original Message-----
From: Roger.He [mailto:[email protected]]
Sent: Monday, March 27, 2017 9:52 PM
To: [email protected]
Cc: Deucher, Alexander; He, Hongbo
Subject: [PATCH 2/2] drm/amd/amdgpu: decrease ttm bo priority number

Patch title should be:
drm/ttm: decrease ttm bo priority number
With that fixed:

Quoted 25 lines

decrease and also reserve priority number for KFD using

Change-Id I9e36d292c920c034ddca53d0ec282c17b7a3cf16
---
 include/drm/ttm/ttm_bo_driver.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/drm/ttm/ttm_bo_driver.h +1 -2
index c3d74be..7777d14 100644
@@ -42,7 +42,7 @@
 #include <linux/spinlock.h>
 #include <linux/reservation.h>
 
-#define TTM_MAX_BO_PRIORITY	16U
+#define TTM_MAX_BO_PRIORITY	4U
 
 struct ttm_backend_func {
 	/**
--
Quoted 1 line

2.7.4

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

Reviewed-by Alex Deucher
#5 lore raw
In reply to a message not in the archive
Quoted 8 lines

-----Original Message-----
From: Roger.He [mailto:[email protected]]
Sent: Monday, March 27, 2017 9:52 PM
To: [email protected]
Cc: Deucher, Alexander; He, Hongbo
Subject: [PATCH 1/2] drm/amd/amdgpu: fix performance drop when VRAM pressure

Quoted 6 lines

When VRAM pressue and trigger huge evictions there is performance drop, this patch fix it.

Change-Id Idcd2db65be69d62bcbd7dfaa3bcf9bc964d6d122
Quoted 24 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +1 -3
index 434c931..d6b2de9 100644
@@ -405,10 +405,8 @@ int amdgpu_bo_create_restricted(struct
 amdgpu_device *adev,
 	if (unlikely(r != 0))
 		return r;
 
-	bo->tbo.priority = ilog2(bo->tbo.num_pages);
 	if (kernel)
-		bo->tbo.priority *= 2;
-	bo->tbo.priority = min(bo->tbo.priority, TTM_MAX_BO_PRIORITY -
 1);
+		bo->tbo.priority = 1;
 
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +0 -1
 	if (flags & AMDGPU_GEM_CREATE_VRAM_CLEARED &&
 	    bo->tbo.mem.placement & TTM_PL_FLAG_VRAM) {
--
Quoted 1 line

2.7.4

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