drm/amdgpu: fix the fence leak
Subsystems (2)
PATCH 1/1 drm/amdgpu: fix the fence leak
release the unreleased fences
Signed-off-by Roy Sun <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +6 -2
@@ -669,11 +669,15 @@ void amdgpu_ctx_fence_time(struct amdgpu_ctx *ctx, struct amdgpu_ctx_entity *cenif (!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);
Signature · 6 lines
2.31.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Am 06.05.21 um 11:14 schrieb Roy Sun:
Quoted 1 line
release the unreleased fences
A bit better description what's going wrong here would be nice.
Quoted 2 lines
Signed-off-by Roy Sun <[email protected]>
Reviewed-by Christian König <[email protected]>
Quoted 16 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +2
-1@@ -669,11 +669,15 @@ void amdgpu_ctx_fence_time(struct amdgpu_ctx *ctx, struct amdgpu_ctx_entity *cenif (!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 ;
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c void amdgpu_ctx_fence_time(struct amdgpu_ctx *ctx, struct amdgpu_ctx_entity *cen · line 683
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +4
-1+ } 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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx