public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Paul <sean@poorly.run>
To: Jason Ekstrand <jason@jlekstrand.net>
Cc: dri-devel@lists.freedesktop.org,
	Jason Ekstrand <jason.ekstrand@intel.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH] drm/syncobj: Don't leak fences when WAIT_FOR_SUBMIT is set
Date: Wed, 26 Sep 2018 10:55:11 -0400	[thread overview]
Message-ID: <20180926145511.GS72545@art_vandelay> (raw)
In-Reply-To: <20180926071703.15257-1-jason.ekstrand@intel.com>

On Wed, Sep 26, 2018 at 02:17:03AM -0500, Jason Ekstrand wrote:
> 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@jlekstrand.net>

Pushed to drm-misc-fixes, thanks!

Sean

> Cc: stable@vger.kernel.org
> ---
>  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);
> +
>  	*fence = drm_syncobj_fence_get(syncobj);
>  	if (*fence)
>  		return 1;
> @@ -743,6 +745,9 @@ static signed long drm_syncobj_array_wait_timeout(struct drm_syncobj **syncobjs,
>  
>  	if (flags & DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT) {
>  		for (i = 0; i < count; ++i) {
> +			if (entries[i].fence)
> +				continue;
> +
>  			drm_syncobj_fence_get_or_add_callback(syncobjs[i],
>  							      &entries[i].fence,
>  							      &entries[i].syncobj_cb,
> -- 
> 2.17.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Sean Paul, Software Engineer, Google / Chromium OS

      parent reply	other threads:[~2018-09-26 21:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-26  7:17 [PATCH] drm/syncobj: Don't leak fences when WAIT_FOR_SUBMIT is set Jason Ekstrand
2018-09-26  8:18 ` Chris Wilson
     [not found]   ` <CAOFGe94mPcR_TsV7A1io0BRg+rGcheNXnAzO=vFDyX6VcuXiOA@mail.gmail.com>
2018-09-26  9:50     ` Chris Wilson
2018-09-26 14:55 ` Sean Paul [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180926145511.GS72545@art_vandelay \
    --to=sean@poorly.run \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jason.ekstrand@intel.com \
    --cc=jason@jlekstrand.net \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox