aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.14.71/2870-drm-amdkfd-no-process-eviction-is-scheduled-after-pr.patch
blob: 5ff6c73f32f899665f8b6e0f3ff970c236b0d565 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
From 884112efaea7ac06302fe149a17daae8d3a637d5 Mon Sep 17 00:00:00 2001
From: Philip Yang <Philip.Yang@amd.com>
Date: Fri, 24 Nov 2017 15:03:35 -0500
Subject: [PATCH 2870/4131] drm/amdkfd: no process eviction is scheduled after
 process destroy

Firstly ensure eviction schedule will not find process through mm again
by removing process from hash list. Then wait for eviction and restore
work finish, and destroy process

Change-Id: I7de877573b987be39f6cd561d2954e728b1ef452
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_process.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
index 50ff3ef..2e16ee4 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
@@ -464,14 +464,14 @@ static void kfd_process_notifier_release(struct mmu_notifier *mn,
 	if (WARN_ON(p->mm != mm))
 		return;
 
-	cancel_delayed_work_sync(&p->eviction_work.dwork);
-	cancel_delayed_work_sync(&p->restore_work);
-
 	mutex_lock(&kfd_processes_mutex);
 	hash_del_rcu(&p->kfd_processes);
 	mutex_unlock(&kfd_processes_mutex);
 	synchronize_srcu(&kfd_processes_srcu);
 
+	cancel_delayed_work_sync(&p->eviction_work.dwork);
+	cancel_delayed_work_sync(&p->restore_work);
+
 	mutex_lock(&p->mutex);
 
 	/* Iterate over all process device data structures and if the
-- 
2.7.4