drm/ttm: fix leaking fences via ttm_buffer_object_transfer
Subsystems (3)
PATCH 1/1 drm/ttm: fix leaking fences via ttm_buffer_object_transfer
From: Ahzo <[email protected]>
Set the drm_device to NULL, so that the newly created buffer object doesn't appear to use the embedded gem object.
This is necessary, because otherwise no corresponding dma_resv_fini for the dma_resv_init is called, resulting in a memory leak.
The dma_resv_fini in ttm_bo_release_list is only called if the embedded gem object is not used, which is determined by checking if the drm_device is NULL.
--- drivers/gpu/drm/ttm/ttm_bo_util.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/ttm/ttm_bo_util.c +1 -0
@@ -514,6 +514,7 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo, fbo->base.base.resv = &fbo->base.base._resv;dma_resv_init (&fbo->base.base._resv); + fbo->base.base.dev =NULL ; ret =dma_resv_trylock (&fbo->base.base._resv);WARN_ON (!ret);
Signature · 6 lines
2.24.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Am 25.02.20 um 19:56 schrieb Alex Deucher:
Quoted 8 lines
From: Ahzo <[email protected]>
Set the
drm_deviceto NULL, so that the newly created buffer object doesn't appear to use the embedded gem object.This is necessary, because otherwise no corresponding
dma_resv_finifor thedma_resv_initis called, resulting in a memory leak.
Quoted 8 lines
The
dma_resv_finiinttm_bo_release_listis only called if the embedded gem object is not used, which is determined by checking if thedrm_deviceis NULL.Fixes 1e053b10ba60 ("drm/ttm: use gem reservation object")Signed-off-by Ahzo <[email protected]>Signed-off-by Alex Deucher <[email protected]>
Good catch I was trying to hunt that one down as well.
Quoted 9 lines
--- drivers/gpu/drm/ttm/ttm_bo_util.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/ttm/ttm_bo_util.c +0
-0
drivers/gpu/drm/ttm/ttm_bo_util.c static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo, · line 520
Quoted 7 lines
drivers/gpu/drm/ttm/ttm_bo_util.c +1
-0@@ -514,6 +514,7 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo, fbo->base.base.resv = &fbo->base.base._resv;dma_resv_init (&fbo->base.base._resv); + fbo->base.base.dev =NULL ; ret =dma_resv_trylock (&fbo->base.base._resv);WARN_ON (!ret);
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 14 lines · Christian König
Am 25.02.20 um 19:56 schrieb Alex Deucher:
Quoted 12 lines
From: Ahzo <[email protected]>
Set the
drm_deviceto NULL, so that the newly created buffer object doesn't appear to use the embedded gem object.This is necessary, because otherwise no corresponding
dma_resv_finifor thedma_resv_initis called, resulting in a memory leak.The
dma_resv_finiinttm_bo_release_listis only called if the embedded gem object is not used, which is determined by checking if thedrm_deviceis NULL.
Quoted 8 lines
Quoted 4 lines
Fixes 1e053b10ba60 ("drm/ttm: use gem reservation object")Signed-off-by Ahzo <[email protected]>Signed-off-by Alex Deucher <[email protected]>Good catch I was trying to hunt that one down as well.
Reviewed-by Christian König <[email protected]>
Can you apply it to drm-misc?
Thanks,
Alex
Quoted 12 lines
Quoted 12 lines
--- drivers/gpu/drm/ttm/ttm_bo_util.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/ttm/ttm_bo_util.c +0
-0@@ -514,6 +514,7 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo, fbo->base.base.resv = &fbo->base.base._resv;
Quoted 6 lines
drivers/gpu/drm/ttm/ttm_bo_util.c static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo, · line 520
Quoted 5 lines
drivers/gpu/drm/ttm/ttm_bo_util.c +1
-0dma_resv_init (&fbo->base.base._resv); + fbo->base.base.dev =NULL ; ret =dma_resv_trylock (&fbo->base.base._resv);WARN_ON (!ret);
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Am 25.02.20 um 20:11 schrieb Alex Deucher:
Quoted 15 lines
Quoted 13 lines · Christian König
Am 25.02.20 um 19:56 schrieb Alex Deucher:
Quoted 12 lines
From: Ahzo <[email protected]>
Set the
drm_deviceto NULL, so that the newly created buffer object doesn't appear to use the embedded gem object.This is necessary, because otherwise no corresponding
dma_resv_finifor thedma_resv_initis called, resulting in a memory leak.The
dma_resv_finiinttm_bo_release_listis only called if the embedded gem object is not used, which is determined by checking if thedrm_deviceis NULL.
Quoted 8 lines
Quoted 7 lines
Quoted 4 lines
Fixes 1e053b10ba60 ("drm/ttm: use gem reservation object")Signed-off-by Ahzo <[email protected]>Signed-off-by Alex Deucher <[email protected]>Good catch I was trying to hunt that one down as well.
Reviewed-by Christian König <[email protected]>Can you apply it to drm-misc?
Sure, but not today. Need to get the kids to bed.
Christian.
Quoted 16 lines
Thanks,
Alex
Quoted 11 lines
Quoted 11 lines
--- drivers/gpu/drm/ttm/ttm_bo_util.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/ttm/ttm_bo_util.c +0
-0@@ -514,6 +514,7 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo, fbo->base.base.resv = &fbo->base.base._resv;
Quoted 5 lines
Quoted 5 lines
drivers/gpu/drm/ttm/ttm_bo_util.c static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo, · line 520
Quoted 5 lines
drivers/gpu/drm/ttm/ttm_bo_util.c +1
-0dma_resv_init (&fbo->base.base._resv); + fbo->base.base.dev =NULL ; ret =dma_resv_trylock (&fbo->base.base._resv);WARN_ON (!ret);
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Am 25.02.20 um 20:12 schrieb Christian König:
Quoted 20 lines
Am 25.02.20 um 20:11 schrieb Alex Deucher:
Quoted 19 lines
Quoted 17 lines · Christian König
Am 25.02.20 um 19:56 schrieb Alex Deucher:
Quoted 16 lines
From: Ahzo <[email protected]>
Set the
drm_deviceto NULL, so that the newly created buffer object doesn't appear to use the embedded gem object.This is necessary, because otherwise no corresponding
dma_resv_finifor thedma_resv_initis called, resulting in a memory leak.The
dma_resv_finiinttm_bo_release_listis only called if the embedded gem object is not used, which is determined by checking if thedrm_deviceis NULL.Fixes 1e053b10ba60 ("drm/ttm: use gem reservation object")Signed-off-by Ahzo <[email protected]>Signed-off-by Alex Deucher <[email protected]>
Quoted 6 lines
Quoted 4 lines
Quoted 3 lines
Good catch I was trying to hunt that one down as well.
Reviewed-by Christian König <[email protected]>Can you apply it to drm-misc?
Sure, but not today. Need to get the kids to bed.
So just pushed to drm-misc-fixes. Do we also need that on amd-staging-drm-next?
Christian.
Quoted 20 lines
Christian.
Quoted 17 lines
Thanks,
Alex
Quoted 12 lines
Quoted 12 lines
---
drivers/gpu/drm/ttm/ttm_bo_util.c| 1 +1 file changed, 1 insertion(+)drivers/gpu/drm/ttm/ttm_bo_util.c +0
-0@@ -514,6 +514,7 @@ static int ttm_buffer_object_transfer(structttm_buffer_object *bo, fbo->base.base.resv = &fbo->base.base._resv;
Quoted 10 lines
Quoted 5 lines
Quoted 5 lines
drivers/gpu/drm/ttm/ttm_bo_util.c static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo, · line 519
Quoted 5 lines
drivers/gpu/drm/ttm/ttm_bo_util.c +1
-0dma_resv_init(&fbo->base.base._resv); + fbo->base.base.dev = NULL; ret = dma_resv_trylock(&fbo->base.base._resv); WARN_ON(!ret);_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 27 lines · Christian König
Am 25.02.20 um 20:12 schrieb Christian König:
Quoted 25 lines
Am 25.02.20 um 20:11 schrieb Alex Deucher:
Quoted 24 lines
Quoted 22 lines · Christian König
Am 25.02.20 um 19:56 schrieb Alex Deucher:
Quoted 14 lines
From: Ahzo <[email protected]>
Set the
drm_deviceto NULL, so that the newly created buffer object doesn't appear to use the embedded gem object.This is necessary, because otherwise no corresponding
dma_resv_finifor
thedma_resv_initis called, resulting in a memory leak.The
dma_resv_finiinttm_bo_release_listis only called if the embedded
gem object is not used, which is determined by checking if thedrm_deviceis NULL.Quoted 5 lines
Fixes 1e053b10ba60 ("drm/ttm: use gem reservation object")Signed-off-by Ahzo <[email protected]>Signed-off-by Alex Deucher <[email protected]>Good catch I was trying to hunt that one down as well.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Quoted 1 line
Reviewed-by Christian König <[email protected]>Can you apply it to drm-misc?
Sure, but not today. Need to get the kids to bed.
So just pushed to drm-misc-fixes. Do we also need that on amd-staging-drm-next?
Backmerge -rc4 (once it's released) probably a good idea. Or cherry-pick with a note why you needed it real quick. -Daniel
Quoted 39 lines
Christian.
Quoted 21 lines
Christian.
Quoted 18 lines
Thanks,
Alex
Quoted 13 lines
Quoted 13 lines
--- drivers/gpu/drm/ttm/ttm_bo_util.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/ttm/ttm_bo_util.c +0
-0@@ -514,6 +514,7 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo, fbo->base.base.resv = &fbo->base.base._resv;Quoted 10 lines
Quoted 5 lines
Quoted 5 lines
drivers/gpu/drm/ttm/ttm_bo_util.c static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo, · line 519
Quoted 5 lines
drivers/gpu/drm/ttm/ttm_bo_util.c +1
-0dma_resv_init (&fbo->base.base._resv); + fbo->base.base.dev =NULL ; ret =dma_resv_trylock (&fbo->base.base._resv);WARN_ON (!ret);_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 27 lines · Christian König
Am 25.02.20 um 20:12 schrieb Christian König:
Quoted 25 lines
Am 25.02.20 um 20:11 schrieb Alex Deucher:
Quoted 24 lines
Quoted 22 lines · Christian König
Am 25.02.20 um 19:56 schrieb Alex Deucher:
Quoted 14 lines
From: Ahzo <[email protected]>
Set the
drm_deviceto NULL, so that the newly created buffer object doesn't appear to use the embedded gem object.This is necessary, because otherwise no corresponding
dma_resv_finifor
thedma_resv_initis called, resulting in a memory leak.The
dma_resv_finiinttm_bo_release_listis only called if the embedded
gem object is not used, which is determined by checking if thedrm_deviceis NULL.Quoted 5 lines
Fixes 1e053b10ba60 ("drm/ttm: use gem reservation object")Signed-off-by Ahzo <[email protected]>Signed-off-by Alex Deucher <[email protected]>Good catch I was trying to hunt that one down as well.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Quoted 1 line
Reviewed-by Christian König <[email protected]>Can you apply it to drm-misc?
Sure, but not today. Need to get the kids to bed.
So just pushed to drm-misc-fixes. Do we also need that on amd-staging-drm-next?
Sure.
Alex
Quoted 35 lines
Christian.
Quoted 31 lines
Christian.
Quoted 18 lines
Thanks,
Alex
Quoted 13 lines
Quoted 13 lines
--- drivers/gpu/drm/ttm/ttm_bo_util.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/ttm/ttm_bo_util.c +0
-0@@ -514,6 +514,7 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo, fbo->base.base.resv = &fbo->base.base._resv;Quoted 5 lines
Quoted 5 lines
drivers/gpu/drm/ttm/ttm_bo_util.c static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo, · line 519
Quoted 5 lines
drivers/gpu/drm/ttm/ttm_bo_util.c +1
-0dma_resv_init (&fbo->base.base._resv); + fbo->base.base.dev =NULL ; ret =dma_resv_trylock (&fbo->base.base._resv);WARN_ON (!ret);_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel