public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH 1/3] drm/i915: Assert we do not try to expand VMA for hugepage inside GGTT
@ 2017-10-08 13:43 Chris Wilson
  2017-10-08 13:43 ` [PATCH 2/3] drm/i915: Retire after wait-for-idle on evict Chris Wilson
                   ` (7 more replies)
  0 siblings, 8 replies; 13+ messages in thread
From: Chris Wilson @ 2017-10-08 13:43 UTC (permalink / raw)
  To: intel-gfx

We only apply the hugepage PD redirection inside the ppGTT, so during
i915_vma_insert() we want to exclude the GGTT from the additional
alignment constraints (thereby avoiding the extra GTT pressure from
fragmentation). Add an assert to document that intention alongside the
comment.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.william.auld@gmail.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_vma.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
index 72e86b32ab41..2d27027eaf85 100644
--- a/drivers/gpu/drm/i915/i915_vma.c
+++ b/drivers/gpu/drm/i915/i915_vma.c
@@ -513,6 +513,8 @@ i915_vma_insert(struct i915_vma *vma, u64 size, u64 alignment, u64 flags)
 				rounddown_pow_of_two(vma->page_sizes.sg |
 						     I915_GTT_PAGE_SIZE_2M);
 
+			GEM_BUG_ON((flags & PIN_USER) == 0); /* No GGTT! */
+
 			alignment = max(alignment, page_alignment);
 
 			if (vma->page_sizes.sg & I915_GTT_PAGE_SIZE_64K)
-- 
2.14.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 2/3] drm/i915: Retire after wait-for-idle on evict
  2017-10-08 13:43 [PATCH 1/3] drm/i915: Assert we do not try to expand VMA for hugepage inside GGTT Chris Wilson
@ 2017-10-08 13:43 ` Chris Wilson
  2017-10-08 13:56   ` Chris Wilson
  2017-10-08 13:43 ` [PATCH 3/3] drm/i915: Replace manual checking for idleness with active_requests counter Chris Wilson
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 13+ messages in thread
From: Chris Wilson @ 2017-10-08 13:43 UTC (permalink / raw)
  To: intel-gfx

We have to manually retire the requests in order to unpin the contexts,
and thereby make their space available in the GGTT. So call retire after
we idle the GPU to account for the lazy pinning.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gem_evict.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_evict.c b/drivers/gpu/drm/i915/i915_gem_evict.c
index 4df039ef2ce3..fc7e476448e3 100644
--- a/drivers/gpu/drm/i915/i915_gem_evict.c
+++ b/drivers/gpu/drm/i915/i915_gem_evict.c
@@ -157,17 +157,18 @@ i915_gem_evict_something(struct i915_address_space *vm,
 				    min_size, alignment, cache_level,
 				    start, end, mode);
 
-	/* Retire before we search the active list. Although we have
+	/*
+	 * 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.
 	 */
+search_again:
 	if (!(flags & PIN_NONBLOCK))
 		i915_gem_retire_requests(dev_priv);
 	else
 		phases[1] = NULL;
 
-search_again:
 	INIT_LIST_HEAD(&eviction_list);
 	phase = phases;
 	do {
@@ -380,6 +381,8 @@ int i915_gem_evict_vm(struct i915_address_space *vm)
 		ret = ggtt_flush(vm->i915);
 		if (ret)
 			return ret;
+
+		i915_gem_retire_requests(vm->i915);
 	}
 
 	INIT_LIST_HEAD(&eviction_list);
-- 
2.14.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 3/3] drm/i915: Replace manual checking for idleness with active_requests counter
  2017-10-08 13:43 [PATCH 1/3] drm/i915: Assert we do not try to expand VMA for hugepage inside GGTT Chris Wilson
  2017-10-08 13:43 ` [PATCH 2/3] drm/i915: Retire after wait-for-idle on evict Chris Wilson
