summaryrefslogtreecommitdiff
path: root/mali_pixel
diff options
context:
space:
mode:
authorJack Diver <diverj@google.com>2023-08-09 09:29:04 +0000
committerJack Diver <diverj@google.com>2023-08-22 09:52:21 +0000
commit82e138310f702a6990caf382573c24bad49e9b54 (patch)
tree0e82891c918e7261a80a7890d31a7023d4aedcc2 /mali_pixel
parent82d34e97fc1f1e425ee5447e5c33e2febebef6ce (diff)
downloadgpu-82e138310f702a6990caf382573c24bad49e9b54.tar.gz
mali_pixel: Disable mgm debugfs by default
Implicit SLC caching results in a high volume of PTE updates. Tracking the number of updates shows up when profiling. Disable these nodes and the associated tracking by default. Bug: 294167925 Test: gfxbench sweep, genshin (cherry picked from https://partner-android-review.googlesource.com/q/commit:82d0547845919e91b27196dccc0202fe7e7e40de) Merged-In: I551b8f58f633ba6cfb74b0651bbbe30a6909eeb2 Change-Id: I551b8f58f633ba6cfb74b0651bbbe30a6909eeb2 Signed-off-by: Jack Diver <diverj@google.com>
Diffstat (limited to 'mali_pixel')
-rw-r--r--mali_pixel/Kconfig7
-rw-r--r--mali_pixel/memory_group_manager.c22
2 files changed, 22 insertions, 7 deletions
diff --git a/mali_pixel/Kconfig b/mali_pixel/Kconfig
index 60ec64f..10ab093 100644
--- a/mali_pixel/Kconfig
+++ b/mali_pixel/Kconfig
@@ -25,6 +25,13 @@ config MALI_MEMORY_GROUP_MANAGER
for allocation and release of pages for memory pools managed by Mali GPU
device drivers.
+config MALI_MEMORY_GROUP_MANAGER_DEBUG_FS
+ depends on MALI_MEMORY_GROUP_MANAGER && DEBUG_FS
+ bool "Enable Mali memory group manager debugfs nodes"
+ default n
+ help
+ Enables support for memory group manager debugfs nodes
+
config MALI_PRIORITY_CONTROL_MANAGER
tristate "MALI_PRIORITY_CONTROL_MANAGER"
help
diff --git a/mali_pixel/memory_group_manager.c b/mali_pixel/memory_group_manager.c
index 0618994..620302a 100644
--- a/mali_pixel/memory_group_manager.c
+++ b/mali_pixel/memory_group_manager.c
@@ -8,7 +8,7 @@
*/
#include <linux/atomic.h>
-#ifdef CONFIG_DEBUG_FS
+#ifdef CONFIG_MALI_MEMORY_GROUP_MANAGER_DEBUG_FS
#include <linux/debugfs.h>
#endif
#include <linux/fs.h>
@@ -96,8 +96,10 @@ static inline vm_fault_t vmf_insert_pfn_prot(struct vm_area_struct *vma,
struct mgm_group {
atomic_t size;
atomic_t lp_size;
+#ifdef CONFIG_MALI_MEMORY_GROUP_MANAGER_DEBUG_FS
atomic_t insert_pfn;
atomic_t update_gpu_pte;
+#endif
ptid_t ptid;
ptpbha_t pbha;
@@ -147,7 +149,7 @@ struct mgm_groups {
struct device *dev;
struct pt_handle *pt_handle;
struct kobject kobj;
-#ifdef CONFIG_DEBUG_FS
+#ifdef CONFIG_MALI_MEMORY_GROUP_MANAGER_DEBUG_FS
struct dentry *mgm_debugfs_root;
#endif
};
@@ -156,7 +158,7 @@ struct mgm_groups {
* DebugFS
*/
-#ifdef CONFIG_DEBUG_FS
+#ifdef CONFIG_MALI_MEMORY_GROUP_MANAGER_DEBUG_FS
static int mgm_debugfs_state_get(void *data, u64 *val)
{
@@ -287,7 +289,7 @@ static int mgm_debugfs_init(struct mgm_groups *mgm_data)
return 0;
}
-#endif /* CONFIG_DEBUG_FS */
+#endif /* CONFIG_MALI_MEMORY_GROUP_MANAGER_DEBUG_FS */
/*
* Pixel Stats sysfs
@@ -785,7 +787,9 @@ static u64 mgm_update_gpu_pte(
}
}
+#ifdef CONFIG_MALI_MEMORY_GROUP_MANAGER_DEBUG_FS
atomic_inc(&data->groups[group_id].update_gpu_pte);
+#endif
return pte;
}
@@ -835,10 +839,12 @@ static vm_fault_t mgm_vmf_insert_pfn_prot(
fault = vmf_insert_pfn_prot(vma, addr, pfn, prot);
- if (fault == VM_FAULT_NOPAGE)
- atomic_inc(&data->groups[group_id].insert_pfn);
- else
+ if (fault != VM_FAULT_NOPAGE)
dev_err(data->dev, "vmf_insert_pfn_prot failed\n");
+#ifdef CONFIG_MALI_MEMORY_GROUP_MANAGER_DEBUG_FS
+ else
+ atomic_inc(&data->groups[group_id].insert_pfn);
+#endif
return fault;
}
@@ -890,8 +896,10 @@ static int mgm_initialize_data(struct mgm_groups *mgm_data)
for (i = 0; i < MEMORY_GROUP_MANAGER_NR_GROUPS; i++) {
atomic_set(&mgm_data->groups[i].size, 0);
atomic_set(&mgm_data->groups[i].lp_size, 0);
+#ifdef CONFIG_MALI_MEMORY_GROUP_MANAGER_DEBUG_FS
atomic_set(&mgm_data->groups[i].insert_pfn, 0);
atomic_set(&mgm_data->groups[i].update_gpu_pte, 0);
+#endif
mgm_data->groups[i].pbha = MGM_PBHA_DEFAULT;
mgm_data->groups[i].base_pt = 0;