* [PATCH] drm/amd/amdgpu: decrease ttm bo priority to fix performance drop when VRAM pressure
@ 2017-03-27 12:05 Roger.He
[not found] ` <1490616311-32137-1-git-send-email-Hongbo.He-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Roger.He @ 2017-03-27 12:05 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: Roger.He, Christian.Koenig-5C7GfCeVMHo
1. When VRAM pressue and trigger huge evictions there is performance drop,
this patch fix it.
2. Also reserve priority for KFD using
Change-Id: Idcd2db65be69d62bcbd7dfaa3bcf9bc964d6d122
Signed-off-by: Roger.He <Hongbo.He@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 4 +---
include/drm/ttm/ttm_bo_driver.h | 2 +-
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index 434c931..d6b2de9 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -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) {
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
index c3d74be..7777d14 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -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 {
/**
--
2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/amd/amdgpu: decrease ttm bo priority to fix performance drop when VRAM pressure
[not found] ` <1490616311-32137-1-git-send-email-Hongbo.He-5C7GfCeVMHo@public.gmane.org>
@ 2017-03-27 14:47 ` Christian König
2017-03-27 15:38 ` Alex Deucher
1 sibling, 0 replies; 3+ messages in thread
From: Christian König @ 2017-03-27 14:47 UTC (permalink / raw)
To: Roger.He, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: Christian.Koenig-5C7GfCeVMHo
Am 27.03.2017 um 14:05 schrieb Roger.He:
> 1. When VRAM pressue and trigger huge evictions there is performance drop,
> this patch fix it.
> 2. Also reserve priority for KFD using
>
> Change-Id: Idcd2db65be69d62bcbd7dfaa3bcf9bc964d6d122
> Signed-off-by: Roger.He <Hongbo.He@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 4 +---
> include/drm/ttm/ttm_bo_driver.h | 2 +-
> 2 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> index 434c931..d6b2de9 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> @@ -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) {
> diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
> index c3d74be..7777d14 100644
> --- a/include/drm/ttm/ttm_bo_driver.h
> +++ b/include/drm/ttm/ttm_bo_driver.h
> @@ -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 {
> /**
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/amd/amdgpu: decrease ttm bo priority to fix performance drop when VRAM pressure
[not found] ` <1490616311-32137-1-git-send-email-Hongbo.He-5C7GfCeVMHo@public.gmane.org>
2017-03-27 14:47 ` Christian König
@ 2017-03-27 15:38 ` Alex Deucher
1 sibling, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2017-03-27 15:38 UTC (permalink / raw)
To: Roger.He; +Cc: Christian Koenig, amd-gfx list
On Mon, Mar 27, 2017 at 8:05 AM, Roger.He <Hongbo.He@amd.com> wrote:
> 1. When VRAM pressue and trigger huge evictions there is performance drop,
> this patch fix it.
> 2. Also reserve priority for KFD using
>
> Change-Id: Idcd2db65be69d62bcbd7dfaa3bcf9bc964d6d122
> Signed-off-by: Roger.He <Hongbo.He@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 4 +---
> include/drm/ttm/ttm_bo_driver.h | 2 +-
> 2 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> index 434c931..d6b2de9 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> @@ -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) {
> diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
> index c3d74be..7777d14 100644
> --- a/include/drm/ttm/ttm_bo_driver.h
> +++ b/include/drm/ttm/ttm_bo_driver.h
> @@ -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
>
> struct ttm_backend_func {
> /**
> --
> 2.7.4
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-03-27 15:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-27 12:05 [PATCH] drm/amd/amdgpu: decrease ttm bo priority to fix performance drop when VRAM pressure Roger.He
[not found] ` <1490616311-32137-1-git-send-email-Hongbo.He-5C7GfCeVMHo@public.gmane.org>
2017-03-27 14:47 ` Christian König
2017-03-27 15:38 ` Alex Deucher
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.