From: fei.yang@intel.com
To: igt-dev@lists.freedesktop.org
Cc: Fei Yang <fei.yang@intel.com>
Subject: [i-g-t 1/1] tests/intel/xe_exec_threads: wait for all submissions to complete
Date: Fri, 25 Oct 2024 12:55:27 -0700 [thread overview]
Message-ID: <20241025195527.1451640-2-fei.yang@intel.com> (raw)
In-Reply-To: <20241025195527.1451640-1-fei.yang@intel.com>
From: Fei Yang <fei.yang@intel.com>
In test_compute_mode, there is an one second sleep waiting for all
the submissions to complete, but that is not reliable especially
on pre-si platforms where the GPU could be a lot slower. Instead we
should wait for the ufence to make sure the GPU is inactive before
unbinding the BO.
Signed-off-by: Fei Yang <fei.yang@intel.com>
---
tests/intel/xe_exec_threads.c | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/tests/intel/xe_exec_threads.c b/tests/intel/xe_exec_threads.c
index 413d6626b..a857a73fa 100644
--- a/tests/intel/xe_exec_threads.c
+++ b/tests/intel/xe_exec_threads.c
@@ -404,16 +404,26 @@ test_compute_mode(int fd, uint32_t vm, uint64_t addr, uint64_t userptr,
}
}
- j = flags & INVALIDATE ?
- (flags & RACE ? n_execs / 2 + 1 : n_execs - 1) : 0;
+ j = 0; /* wait for all submissions to complete */
+ if (flags & INVALIDATE)
+ /*
+ * For !RACE cases xe_wait_ufence has been called in above for-loop
+ * except the last batch of submissions (0x20 submissions in a batch).
+ * For RACE cases we will need to wait for all the submissions to
+ * complete here.
+ */
+ j = (flags & RACE) ? 0 : (n_execs - 0x1f);
+ else if (flags & REBIND)
+ /*
+ * For REBIND cases xe_wait_ufence has been called in above for-loop
+ * except the last batch of submissions (0x20 submissions in a batch).
+ */
+ j = n_execs - 0x1f;
+
for (i = j; i < n_execs; i++)
xe_wait_ufence(fd, &data[i].exec_sync, USER_FENCE_VALUE,
exec_queues[i % n_exec_queues], fence_timeout);
- /* Wait for all execs to complete */
- if (flags & INVALIDATE)
- sleep(1);
-
sync[0].addr = to_user_pointer(&data[0].vm_sync);
xe_vm_unbind_async(fd, vm, 0, 0, addr, bo_size, sync, 1);
xe_wait_ufence(fd, &data[0].vm_sync, USER_FENCE_VALUE, 0, fence_timeout);
--
2.25.1
next prev parent reply other threads:[~2024-10-25 19:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-25 19:55 [i-g-t 0/1] xe_exec_threads: wait for all submissions to complete fei.yang
2024-10-25 19:55 ` fei.yang [this message]
2024-10-25 22:33 ` ✗ Fi.CI.BAT: failure for " Patchwork
2024-10-25 22:49 ` ✗ CI.xeBAT: " Patchwork
2024-10-27 13:54 ` ✗ CI.xeFULL: " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2024-10-26 1:01 [i-g-t 0/1] " fei.yang
2024-10-26 1:01 ` [i-g-t 1/1] tests/intel/xe_exec_threads: " fei.yang
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=20241025195527.1451640-2-fei.yang@intel.com \
--to=fei.yang@intel.com \
--cc=igt-dev@lists.freedesktop.org \
/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