summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Diver <diverj@google.com>2024-03-13 16:33:34 +0000
committerJack Diver <diverj@google.com>2024-03-14 10:13:25 +0000
commita4576945ecccdb3b0604fd2e70631a4332e2984d (patch)
treeda2b58807e3afbc55dcfd028e963adc069f87089
parent1070f52fcdd574c469f70c9ec4d5d670f02ff7fe (diff)
downloadgpu-a4576945ecccdb3b0604fd2e70631a4332e2984d.tar.gz
[DO NOT MERGE ANYWHERE] Revert "mgm: sysfs node to manually retain SLC partition"
Revert submission 2753879-gpu-slcv2-gs201 Reason for revert: Prebuild did not land before cutoff Reverted changes: /q/submissionid:2753879-gpu-slcv2-gs201 Bug: 329447972 Change-Id: I8216424d3713d063b0f24f33a65162541cfda408
-rw-r--r--mali_pixel/Documentation/ABI/testing/sysfs-kernel-pixel_stat-gpu7
-rw-r--r--mali_pixel/memory_group_manager.c23
-rw-r--r--mali_pixel/pixel_slc.c20
-rw-r--r--mali_pixel/pixel_slc.h5
4 files changed, 1 insertions, 54 deletions
diff --git a/mali_pixel/Documentation/ABI/testing/sysfs-kernel-pixel_stat-gpu b/mali_pixel/Documentation/ABI/testing/sysfs-kernel-pixel_stat-gpu
deleted file mode 100644
index 1d3bc11..0000000
--- a/mali_pixel/Documentation/ABI/testing/sysfs-kernel-pixel_stat-gpu
+++ /dev/null
@@ -1,7 +0,0 @@
-What: /sys/kernel/pixel_stat/gpu/mem/slc_pin_partition
-Date: Feb 2024
-Contact: "Jack Diver" <diverj@google.com>
-Description:
- Write-only node to manually pin the SLC partition in the enabled
- state. This useful when profiling SLC performance.
-
diff --git a/mali_pixel/memory_group_manager.c b/mali_pixel/memory_group_manager.c
index 9076a65..81abfb4 100644
--- a/mali_pixel/memory_group_manager.c
+++ b/mali_pixel/memory_group_manager.c
@@ -254,8 +254,6 @@ 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)
@@ -298,31 +296,10 @@ 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);
diff --git a/mali_pixel/pixel_slc.c b/mali_pixel/pixel_slc.c
index 45506ab..f06d495 100644
--- a/mali_pixel/pixel_slc.c
+++ b/mali_pixel/pixel_slc.c
@@ -56,8 +56,7 @@ static bool partition_required(struct slc_partition *pt)
{
lockdep_assert_held(&pt->lock);
- return (atomic_read(&pt->refcount) && (pt->signal >= PARTITION_ENABLE_THRESHOLD)) ||
- pt->pinned;
+ return atomic_read(&pt->refcount) && (pt->signal >= PARTITION_ENABLE_THRESHOLD);
}
/**
@@ -252,22 +251,6 @@ void slc_update_signal(struct slc_data *data, u64 signal)
spin_unlock_irqrestore(&pt->lock, flags);
}
-void slc_pin(struct slc_data *data, bool pin)
-{
- struct slc_partition *pt = &data->partition;
- unsigned long flags;
-
- spin_lock_irqsave(&pt->lock, flags);
-
- pt->pinned = pin;
- if (pin)
- enable_partition(data, pt);
- else if (!partition_required(pt))
- queue_disable_worker(data);
-
- spin_unlock_irqrestore(&pt->lock, flags);
-}
-
/**
* init_partition - Register and initialize a partition with the SLC driver.
*
@@ -308,7 +291,6 @@ static int init_partition(struct slc_data *data, struct slc_partition *pt, u32 i
.enabled = false,
.refcount = ATOMIC_INIT(0),
.signal = 0,
- .pinned = false,
};
spin_lock_init(&pt->lock);
diff --git a/mali_pixel/pixel_slc.h b/mali_pixel/pixel_slc.h
index cb8e90d..1ac3da4 100644
--- a/mali_pixel/pixel_slc.h
+++ b/mali_pixel/pixel_slc.h
@@ -54,9 +54,6 @@ struct slc_partition {
/** @signal: Partition enable/disable signal from SLC governor */
u64 signal;
-
- /** @pinned: Is the partition pinned to the enabled state */
- bool pinned;
};
/**
@@ -91,8 +88,6 @@ void slc_inc_refcount(struct slc_data *data);
void slc_dec_refcount(struct slc_data *data);
-void slc_pin(struct slc_data *data, bool pin);
-
void slc_update_signal(struct slc_data *data, u64 signal);
#endif /* _PIXEL_SLC_H_ */