All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/amdkfd: Fix GWS queue count
@ 2022-04-13 15:51 David Yat Sin
  2022-04-13 15:51 ` [PATCH 2/2] drm/amdkfd: CRIU add support for GWS queues David Yat Sin
  2022-04-14 14:52 ` [PATCH 1/2] drm/amdkfd: Fix GWS queue count Felix Kuehling
  0 siblings, 2 replies; 7+ messages in thread
From: David Yat Sin @ 2022-04-13 15:51 UTC (permalink / raw)
  To: amd-gfx; +Cc: Felix.Kuehling

Queue can be inactive during process termination. This would cause
dqm->gws_queue_count to not be decremented. There can only be 1 GWS
queue per device process so moving the logic out of loop.

Signed-off-by: David Yat Sin <david.yatsin@amd.com>
---
 .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c    | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
index acf4f7975850..7c107b88d944 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
@@ -1945,17 +1945,17 @@ static int process_termination_cpsch(struct device_queue_manager *dqm,
 		else if (q->properties.type == KFD_QUEUE_TYPE_SDMA_XGMI)
 			deallocate_sdma_queue(dqm, q);
 
-		if (q->properties.is_active) {
+		if (q->properties.is_active)
 			decrement_queue_count(dqm, q->properties.type);
-			if (q->properties.is_gws) {
-				dqm->gws_queue_count--;
-				qpd->mapped_gws_queue = false;
-			}
-		}
 
 		dqm->total_queue_count--;
 	}
 
+	if (qpd->mapped_gws_queue) {
+		dqm->gws_queue_count--;
+		qpd->mapped_gws_queue = false;
+	}
+
 	/* Unregister process */
 	list_for_each_entry_safe(cur, next_dpn, &dqm->queues, list) {
 		if (qpd == cur->qpd) {
-- 
2.30.2


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

end of thread, other threads:[~2022-04-14 18:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-13 15:51 [PATCH 1/2] drm/amdkfd: Fix GWS queue count David Yat Sin
2022-04-13 15:51 ` [PATCH 2/2] drm/amdkfd: CRIU add support for GWS queues David Yat Sin
2022-04-14 14:52 ` [PATCH 1/2] drm/amdkfd: Fix GWS queue count Felix Kuehling
2022-04-14 15:08   ` Yat Sin, David
2022-04-14 15:42     ` Felix Kuehling
2022-04-14 17:56       ` Yat Sin, David
2022-04-14 18:04         ` Felix Kuehling

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.