* [PATCH] drm/i915: Retire before attempting to evict from the active lists
@ 2016-12-09 13:42 Chris Wilson
2016-12-09 15:05 ` [PATCH v2] " Chris Wilson
0 siblings, 1 reply; 4+ messages in thread
From: Chris Wilson @ 2016-12-09 13:42 UTC (permalink / raw)
To: intel-gfx
Some object retain an extra pin whilst they are active (e.g. contexts).
This excludes them from being considered for eviction unless we idle the
GPU. If before we look at the active list, before we retire we can
hopefully remove a few excess pins and reduce the amount of searching
required..
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/i915_gem_evict.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_gem_evict.c b/drivers/gpu/drm/i915/i915_gem_evict.c
index a3f7f1ca6f21..722b52ff85c1 100644
--- a/drivers/gpu/drm/i915/i915_gem_evict.c
+++ b/drivers/gpu/drm/i915/i915_gem_evict.c
@@ -130,7 +130,14 @@ i915_gem_evict_something(struct i915_address_space *vm,
start, end,
flags & PIN_HIGH ? DRM_MM_INSERT_HIGH : 0);
- if (flags & PIN_NONBLOCK)
+ /* Retire before we search the active list. Although we have
+ * reasonable accuracy in our retirement lists, we may have
+ * a stray pin (preventing eviction) that can only be resolved by
+ * retiring.
+ */
+ if (!(flags & PIN_NONBLOCK))
+ i915_gem_retire_requests(dev_priv);
+ else
phases[1] = NULL;
search_again:
--
2.11.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v2] drm/i915: Retire before attempting to evict from the active lists
2016-12-09 13:42 [PATCH] drm/i915: Retire before attempting to evict from the active lists Chris Wilson
@ 2016-12-09 15:05 ` Chris Wilson
2016-12-12 11:58 ` Tvrtko Ursulin
0 siblings, 1 reply; 4+ messages in thread
From: Chris Wilson @ 2016-12-09 15:05 UTC (permalink / raw)
To: intel-gfx
Some object retain an extra pin whilst they are active (e.g. contexts).
This excludes them from being considered for eviction unless we idle the
GPU. If before we look at the active list, before we retire we can
hopefully remove a few excess pins and reduce the amount of searching
required.
v2: Similar principle applies to evict_for_vma
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/i915_gem_evict.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_gem_evict.c b/drivers/gpu/drm/i915/i915_gem_evict.c
index a3f7f1ca6f21..689338e22ba8 100644
--- a/drivers/gpu/drm/i915/i915_gem_evict.c
+++ b/drivers/gpu/drm/i915/i915_gem_evict.c
@@ -130,7 +130,14 @@ i915_gem_evict_something(struct i915_address_space *vm,
start, end,
flags & PIN_HIGH ? DRM_MM_INSERT_HIGH : 0);
- if (flags & PIN_NONBLOCK)
+ /* Retire before we search the active list. Although we have
+ * reasonable accuracy in our retirement lists, we may have
+ * a stray pin (preventing eviction) that can only be resolved by
+ * retiring.
+ */
+ if (!(flags & PIN_NONBLOCK))
+ i915_gem_retire_requests(dev_priv);
+ else
phases[1] = NULL;
search_again:
@@ -236,6 +243,14 @@ int i915_gem_evict_for_vma(struct i915_vma *target, unsigned int flags)
lockdep_assert_held(&target->vm->i915->drm.struct_mutex);
trace_i915_gem_evict_vma(target, flags);
+ /* Retire before we search the active list. Although we have
+ * reasonable accuracy in our retirement lists, we may have
+ * a stray pin (preventing eviction) that can only be resolved by
+ * retiring.
+ */
+ if (!(flags & PIN_NONBLOCK))
+ i915_gem_retire_requests(target->vm->i915);
+
check_color = target->vm->mm.color_adjust;
if (check_color) {
/* Expand search to cover neighbouring guard pages (or lack!) */
--
2.11.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH v2] drm/i915: Retire before attempting to evict from the active lists
2016-12-09 15:05 ` [PATCH v2] " Chris Wilson
@ 2016-12-12 11:58 ` Tvrtko Ursulin
2016-12-13 11:19 ` Chris Wilson
0 siblings, 1 reply; 4+ messages in thread
From: Tvrtko Ursulin @ 2016-12-12 11:58 UTC (permalink / raw)
To: Chris Wilson, intel-gfx
On 09/12/2016 15:05, Chris Wilson wrote:
> Some object retain an extra pin whilst they are active (e.g. contexts).
> This excludes them from being considered for eviction unless we idle the
> GPU. If before we look at the active list, before we retire we can
> hopefully remove a few excess pins and reduce the amount of searching
> required.
>
> v2: Similar principle applies to evict_for_vma
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
> drivers/gpu/drm/i915/i915_gem_evict.c | 17 ++++++++++++++++-
> 1 file changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_evict.c b/drivers/gpu/drm/i915/i915_gem_evict.c
> index a3f7f1ca6f21..689338e22ba8 100644
> --- a/drivers/gpu/drm/i915/i915_gem_evict.c
> +++ b/drivers/gpu/drm/i915/i915_gem_evict.c
> @@ -130,7 +130,14 @@ i915_gem_evict_something(struct i915_address_space *vm,
> start, end,
> flags & PIN_HIGH ? DRM_MM_INSERT_HIGH : 0);
>
> - if (flags & PIN_NONBLOCK)
> + /* Retire before we search the active list. Although we have
> + * reasonable accuracy in our retirement lists, we may have
> + * a stray pin (preventing eviction) that can only be resolved by
> + * retiring.
> + */
> + if (!(flags & PIN_NONBLOCK))
> + i915_gem_retire_requests(dev_priv);
> + else
> phases[1] = NULL;
>
> search_again:
> @@ -236,6 +243,14 @@ int i915_gem_evict_for_vma(struct i915_vma *target, unsigned int flags)
> lockdep_assert_held(&target->vm->i915->drm.struct_mutex);
> trace_i915_gem_evict_vma(target, flags);
>
> + /* Retire before we search the active list. Although we have
> + * reasonable accuracy in our retirement lists, we may have
> + * a stray pin (preventing eviction) that can only be resolved by
> + * retiring.
> + */
> + if (!(flags & PIN_NONBLOCK))
> + i915_gem_retire_requests(target->vm->i915);
> +
> check_color = target->vm->mm.color_adjust;
> if (check_color) {
> /* Expand search to cover neighbouring guard pages (or lack!) */
>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH v2] drm/i915: Retire before attempting to evict from the active lists
2016-12-12 11:58 ` Tvrtko Ursulin
@ 2016-12-13 11:19 ` Chris Wilson
0 siblings, 0 replies; 4+ messages in thread
From: Chris Wilson @ 2016-12-13 11:19 UTC (permalink / raw)
To: Tvrtko Ursulin; +Cc: intel-gfx
On Mon, Dec 12, 2016 at 11:58:24AM +0000, Tvrtko Ursulin wrote:
>
> On 09/12/2016 15:05, Chris Wilson wrote:
> >Some object retain an extra pin whilst they are active (e.g. contexts).
> >This excludes them from being considered for eviction unless we idle the
> >GPU. If before we look at the active list, before we retire we can
> >hopefully remove a few excess pins and reduce the amount of searching
> >required.
> >
> >v2: Similar principle applies to evict_for_vma
> >
> >Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> >---
> > drivers/gpu/drm/i915/i915_gem_evict.c | 17 ++++++++++++++++-
> > 1 file changed, 16 insertions(+), 1 deletion(-)
> >
> >diff --git a/drivers/gpu/drm/i915/i915_gem_evict.c b/drivers/gpu/drm/i915/i915_gem_evict.c
> >index a3f7f1ca6f21..689338e22ba8 100644
> >--- a/drivers/gpu/drm/i915/i915_gem_evict.c
> >+++ b/drivers/gpu/drm/i915/i915_gem_evict.c
> >@@ -130,7 +130,14 @@ i915_gem_evict_something(struct i915_address_space *vm,
> > start, end,
> > flags & PIN_HIGH ? DRM_MM_INSERT_HIGH : 0);
> >
> >- if (flags & PIN_NONBLOCK)
> >+ /* Retire before we search the active list. Although we have
> >+ * reasonable accuracy in our retirement lists, we may have
> >+ * a stray pin (preventing eviction) that can only be resolved by
> >+ * retiring.
> >+ */
> >+ if (!(flags & PIN_NONBLOCK))
> >+ i915_gem_retire_requests(dev_priv);
> >+ else
> > phases[1] = NULL;
> >
> > search_again:
> >@@ -236,6 +243,14 @@ int i915_gem_evict_for_vma(struct i915_vma *target, unsigned int flags)
> > lockdep_assert_held(&target->vm->i915->drm.struct_mutex);
> > trace_i915_gem_evict_vma(target, flags);
> >
> >+ /* Retire before we search the active list. Although we have
> >+ * reasonable accuracy in our retirement lists, we may have
> >+ * a stray pin (preventing eviction) that can only be resolved by
> >+ * retiring.
> >+ */
> >+ if (!(flags & PIN_NONBLOCK))
> >+ i915_gem_retire_requests(target->vm->i915);
> >+
> > check_color = target->vm->mm.color_adjust;
> > if (check_color) {
> > /* Expand search to cover neighbouring guard pages (or lack!) */
> >
>
> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Ta, pushed a while back.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-12-13 11:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-09 13:42 [PATCH] drm/i915: Retire before attempting to evict from the active lists Chris Wilson
2016-12-09 15:05 ` [PATCH v2] " Chris Wilson
2016-12-12 11:58 ` Tvrtko Ursulin
2016-12-13 11:19 ` Chris Wilson
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).