public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [RFC] tests/i915/gem_exec_fence: Pre-fault objects with dependencies
@ 2019-03-14 23:22 Antonio Argenziano
  2019-03-14 23:29 ` Chris Wilson
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Antonio Argenziano @ 2019-03-14 23:22 UTC (permalink / raw)
  To: igt-dev; +Cc: Matthew Auld

In the fault manager code we wait on an active object to complete before
servicing the fault. This meant that the object 'out' used in the test
could not be read until it became inactive which could not happen since
it is kept busy from the store queued behind the spinner (at least). The
bug became evident only after using the mmap_offset patches since we
were not faulting before.

We haven't looked at all the tests yet so the issue might be present in
other tests as well. The solution proposed here is a pre-fault as soon
as the object is mapped. There is a question of does the kernel need to
allow for reads of a busy object or do we have a better way of fixing
this in IGT.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Daniele Spurio Ceraolo <daniele.ceraolospurio@intel.com>
Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com>
---
 tests/i915/gem_exec_fence.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/i915/gem_exec_fence.c b/tests/i915/gem_exec_fence.c
index ba46595d..2fe083fc 100644
--- a/tests/i915/gem_exec_fence.c
+++ b/tests/i915/gem_exec_fence.c
@@ -344,6 +344,8 @@ static void test_fence_await(int fd, unsigned ring, unsigned flags)
 	gem_set_domain(fd, obj.handle,
 			I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
 
+	*out = 0; /* Need to pre-fault this object otherwise, when reading it later on fault handler will block waiting on spinner therefore failing the test  */
+
 	batch = gem_mmap__wc(fd, obj.handle, 0, 4096, PROT_WRITE);
 	gem_set_domain(fd, obj.handle,
 			I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
@@ -400,7 +402,7 @@ static void test_fence_await(int fd, unsigned ring, unsigned flags)
 
 	/* Check for invalidly completing the task early */
 	for (int n = 0; n < i; n++)
-		igt_assert_eq_u32(out[n], 0);
+		igt_assert_eq_u32(out[n], 0); /* Requires out to be pre-faulted at this point or it will never get to unlocking the spinner  */
 
 	if ((flags & HANG) == 0) {
 		*batch = MI_BATCH_BUFFER_END;
-- 
2.20.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

end of thread, other threads:[~2019-03-15 12:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-14 23:22 [igt-dev] [RFC] tests/i915/gem_exec_fence: Pre-fault objects with dependencies Antonio Argenziano
2019-03-14 23:29 ` Chris Wilson
2019-03-14 23:56   ` Daniele Ceraolo Spurio
2019-03-15  0:07     ` Chris Wilson
2019-03-14 23:54 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-03-15 12:11 ` [igt-dev] ✓ 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