AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] drm/amdkfd: Fix false positive queue buffer free warning
@ 2025-10-15 20:11 Philip Yang
  2025-10-15 20:11 ` [PATCH v2 2/2] drm/amdkfd: Stop user queues when process mm released Philip Yang
  2025-10-15 21:01 ` [PATCH v2 1/2] drm/amdkfd: Fix false positive queue buffer free warning Chen, Xiaogang
  0 siblings, 2 replies; 13+ messages in thread
From: Philip Yang @ 2025-10-15 20:11 UTC (permalink / raw)
  To: amd-gfx; +Cc: Felix.Kuehling, Philip Yang

Only show warning message if process mm is still alive when queue
buffer is freed to evcit the queues.

If kfd_lookup_process_by_mm return NULL, means the process is already
exited and mm is gone, it is fine to free queue buffer.

Fixes: b049504e211e ("drm/amdkfd: Validate user queue svm memory residency")
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
index 4d4a47313f5b..d1b2f8525f80 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
@@ -2487,7 +2487,9 @@ svm_range_unmap_from_cpu(struct mm_struct *mm, struct svm_range *prange,
 	bool unmap_parent;
 	uint32_t i;
 
-	if (atomic_read(&prange->queue_refcount)) {
+	p = kfd_lookup_process_by_mm(mm);
+
+	if (p && atomic_read(&prange->queue_refcount)) {
 		int r;
 
 		pr_warn("Freeing queue vital buffer 0x%lx, queue evicted\n",
@@ -2497,7 +2499,6 @@ svm_range_unmap_from_cpu(struct mm_struct *mm, struct svm_range *prange,
 			pr_debug("failed %d to quiesce KFD queues\n", r);
 	}
 
-	p = kfd_lookup_process_by_mm(mm);
 	if (!p)
 		return;
 	svms = &p->svms;
-- 
2.49.0


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

end of thread, other threads:[~2025-10-20 14:26 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-15 20:11 [PATCH v2 1/2] drm/amdkfd: Fix false positive queue buffer free warning Philip Yang
2025-10-15 20:11 ` [PATCH v2 2/2] drm/amdkfd: Stop user queues when process mm released Philip Yang
2025-10-15 20:40   ` Chen, Xiaogang
2025-10-15 21:33     ` Philip Yang
2025-10-16 14:46       ` Chen, Xiaogang
2025-10-17 22:34         ` Felix Kuehling
2025-10-17 22:43   ` Felix Kuehling
2025-10-20 14:26     ` Philip Yang
2025-10-15 21:01 ` [PATCH v2 1/2] drm/amdkfd: Fix false positive queue buffer free warning Chen, Xiaogang
2025-10-15 21:45   ` Philip Yang
2025-10-15 22:46     ` Chen, Xiaogang
2025-10-16 18:01       ` Philip Yang
2025-10-17 22:39       ` Felix Kuehling

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox