Re: [PATCH] drm/radeon/ttm: Fix memory leak userptr pages
From: Alex Deucher
Date: Thu Mar 18 2021 - 22:58:47 EST
Applied. Thanks!
Alex
On Thu, Mar 18, 2021 at 5:00 AM Koenig, Christian
<Christian.Koenig@xxxxxxx> wrote:
>
> Reviewed-by: Christian König <christian.koenig@xxxxxxx>
> ________________________________
> Von: Daniel Gomez <daniel@xxxxxxxx>
> Gesendet: Donnerstag, 18. März 2021 09:32
> Cc: dagmcr@xxxxxxxxx <dagmcr@xxxxxxxxx>; Daniel Gomez <daniel@xxxxxxxx>; Deucher, Alexander <Alexander.Deucher@xxxxxxx>; Koenig, Christian <Christian.Koenig@xxxxxxx>; David Airlie <airlied@xxxxxxxx>; Daniel Vetter <daniel@xxxxxxxx>; amd-gfx@xxxxxxxxxxxxxxxxxxxxx <amd-gfx@xxxxxxxxxxxxxxxxxxxxx>; dri-devel@xxxxxxxxxxxxxxxxxxxxx <dri-devel@xxxxxxxxxxxxxxxxxxxxx>; linux-kernel@xxxxxxxxxxxxxxx <linux-kernel@xxxxxxxxxxxxxxx>
> Betreff: [PATCH] drm/radeon/ttm: Fix memory leak userptr pages
>
> If userptr pages have been pinned but not bounded,
> they remain uncleared.
>
> Signed-off-by: Daniel Gomez <daniel@xxxxxxxx>
> ---
> drivers/gpu/drm/radeon/radeon_ttm.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
> index e8c66d10478f..bbcc6264d48f 100644
> --- a/drivers/gpu/drm/radeon/radeon_ttm.c
> +++ b/drivers/gpu/drm/radeon/radeon_ttm.c
> @@ -485,13 +485,14 @@ static void radeon_ttm_backend_unbind(struct ttm_bo_device *bdev, struct ttm_tt
> struct radeon_ttm_tt *gtt = (void *)ttm;
> struct radeon_device *rdev = radeon_get_rdev(bdev);
>
> + if (gtt->userptr)
> + radeon_ttm_tt_unpin_userptr(bdev, ttm);
> +
> if (!gtt->bound)
> return;
>
> radeon_gart_unbind(rdev, gtt->offset, ttm->num_pages);
>
> - if (gtt->userptr)
> - radeon_ttm_tt_unpin_userptr(bdev, ttm);
> gtt->bound = false;
> }
>
> --
> 2.30.2
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/dri-devel