Remove unnecessary struct pass_freq_policy and level_up_threshold.
Instead, add max_freq which contains the maximum frequency among PASS's levels
to struct pass_cpuhp. The max_freq is used to calculate the busy cpu on CPUHP's
governor.
Change-Id: I3cab9c13baa927cf0ecd5a9220ba8ab8c8db30dd
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
cpu_threshold =
(unsigned int)(cur_freq * load)
- / cpuhp->freq.max_freq;
+ / cpuhp->max_freq;
if (load == 100
|| cpu_threshold >= cpuhp->pass_cpu_threshold)
busy_cpu++;
cpuhp->pass_cpu_threshold = 0;
cpuhp->up_threshold = 0;
cpuhp->down_threshold = 0;
- cpuhp->level_up_threshold = 0;
cpuhp->num_pass_cpu_stats = 0;
cpuhp->governor = NULL;
if (!cpuhp->down_threshold)
cpuhp->down_threshold = PASS_DEFAULT_LEVEL_DOWN_THRESHOLD;
- if (!cpuhp->level_up_threshold)
- cpuhp->level_up_threshold = 0;
-
if (!cpuhp->num_pass_cpu_stats)
cpuhp->num_pass_cpu_stats = PASS_CPU_STATS_MAX_COUNT;
for (i = 0; i < res->config_data.num_levels; i++)
if (max_freq < res->config_data.levels[i].limit_max_freq)
max_freq = res->config_data.levels[i].limit_max_freq;
- cpuhp->freq.max_freq = max_freq;
-
+ cpuhp->max_freq = max_freq;
/* Allocate memory according to the number of data and cpu */
cpuhp->pass_cpu_stats = calloc(cpuhp->num_pass_cpu_stats,
res->cpuhp.up_threshold = atoi(result->value);
else if (MATCH(result->name, "pass_down_threshold"))
res->cpuhp.down_threshold = atoi(result->value);
- else if (MATCH(result->name, "pass_level_up_threshold"))
- res->cpuhp.level_up_threshold = atoi(result->value);
else if (MATCH(result->name, "pass_governor_timeout")) {
res->config_data.gov_timeout = atof(result->value);
cpuhp->pass_cpu_threshold = 0;
cpuhp->up_threshold = 0;
cpuhp->down_threshold = 0;
- cpuhp->level_up_threshold = 0;
cpuhp->last_time = 0;
/* Initialize the PMQoS's data */
int (*governor)(struct pass_resource *res);
};
-struct pass_freq_policy {
- unsigned int max_freq;
- unsigned int sampling_rate;
- unsigned int up_threshold;
-};
-
struct pass_level_condition {
int freq;
int nr_running;
* @last_time: the updated last time of cpu_stats
* @governor: the instance of CPUHP Policy governor.
* @gov_timeout_id: the periodic timer id
+ * @max_freq: the maximum frequency among levels
*
* @hotplug: the instance of CPU Hotplug governor (will be deprecated).
- * @freq: store cpufreq's variables (will be deprecated).
- * @level_up_threshold: threshold used when changing level (will be deprecated).
*
* CPUHP may be o enabled or disabled according to configuration file setting.
*/
struct pass_cpuhp_governor *governor;
guint gov_timeout_id;
+ unsigned int max_freq;
+
struct pass_hotplug *hotplug;
- struct pass_freq_policy freq;
- unsigned int level_up_threshold;
};
/******************************************************