Re: [PATCH] drm/syncobj: Don't leak fences when WAIT_FOR_SUBMIT is set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Jason Ekstrand (2018-09-26 08:17:03)
> We attempt to get fences earlier in the hopes that everything will
> already have fences and no callbacks will be needed.  If we do succeed
> in getting a fence, getting one a second time will result in a duplicate
> ref with no unref.  This is causing memory leaks in Vulkan applications
> that create a lot of fences; playing for a few hours can, apparently,
> bring down the system.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107899
> Signed-off-by: Jason Ekstrand <jason@xxxxxxxxxxxxxx>
> Cc: stable@xxxxxxxxxxxxxxx
> ---
>  drivers/gpu/drm/drm_syncobj.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c
> index adb3cb27d31e..759278fef35a 100644
> --- a/drivers/gpu/drm/drm_syncobj.c
> +++ b/drivers/gpu/drm/drm_syncobj.c
> @@ -97,6 +97,8 @@ static int drm_syncobj_fence_get_or_add_callback(struct drm_syncobj *syncobj,
>  {
>         int ret;
>  
> +       WARN_ON(*fence);

I would have just put if (*fence) return; since the function is tied to
the array_wait implementation.

Reviewed-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
-Chris
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux