[AMD Official Use Only - General] Tested-by and Acked-by: Mukul Joshi <mukul.joshi@xxxxxxx> > -----Original Message----- > From: amd-gfx <amd-gfx-bounces@xxxxxxxxxxxxxxxxxxxxx> On Behalf Of Felix > Kuehling > Sent: Thursday, April 18, 2024 2:07 PM > To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx > Cc: Joshi, Mukul <Mukul.Joshi@xxxxxxx>; Koenig, Christian > <Christian.Koenig@xxxxxxx> > 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@xxxxxxx> > --- > 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