All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdkfd: Cleanup workqueue during module unload
@ 2024-03-20 22:52 Mukul Joshi
  2024-03-21 17:01 ` Felix Kuehling
  2024-03-26 19:06 ` Chen, Xiaogang
  0 siblings, 2 replies; 3+ messages in thread
From: Mukul Joshi @ 2024-03-20 22:52 UTC (permalink / raw
  To: amd-gfx; +Cc: Felix.Kuehling, Mukul Joshi

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

Signed-off-by: Mukul Joshi <mukul.joshi@amd.com>
---
 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);
+
 	kfifo_free(&node->ih_fifo);
 }
 
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/amdkfd: Cleanup workqueue during module unload
  2024-03-20 22:52 [PATCH] drm/amdkfd: Cleanup workqueue during module unload Mukul Joshi
@ 2024-03-21 17:01 ` Felix Kuehling
  2024-03-26 19:06 ` Chen, Xiaogang
  1 sibling, 0 replies; 3+ messages in thread
From: Felix Kuehling @ 2024-03-21 17:01 UTC (permalink / raw
  To: Mukul Joshi, amd-gfx


On 2024-03-20 18:52, Mukul Joshi wrote:
> Destroy the high priority workqueue that handles interrupts
> during KFD node cleanup.
>
> Signed-off-by: Mukul Joshi <mukul.joshi@amd.com>

Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>


> ---
>   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);
> +
>   	kfifo_free(&node->ih_fifo);
>   }
>   

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/amdkfd: Cleanup workqueue during module unload
  2024-03-20 22:52 [PATCH] drm/amdkfd: Cleanup workqueue during module unload Mukul Joshi
  2024-03-21 17:01 ` Felix Kuehling
@ 2024-03-26 19:06 ` Chen, Xiaogang
  1 sibling, 0 replies; 3+ messages in thread
From: Chen, Xiaogang @ 2024-03-26 19:06 UTC (permalink / raw
  To: Mukul Joshi, amd-gfx; +Cc: Felix.Kuehling

[-- Attachment #1: Type: text/plain, Size: 1300 bytes --]


On 3/20/2024 5:52 PM, Mukul Joshi wrote:
> 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<mukul.joshi@amd.com>
> ---
>   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);
> +

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.

After cancel left work items we can call destroy_workqueue.

Regards

Xiaogang

>          kfifo_free(&node->ih_fifo);
>   }
>
> --
> 2.35.1
>

[-- Attachment #2: Type: text/html, Size: 1951 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-03-26 19:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-20 22:52 [PATCH] drm/amdkfd: Cleanup workqueue during module unload Mukul Joshi
2024-03-21 17:01 ` Felix Kuehling
2024-03-26 19:06 ` Chen, Xiaogang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.