From: Alex Deucher <alexdeucher@gmail.com>
To: "Koenig, Christian" <Christian.Koenig@amd.com>
Cc: Daniel Gomez <daniel@qtec.com>, David Airlie <airlied@linux.ie>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>,
"Deucher, Alexander" <Alexander.Deucher@amd.com>,
"dagmcr@gmail.com" <dagmcr@gmail.com>
Subject: Re: [PATCH] drm/radeon/ttm: Fix memory leak userptr pages
Date: Thu, 18 Mar 2021 22:57:53 -0400 [thread overview]
Message-ID: <CADnq5_MMTBXt50sqJvYmXWn0uBALz2fNvpSrCfjSuMa99VLa=w@mail.gmail.com> (raw)
In-Reply-To: <MN2PR12MB37755DAAB03FC0065E98EF1183699@MN2PR12MB3775.namprd12.prod.outlook.com>
Applied. Thanks!
Alex
On Thu, Mar 18, 2021 at 5:00 AM Koenig, Christian
<Christian.Koenig@amd.com> wrote:
>
> Reviewed-by: Christian König <christian.koenig@amd.com>
> ________________________________
> Von: Daniel Gomez <daniel@qtec.com>
> Gesendet: Donnerstag, 18. März 2021 09:32
> Cc: dagmcr@gmail.com <dagmcr@gmail.com>; Daniel Gomez <daniel@qtec.com>; Deucher, Alexander <Alexander.Deucher@amd.com>; Koenig, Christian <Christian.Koenig@amd.com>; David Airlie <airlied@linux.ie>; Daniel Vetter <daniel@ffwll.ch>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>; dri-devel@lists.freedesktop.org <dri-devel@lists.freedesktop.org>; linux-kernel@vger.kernel.org <linux-kernel@vger.kernel.org>
> 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@qtec.com>
> ---
> 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@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2021-03-19 2:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-18 8:32 [PATCH] drm/radeon/ttm: Fix memory leak userptr pages Daniel Gomez
[not found] ` <MN2PR12MB37755DAAB03FC0065E98EF1183699@MN2PR12MB3775.namprd12.prod.outlook.com>
2021-03-19 2:57 ` Alex Deucher [this message]
2021-03-19 20:28 ` Felix Kuehling
2021-03-22 9:38 ` Daniel Gomez
2021-03-22 10:34 ` Christian König
2021-03-22 10:49 ` Daniel Gomez
2021-04-06 20:55 ` Alex Deucher
2021-04-07 7:47 ` Daniel Gomez
2021-04-07 9:27 ` Christian König
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CADnq5_MMTBXt50sqJvYmXWn0uBALz2fNvpSrCfjSuMa99VLa=w@mail.gmail.com' \
--to=alexdeucher@gmail.com \
--cc=Alexander.Deucher@amd.com \
--cc=Christian.Koenig@amd.com \
--cc=airlied@linux.ie \
--cc=amd-gfx@lists.freedesktop.org \
--cc=dagmcr@gmail.com \
--cc=daniel@qtec.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).