AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Roy Sun <Roy.Sun@amd.com>, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/amdgpu: fix the fence leak
Date: Thu, 6 May 2021 12:39:00 +0200	[thread overview]
Message-ID: <cb6deb4a-06c7-6e34-a484-ca161dbe714b@gmail.com> (raw)
In-Reply-To: <20210506091453.4541-1-Roy.Sun@amd.com>

Am 06.05.21 um 11:14 schrieb Roy Sun:
> release the unreleased fences

A bit better description what's going wrong here would be nice.

>
> Signed-off-by: Roy Sun <Roy.Sun@amd.com>

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

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> index 01fe60fedcbe..59b662947dde 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> @@ -669,11 +669,15 @@ void amdgpu_ctx_fence_time(struct amdgpu_ctx *ctx, struct amdgpu_ctx_entity *cen
>   		if (!fence)
>   			continue;
>   		s_fence = to_drm_sched_fence(fence);
> -		if (!dma_fence_is_signaled(&s_fence->scheduled))
> +		if (!dma_fence_is_signaled(&s_fence->scheduled)) {
> +			dma_fence_put(fence);
>   			continue;
> +		}
>   		t1 = s_fence->scheduled.timestamp;
> -		if (t1 >= now)
> +		if (t1 >= now) {
> +			dma_fence_put(fence);
>   			continue;
> +		}
>   		if (dma_fence_is_signaled(&s_fence->finished) &&
>   			s_fence->finished.timestamp < now)
>   			*total += ktime_sub(s_fence->finished.timestamp, t1);

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

      reply	other threads:[~2021-05-06 10:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-06  9:14 [PATCH] drm/amdgpu: fix the fence leak Roy Sun
2021-05-06 10:39 ` Christian König [this message]

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=cb6deb4a-06c7-6e34-a484-ca161dbe714b@gmail.com \
    --to=ckoenig.leichtzumerken@gmail.com \
    --cc=Roy.Sun@amd.com \
    --cc=amd-gfx@lists.freedesktop.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