Skip to contentSkip to conversation

drm/ttm: fix memleak in ttm_transfered_destroy

PATCH In review Christian König 3 participants 5 messages Oct 20, 2021 – Oct 21, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/ttm: fix memleak in ttm_transfered_destroy

We need to cleanup the fences for ghost objects as well.

---
 drivers/gpu/drm/ttm/ttm_bo_util.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/ttm/ttm_bo_util.c +1 -0
index 82af095f6b81..f37a8c53b35f 100644
@@ -190,6 +190,7 @@ static void ttm_transfered_destroy(struct ttm_buffer_object *bo)
 	struct ttm_transfer_obj *fbo;
 
 	fbo = container_of(bo, struct ttm_transfer_obj, base);
+	dma_resv_fini(&fbo->base.base._resv);
 	ttm_bo_put(fbo->bo);
 	kfree(fbo);
 }
Signature · 1 line
2.25.1
#1 lore raw
Quoted 5 lines · Christian König

We need to cleanup the fences for ghost objects as well.

Does this fix this bug?
https://bugzilla.kernel.org/show_bug.cgi?id=214029

Alex

Quoted 19 lines
---
 drivers/gpu/drm/ttm/ttm_bo_util.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/ttm/ttm_bo_util.c +1 -1
index 82af095f6b81..f37a8c53b35f 100644
@@ -190,6 +190,7 @@ static void ttm_transfered_destroy(struct ttm_buffer_object *bo)
        struct ttm_transfer_obj *fbo;
 
        fbo = container_of(bo, struct ttm_transfer_obj, base);
+       dma_resv_fini(&fbo->base.base._resv);
        ttm_bo_put(fbo->bo);
        kfree(fbo);
 }
--

2.25.1

#2 lore raw

Am 20.10.21 um 19:43 schrieb Alex Deucher:

Quoted 8 lines
Quoted 4 lines · Christian König

We need to cleanup the fences for ghost objects as well.

Does this fix this bug?
https://bugzilla.kernel.org/show_bug.cgi?id=214029

Yeah, I was already adding that patch to the bug report as potential fix.

Christian.

Quoted 22 lines

Alex

Quoted 19 lines
---
  drivers/gpu/drm/ttm/ttm_bo_util.c | 1 +
  1 file changed, 1 insertion(+)
drivers/gpu/drm/ttm/ttm_bo_util.c +1 -1
index 82af095f6b81..f37a8c53b35f 100644
@@ -190,6 +190,7 @@ static void ttm_transfered_destroy(struct ttm_buffer_object *bo)
         struct ttm_transfer_obj *fbo;
 
         fbo = container_of(bo, struct ttm_transfer_obj, base);
+       dma_resv_fini(&fbo->base.base._resv);
         ttm_bo_put(fbo->bo);
         kfree(fbo);
  }
--

2.25.1

#3 lore raw

Am 20.10.21 um 19:47 schrieb Christian König:

Quoted 11 lines

Am 20.10.21 um 19:43 schrieb Alex Deucher:

Quoted 8 lines
Quoted 4 lines · Christian König

We need to cleanup the fences for ghost objects as well.

Does this fix this bug?
https://bugzilla.kernel.org/show_bug.cgi?id=214029

Yeah, I was already adding that patch to the bug report as potential fix.

Ok that indeed fixes the issues we were seeing.

Can I get an acked or reviewed-by so that I can push this to drm-misc-fixes ASAP?

Thanks,
Christian.

Quoted 27 lines

Christian.

Quoted 23 lines

Alex

Quoted 20 lines

---
  drivers/gpu/drm/ttm/ttm_bo_util.c | 1 +

  1 file changed, 1 insertion(+)
drivers/gpu/drm/ttm/ttm_bo_util.c +1 -0
index 82af095f6b81..f37a8c53b35f 100644
@@ -190,6 +190,7 @@ static void ttm_transfered_destroy(struct 
 ttm_buffer_object *bo)
          struct ttm_transfer_obj *fbo;
 
          fbo = container_of(bo, struct ttm_transfer_obj, base);
+       dma_resv_fini(&fbo->base.base._resv);
          ttm_bo_put(fbo->bo);
          kfree(fbo);

  }

Signature · 1 line
2.25.1
Reviewed-by
#4 lore raw

[AMD Official Use Only]

Quoted 36 lines

-----Original Message-----
From: Christian König <[email protected]>
Sent: Thursday, October 21, 2021 5:06 PM
To: Alex Deucher <[email protected]>; Huang, Ray <[email protected]>
Cc: Maling list - DRI developers <[email protected]>
Subject: Re: [PATCH] drm/ttm: fix memleak in ttm_transfered_destroy

Am 20.10.21 um 19:47 schrieb Christian König:

Quoted 9 lines

Am 20.10.21 um 19:43 schrieb Alex Deucher:

Quoted 8 lines
Quoted 4 lines · Christian König

We need to cleanup the fences for ghost objects as well.

Does this fix this bug?

https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbug

Quoted 1 line
Quoted 1 line

zilla.kernel.org%2Fshow_bug.cgi%3Fid%3D214029&amp;data=04%7C01%7C ray.

Quoted 1 line
Quoted 1 line

huang%40amd.com%7C2649abcb898e44a70a2908d99471fded%7C3dd8961f e4884e60

Quoted 1 line
Quoted 1 line

8e11a82d994e183d%7C0%7C0%7C637704039590182871%7CUnknown%7CT WFpbGZsb3d

Quoted 1 line
Quoted 1 line

8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0% 3D%7

Quoted 1 line
Quoted 1 line

C1000&amp;sdata=M2sEOCDiZIr8mGuOHQNFGPNi93kp6HcrAS1hjxy79r8%3 D&amp;re

Quoted 9 lines
Quoted 3 lines
Quoted 1 line

served=0

Yeah, I was already adding that patch to the bug report as potential fix.

Ok that indeed fixes the issues we were seeing.

Can I get an acked or reviewed-by so that I can push this to drm-misc-fixes ASAP?

(+ Lang), he is debugging a similar issue as well.

Quoted 31 lines

Thanks,
Christian.

Quoted 28 lines

Christian.

Quoted 24 lines

Alex

Quoted 21 lines

---
  drivers/gpu/drm/ttm/ttm_bo_util.c | 1 +

  1 file changed, 1 insertion(+)
drivers/gpu/drm/ttm/ttm_bo_util.c +1 -0
index 82af095f6b81..f37a8c53b35f 100644
@@ -190,6 +190,7 @@ static void ttm_transfered_destroy(struct
 ttm_buffer_object *bo)
          struct ttm_transfer_obj *fbo;
 
          fbo = container_of(bo, struct ttm_transfer_obj, base);
+       dma_resv_fini(&fbo->base.base._resv);
          ttm_bo_put(fbo->bo);
          kfree(fbo);

  }
--
2.25.1