@@ -143,6 +143,13 @@ void dbs_check_cpu(struct dbs_data *dbs_data, int cpu)
idle_time += jiffies_to_usecs(cur_nice_jiffies);
}
+ if (dbs_data->governor == GOV_LAB) {
+ struct lb_cpu_dbs_info_s *lb_dbs_info =
+ dbs_data->get_cpu_dbs_info_s(j);
+
+ lb_dbs_info->idle_time = (100 * idle_time) / wall_time;
+ }
+
if (unlikely(!wall_time || wall_time < idle_time))
continue;
@@ -163,6 +163,20 @@ struct cs_cpu_dbs_info_s {
unsigned int enable:1;
};
+struct lb_cpu_dbs_info_s {
+ struct cpu_dbs_common_info cdbs;
+ u64 prev_cpu_iowait;
+ struct cpufreq_frequency_table *freq_table;
+ unsigned int freq_lo;
+ unsigned int freq_lo_jiffies;
+ unsigned int freq_hi_jiffies;
+ unsigned int rate_mult;
+ unsigned int sample_type:1;
+
+ unsigned int last_sampling_rate;
+ unsigned int idle_time;
+};
+
/* Per policy Governers sysfs tunables */
struct od_dbs_tuners {
unsigned int ignore_nice;
@@ -189,6 +203,7 @@ struct common_dbs_data {
/* Common across governors */
#define GOV_ONDEMAND 0
#define GOV_CONSERVATIVE 1
+ #define GOV_LAB 2
int governor;
struct attribute_group *attr_group_gov_sys; /* one governor - system */
struct attribute_group *attr_group_gov_pol; /* one governor - policy */