<!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 10/22/2024 1:02 AM, Matthew Brost
wrote:<br>
</div>
<blockquote type="cite" cite="mid:Zxbdm8wpXQ8Iu477@DUT025-TGLU.fm.intel.com">
<pre wrap="" class="moz-quote-pre">On Mon, Oct 21, 2024 at 11:11:46PM +0200, Nirmoy Das wrote:
</pre>
<blockquote type="cite">
<pre wrap="" class="moz-quote-pre">In case of parallel submissions multiple GuC id will point to the
same exec queue and on GT reset such exec queues will get restarted
multiple times which is not desirable.
Link: <a class="moz-txt-link-freetext" href="https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/2295">https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/2295</a>
Cc: Himal Prasad Ghimiray <a class="moz-txt-link-rfc2396E" href="mailto:himal.prasad.ghimiray@intel.com"><himal.prasad.ghimiray@intel.com></a>
Cc: Matthew Auld <a class="moz-txt-link-rfc2396E" href="mailto:matthew.auld@intel.com"><matthew.auld@intel.com></a>
Cc: Matthew Brost <a class="moz-txt-link-rfc2396E" href="mailto:matthew.brost@intel.com"><matthew.brost@intel.com></a>
Cc: Tejas Upadhyay <a class="moz-txt-link-rfc2396E" href="mailto:tejas.upadhyay@intel.com"><tejas.upadhyay@intel.com></a>
Signed-off-by: Nirmoy Das <a class="moz-txt-link-rfc2396E" href="mailto:nirmoy.das@intel.com"><nirmoy.das@intel.com></a>
---
drivers/gpu/drm/xe/xe_guc_submit.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
index 0b81972ff651..6aeb007eaf06 100644
--- a/drivers/gpu/drm/xe/xe_guc_submit.c
+++ b/drivers/gpu/drm/xe/xe_guc_submit.c
@@ -1784,8 +1784,13 @@ int xe_guc_submit_start(struct xe_guc *guc)
mutex_lock(&guc->submission_state.lock);
atomic_dec(&guc->submission_state.stopped);
- xa_for_each(&guc->submission_state.exec_queue_lookup, index, q)
+ xa_for_each(&guc->submission_state.exec_queue_lookup, index, q) {
+ /* Skip restarting parallel queues */
+ if (exec_queue_enabled(q) && xe_exec_queue_is_parallel(q))
+ continue;
</pre>
</blockquote>
<pre wrap="" class="moz-quote-pre">
This doesn't look right as exec_queue_enabled can race here...</pre>
</blockquote>
<p>Ah right, just realized this happens async with the run_job</p>
<p><br>
</p>
<blockquote type="cite" cite="mid:Zxbdm8wpXQ8Iu477@DUT025-TGLU.fm.intel.com">
<pre wrap="" class="moz-quote-pre">
I think this should be...
if (q->guc->id != index)
continue;</pre>
</blockquote>
<p><br>
</p>
<p>This looks much better. I will try it out and resend.<br>
</p>
<p><br>
</p>
<blockquote type="cite" cite="mid:Zxbdm8wpXQ8Iu477@DUT025-TGLU.fm.intel.com">
<pre wrap="" class="moz-quote-pre">
This way we only call guc_exec_queue_start once per queue parallel exec
queue. Also I think we need to add the same check to xe_guc_submit_stop.
</pre>
</blockquote>
<p><br>
</p>
<p>I will resend with updated <span style="white-space: pre-wrap">xe_guc_submit_stop()</span></p>
<p><span style="white-space: pre-wrap">
</span></p>
<p><span style="white-space: pre-wrap">thanks,</span></p>
<p><span style="white-space: pre-wrap">Nirmoy
</span></p>
<blockquote type="cite" cite="mid:Zxbdm8wpXQ8Iu477@DUT025-TGLU.fm.intel.com">
<pre wrap="" class="moz-quote-pre">
Matt
</pre>
<blockquote type="cite">
<pre wrap="" class="moz-quote-pre">+
guc_exec_queue_start(q);
+ }
mutex_unlock(&guc->submission_state.lock);
wake_up_all(&guc->ct.wq);
--
2.46.0
</pre>
</blockquote>
</blockquote>
</body>
</html>