summaryrefslogtreecommitdiff
path: root/mali_pixel/memory_group_manager.c
diff options
context:
space:
mode:
authorJack Diver <diverj@google.com>2023-11-16 17:20:59 +0000
committerJack Diver <diverj@google.com>2024-02-28 18:28:08 +0000
commit01d962ed80c456fb8b39584fec920621b2832f8a (patch)
tree2b4916e815dec456be77c4769f95a3e9bf128f9a /mali_pixel/memory_group_manager.c
parent0e82736f4877d92e69edd133538ea1ed9ebf76f3 (diff)
downloadgpu-01d962ed80c456fb8b39584fec920621b2832f8a.tar.gz
Add sysfs node to manually pin the SLC partition in the enabled state, which is useful when profiling SLC performance. Bug: 313458962 Test: echo 1 > /sys/kernel/pixel_stat/gpu/mem/slc_pin_partition Signed-off-by: Jack Diver <diverj@google.com> (cherry picked from https://partner-android-review.googlesource.com/q/commit:4f276f684312fa600b038553e1ad2b357034dd91) Merged-In: I5d316d9277c7f514039581f95188f14f86bd87c2 Change-Id: I5d316d9277c7f514039581f95188f14f86bd87c2
Diffstat (limited to 'mali_pixel/memory_group_manager.c')
-rw-r--r--mali_pixel/memory_group_manager.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/mali_pixel/memory_group_manager.c b/mali_pixel/memory_group_manager.c
index 81abfb4..9076a65 100644
--- a/mali_pixel/memory_group_manager.c
+++ b/mali_pixel/memory_group_manager.c
@@ -254,6 +254,8 @@ extern struct kobject *pixel_stat_gpu_kobj;
#define MGM_ATTR_RO(_name) \
static struct kobj_attribute _name##_attr = __ATTR_RO(_name)
+#define MGM_ATTR_WO(_name) \
+ static struct kobj_attribute _name##_attr = __ATTR_WO(_name)
static ssize_t total_page_count_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buf)
@@ -296,10 +298,31 @@ static ssize_t large_page_count_show(struct kobject *kobj,
}
MGM_ATTR_RO(large_page_count);
+static ssize_t slc_pin_partition_store(struct kobject* kobj,
+ struct kobj_attribute* attr,
+ const char* buf,
+ size_t count)
+{
+ struct mgm_groups *data = container_of(kobj, struct mgm_groups, kobj);
+ bool pin;
+
+ if (!data)
+ return -ENODEV;
+
+ if (kstrtobool(buf, &pin))
+ return -EINVAL;
+
+ slc_pin(&data->slc_data, pin);
+
+ return count;
+}
+MGM_ATTR_WO(slc_pin_partition);
+
static struct attribute *mgm_attrs[] = {
&total_page_count_attr.attr,
&small_page_count_attr.attr,
&large_page_count_attr.attr,
+ &slc_pin_partition_attr.attr,
NULL,
};
ATTRIBUTE_GROUPS(mgm);