Skip to contentSkip to conversation

drm/amdkfd: Remove GWS from process during uninit

PATCH In review Greathouse, Joseph 3 participants 3 messages Jul 17, 2019 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdkfd: Remove GWS from process during uninit

If we shut down a process without having destroyed its GWS-using queues, it is possible that GWS BO will still be in the process BO list during the gpuvm destruction. This list should be empty at that time, so we should remove the GWS allocation at the process uninit point if it is still around.

Change-Id I098e7b315070dd5b0165bb7905aef643450f27f2
---
 drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c +3 -0
index da0958625861..7e6c3ee82f5b 100644
@@ -150,6 +150,9 @@ void pqm_uninit(struct process_queue_manager *pqm)
 	struct process_queue_node *pqn, *next;
 
 	list_for_each_entry_safe(pqn, next, &pqm->queues, process_queue_list) {
+		if (pqn->q && pqn->q->gws)
+			amdgpu_amdkfd_remove_gws_from_process(pqm->process->kgd_process_info,
+				pqn->q->gws);
 		uninit_queue(pqn->q);
 		list_del(&pqn->process_queue_list);
 		kfree(pqn);
Signature · 6 lines
2.19.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20190717145830.9004-1-Joseph.Greathouse-5C7GfCeVMHo@public.gmane.org

#2 lore raw

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Greathouse, Joseph <[email protected]>
Sent: Wednesday, July 17, 2019 10:58 AM
To: [email protected]
Cc: Greathouse, Joseph
Subject: [PATCH] drm/amdkfd: Remove GWS from process during uninit

If we shut down a process without having destroyed its GWS-using queues, it is possible that GWS BO will still be in the process BO list during the gpuvm destruction. This list should be empty at that time, so we should remove the GWS allocation at the process uninit point if it is still around.

Change-Id I098e7b315070dd5b0165bb7905aef643450f27f2
---
 drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c +3 -0
index da0958625861..7e6c3ee82f5b 100644
@@ -150,6 +150,9 @@ void pqm_uninit(struct process_queue_manager *pqm)
         struct process_queue_node *pqn, *next;
 
         list_for_each_entry_safe(pqn, next, &pqm->queues, process_queue_list) {
+               if (pqn->q && pqn->q->gws)
+                       amdgpu_amdkfd_remove_gws_from_process(pqm->process->kgd_process_info,
+                               pqn->q->gws);
                 uninit_queue(pqn->q);
                 list_del(&pqn->process_queue_list);
                 kfree(pqn);

--
2.19.1

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reviewed-by Felix Kuehling
#3 lore raw
In reply to a message not in the archive
Quoted 8 lines · Joseph

If we shut down a process without having destroyed its GWS-using queues, it is possible that GWS BO will still be in the process BO list during the gpuvm destruction. This list should be empty at that time, so we should remove the GWS allocation at the process uninit point if it is still around.

Change-Id I098e7b315070dd5b0165bb7905aef643450f27f2
Quoted 9 lines
---
  drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c +0 -0
index da0958625861..7e6c3ee82f5b 100644

drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c void pqm_uninit(struct process_queue_manager *pqm) · line 158

Quoted 9 lines
drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c +3 -0
@@ -150,6 +150,9 @@ void pqm_uninit(struct process_queue_manager *pqm)
  	struct process_queue_node *pqn, *next;
 
  	list_for_each_entry_safe(pqn, next, &pqm->queues, process_queue_list) {
+		if (pqn->q && pqn->q->gws)
+			amdgpu_amdkfd_remove_gws_from_process(pqm->process->kgd_process_info,
+				pqn->q->gws);
  		uninit_queue(pqn->q);
  		list_del(&pqn->process_queue_list);
  		kfree(pqn);

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx