All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: fix the fence leak
@ 2021-05-06  9:14 Roy Sun
  2021-05-06 10:39 ` Christian König
  0 siblings, 1 reply; 2+ messages in thread
From: Roy Sun @ 2021-05-06  9:14 UTC (permalink / raw)
  To: amd-gfx; +Cc: Roy Sun

release the unreleased fences

Signed-off-by: Roy Sun <Roy.Sun@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);
-- 
2.31.1

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

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

* Re: [PATCH] drm/amdgpu: fix the fence leak
  2021-05-06  9:14 [PATCH] drm/amdgpu: fix the fence leak Roy Sun
@ 2021-05-06 10:39 ` Christian König
  0 siblings, 0 replies; 2+ messages in thread
From: Christian König @ 2021-05-06 10:39 UTC (permalink / raw)
  To: Roy Sun, amd-gfx

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

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

end of thread, other threads:[~2021-05-06 10:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-06  9:14 [PATCH] drm/amdgpu: fix the fence leak Roy Sun
2021-05-06 10:39 ` 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.