drm/amdkfd: Signal eviction fence on process destruction (v2)
authorFelix Kuehling <Felix.Kuehling@amd.com>
Wed, 4 Mar 2020 20:57:23 +0000 (15:57 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 6 Mar 2020 19:40:30 +0000 (14:40 -0500)
Otherwise BOs may wait for the fence indefinitely and never be destroyed.

v2: Signal the fence right after destroying queues to avoid unnecessary
    delaye-delete in kfd_process_wq_release

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: xinhui pan <xinhui.pan@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_process.c

index 22abdbc..c92285f 100644 (file)
@@ -641,6 +641,11 @@ static void kfd_process_notifier_release(struct mmu_notifier *mn,
 
        /* Indicate to other users that MM is no longer valid */
        p->mm = NULL;
+       /* Signal the eviction fence after user mode queues are
+        * destroyed. This allows any BOs to be freed without
+        * triggering pointless evictions or waiting for fences.
+        */
+       dma_fence_signal(p->ef);
 
        mutex_unlock(&p->mutex);