public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Antonio Argenziano <antonio.argenziano@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Matthew Auld <matthew.auld@intel.com>
Subject: [igt-dev] [RFC] tests/i915/gem_exec_fence: Pre-fault objects with dependencies
Date: Thu, 14 Mar 2019 16:22:32 -0700	[thread overview]
Message-ID: <20190314232232.18226-1-antonio.argenziano@intel.com> (raw)

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

             reply	other threads:[~2019-03-14 23:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-14 23:22 Antonio Argenziano [this message]
2019-03-14 23:29 ` [igt-dev] [RFC] tests/i915/gem_exec_fence: Pre-fault objects with dependencies 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

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=20190314232232.18226-1-antonio.argenziano@intel.com \
    --to=antonio.argenziano@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=matthew.auld@intel.com \
    /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