@ 2017-10-08 13:43 ` Chris Wilson
  2017-10-09  8:37   ` Chris Wilson
  2017-10-08 14:06 ` ✓ Fi.CI.BAT: success for series starting with [1/3] drm/i915: Assert we do not try to expand VMA for hugepage inside GGTT Patchwork
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 13+ messages in thread
From: Chris Wilson @ 2017-10-08 13:43 UTC (permalink / raw)
  To: intel-gfx

As we emit and retire requests, we track how many are still in flight.
As we have this knowledge, we can make use of that inside
i915_gem_evict_something() as a better test to see if the device is
idle.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gem_evict.c | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_evict.c b/drivers/gpu/drm/i915/i915_gem_evict.c
index fc7e476448e3..00b8ca15784c 100644
--- a/drivers/gpu/drm/i915/i915_gem_evict.c
+++ b/drivers/gpu/drm/i915/i915_gem_evict.c
@@ -33,23 +33,6 @@
 #include "intel_drv.h"
 #include "i915_trace.h"
 
-static bool ggtt_is_idle(struct drm_i915_private *dev_priv)
-{
-	struct i915_ggtt *ggtt = &dev_priv->ggtt;
-	struct intel_engine_cs *engine;
-	enum intel_engine_id id;
-
-	for_each_engine(engine, dev_priv, id) {
-		struct intel_timeline *tl;
-
-		tl = &ggtt->base.timeline.engine[engine->id];
-		if (i915_gem_active_isset(&tl->last_request))
-			return false;
-	}
-
-	return true;
-}
-
 static int ggtt_flush(struct drm_i915_private *i915)
 {
 	int err;
@@ -191,7 +174,7 @@ i915_gem_evict_something(struct i915_address_space *vm,
 	if (!i915_is_ggtt(vm) || flags & PIN_NONBLOCK)
 		return -ENOSPC;
 
-	if (ggtt_is_idle(dev_priv)) {
+	if (!dev_priv->gt.active_requests) {
 		/* If we still have pending pageflip completions, drop
 		 * back to userspace to give our workqueues time to
 		 * acquire our locks and unpin the old scanouts.
-- 
2.14.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/3] drm/i915: Retire after wait-for-idle on evict
  2017-10-08 13:43 ` [PATCH 2/3] drm/i915: Retire after wait-for-idle on evict Chris Wilson
