****************************************************************************/
/*
- * pass_hotplug_set_online - Change the maximum number of online cpu
+ * pass_hotplug_set_online - Change the minimum number of online cpu
*
* @policy: the instance of struct pass_policy
- * @max_online: the maximum number of online cpu
+ * @min_num: the minimum number of online cpu
*/
static void pass_hotplug_set_online(struct pass_policy *policy,
- unsigned int online)
+ unsigned int min_num)
{
struct pass_resource *pass_res = to_pass_resource(policy);
struct pass_hotplug *hotplug = policy->hotplug;
int i;
- if (!hotplug || online == hotplug->online)
+ if (!hotplug || min_num == hotplug->online)
return;
- if (online > hotplug->max_online)
- online = hotplug->max_online;
+ if (min_num > hotplug->max_online)
+ min_num = hotplug->max_online;
for (i = 0 ; i < policy->freq.num_nr_cpus; i++) {
- if (i < online) {
+ if (i < min_num) {
pass_set_online_state(pass_res, hotplug->sequence[i],
PASS_CPU_UP);
} else {
/*
_I("- CPU %4s '%d->%d'Core\n",
- (hotplug->online > online ? "DOWN" : "UP"),
- hotplug->online, online);
+ (hotplug->online > min_num ? "DOWN" : "UP"),
+ hotplug->online, min_num);
*/
- hotplug->online = online;
+ hotplug->online = min_num;
}
/*
****************************************************************************/
/*
- * pass_governor_change_level - Change maximum cpu frequency and number of online cpu
+ * pass_governor_change_level - Change frequency and number of online resources
*
* @policy: the instance of struct pass_policy
- * @level: the pass level
+ * @new_level: the desired pass level
*/
static int pass_governor_change_level(struct pass_policy *policy, int new_level)
{
/*
* Collect data related to system state
- * - current cpu frequency
+ * - the current frequency
* - the number of nr_running
- * - cpu load (= runnable_avg_sum * 100 / runnable_avg_period)
+ * - the resource utilization
*/
ret = pass_get_cpu_stats(policy);
if (ret < 0) {
return;
}
- /* Restore maximum cpu freq/the number of online cpu */
+ /* Restore the frequency and the number of online resources */
pass_governor_change_level(policy, policy->num_levels - 1);
pass_hotplug_stop(policy);
pass_notifier_exit(policy);
/*
- * Stop core timer and
- * Restore maximum online cpu/cpu frequency
+ * Stop timer and
+ * Restore the frequency and the number of online resources
*/
pass_governor_update(policy, PASS_GOV_STOP);
}
/*
- * pass_governor_change_level_scope - Change the scope of frequency scaling
+ * pass_governor_change_level_scope - Change the scope of pass level
*
* @policy: the instance of struct pass_policy
- * @min_level: the minimum level of frequency scaling
- * @max_level: the maximum level of frequency scaling
+ * @min_level: the minimum pass level
+ * @max_level: the maximum pass level
*/
int pass_governor_change_level_scope(struct pass_policy *policy,
int min_level, int max_level)
&& max_level == policy->max_level)
return 0;
- /* Change minimum/maximum level of frequency scaling */
+ /* Change minimum/maximum pass level */
policy->min_level = min_level;
policy->max_level = max_level;