<!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 3/20/2024 5:52 PM, Mukul Joshi
      wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:20240320225248.754671-1-mukul.joshi@amd.com">
      <pre class="moz-quote-pre" wrap="">Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.


Destroy the high priority workqueue that handles interrupts
during KFD node cleanup.

Signed-off-by: Mukul Joshi <a class="moz-txt-link-rfc2396E" href="mailto:mukul.joshi@amd.com"><mukul.joshi@amd.com></a>
---
 drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c b/drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c
index dd3c43c1ad70..9b6b6e882593 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c
@@ -104,6 +104,8 @@ void kfd_interrupt_exit(struct kfd_node *node)
         */
        flush_workqueue(node->ih_wq);

+       destroy_workqueue(node->ih_wq);
+</pre>
    </blockquote>
    <p>Here I think we should cancel work items that are still in the
      work queue, not flush workqueue node->ih_wq. In this case the
      kfd functions have been terminated, there is no way to handle the
      left work items. That would make work queue flush never finish. I
      think it is the reason there are orphan kernel tasks.</p>
    <p>After cancel left work items we can call <span style="white-space: pre-wrap">destroy_workqueue.</span></p>
    <p>Regards</p>
    <p>Xiaogang</p>
    <blockquote type="cite" cite="mid:20240320225248.754671-1-mukul.joshi@amd.com">
      <pre class="moz-quote-pre" wrap="">
        kfifo_free(&node->ih_fifo);
 }

--
2.35.1

</pre>
    </blockquote>
  </body>
</html>