From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Prune the reservation shared fence array
Date: Wed, 08 Nov 2017 17:09:47 +0200 [thread overview]
Message-ID: <1510153787.4626.29.camel@linux.intel.com> (raw)
In-Reply-To: <20171107220656.5020-1-chris@chris-wilson.co.uk>
On Tue, 2017-11-07 at 22:06 +0000, Chris Wilson wrote:
> The shared fence array is not autopruning and may continue to grow as an
> object is shared between new timelines. Take the opportunity when we
> think the object is idle (we have to confirm that any external fence is
> also signaled) to decouple all the fences.
>
> We apply a similar trick after waiting on an object, see commit
> e54ca9774777 ("drm/i915: Remove completed fences after a wait")
>
> v2: No longer need to handle the batch pool as a special case.
> v3: Need to trylock from within i915_vma_retire as this may be called
> form the shrinker - and we may later try to allocate underneath the
> reservation lock, so a deadlock is possible.
>
> References: https://bugs.freedesktop.org/show_bug.cgi?id=102936
> Fixes: d07f0e59b2c7 ("drm/i915: Move GEM activity tracking into a common struct reservation_object")
> Fixes: 80b204bce8f2 ("drm/i915: Enable multiple timelines")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
<SNIP>
> +++ b/drivers/gpu/drm/i915/i915_vma.c
> @@ -54,6 +54,13 @@ i915_vma_retire(struct i915_gem_active *active,
> if (--obj->active_count)
> return;
>
> + /* Prune the shared fence arrays iff completely idle (inc. external) */
> + if (reservation_object_trylock(obj->resv)) {
> + if (reservation_object_test_signaled_rcu(obj->resv, true))
> + reservation_object_add_excl_fence(obj->resv, NULL);
> + reservation_object_unlock(obj->resv);
> + }
Feels bit like this could also be a feature of reservation objects.
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Regards, Joonas
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-11-08 15:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-07 22:06 [PATCH] drm/i915: Prune the reservation shared fence array Chris Wilson
2017-11-08 10:06 ` ✗ Fi.CI.BAT: failure for drm/i915: Prune the reservation shared fence array (rev3) Patchwork
2017-11-08 15:09 ` Joonas Lahtinen [this message]
2017-11-08 15:51 ` [PATCH] drm/i915: Prune the reservation shared fence array Chris Wilson
-- strict thread matches above, loose matches on Subject: below --
2016-11-14 8:53 Chris Wilson
2016-11-15 14:38 ` Joonas Lahtinen
2016-11-15 15:26 ` Chris Wilson
2016-11-15 15:33 ` Chris Wilson
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=1510153787.4626.29.camel@linux.intel.com \
--to=joonas.lahtinen@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.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;
as well as URLs for NNTP newsgroup(s).