aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.14.71/1236-drm-amdkfd-Print-rate-limited-messages-for-all-evict.patch
blob: f8c27466bd7ff2a7aabe3c78fdf91bf452da39ce (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
From c3b6167ab9d36b52fb56e02fe767229e8f6c4546 Mon Sep 17 00:00:00 2001
From: Felix Kuehling <Felix.Kuehling@amd.com>
Date: Tue, 28 Feb 2017 15:19:53 -0500
Subject: [PATCH 1236/4131] drm/amdkfd: Print rate-limited messages for all
 evictions

This can probably be replaced with traces later on. For now this should
help us track down unexpected evictions and give user mode teams an
indication when frequent evictions are responsible for performance
problems.

Change-Id: Ia594c9a4c8ebe095b69a853ce5550ffb03fa6b02
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
index bb7fdc3..fe99477 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
@@ -517,6 +517,7 @@ int process_evict_queues(struct device_queue_manager *dqm,
 {
 	struct queue *q, *next;
 	struct mqd_manager *mqd;
+	struct kfd_process_device *pdd;
 	int retval = 0;
 
 	BUG_ON(!dqm || !qpd);
@@ -526,6 +527,11 @@ int process_evict_queues(struct device_queue_manager *dqm,
 		mutex_unlock(&dqm->lock);
 		return 0;
 	}
+
+	pdd = qpd_to_pdd(qpd);
+	pr_info_ratelimited("Evicting PASID %u queues\n",
+			    pdd->process->pasid);
+
 	/* unactivate all active queues on the qpd */
 	list_for_each_entry_safe(q, next, &qpd->queues_list, list) {
 		mqd = dqm->ops.get_mqd_manager(dqm,
@@ -579,6 +585,9 @@ int process_restore_queues(struct device_queue_manager *dqm,
 		goto out_unlock;
 	}
 
+	pr_info_ratelimited("Restoring PASID %u queues\n",
+			    pdd->process->pasid);
+
 	/* Update PD Base in QPD */
 	qpd->page_table_base = pd_base;
 	pr_debug("Updated PD address to 0x%08x in %s\n", pd_base, __func__);
-- 
2.7.4