limit_max_freq = table[new_level].limit_max_freq;
limit_min_freq = table[new_level].limit_min_freq;
- policy->prev_level = policy->curr_level;
+ policy->prev_level = curr_level;
policy->curr_level = new_level;
/* Turn on/off CPUs according the maximum number of online CPU */
{
struct pass_policy *policy = (struct pass_policy *)data;
static int count = 0;
+ double curr_gov_timeout, next_gov_timeout;
int level;
int ret;
/* Calculate the number of busy cpu */
pass_calculate_busy_cpu(policy);
+ /* Store current governor timeout */
+ curr_gov_timeout = policy->pass_table[policy->curr_level].gov_timeout;
+
/* Determine the amount of proper resource */
if (policy->governor->governor) {
level = policy->governor->governor(policy);
return ECORE_CALLBACK_CANCEL;
}
- /*
- * Change the period of govenor timer according to PASS level
- */
- if (policy->pass_table[level].gov_timeout >= PASS_MIN_GOV_TIMEOUT &&
- (policy->gov_timeout
- != policy->pass_table[level].gov_timeout)) {
+ /* Store next governor timeout */
+ next_gov_timeout = policy->pass_table[policy->curr_level].gov_timeout;
+ /* Change the period of govenor timer according to PASS level */
+ if (curr_gov_timeout != next_gov_timeout) {
_I("Change the period of governor timer from %fs to %fs\n",
- policy->gov_timeout,
- policy->pass_table[level].gov_timeout);
-
- policy->gov_timeout =
- policy->pass_table[level].gov_timeout;
+ curr_gov_timeout,
+ next_gov_timeout);
ecore_timer_interval_set(policy->gov_timer_id,
- policy->gov_timeout);
+ next_gov_timeout);
ecore_timer_reset(policy->gov_timer_id);
}
policy->curr_level = -1;
if (policy->init_level > policy->max_level)
policy->init_level = policy->max_level;
+
pass_governor_change_level(policy, policy->init_level);
/* Set PASS state as PASS_GOV_START */