@ 2017-10-08 13:56   ` Chris Wilson
  0 siblings, 0 replies; 13+ messages in thread
From: Chris Wilson @ 2017-10-08 13:56 UTC (permalink / raw)
  To: intel-gfx

Quoting Chris Wilson (2017-10-08 14:43:21)
> We have to manually retire the requests in order to unpin the contexts,
> and thereby make their space available in the GGTT. So call retire after
> we idle the GPU to account for the lazy pinning.

Bah, no we moved the retire to i915_gem_wait_for_idle.

commit 72022a705e1da854653e56b67bef57b72f1392eb
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Mar 30 15:50:38 2017 +0100

    drm/i915: Move retire-requests into i915_gem_wait_for_idle()
    
    As we now distinguish everywhere that can call
    i915_gem_retire_requests() following a successful wait_for_idle, we can
    remove the duplication by moving that call into i915_gem_wait_for_idle()
    itself.

Back to the drawing board why we weren't apparently able to clear the
pinned contexts from the GGTT.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

* ✓ Fi.CI.BAT: success for series starting with [1/3] drm/i915: Assert we do not try to expand VMA for hugepage inside GGTT
  2017-10-08 13:43 [PATCH 1/3] drm/i915: Assert we do not try to expand VMA for hugepage inside GGTT Chris Wilson
  2017-10-08 13:43 ` [PATCH 2/3] drm/i915: Retire after wait-for-idle on evict Chris Wilson
  2017-10-08 13:43 ` [PATCH 3/3] drm/i915: Replace manual checking for idleness with active_requests counter Chris Wilson
@ 2017-10-08 14:06 ` Patchwork
  2017-10-08 15:01 ` [PATCH 1/3] " Matthew Auld
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Patchwork @ 2017-10-08 14:06 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/3] drm/i915: Assert we do not try to expand VMA for hugepage inside GGTT
URL   : https://patchwork.freedesktop.org/series/31549/
State : success

== Summary ==

Series 31549v1 series starting with [1/3] drm/i915: Assert we do not try to expand VMA for hugepage inside GGTT
https://patchwork.freedesktop.org/api/1.0/series/31549/revisions/1/mbox/

Test gem_ringfill:
        Subgroup basic-default:
                skip       -> PASS       (fi-bsw-n3050)
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-b:
                dmesg-warn -> PASS       (fi-skl-6700k) fdo#100367 +1
Test drv_module_reload:
        Subgroup basic-no-display:
                dmesg-warn -> PASS       (fi-cfl-s) fdo#103022

fdo#100367 https://bugs.freedesktop.org/show_bug.cgi?id=100367
fdo#103022 https://bugs.freedesktop.org/show_bug.cgi?id=103022

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:449s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:465s
fi-blb-e6850     total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:390s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:575s
fi-bwr-2160      total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 time:284s
fi-bxt-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:524s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:521s
fi-byt-j1900     total:289  pass:253  dwarn:1   dfail:0   fail:0   skip:35  time:538s
fi-byt-n2820     total:289  pass:249  dwarn:1   dfail:0   fail:0   skip:39  time:517s
fi-cfl-s         total:289  pass:256  dwarn:1   dfail:0   fail:0   skip:32  time:562s
fi-cnl-y         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:614s
fi-elk-e7500     total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:431s
fi-glk-1         total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:596s
fi-hsw-4770      total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:439s
fi-hsw-4770r     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:417s
fi-ivb-3520m     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:508s
fi-ivb-3770      total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:471s
fi-kbl-7500u     total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  time:498s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:581s
fi-kbl-7567u     total:289  pass:265  dwarn:4   dfail:0   fail:0   skip:20  time:488s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:596s
fi-pnv-d510      total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  time:656s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:470s
fi-skl-6700hq    total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:656s
fi-skl-6700k     total:289  pass:264  dwarn:0   dfail:0   fail:1   skip:24  time:515s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:511s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:470s
fi-snb-2520m     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:576s
fi-snb-2600      total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  time:426s

36006288fba389b08bbfb73a89da8eced404dfed drm-tip: 2017y-10m-07d-09h-13m-34s UTC integration manifest
be87680d54c7 drm/i915: Replace manual checking for idleness with active_requests counter
51d9130d2ff8 drm/i915: Retire after wait-for-idle on evict
ed803116c2aa drm/i915: Assert we do not try to expand VMA for hugepage inside GGTT

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5941/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/3] drm/i915: Assert we do not try to expand VMA for hugepage inside GGTT
  2017-10-08 13:43 [PATCH 1/3] drm/i915: Assert we do not try to expand VMA for hugepage inside GGTT Chris Wilson
                   ` (2 preceding siblings ...)
  2017-10-08 14:06 ` ✓ Fi.CI.BAT: success for series starting with [1/3] drm/i915: Assert we do not try to expand VMA for hugepage inside GGTT Patchwork
@ 2017-10-08 15:01 ` Matthew Auld
  2017-10-09  8:17   ` Chris Wilson
  2017-10-08 15:07 ` ✓ Fi.CI.IGT: success for series starting with [1/3] " Patchwork
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 13+ messages in thread
From: Matthew Auld @ 2017-10-08 15:01 UTC (permalink / raw)
  To: Chris Wilson; +Cc: Intel Graphics Development

On 8 October 2017 at 14:43, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> We only apply the hugepage PD redirection inside the ppGTT, so during
> i915_vma_insert() we want to exclude the GGTT from the additional
> alignment constraints (thereby avoiding the extra GTT pressure from
> fragmentation). Add an assert to document that intention alongside the
> comment.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Matthew Auld <matthew.william.auld@gmail.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_vma.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
> index 72e86b32ab41..2d27027eaf85 100644
> --- a/drivers/gpu/drm/i915/i915_vma.c
> +++ b/drivers/gpu/drm/i915/i915_vma.c
> @@ -513,6 +513,8 @@ i915_vma_insert(struct i915_vma *vma, u64 size, u64 alignment, u64 flags)
>                                 rounddown_pow_of_two(vma->page_sizes.sg |
>                                                      I915_GTT_PAGE_SIZE_2M);
>
> +                       GEM_BUG_ON((flags & PIN_USER) == 0); /* No GGTT! */
> +
Maybe GEM_BUG_ON(i915_is_ggtt(vm)); should also catch misuse with the appgtt?

Either way:
Reviewed-by: Matthew Auld <matthew.william.auld@gmail.com>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

* ✓ Fi.CI.IGT: success for series starting with [1/3] drm/i915: Assert we do not try to expand VMA for hugepage inside GGTT
  2017-10-08 13:43 [PATCH 1/3] drm/i915: Assert we do not try to expand VMA for hugepage inside GGTT Chris Wilson
                   ` (3 preceding siblings ...)
  2017-10-08 15:01 ` [PATCH 1/3] " Matthew Auld
