drm/amd/amdgpu: decrease ttm bo priority to fix performance drop when VRAM pressure
Subsystems (3)
PATCH 1/1 drm/amd/amdgpu: decrease ttm bo priority to fix performance drop when VRAM pressure
1. When VRAM pressue and trigger huge evictions there is performance drop, this patch fix it.
2. Also reserve priority for KFD using
--- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 4 +--- include/drm/ttm/ttm_bo_driver.h | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +1 -3
@@ -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 ) {
include/drm/ttm/ttm_bo_driver.h +1 -1
@@ -42,7 +42,7 @@#include <linux/spinlock.h> #include <linux/reservation.h> -#define TTM_MAX_BO_PRIORITY 16U +#define TTM_MAX_BO_PRIORITY 4Ustruct 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): 1490616311-32137-1-git-send-email-Hongbo.He-5C7GfCeVMHo@public.gmane.org
Christian König
Reviewed-byAm 27.03.2017 um 14:05 schrieb Roger.He:
Quoted 6 lines
1. When VRAM pressue and trigger huge evictions there is performance drop, this patch fix it.
2. Also reserve priority for KFD usingChange-Id Idcd2db65be69d62bcbd7dfaa3bcf9bc964d6d122Signed-off-by Roger.He <[email protected]>
Quoted 26 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 4 +--- include/drm/ttm/ttm_bo_driver.h | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +1
-3@@ -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 ) {include/drm/ttm/ttm_bo_driver.h +0
-0
include/drm/ttm/ttm_bo_driver.h line 48
Quoted 8 lines
include/drm/ttm/ttm_bo_driver.h +1
-1@@ -42,7 +42,7 @@#include <linux/spinlock.h> #include <linux/reservation.h> -#define TTM_MAX_BO_PRIORITY 16U +#define TTM_MAX_BO_PRIORITY 4Ustruct ttm_backend_func {/**
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 32 lines · Roger.He
1. When VRAM pressue and trigger huge evictions there is performance drop, this patch fix it.
2. Also reserve priority for KFD usingChange-Id Idcd2db65be69d62bcbd7dfaa3bcf9bc964d6d122Signed-off-by Roger.He <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 4 +--- include/drm/ttm/ttm_bo_driver.h | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +1
-3@@ -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 ) {include/drm/ttm/ttm_bo_driver.h +0
-0
include/drm/ttm/ttm_bo_driver.h line 45
Quoted 5 lines
include/drm/ttm/ttm_bo_driver.h +1
-1@@ -42,7 +42,7 @@#include <linux/spinlock.h> #include <linux/reservation.h> -#define TTM_MAX_BO_PRIORITY 16U +#define TTM_MAX_BO_PRIORITY 4U
I'd suggest splitting this out as a separate patch.
Alex
Quoted 10 lines
include/drm/ttm/ttm_bo_driver.h +0
-1struct ttm_backend_func {/** -- 2.7.4
_______________________________________________
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