Commit 875b8508 authored by Viresh Kumar's avatar Viresh Kumar Committed by Rafael J. Wysocki

cpufreq: governor: Rename 'cpu_dbs_common_info' to 'cpu_dbs_info'

Its not common info to all CPUs, but a structure representing common
type of cpu info to both governor types. Lets drop 'common_' from its
name.
Reviewed-by: default avatarPreeti U Murthy <preeti@linux.vnet.ibm.com>
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent d3574c85
...@@ -32,7 +32,7 @@ static struct attribute_group *get_sysfs_attr(struct dbs_data *dbs_data) ...@@ -32,7 +32,7 @@ static struct attribute_group *get_sysfs_attr(struct dbs_data *dbs_data)
void dbs_check_cpu(struct dbs_data *dbs_data, int cpu) void dbs_check_cpu(struct dbs_data *dbs_data, int cpu)
{ {
struct cpu_dbs_common_info *cdbs = dbs_data->cdata->get_cpu_cdbs(cpu); struct cpu_dbs_info *cdbs = dbs_data->cdata->get_cpu_cdbs(cpu);
struct od_dbs_tuners *od_tuners = dbs_data->tuners; struct od_dbs_tuners *od_tuners = dbs_data->tuners;
struct cs_dbs_tuners *cs_tuners = dbs_data->tuners; struct cs_dbs_tuners *cs_tuners = dbs_data->tuners;
struct cpufreq_policy *policy; struct cpufreq_policy *policy;
...@@ -64,7 +64,7 @@ void dbs_check_cpu(struct dbs_data *dbs_data, int cpu) ...@@ -64,7 +64,7 @@ void dbs_check_cpu(struct dbs_data *dbs_data, int cpu)
/* Get Absolute Load */ /* Get Absolute Load */
for_each_cpu(j, policy->cpus) { for_each_cpu(j, policy->cpus) {
struct cpu_dbs_common_info *j_cdbs; struct cpu_dbs_info *j_cdbs;
u64 cur_wall_time, cur_idle_time; u64 cur_wall_time, cur_idle_time;
unsigned int idle_time, wall_time; unsigned int idle_time, wall_time;
unsigned int load; unsigned int load;
...@@ -163,7 +163,7 @@ EXPORT_SYMBOL_GPL(dbs_check_cpu); ...@@ -163,7 +163,7 @@ EXPORT_SYMBOL_GPL(dbs_check_cpu);
static inline void __gov_queue_work(int cpu, struct dbs_data *dbs_data, static inline void __gov_queue_work(int cpu, struct dbs_data *dbs_data,
unsigned int delay) unsigned int delay)
{ {
struct cpu_dbs_common_info *cdbs = dbs_data->cdata->get_cpu_cdbs(cpu); struct cpu_dbs_info *cdbs = dbs_data->cdata->get_cpu_cdbs(cpu);
mod_delayed_work_on(cpu, system_wq, &cdbs->dwork, delay); mod_delayed_work_on(cpu, system_wq, &cdbs->dwork, delay);
} }
...@@ -199,7 +199,7 @@ EXPORT_SYMBOL_GPL(gov_queue_work); ...@@ -199,7 +199,7 @@ EXPORT_SYMBOL_GPL(gov_queue_work);
static inline void gov_cancel_work(struct dbs_data *dbs_data, static inline void gov_cancel_work(struct dbs_data *dbs_data,
struct cpufreq_policy *policy) struct cpufreq_policy *policy)
{ {
struct cpu_dbs_common_info *cdbs; struct cpu_dbs_info *cdbs;
int i; int i;
for_each_cpu(i, policy->cpus) { for_each_cpu(i, policy->cpus) {
...@@ -209,8 +209,7 @@ static inline void gov_cancel_work(struct dbs_data *dbs_data, ...@@ -209,8 +209,7 @@ static inline void gov_cancel_work(struct dbs_data *dbs_data,
} }
/* Will return if we need to evaluate cpu load again or not */ /* Will return if we need to evaluate cpu load again or not */
bool need_load_eval(struct cpu_dbs_common_info *cdbs, bool need_load_eval(struct cpu_dbs_info *cdbs, unsigned int sampling_rate)
unsigned int sampling_rate)
{ {
if (policy_is_shared(cdbs->cur_policy)) { if (policy_is_shared(cdbs->cur_policy)) {
ktime_t time_now = ktime_get(); ktime_t time_now = ktime_get();
...@@ -330,7 +329,7 @@ static int cpufreq_governor_start(struct cpufreq_policy *policy, ...@@ -330,7 +329,7 @@ static int cpufreq_governor_start(struct cpufreq_policy *policy,
{ {
struct common_dbs_data *cdata = dbs_data->cdata; struct common_dbs_data *cdata = dbs_data->cdata;
unsigned int sampling_rate, ignore_nice, j, cpu = policy->cpu; unsigned int sampling_rate, ignore_nice, j, cpu = policy->cpu;
struct cpu_dbs_common_info *cpu_cdbs = cdata->get_cpu_cdbs(cpu); struct cpu_dbs_info *cpu_cdbs = cdata->get_cpu_cdbs(cpu);
int io_busy = 0; int io_busy = 0;
if (!policy->cur) if (!policy->cur)
...@@ -350,7 +349,7 @@ static int cpufreq_governor_start(struct cpufreq_policy *policy, ...@@ -350,7 +349,7 @@ static int cpufreq_governor_start(struct cpufreq_policy *policy,
} }
for_each_cpu(j, policy->cpus) { for_each_cpu(j, policy->cpus) {
struct cpu_dbs_common_info *j_cdbs = cdata->get_cpu_cdbs(j); struct cpu_dbs_info *j_cdbs = cdata->get_cpu_cdbs(j);
unsigned int prev_load; unsigned int prev_load;
j_cdbs->cur_policy = policy; j_cdbs->cur_policy = policy;
...@@ -398,7 +397,7 @@ static void cpufreq_governor_stop(struct cpufreq_policy *policy, ...@@ -398,7 +397,7 @@ static void cpufreq_governor_stop(struct cpufreq_policy *policy,
{ {
struct common_dbs_data *cdata = dbs_data->cdata; struct common_dbs_data *cdata = dbs_data->cdata;
unsigned int cpu = policy->cpu; unsigned int cpu = policy->cpu;
struct cpu_dbs_common_info *cpu_cdbs = cdata->get_cpu_cdbs(cpu); struct cpu_dbs_info *cpu_cdbs = cdata->get_cpu_cdbs(cpu);
if (cdata->governor == GOV_CONSERVATIVE) { if (cdata->governor == GOV_CONSERVATIVE) {
struct cs_cpu_dbs_info_s *cs_dbs_info = struct cs_cpu_dbs_info_s *cs_dbs_info =
...@@ -418,7 +417,7 @@ static void cpufreq_governor_limits(struct cpufreq_policy *policy, ...@@ -418,7 +417,7 @@ static void cpufreq_governor_limits(struct cpufreq_policy *policy,
{ {
struct common_dbs_data *cdata = dbs_data->cdata; struct common_dbs_data *cdata = dbs_data->cdata;
unsigned int cpu = policy->cpu; unsigned int cpu = policy->cpu;
struct cpu_dbs_common_info *cpu_cdbs = cdata->get_cpu_cdbs(cpu); struct cpu_dbs_info *cpu_cdbs = cdata->get_cpu_cdbs(cpu);
if (!cpu_cdbs->cur_policy) if (!cpu_cdbs->cur_policy)
return; return;
......
...@@ -109,7 +109,7 @@ store_one(_gov, file_name) ...@@ -109,7 +109,7 @@ store_one(_gov, file_name)
/* create helper routines */ /* create helper routines */
#define define_get_cpu_dbs_routines(_dbs_info) \ #define define_get_cpu_dbs_routines(_dbs_info) \
static struct cpu_dbs_common_info *get_cpu_cdbs(int cpu) \ static struct cpu_dbs_info *get_cpu_cdbs(int cpu) \
{ \ { \
return &per_cpu(_dbs_info, cpu).cdbs; \ return &per_cpu(_dbs_info, cpu).cdbs; \
} \ } \
...@@ -129,7 +129,7 @@ static void *get_cpu_dbs_info_s(int cpu) \ ...@@ -129,7 +129,7 @@ static void *get_cpu_dbs_info_s(int cpu) \
*/ */
/* Per cpu structures */ /* Per cpu structures */
struct cpu_dbs_common_info { struct cpu_dbs_info {
u64 prev_cpu_idle; u64 prev_cpu_idle;
u64 prev_cpu_wall; u64 prev_cpu_wall;
u64 prev_cpu_nice; u64 prev_cpu_nice;
...@@ -152,7 +152,7 @@ struct cpu_dbs_common_info { ...@@ -152,7 +152,7 @@ struct cpu_dbs_common_info {
}; };
struct od_cpu_dbs_info_s { struct od_cpu_dbs_info_s {
struct cpu_dbs_common_info cdbs; struct cpu_dbs_info cdbs;
struct cpufreq_frequency_table *freq_table; struct cpufreq_frequency_table *freq_table;
unsigned int freq_lo; unsigned int freq_lo;
unsigned int freq_lo_jiffies; unsigned int freq_lo_jiffies;
...@@ -162,7 +162,7 @@ struct od_cpu_dbs_info_s { ...@@ -162,7 +162,7 @@ struct od_cpu_dbs_info_s {
}; };
struct cs_cpu_dbs_info_s { struct cs_cpu_dbs_info_s {
struct cpu_dbs_common_info cdbs; struct cpu_dbs_info cdbs;
unsigned int down_skip; unsigned int down_skip;
unsigned int requested_freq; unsigned int requested_freq;
unsigned int enable:1; unsigned int enable:1;
...@@ -203,7 +203,7 @@ struct common_dbs_data { ...@@ -203,7 +203,7 @@ struct common_dbs_data {
*/ */
struct dbs_data *gdbs_data; struct dbs_data *gdbs_data;
struct cpu_dbs_common_info *(*get_cpu_cdbs)(int cpu); struct cpu_dbs_info *(*get_cpu_cdbs)(int cpu);
void *(*get_cpu_dbs_info_s)(int cpu); void *(*get_cpu_dbs_info_s)(int cpu);
void (*gov_dbs_timer)(struct work_struct *work); void (*gov_dbs_timer)(struct work_struct *work);
void (*gov_check_cpu)(int cpu, unsigned int load); void (*gov_check_cpu)(int cpu, unsigned int load);
...@@ -264,8 +264,7 @@ static ssize_t show_sampling_rate_min_gov_pol \ ...@@ -264,8 +264,7 @@ static ssize_t show_sampling_rate_min_gov_pol \
extern struct mutex cpufreq_governor_lock; extern struct mutex cpufreq_governor_lock;
void dbs_check_cpu(struct dbs_data *dbs_data, int cpu); void dbs_check_cpu(struct dbs_data *dbs_data, int cpu);
bool need_load_eval(struct cpu_dbs_common_info *cdbs, bool need_load_eval(struct cpu_dbs_info *cdbs, unsigned int sampling_rate);
unsigned int sampling_rate);
int cpufreq_governor_dbs(struct cpufreq_policy *policy, int cpufreq_governor_dbs(struct cpufreq_policy *policy,
struct common_dbs_data *cdata, unsigned int event); struct common_dbs_data *cdata, unsigned int event);
void gov_queue_work(struct dbs_data *dbs_data, struct cpufreq_policy *policy, void gov_queue_work(struct dbs_data *dbs_data, struct cpufreq_policy *policy,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment