aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched/fair.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sched/fair.c')
-rw-r--r--kernel/sched/fair.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 678966ca393b..968ffee24721 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -3781,7 +3781,8 @@ static inline void update_sg_lb_stats(struct sched_domain *sd,
3781{ 3781{
3782 unsigned long load, max_cpu_load, min_cpu_load, max_nr_running; 3782 unsigned long load, max_cpu_load, min_cpu_load, max_nr_running;
3783 int i; 3783 int i;
3784 unsigned int balance_cpu = -1, first_idle_cpu = 0; 3784 unsigned int balance_cpu = -1;
3785 unsigned long balance_load = ~0UL;
3785 unsigned long avg_load_per_task = 0; 3786 unsigned long avg_load_per_task = 0;
3786 3787
3787 if (local_group) 3788 if (local_group)
@@ -3797,12 +3798,11 @@ static inline void update_sg_lb_stats(struct sched_domain *sd,
3797 3798
3798 /* Bias balancing toward cpus of our domain */ 3799 /* Bias balancing toward cpus of our domain */
3799 if (local_group) { 3800 if (local_group) {
3800 if (idle_cpu(i) && !first_idle_cpu) { 3801 load = target_load(i, load_idx);
3801 first_idle_cpu = 1; 3802 if (load < balance_load || idle_cpu(i)) {
3803 balance_load = load;
3802 balance_cpu = i; 3804 balance_cpu = i;
3803 } 3805 }
3804
3805 load = target_load(i, load_idx);
3806 } else { 3806 } else {
3807 load = source_load(i, load_idx); 3807 load = source_load(i, load_idx);
3808 if (load > max_cpu_load) { 3808 if (load > max_cpu_load) {