All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: Update BO eviction priorities
@ 2024-04-18 18:06 Felix Kuehling
  2024-04-18 18:40 ` Joshi, Mukul
  2024-04-19  8:44 ` Christian König
  0 siblings, 2 replies; 3+ messages in thread
From: Felix Kuehling @ 2024-04-18 18:06 UTC (permalink / raw)
  To: amd-gfx; +Cc: mukul.joshi, christian.koenig

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>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index cd2dd3ed7153..d80671535ab3 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -608,6 +608,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)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH] drm/amdgpu: Update BO eviction priorities
  2024-04-18 18:06 [PATCH] drm/amdgpu: Update BO eviction priorities Felix Kuehling
@ 2024-04-18 18:40 ` Joshi, Mukul
  2024-04-19  8:44 ` Christian König
  1 sibling, 0 replies; 3+ messages in thread
From: Joshi, Mukul @ 2024-04-18 18:40 UTC (permalink / raw)
  To: Kuehling, Felix, amd-gfx; +Cc: Koenig, Christian

[AMD Official Use Only - General]

Tested-by and Acked-by: Mukul Joshi <mukul.joshi@amd.com>

> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Felix
> Kuehling
> Sent: Thursday, April 18, 2024 2:07 PM
> To: amd-gfx@lists.freedesktop.org
> Cc: Joshi, Mukul <Mukul.Joshi@amd.com>; Koenig, Christian
> <Christian.Koenig@amd.com>
> Subject: [PATCH] drm/amdgpu: Update BO eviction priorities
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> 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>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> index cd2dd3ed7153..d80671535ab3 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> @@ -608,6 +608,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)
> --
> 2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/amdgpu: Update BO eviction priorities
  2024-04-18 18:06 [PATCH] drm/amdgpu: Update BO eviction priorities Felix Kuehling
  2024-04-18 18:40 ` Joshi, Mukul
@ 2024-04-19  8:44 ` Christian König
  1 sibling, 0 replies; 3+ messages in thread
From: Christian König @ 2024-04-19  8:44 UTC (permalink / raw)
  To: Felix Kuehling, amd-gfx; +Cc: mukul.joshi

Am 18.04.24 um 20:06 schrieb Felix Kuehling:
> 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>

Good point and at least of hand I can't think of anything which could go 
wrong here.

Just keep an eye on potentially failing CI tests since we haven't really 
exercised this functionality in recent years.

Reviewed-by: Christian König <christian.koenig@amd.com>

Regards,
Christian.

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> index cd2dd3ed7153..d80671535ab3 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> @@ -608,6 +608,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)


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-04-19  8:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-18 18:06 [PATCH] drm/amdgpu: Update BO eviction priorities Felix Kuehling
2024-04-18 18:40 ` Joshi, Mukul
2024-04-19  8:44 ` Christian König

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.