提交 7a85779d 编写于 作者: L liqiang

Rename feature cache to read unique

上级 c7dfb031
...@@ -33,9 +33,9 @@ static cfg_t __percpu *cur_cfg; ...@@ -33,9 +33,9 @@ static cfg_t __percpu *cur_cfg;
static cfg_t __percpu *old_cfg; static cfg_t __percpu *old_cfg;
static DEFINE_MUTEX(prefetch_mtx); static DEFINE_MUTEX(prefetch_mtx);
static ssize_t cache_store(struct device* dev, static ssize_t read_unique_store(struct device* dev,
struct device_attribute* attr, const char* buf, size_t count); struct device_attribute* attr, const char* buf, size_t count);
static ssize_t cache_show(struct device* dev, static ssize_t read_unique_show(struct device* dev,
struct device_attribute* attr, char* buf); struct device_attribute* attr, char* buf);
static ssize_t prefetch_store(struct device* dev, static ssize_t prefetch_store(struct device* dev,
struct device_attribute* attr, const char* buf, size_t count); struct device_attribute* attr, const char* buf, size_t count);
...@@ -47,8 +47,8 @@ static ssize_t prefetch_mask_show(struct device* dev, ...@@ -47,8 +47,8 @@ static ssize_t prefetch_mask_show(struct device* dev,
struct device_attribute* attr, char* buf); struct device_attribute* attr, char* buf);
/* Device create */ /* Device create */
static DEVICE_ATTR(cache, S_IRUGO|S_IWUSR, static DEVICE_ATTR(read_unique, S_IRUGO|S_IWUSR,
cache_show, cache_store); read_unique_show, read_unique_store);
static DEVICE_ATTR(policy, S_IRUGO|S_IWUSR, static DEVICE_ATTR(policy, S_IRUGO|S_IWUSR,
prefetch_show, prefetch_store); prefetch_show, prefetch_store);
...@@ -60,7 +60,7 @@ static DEVICE_ATTR(cpumask, S_IRUGO|S_IWUSR, ...@@ -60,7 +60,7 @@ static DEVICE_ATTR(cpumask, S_IRUGO|S_IWUSR,
static struct attribute *prefetch_attrs[] = { static struct attribute *prefetch_attrs[] = {
&dev_attr_policy.attr, &dev_attr_policy.attr,
&dev_attr_cpumask.attr, &dev_attr_cpumask.attr,
&dev_attr_cache.attr, &dev_attr_read_unique.attr,
NULL, NULL,
}; };
...@@ -80,7 +80,7 @@ static struct miscdevice misc = { ...@@ -80,7 +80,7 @@ static struct miscdevice misc = {
}; };
/* 0--close, 1--open */ /* 0--close, 1--open */
static ssize_t cache_store(struct device* dev, static ssize_t read_unique_store(struct device* dev,
struct device_attribute* attr, const char* buf, size_t count) struct device_attribute* attr, const char* buf, size_t count)
{ {
ssize_t ret; ssize_t ret;
...@@ -93,13 +93,13 @@ static ssize_t cache_store(struct device* dev, ...@@ -93,13 +93,13 @@ static ssize_t cache_store(struct device* dev,
} }
mutex_lock(&prefetch_mtx); mutex_lock(&prefetch_mtx);
on_each_cpu_mask(prefetch_cpumask_value, cache_set, &value, 1); on_each_cpu_mask(prefetch_cpumask_value, read_unique_set, &value, 1);
mutex_unlock(&prefetch_mtx); mutex_unlock(&prefetch_mtx);
return count; return count;
} }
static ssize_t cache_show(struct device* dev, static ssize_t read_unique_show(struct device* dev,
struct device_attribute* attr, char* buf) struct device_attribute* attr, char* buf)
{ {
int cpu; int cpu;
...@@ -111,7 +111,7 @@ static ssize_t cache_show(struct device* dev, ...@@ -111,7 +111,7 @@ static ssize_t cache_show(struct device* dev,
return -ENOMEM; return -ENOMEM;
} }
mutex_lock(&prefetch_mtx); mutex_lock(&prefetch_mtx);
on_each_cpu_mask(prefetch_cpumask_value, cache_get, cur, 1); on_each_cpu_mask(prefetch_cpumask_value, read_unique_get, cur, 1);
for_each_cpu(cpu, prefetch_cpumask_value) { for_each_cpu(cpu, prefetch_cpumask_value) {
int *ptr = per_cpu_ptr(cur, cpu); int *ptr = per_cpu_ptr(cur, cpu);
......
...@@ -22,8 +22,8 @@ typedef long cfg_t; ...@@ -22,8 +22,8 @@ typedef long cfg_t;
extern void set_prefetch(void* dummy); extern void set_prefetch(void* dummy);
extern void get_prefetch(void* dummy); extern void get_prefetch(void* dummy);
extern void cache_set(void *dummy); extern void read_unique_set(void *dummy);
extern void cache_get(void *dummy); extern void read_unique_get(void *dummy);
extern void reset_prefetch(void* dummy); extern void reset_prefetch(void* dummy);
extern int prefetch_policy_num(void); extern int prefetch_policy_num(void);
......
...@@ -107,7 +107,7 @@ void get_prefetch(void* dummy) ...@@ -107,7 +107,7 @@ void get_prefetch(void* dummy)
return; return;
} }
void cache_set(void *dummy) void read_unique_set(void *dummy)
{ {
int *value = (int *)dummy; int *value = (int *)dummy;
if (*value == ENABLE) if (*value == ENABLE)
...@@ -118,7 +118,7 @@ void cache_set(void *dummy) ...@@ -118,7 +118,7 @@ void cache_set(void *dummy)
return; return;
} }
void cache_get(void *dummy) void read_unique_get(void *dummy)
{ {
int *value = this_cpu_ptr((int __percpu *)dummy); int *value = this_cpu_ptr((int __percpu *)dummy);
u64 reg_value = read_sysreg(S3_1_c15_c6_4); u64 reg_value = read_sysreg(S3_1_c15_c6_4);
...@@ -139,12 +139,12 @@ void get_prefetch(void* dummy) ...@@ -139,12 +139,12 @@ void get_prefetch(void* dummy)
return; return;
} }
void cache_set(void *dummy) void read_unique_set(void *dummy)
{ {
return; return;
} }
void cache_get(void *dummy) void read_unique_get(void *dummy)
{ {
return; return;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册