aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1225-drm-amdkfd-Abandon-master-VM-usage.patch
blob: a3553719aac1e1bd98d72cf83d10fd7977003751 (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
From 70fb3fc19decc4bd125e1164ab5799c4af1e7415 Mon Sep 17 00:00:00 2001
From: Yong Zhao <yong.zhao@amd.com>
Date: Fri, 16 Dec 2016 19:00:09 -0500
Subject: [PATCH 1225/4131] drm/amdkfd: Abandon master VM usage

The master VM design is prone to bugs, and sometimes misleading. A kfd
process memory eviction structure amdkfd_eviction_info is used for
the new design.

Change-Id: If194af56203fe18b06d0c9c0273384454c5a1c36
Signed-off-by: Yong Zhao <yong.zhao@amd.com>

 Conflicts:
	drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
	drivers/gpu/drm/amd/amdkfd/kfd_device.c
---
 drivers/gpu/drm/amd/amdkfd/kfd_device.c  | 4 +++-
 drivers/gpu/drm/amd/amdkfd/kfd_priv.h    | 3 ++-
 drivers/gpu/drm/amd/amdkfd/kfd_process.c | 4 +---
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
index 4ed7420..46a722f 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
@@ -817,7 +817,9 @@ void kfd_restore_bo_worker(struct work_struct *work)
 			       struct kfd_process_device,
 			       per_device_list);
 
-	ret = pdd->dev->kfd2kgd->restore_process_bos(p->master_vm);
+	pr_info("Started restoring process of pasid %d\n", p->pasid);
+
+	ret = pdd->dev->kfd2kgd->restore_process_bos(p->process_info);
 	if (ret) {
 		kfd_schedule_restore_bos_and_queues(p);
 		return;
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
index a9e5618..dcb939e 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
@@ -709,7 +709,8 @@ struct kfd_process {
 
 	struct rb_root bo_interval_tree;
 
-	void *master_vm;
+	/* Information used for memory eviction */
+	void *process_info;
 
 	/* Work items for evicting and restoring BOs */
 	struct kfd_eviction_work eviction_work;
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
index 1aa7ee3..5e80a44 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
@@ -630,14 +630,12 @@ struct kfd_process_device *kfd_create_process_device_data(struct kfd_dev *dev,
 
 		/* Create the GPUVM context for this specific device */
 		if (dev->kfd2kgd->create_process_vm(dev->kgd, &pdd->vm,
-						    p->master_vm)) {
+						&p->process_info)) {
 			pr_err("Failed to create process VM object\n");
 			list_del(&pdd->per_device_list);
 			kfree(pdd);
 			pdd = NULL;
 		}
-		if (p->master_vm == NULL)
-			p->master_vm = pdd->vm;
 	}
 
 	return pdd;
-- 
2.7.4