@ 2017-10-08 15:07 ` Patchwork
  2017-10-09  9:20 ` [PATCH v2] " Chris Wilson
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Patchwork @ 2017-10-08 15:07 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/3] drm/i915: Assert we do not try to expand VMA for hugepage inside GGTT
URL   : https://patchwork.freedesktop.org/series/31549/
State : success

== Summary ==

Test kms_cursor_legacy:
        Subgroup cursorA-vs-flipA-varying-size:
                skip       -> PASS       (shard-hsw)
Test kms_setmode:
        Subgroup basic:
                pass       -> FAIL       (shard-hsw) fdo#99912

fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912

shard-hsw        total:2446 pass:1328 dwarn:6   dfail:0   fail:9   skip:1103 time:10088s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5941/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/3] drm/i915: Assert we do not try to expand VMA for hugepage inside GGTT
  2017-10-08 15:01 ` [PATCH 1/3] " Matthew Auld
@ 2017-10-09  8:17   ` Chris Wilson
  0 siblings, 0 replies; 13+ messages in thread
From: Chris Wilson @ 2017-10-09  8:17 UTC (permalink / raw)
  To: Matthew Auld; +Cc: Intel Graphics Development

Quoting Matthew Auld (2017-10-08 16:01:00)
> On 8 October 2017 at 14:43, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > We only apply the hugepage PD redirection inside the ppGTT, so during
> > i915_vma_insert() we want to exclude the GGTT from the additional
> > alignment constraints (thereby avoiding the extra GTT pressure from
> > fragmentation). Add an assert to document that intention alongside the
> > comment.
> >
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Matthew Auld <matthew.william.auld@gmail.com>
> > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_vma.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
> > index 72e86b32ab41..2d27027eaf85 100644
> > --- a/drivers/gpu/drm/i915/i915_vma.c
> > +++ b/drivers/gpu/drm/i915/i915_vma.c
> > @@ -513,6 +513,8 @@ i915_vma_insert(struct i915_vma *vma, u64 size, u64 alignment, u64 flags)
> >                                 rounddown_pow_of_two(vma->page_sizes.sg |
> >                                                      I915_GTT_PAGE_SIZE_2M);
> >
> > +                       GEM_BUG_ON((flags & PIN_USER) == 0); /* No GGTT! */
> > +
> Maybe GEM_BUG_ON(i915_is_ggtt(vm)); should also catch misuse with the appgtt?

It is not categorically misuse with appgtt, I thought we could support
large pages there (even if we don't atm)? Hence why I was hesitant at
ruling it out completely.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 3/3] drm/i915: Replace manual checking for idleness with active_requests counter
  2017-10-08 13:43 ` [PATCH 3/3] drm/i915: Replace manual checking for idleness with active_requests counter Chris Wilson
@ 2017-10-09  8:37   ` Chris Wilson
  0 siblings, 0 replies; 13+ messages in thread
From: Chris Wilson @ 2017-10-09  8:37 UTC (permalink / raw)
  To: intel-gfx

Quoting Chris Wilson (2017-10-08 14:43:22)
> As we emit and retire requests, we track how many are still in flight.
> As we have this knowledge, we can make use of that inside
> i915_gem_evict_something() as a better test to see if the device is
> idle.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

I've just confirmed this was the bug that triggered ENOSPC with
(failure to do) context eviction.

With this fixed, the test times out (because we are now forced to wait
for the fence to be signaled) and so preemption/scheduling is fubar.
I guess we just pencil that in as yet-another-pi-bug.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH v2] drm/i915: Assert we do not try to expand VMA for hugepage inside GGTT
  2017-10-08 13:43 [PATCH 1/3] drm/i915: Assert we do not try to expand VMA for hugepage inside GGTT Chris Wilson
                   ` (4 preceding siblings ...)
  2017-10-08 15:07 ` ✓ Fi.CI.IGT: success for series starting with [1/3] " Patchwork
@ 2017-10-09  9:20 ` Chris Wilson
  2017-10-09 13:03   ` Joonas Lahtinen
  2017-10-09  9:44 ` ✓ Fi.CI.BAT: success for series starting with [v2] drm/i915: Assert we do not try to expand VMA for hugepage inside GGTT (rev2) Patchwork
  2017-10-09 11:05 ` ✓ Fi.CI.IGT: " Patchwork
  7 siblings, 1 reply; 13+ messages in thread
