If cpus are busy, the cpu selection algorithm was favoring
cpus with lower capacity. This can result in uneven packing
since there will be a bias toward the same cpu until there
is a capacity change. Instead use the utilization so there
is immediate feedback as tasks are assigned
BUG:
30115868
Change-Id: I0ac7ae3ab5d8f2f5a5838c29bb6da2c3e8ef44e8
{
int iter_cpu;
int target_cpu = -1;
- int target_capacity = 0;
+ int target_util = 0;
int backup_capacity = 0;
int best_idle_cpu = -1;
int best_idle_cstate = INT_MAX;
if (new_util < cur_capacity) {
if (cpu_rq(i)->nr_running) {
- if (target_capacity == 0 ||
- target_capacity > cur_capacity) {
+ if (target_util == 0 ||
+ target_util > new_util) {
target_cpu = i;
- target_capacity = cur_capacity;
+ target_util = new_util;
}
} else if (!boosted) {
if (best_idle_cpu < 0 ||