<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Acked-by: Alex Deucher <alexander.deucher@amd.com><br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Greathouse, Joseph <Joseph.Greathouse@amd.com><br>
<b>Sent:</b> Wednesday, July 17, 2019 10:58 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Greathouse, Joseph<br>
<b>Subject:</b> [PATCH] drm/amdkfd: Remove GWS from process during uninit</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">If we shut down a process without having destroyed its GWS-using<br>
queues, it is possible that GWS BO will still be in the process<br>
BO list during the gpuvm destruction. This list should be empty<br>
at that time, so we should remove the GWS allocation at the<br>
process uninit point if it is still around.<br>
<br>
Change-Id: I098e7b315070dd5b0165bb7905aef643450f27f2<br>
Signed-off-by: Joseph Greathouse <Joseph.Greathouse@amd.com><br>
---<br>
 drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 3 +++<br>
 1 file changed, 3 insertions(+)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c<br>
index da0958625861..7e6c3ee82f5b 100644<br>
--- a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c<br>
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c<br>
@@ -150,6 +150,9 @@ void pqm_uninit(struct process_queue_manager *pqm)<br>
         struct process_queue_node *pqn, *next;<br>
 <br>
         list_for_each_entry_safe(pqn, next, &pqm->queues, process_queue_list) {<br>
+               if (pqn->q && pqn->q->gws)<br>
+                       amdgpu_amdkfd_remove_gws_from_process(pqm->process->kgd_process_info,<br>
+                               pqn->q->gws);<br>
                 uninit_queue(pqn->q);<br>
                 list_del(&pqn->process_queue_list);<br>
                 kfree(pqn);<br>
-- <br>
2.19.1<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a></div>
</span></font></div>
</body>
</html>