From: Chris Wilson @ 2017-10-09  9:20 UTC (permalink / raw)
  To: intel-gfx

We only apply the hugepage PD redirection inside the ppGTT, so during
i915_vma_insert() we want to exclude the GGTT from the additional
alignment constraints (thereby avoiding the extra GTT pressure from
fragmentation). Add an assert to document that intention alongside the
comment.

v2: After discussion with Matthew, make it a blanket GGTT ban
(previously we allowed the expansion for appgtt, and so indirectly
ggtt). There are issues we need to fix before allowing the current
appgtt to be used with hugepages, and if we do, we probably want more
care over when to expand/align, as the mappable aperture inside the ggtt
is precious.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.william.auld@gmail.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Matthew Auld <matthew.william.auld@gmail.com>
---
 drivers/gpu/drm/i915/i915_vma.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
index df6b63a4dfe6..d006a35cde3b 100644
--- a/drivers/gpu/drm/i915/i915_vma.c
+++ b/drivers/gpu/drm/i915/i915_vma.c
@@ -538,6 +538,13 @@ i915_vma_insert(struct i915_vma *vma, u64 size, u64 alignment, u64 flags)
 				rounddown_pow_of_two(vma->page_sizes.sg |
 						     I915_GTT_PAGE_SIZE_2M);
 
+			/*
+			 * Check we don't expand for the limited Global GTT
+			 * (mappable aperture is even more precious!). This
+			 * also checks that we exclude the aliasing-ppgtt.
+			 */
+			GEM_BUG_ON(i915_vma_is_ggtt(vma));
+
 			alignment = max(alignment, page_alignment);
 
 			if (vma->page_sizes.sg & I915_GTT_PAGE_SIZE_64K)
-- 
2.14.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* ✓ Fi.CI.BAT: success for series starting with [v2] drm/i915: Assert we do not try to expand VMA for hugepage inside GGTT (rev2)
  2017-10-08 13:43 [PATCH 1/3] drm/i915: Assert we do not try to expand VMA for hugepage inside GGTT Chris Wilson
                   ` (5 preceding siblings ...)
  2017-10-09  9:20 ` [PATCH v2] " Chris Wilson
@ 2017-10-09  9:44 ` Patchwork
  2017-10-09 11:05 ` ✓ Fi.CI.IGT: " Patchwork
  7 siblings, 0 replies; 13+ messages in thread
From: Patchwork @ 2017-10-09  9:44 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [v2] drm/i915: Assert we do not try to expand VMA for hugepage inside GGTT (rev2)
URL   : https://patchwork.freedesktop.org/series/31549/
State : success

== Summary ==

Series 31549v2 series starting with [v2] drm/i915: Assert we do not try to expand VMA for hugepage inside GGTT
https://patchwork.freedesktop.org/api/1.0/series/31549/revisions/2/mbox/

Test kms_frontbuffer_tracking:
        Subgroup basic:
                dmesg-warn -> PASS       (fi-bdw-5557u) fdo#102473

fdo#102473 https://bugs.freedesktop.org/show_bug.cgi?id=102473

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:450s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:473s
fi-blb-e6850     total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:404s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:562s
fi-bwr-2160      total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 time:284s
fi-bxt-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:519s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:519s
fi-byt-j1900     total:289  pass:253  dwarn:1   dfail:0   fail:0   skip:35  time:536s
fi-byt-n2820     total:289  pass:249  dwarn:1   dfail:0   fail:0   skip:39  time:515s
fi-cfl-s         total:289  pass:256  dwarn:1   dfail:0   fail:0   skip:32  time:567s
fi-cnl-y         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:616s
fi-elk-e7500     total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:433s
fi-glk-1         total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:599s
fi-hsw-4770      total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:436s
fi-hsw-4770r     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:414s
fi-ivb-3520m     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:493s
fi-ivb-3770      total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:474s
fi-kbl-7500u     total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  time:496s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:583s
fi-kbl-7567u     total:289  pass:265  dwarn:4   dfail:0   fail:0   skip:20  time:490s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:592s
fi-pnv-d510      total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  time:652s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:469s
fi-skl-6700hq    total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:658s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:531s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:511s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:473s
fi-snb-2520m     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:576s
fi-snb-2600      total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  time:430s

