/* max freq cannot be less than 100. But who knows... */ if (unlikely(freq_step == 0))
freq_step = DEF_FREQUENCY_STEP;
return freq_step;
}
/* * Every sampling_rate, we check, if current idle time is less than 20% * (default), then we try to increase frequency. Every sampling_rate * * sampling_down_factor, we check, if current idle time is more than 80% * (default), then we try to decrease frequency * * Frequency updates happen at minimum steps of 5% (default) of maximum * frequency
*/ staticunsignedint cs_dbs_update(struct cpufreq_policy *policy)
{ struct policy_dbs_info *policy_dbs = policy->governor_data; struct cs_policy_dbs_info *dbs_info = to_dbs_info(policy_dbs); unsignedint requested_freq = dbs_info->requested_freq; struct dbs_data *dbs_data = policy_dbs->dbs_data; struct cs_dbs_tuners *cs_tuners = dbs_data->tuners; unsignedint load = dbs_update(policy); unsignedint freq_step;
/* * break out if we 'cannot' reduce the speed as the user might * want freq_step to be zero
*/ if (cs_tuners->freq_step == 0) goto out;
/* * If requested_freq is out of range, it is likely that the limits * changed in the meantime, so fall back to current frequency in that * case.
*/ if (requested_freq > policy->max || requested_freq < policy->min) {
requested_freq = policy->cur;
dbs_info->requested_freq = requested_freq;
}
freq_step = get_freq_step(cs_tuners, policy);
/* * Decrease requested_freq one freq_step for each idle period that * we didn't update the frequency.
*/ if (policy_dbs->idle_periods < UINT_MAX) { unsignedint freq_steps = policy_dbs->idle_periods * freq_step;
/* if sampling_down_factor is active break out early */ if (++dbs_info->down_skip < dbs_data->sampling_down_factor) goto out;
dbs_info->down_skip = 0;
/* Check for frequency decrease */ if (load < cs_tuners->down_threshold) { /* * if we cannot reduce the frequency anymore, break out early
*/ if (requested_freq == policy->min) goto out;
/* * no need to test here if freq_step is zero as the user might actually * want this, they would be crazy though :)
*/
cs_tuners->freq_step = input; return count;
}
MODULE_AUTHOR("Alexander Clouter ");
MODULE_DESCRIPTION("'cpufreq_conservative' - A dynamic cpufreq governor for " "Low Latency Frequency Transition capable processors " "optimised for use in a battery environment");
MODULE_LICENSE("GPL");
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.