intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915: Flush pending GTT writes before unbinding
@ 2017-12-05 11:16 Chris Wilson
  2017-12-05 11:16 ` [PATCH 2/2] drm/i915: Assert GGTT writes were flushed before unbinding a GGTT vma Chris Wilson
  2017-12-05 11:32 ` ✗ Fi.CI.BAT: failure for series starting with [1/2] drm/i915: Flush pending GTT writes before unbinding Patchwork
  0 siblings, 2 replies; 4+ messages in thread
From: Chris Wilson @ 2017-12-05 11:16 UTC (permalink / raw)
  To: intel-gfx; +Cc: Chris Wilson, Joonas Lahtinen, stable

>From the shrinker paths, we want to relinquish the GPU and GGTT access to
the object, releasing the backing storage back to the system for
swapout. As a part of that process we would unpin the pages, marking
them for access by the CPU (for the swapout/swapin). However, if that
process was interrupted after unbind the vma, we missed a flush of the
inflight GGTT writes before we made that GTT space available again for
reuse, with the prospect that we would redirect them to another page.

The bug dates back to the introduction of multiple GGTT vma, but the
code itself dates to commit 02bef8f98d26 ("drm/i915: Unbind closed vma
for i915_gem_object_unbind()").

Fixes: 02bef8f98d26 ("drm/i915: Unbind closed vma for i915_gem_object_unbind()")
Fixes: c5ad54cf7dd8 ("drm/i915: Use partial view in mmap fault handler")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: stable@vger.kernel.org
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index e083f242b8dc..80b78fb5daac 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -330,17 +330,10 @@ int i915_gem_object_unbind(struct drm_i915_gem_object *obj)
 	 * must wait for all rendering to complete to the object (as unbinding
 	 * must anyway), and retire the requests.
 	 */
-	ret = i915_gem_object_wait(obj,
-				   I915_WAIT_INTERRUPTIBLE |
-				   I915_WAIT_LOCKED |
-				   I915_WAIT_ALL,
-				   MAX_SCHEDULE_TIMEOUT,
-				   NULL);
+	ret = i915_gem_object_set_to_cpu_domain(obj, false);
 	if (ret)
 		return ret;
 
-	i915_gem_retire_requests(to_i915(obj->base.dev));
-
 	while ((vma = list_first_entry_or_null(&obj->vma_list,
 					       struct i915_vma,
 					       obj_link))) {
-- 
2.15.1

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

* [PATCH 2/2] drm/i915: Assert GGTT writes were flushed before unbinding a GGTT vma
  2017-12-05 11:16 [PATCH 1/2] drm/i915: Flush pending GTT writes before unbinding Chris Wilson
@ 2017-12-05 11:16 ` Chris Wilson
  2017-12-05 11:32 ` ✗ Fi.CI.BAT: failure for series starting with [1/2] drm/i915: Flush pending GTT writes before unbinding Patchwork
  1 sibling, 0 replies; 4+ messages in thread
From: Chris Wilson @ 2017-12-05 11:16 UTC (permalink / raw)
  To: intel-gfx

As writes through the GTT and GGTT PTE updates do not share the same
path, they are not strictly ordered and so we must explicitly flush the
indirect writes prior to modifying the PTE. However, we track the PTE
using multiple vma, but only a single write_domain on the object, so
before unbinding any GGTT vma we must flush all writes. Provide an
assert that this is so.

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

diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
index bf6d8d1eaabe..846056cd1eb7 100644
--- a/drivers/gpu/drm/i915/i915_vma.c
+++ b/drivers/gpu/drm/i915/i915_vma.c
@@ -790,6 +790,14 @@ int i915_vma_unbind(struct i915_vma *vma)
 	GEM_BUG_ON(!i915_gem_object_has_pinned_pages(obj));
 
 	if (i915_vma_is_map_and_fenceable(vma)) {
+		/*
+		 * Check that we have flushed all writes through the GGTT
+		 * before the unbind. We don't track writes per-vma so assume
+		 * that we have flushed all writes on the object before each
+		 * GGTT vma is unbound.
+		 */
+		GEM_BUG_ON(obj->base.write_domain & I915_GEM_DOMAIN_GTT);
+
 		/* release the fence reg _after_ flushing */
 		ret = i915_vma_put_fence(vma);
 		if (ret)
-- 
2.15.1

_______________________________________________
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

* ✗ Fi.CI.BAT: failure for series starting with [1/2] drm/i915: Flush pending GTT writes before unbinding
  2017-12-05 11:16 [PATCH 1/2] drm/i915: Flush pending GTT writes before unbinding Chris Wilson
  2017-12-05 11:16 ` [PATCH 2/2] drm/i915: Assert GGTT writes were flushed before unbinding a GGTT vma Chris Wilson
@ 2017-12-05 11:32 ` Patchwork
  1 sibling, 0 replies; 4+ messages in thread
From: Patchwork @ 2017-12-05 11:32 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/2] drm/i915: Flush pending GTT writes before unbinding
URL   : https://patchwork.freedesktop.org/series/34899/
State : failure

== Summary ==

Series 34899v1 series starting with [1/2] drm/i915: Flush pending GTT writes before unbinding
https://patchwork.freedesktop.org/api/1.0/series/34899/revisions/1/mbox/

Test core_auth:
        Subgroup basic-auth:
                pass       -> INCOMPLETE (fi-bdw-5557u)
                pass       -> INCOMPLETE (fi-bsw-n3050)
                pass       -> INCOMPLETE (fi-skl-6260u)
                pass       -> INCOMPLETE (fi-skl-6600u)
                pass       -> INCOMPLETE (fi-skl-6700hq)
                pass       -> INCOMPLETE (fi-skl-6700k)
                pass       -> INCOMPLETE (fi-skl-6770hq)
                pass       -> INCOMPLETE (fi-bxt-dsi)
                pass       -> INCOMPLETE (fi-bxt-j4205)
                pass       -> INCOMPLETE (fi-kbl-7500u)
                pass       -> INCOMPLETE (fi-kbl-7560u)
                pass       -> INCOMPLETE (fi-kbl-7567u)
                pass       -> INCOMPLETE (fi-kbl-r)
                pass       -> INCOMPLETE (fi-glk-1)
Test debugfs_test:
        Subgroup read_all_entries:
                pass       -> INCOMPLETE (fi-bwr-2160)
                pass       -> INCOMPLETE (fi-byt-j1900)
                pass       -> INCOMPLETE (fi-byt-n2820)
                pass       -> INCOMPLETE (fi-skl-gvtdvm)
Test gem_exec_basic:
        Subgroup gtt-blt:
                pass       -> INCOMPLETE (fi-snb-2520m)
                pass       -> INCOMPLETE (fi-snb-2600)
                pass       -> INCOMPLETE (fi-ivb-3520m)
                pass       -> INCOMPLETE (fi-ivb-3770)
                pass       -> INCOMPLETE (fi-hsw-4770)
                pass       -> INCOMPLETE (fi-hsw-4770r)
                pass       -> INCOMPLETE (fi-bdw-gvtdvm)
        Subgroup gtt-bsd:
                pass       -> INCOMPLETE (fi-elk-e7500)
                pass       -> INCOMPLETE (fi-ilk-650)
        Subgroup gtt-default:
                pass       -> INCOMPLETE (fi-gdg-551)
                pass       -> INCOMPLETE (fi-blb-e6850)
                pass       -> INCOMPLETE (fi-pnv-d510)

fi-bdw-5557u     total:1    pass:0    dwarn:0   dfail:0   fail:0   skip:0  
fi-bdw-gvtdvm    total:30   pass:29   dwarn:0   dfail:0   fail:0   skip:0  
fi-blb-e6850     total:34   pass:17   dwarn:0   dfail:0   fail:0   skip:16 
fi-bsw-n3050     total:1    pass:0    dwarn:0   dfail:0   fail:0   skip:0  
fi-bwr-2160      total:3    pass:2    dwarn:0   dfail:0   fail:0   skip:0  
fi-bxt-dsi       total:1    pass:0    dwarn:0   dfail:0   fail:0   skip:0  
fi-bxt-j4205     total:1    pass:0    dwarn:0   dfail:0   fail:0   skip:0  
fi-byt-j1900     total:3    pass:2    dwarn:0   dfail:0   fail:0   skip:0  
fi-byt-n2820     total:3    pass:2    dwarn:0   dfail:0   fail:0   skip:0  
fi-elk-e7500     total:31   pass:17   dwarn:1   dfail:0   fail:0   skip:12 
fi-gdg-551       total:34   pass:15   dwarn:0   dfail:0   fail:0   skip:18 
fi-glk-1         total:1    pass:0    dwarn:0   dfail:0   fail:0   skip:0  
fi-hsw-4770      total:30   pass:27   dwarn:0   dfail:0   fail:0   skip:2  
fi-hsw-4770r     total:30   pass:27   dwarn:0   dfail:0   fail:0   skip:2  
fi-ilk-650       total:31   pass:18   dwarn:0   dfail:0   fail:0   skip:12 
fi-ivb-3520m     total:30   pass:26   dwarn:0   dfail:0   fail:0   skip:3  
fi-ivb-3770      total:30   pass:26   dwarn:0   dfail:0   fail:0   skip:3  
fi-kbl-7500u     total:1    pass:0    dwarn:0   dfail:0   fail:0   skip:0  
fi-kbl-7560u     total:1    pass:0    dwarn:0   dfail:0   fail:0   skip:0  
fi-kbl-7567u     total:1    pass:0    dwarn:0   dfail:0   fail:0   skip:0  
fi-kbl-r         total:1    pass:0    dwarn:0   dfail:0   fail:0   skip:0  
fi-pnv-d510      total:34   pass:17   dwarn:0   dfail:0   fail:0   skip:16 
fi-skl-6260u     total:1    pass:0    dwarn:0   dfail:0   fail:0   skip:0  
fi-skl-6600u     total:1    pass:0    dwarn:0   dfail:0   fail:0   skip:0  
fi-skl-6700hq    total:1    pass:0    dwarn:0   dfail:0   fail:0   skip:0  
fi-skl-6700k     total:1    pass:0    dwarn:0   dfail:0   fail:0   skip:0  
fi-skl-6770hq    total:1    pass:0    dwarn:0   dfail:0   fail:0   skip:0  
fi-skl-gvtdvm    total:3    pass:2    dwarn:0   dfail:0   fail:0   skip:0  
fi-snb-2520m     total:30   pass:26   dwarn:0   dfail:0   fail:0   skip:3  
fi-snb-2600      total:30   pass:26   dwarn:0   dfail:0   fail:0   skip:3  
Blacklisted hosts:
fi-cfl-s2        total:1    pass:0    dwarn:0   dfail:0   fail:0   skip:0  
fi-cnl-y         total:1    pass:0    dwarn:0   dfail:0   fail:0   skip:0  
fi-glk-dsi       total:1    pass:0    dwarn:0   dfail:0   fail:0   skip:0  

84cd3d972bdd25fd6f7fe3dc2fe92b0617cde2a5 drm-tip: 2017y-12m-05d-08h-41m-59s UTC integration manifest
88a7c20b7c95 drm/i915: Assert GGTT writes were flushed before unbinding a GGTT vma
9673a7c7ace9 drm/i915: Flush pending GTT writes before unbinding

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7407/
_______________________________________________
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

* ✗ Fi.CI.BAT: failure for series starting with [1/2] drm/i915: Flush pending GTT writes before unbinding
  2017-12-05 12:17 [PATCH 1/2] " Chris Wilson
@ 2017-12-05 12:55 ` Patchwork
  0 siblings, 0 replies; 4+ messages in thread
From: Patchwork @ 2017-12-05 12:55 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/2] drm/i915: Flush pending GTT writes before unbinding
URL   : https://patchwork.freedesktop.org/series/34900/
State : failure

== Summary ==

Series 34900v1 series starting with [1/2] drm/i915: Flush pending GTT writes before unbinding
https://patchwork.freedesktop.org/api/1.0/series/34900/revisions/1/mbox/

Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-b:
                pass       -> INCOMPLETE (fi-snb-2520m) fdo#103713
Test drv_module_reload:
        Subgroup basic-reload:
                pass       -> DMESG-FAIL (fi-ilk-650)
                pass       -> INCOMPLETE (fi-snb-2600)
                pass       -> INCOMPLETE (fi-ivb-3520m)
                pass       -> INCOMPLETE (fi-ivb-3770)
                pass       -> INCOMPLETE (fi-byt-j1900)
                pass       -> INCOMPLETE (fi-byt-n2820)
                pass       -> INCOMPLETE (fi-hsw-4770)
                pass       -> INCOMPLETE (fi-hsw-4770r)
                pass       -> DMESG-FAIL (fi-bdw-5557u)
                pass       -> DMESG-FAIL (fi-bdw-gvtdvm)
                pass       -> DMESG-FAIL (fi-bsw-n3050)
                pass       -> DMESG-FAIL (fi-skl-6260u)
                pass       -> DMESG-FAIL (fi-skl-6600u)
                pass       -> DMESG-FAIL (fi-skl-6700hq)
                pass       -> DMESG-FAIL (fi-skl-6700k)
                pass       -> DMESG-FAIL (fi-skl-6770hq)
                pass       -> DMESG-FAIL (fi-skl-gvtdvm)
                pass       -> DMESG-FAIL (fi-bxt-dsi)
                pass       -> DMESG-FAIL (fi-bxt-j4205)
                pass       -> DMESG-FAIL (fi-kbl-7500u)
                pass       -> DMESG-FAIL (fi-kbl-7560u)
                pass       -> DMESG-FAIL (fi-kbl-7567u)
                pass       -> DMESG-FAIL (fi-kbl-r)
                pass       -> DMESG-FAIL (fi-glk-1)
        Subgroup basic-no-display:
                pass       -> FAIL       (fi-ilk-650)
                pass       -> FAIL       (fi-bdw-5557u)
                pass       -> FAIL       (fi-bdw-gvtdvm)
                pass       -> DMESG-FAIL (fi-bsw-n3050)
                pass       -> FAIL       (fi-skl-6260u)
                pass       -> FAIL       (fi-skl-6600u)
                pass       -> FAIL       (fi-skl-6700hq)
                pass       -> FAIL       (fi-skl-6700k)
                pass       -> FAIL       (fi-skl-6770hq)
                pass       -> FAIL       (fi-skl-gvtdvm)
                pass       -> FAIL       (fi-bxt-dsi)
                pass       -> FAIL       (fi-bxt-j4205)
                pass       -> FAIL       (fi-kbl-7500u)
                pass       -> FAIL       (fi-kbl-7560u)
                pass       -> FAIL       (fi-kbl-7567u)
                pass       -> FAIL       (fi-kbl-r)
                pass       -> FAIL       (fi-glk-1)
        Subgroup basic-reload-inject:
                pass       -> FAIL       (fi-ilk-650)
                pass       -> FAIL       (fi-bdw-5557u)
                pass       -> FAIL       (fi-bdw-gvtdvm)
                pass       -> FAIL       (fi-bsw-n3050) fdo#103706 +9
                pass       -> FAIL       (fi-skl-6260u)
                pass       -> FAIL       (fi-skl-6600u)
                pass       -> FAIL       (fi-skl-6700hq)
                pass       -> FAIL       (fi-skl-6700k)
                pass       -> FAIL       (fi-skl-6770hq)
                pass       -> FAIL       (fi-skl-gvtdvm)
                pass       -> FAIL       (fi-kbl-7500u)
                pass       -> FAIL       (fi-kbl-7567u)
                pass       -> FAIL       (fi-kbl-r)
Test gvt_basic:
        Subgroup invalid-placeholder-test:
                skip       -> INCOMPLETE (fi-ilk-650)
                skip       -> INCOMPLETE (fi-bdw-5557u)
                skip       -> INCOMPLETE (fi-skl-6260u)
                skip       -> INCOMPLETE (fi-skl-6600u)
                skip       -> INCOMPLETE (fi-skl-6700hq)
                skip       -> INCOMPLETE (fi-skl-6700k)
                skip       -> INCOMPLETE (fi-skl-6770hq)
                skip       -> INCOMPLETE (fi-kbl-7500u)
                skip       -> INCOMPLETE (fi-kbl-7567u)
                skip       -> INCOMPLETE (fi-kbl-r)

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

fi-bdw-5557u     total:288  pass:264  dwarn:0   dfail:1   fail:2   skip:20 
fi-bdw-gvtdvm    total:288  pass:261  dwarn:0   dfail:1   fail:2   skip:24  time:439s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:384s
fi-bsw-n3050     total:288  pass:239  dwarn:0   dfail:2   fail:1   skip:45 
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:281s
fi-bxt-dsi       total:288  pass:255  dwarn:0   dfail:1   fail:2   skip:29 
fi-bxt-j4205     total:288  pass:256  dwarn:0   dfail:1   fail:2   skip:28 
fi-byt-j1900     total:285  pass:250  dwarn:0   dfail:0   fail:0   skip:34 
fi-byt-n2820     total:285  pass:246  dwarn:0   dfail:0   fail:0   skip:38 
fi-elk-e7500     total:224  pass:163  dwarn:15  dfail:0   fail:0   skip:45 
fi-gdg-551       total:288  pass:178  dwarn:1   dfail:0   fail:1   skip:108 time:268s
fi-glk-1         total:288  pass:257  dwarn:0   dfail:1   fail:2   skip:27 
fi-hsw-4770      total:285  pass:258  dwarn:0   dfail:0   fail:0   skip:26 
fi-hsw-4770r     total:285  pass:221  dwarn:0   dfail:0   fail:0   skip:63 
fi-ilk-650       total:288  pass:225  dwarn:0   dfail:1   fail:2   skip:59 
fi-ivb-3520m     total:285  pass:256  dwarn:0   dfail:0   fail:0   skip:28 
fi-ivb-3770      total:285  pass:256  dwarn:0   dfail:0   fail:0   skip:28 
fi-kbl-7500u     total:288  pass:260  dwarn:1   dfail:1   fail:2   skip:23 
fi-kbl-7560u     total:288  pass:266  dwarn:0   dfail:1   fail:2   skip:18 
fi-kbl-7567u     total:288  pass:265  dwarn:0   dfail:1   fail:2   skip:19 
WARNING: Long output truncated

e53251a19e664fae2666d1b0fba71772335feb2d drm-tip: 2017y-12m-05d-12h-06m-31s UTC integration manifest
f55f877e41f2 drm/i915: Track GGTT on the vma
11f6a95433b6 drm/i915: Flush pending GTT writes before unbinding

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7408/
_______________________________________________
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:[~2017-12-05 12:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-05 11:16 [PATCH 1/2] drm/i915: Flush pending GTT writes before unbinding Chris Wilson
2017-12-05 11:16 ` [PATCH 2/2] drm/i915: Assert GGTT writes were flushed before unbinding a GGTT vma Chris Wilson
2017-12-05 11:32 ` ✗ Fi.CI.BAT: failure for series starting with [1/2] drm/i915: Flush pending GTT writes before unbinding Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2017-12-05 12:17 [PATCH 1/2] " Chris Wilson
2017-12-05 12:55 ` ✗ Fi.CI.BAT: failure for series starting with [1/2] " Patchwork

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).