1d09197a9f9140f4795ed109018602c9e807d957 drm-tip: 2017y-10m-09d-07h-50m-48s UTC integration manifest
4a074ae56364 drm/i915: Replace manual checking for idleness with active_requests counter
949dd72bff52 drm/i915: Retire after wait-for-idle on evict
5a2f032744c6 drm/i915: Assert we do not try to expand VMA for hugepage inside GGTT

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5944/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

* ✓ Fi.CI.IGT: success for series starting with [v2] drm/i915: Assert we do not try to expand VMA for hugepage inside GGTT (rev2)
  2017-10-08 13:43 [PATCH 1/3] drm/i915: Assert we do not try to expand VMA for hugepage inside GGTT Chris Wilson
                   ` (6 preceding siblings ...)
  2017-10-09  9:44 ` ✓ Fi.CI.BAT: success for series starting with [v2] drm/i915: Assert we do not try to expand VMA for hugepage inside GGTT (rev2) Patchwork
@ 2017-10-09 11:05 ` Patchwork
  7 siblings, 0 replies; 13+ messages in thread
From: Patchwork @ 2017-10-09 11:05 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [v2] drm/i915: Assert we do not try to expand VMA for hugepage inside GGTT (rev2)
URL   : https://patchwork.freedesktop.org/series/31549/
State : success

== Summary ==

Test kms_flip:
        Subgroup flip-vs-absolute-wf_vblank-interruptible:
                fail       -> PASS       (shard-hsw) fdo#100368
Test kms_setmode:
        Subgroup basic:
                fail       -> PASS       (shard-hsw) fdo#99912

fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912

shard-hsw        total:2446 pass:1329 dwarn:6   dfail:0   fail:8   skip:1103 time:10030s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5944/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2] drm/i915: Assert we do not try to expand VMA for hugepage inside GGTT
  2017-10-09  9:20 ` [PATCH v2] " Chris Wilson
@ 2017-10-09 13:03   ` Joonas Lahtinen
  0 siblings, 0 replies; 13+ messages in thread
From: Joonas Lahtinen @ 2017-10-09 13:03 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx

On Mon, 2017-10-09 at 10:20 +0100, Chris Wilson wrote:
> We only apply the hugepage PD redirection inside the ppGTT, so during
> i915_vma_insert() we want to exclude the GGTT from the additional
> alignment constraints (thereby avoiding the extra GTT pressure from
> fragmentation). Add an assert to document that intention alongside the
> comment.
> 
> v2: After discussion with Matthew, make it a blanket GGTT ban
> (previously we allowed the expansion for appgtt, and so indirectly
> ggtt). There are issues we need to fix before allowing the current
> appgtt to be used with hugepages, and if we do, we probably want more
> care over when to expand/align, as the mappable aperture inside the ggtt
> is precious.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Matthew Auld <matthew.william.auld@gmail.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Reviewed-by: Matthew Auld <matthew.william.auld@gmail.com>

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-10-09 13:03 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-08 13:43 [PATCH 1/3] drm/i915: Assert we do not try to expand VMA for hugepage inside GGTT Chris Wilson
2017-10-08 13:43 ` [PATCH 2/3] drm/i915: Retire after wait-for-idle on evict Chris Wilson
2017-10-08 13:56   ` Chris Wilson
2017-10-08 13:43 ` [PATCH 3/3] drm/i915: Replace manual checking for idleness with active_requests counter Chris Wilson
2017-10-09  8:37   ` Chris Wilson
2017-10-08 14:06 ` ✓ Fi.CI.BAT: success for series starting with [1/3] drm/i915: Assert we do not try to expand VMA for hugepage inside GGTT Patchwork
2017-10-08 15:01 ` [PATCH 1/3] " Matthew Auld
2017-10-09  8:17   ` Chris Wilson
2017-10-08 15:07 ` ✓ Fi.CI.IGT: success for series starting with [1/3] " Patchwork
2017-10-09  9:20 ` [PATCH v2] " Chris Wilson
2017-10-09 13:03   ` Joonas Lahtinen
2017-10-09  9:44 ` ✓ Fi.CI.BAT: success for series starting with [v2] drm/i915: Assert we do not try to expand VMA for hugepage inside GGTT (rev2) Patchwork
2017-10-09 11:05 ` ✓ Fi.CI.IGT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox