<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p><br>
</p>
<div class="moz-cite-prefix">On 9/3/2024 4:48 PM, Andrzej Hajda
wrote:<br>
</div>
<blockquote type="cite" cite="mid:fdf77e79-3ab4-4209-93d0-d084f31cc27e@intel.com">
<br>
<br>
<div class="moz-cite-prefix">On 29.08.2024 20:00, Nirmoy Das
wrote:<br>
</div>
<blockquote type="cite" cite="mid:20240829180051.3286-1-nirmoy.das@intel.com">
<pre class="moz-quote-pre" wrap="">Tests that are causing pagefaults should wait for exec to queue
ban/finish otherwise pending engine resets because of on-going
pagefaults would cause failure in subsequent tests to fail.
Not all execs will generate page faults and in such case reading ban
property is not enough but the signal should either -EIO or 0.
so read that instead.
v2: specify timeout reason and iterate over exec_queues(Andrzej)
v3: increase timeout
v4: check for signal status to be -EIO/0.
Cc: Andrzej Hajda <a class="moz-txt-link-rfc2396E" href="mailto:andrzej.hajda@intel.com" moz-do-not-send="true"><andrzej.hajda@intel.com></a>
Cc: Kamil Konieczny <a class="moz-txt-link-rfc2396E" href="mailto:kamil.konieczny@linux.intel.com" moz-do-not-send="true"><kamil.konieczny@linux.intel.com></a>
Cc: Matthew Brost <a class="moz-txt-link-rfc2396E" href="mailto:matthew.brost@intel.com" moz-do-not-send="true"><matthew.brost@intel.com></a>
Cc: Tejas Upadhyay <a class="moz-txt-link-rfc2396E" href="mailto:tejas.upadhyay@intel.com" moz-do-not-send="true"><tejas.upadhyay@intel.com></a>
Link: <a class="moz-txt-link-freetext" href="https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/1630" moz-do-not-send="true">https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/1630</a>
Signed-off-by: Nirmoy Das <a class="moz-txt-link-rfc2396E" href="mailto:nirmoy.das@intel.com" moz-do-not-send="true"><nirmoy.das@intel.com></a>
---
tests/intel/xe_exec_fault_mode.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/tests/intel/xe_exec_fault_mode.c b/tests/intel/xe_exec_fault_mode.c
index 1f1f1e50b..fa050d0dc 100644
--- a/tests/intel/xe_exec_fault_mode.c
+++ b/tests/intel/xe_exec_fault_mode.c
@@ -329,6 +329,17 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
igt_assert_eq(data[i].data, 0xc0ffee);
}
+ if ((flags & INVALID_FAULT)) {
+ for (i = 0; i < n_execs; i++) {
+ int ret;
+ int64_t timeout = NSEC_PER_SEC;
+
+ ret = __xe_wait_ufence(fd, &data[i].exec_sync, USER_FENCE_VALUE,
+ exec_queues[i % n_exec_queues], &timeout);
+ igt_assert(ret == -EIO || ret ==0);</pre>
</blockquote>
<br>
<pre class="moz-quote-pre" wrap="">"ret ==0" - missing space.</pre>
</blockquote>
<p>I will fix it.</p>
<p><br>
</p>
<blockquote type="cite" cite="mid:fdf77e79-3ab4-4209-93d0-d084f31cc27e@intel.com">
<pre class="moz-quote-pre" wrap="">Btw in theory we have n_execs * 1second (128sec???) total wait time.</pre>
</blockquote>
<p><br>
</p>
<p>We will be trouble if this ever happens for one store instruction
:) I could add a 1sec wait and then run the <br>
</p>
<p>loop but I think that is not needed. <br>
</p>
<blockquote type="cite" cite="mid:fdf77e79-3ab4-4209-93d0-d084f31cc27e@intel.com">
<blockquote type="cite" cite="mid:20240829180051.3286-1-nirmoy.das@intel.com">
<pre class="moz-quote-pre" wrap="">+ }
+ }
+</pre>
</blockquote>
<br>
If I placed change correctly in the code it could be replaced by
chain:<br>
<pre class="moz-quote-pre" wrap="">if ((flags & INVALID_FAULT)) {</pre>
// your change<br>
} else if <span style="background-color:#ffffff;padding:0px 0px 0px 2px;"><span style="color:#000000;background-color:#ffffff;font-family:"Consolas";font-size:10pt;white-space:pre;"><span style="color:#000000;">!(flags & INVALID_VA) {
...
}
</span></span></span></blockquote>
<p><br>
</p>
<p>That fits well, I will do that.<br>
</p>
<blockquote type="cite" cite="mid:fdf77e79-3ab4-4209-93d0-d084f31cc27e@intel.com"><span style="background-color:#ffffff;padding:0px 0px 0px 2px;"><span style="color:#000000;background-color:#ffffff;font-family:"Consolas";font-size:10pt;white-space:pre;"><span style="color:#000000;">
Up to you.
Reviewed-by: Andrzej Hajda <a class="moz-txt-link-rfc2396E" href="mailto:andrzej.hajda@intel.com" moz-do-not-send="true"><andrzej.hajda@intel.com></a></span></span></span></blockquote>
<p><br>
</p>
<p>Thanks,</p>
<p>Nirmoy<br>
</p>
<blockquote type="cite" cite="mid:fdf77e79-3ab4-4209-93d0-d084f31cc27e@intel.com"><span style="background-color:#ffffff;padding:0px 0px 0px 2px;"><span style="color:#000000;background-color:#ffffff;font-family:"Consolas";font-size:10pt;white-space:pre;"><span style="color:#000000;">
Regards
Andrzej
</span></span></span><br>
<blockquote type="cite" cite="mid:20240829180051.3286-1-nirmoy.das@intel.com">
<pre class="moz-quote-pre" wrap=""> for (i = 0; i < n_exec_queues; i++) {
xe_exec_queue_destroy(fd, exec_queues[i]);
if (bind_exec_queues[i])
</pre>
</blockquote>
<br>
</blockquote>
</body>
</html>