From b6e6e4afb66ffdb81bd83516794755c39c0587f9 Mon Sep 17 00:00:00 2001 From: Felix Kuehling Date: Wed, 4 Mar 2020 15:57:23 -0500 Subject: [PATCH] drm/amdkfd: Signal eviction fence on process destruction (v2) 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 Reviewed-by: xinhui pan --- drivers/gpu/drm/amd/amdkfd/kfd_process.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c index 08960008d8c8e..6b32149a5a744 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c @@ -715,6 +715,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);