diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 5fc60219b6a8..60ad153716a0 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7105,7 +7105,6 @@ struct lb_env { int new_dst_cpu; enum cpu_idle_type idle; long imbalance; - unsigned int src_grp_nr_running; /* The set of CPUs under consideration for load-balancing */ struct cpumask *cpus; @@ -8670,8 +8669,6 @@ next_group: if (env->sd->flags & SD_NUMA) env->fbq_type = fbq_classify_group(&sds->busiest_stat); - env->src_grp_nr_running = sds->busiest_stat.sum_nr_running; - if (!env->sd->parent) { struct root_domain *rd = env->dst_rq->rd; @@ -8752,54 +8749,7 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s env->migration_type = migrate_util; env->imbalance = max(local->group_capacity, local->group_util) - local->group_util; -#if 0 -<<<<<<< HEAD - capa_now += busiest->group_capacity * - min(busiest->load_per_task, busiest->avg_load); - capa_now += local->group_capacity * - min(local->load_per_task, local->avg_load); - capa_now /= SCHED_CAPACITY_SCALE; - /* Amount of load we'd subtract */ - if (busiest->avg_load > scaled_busy_load_per_task) { - capa_move += busiest->group_capacity * - min(busiest->load_per_task, - busiest->avg_load - scaled_busy_load_per_task); - } - - /* Amount of load we'd add */ - if (busiest->avg_load * busiest->group_capacity < - busiest->load_per_task * SCHED_CAPACITY_SCALE) { - tmp = (busiest->avg_load * busiest->group_capacity) / - local->group_capacity; - } else { - tmp = (busiest->load_per_task * SCHED_CAPACITY_SCALE) / - local->group_capacity; - } - capa_move += local->group_capacity * - min(local->load_per_task, local->avg_load + tmp); - capa_move /= SCHED_CAPACITY_SCALE; - - /* Move if we gain throughput */ - if (capa_move > capa_now) { - env->imbalance = busiest->load_per_task; - return; - } - - /* We can't see throughput improvement with the load-based - * method, but it is possible depending upon group size and - * capacity range that there might still be an underutilized - * cpu available in an asymmetric capacity system. Do one last - * check just in case. - */ - if (env->sd->flags & SD_ASYM_CPUCAPACITY && - busiest->group_type == group_overloaded && - busiest->sum_nr_running > busiest->group_weight && - local->sum_nr_running < local->group_weight && - local->group_capacity < busiest->group_capacity) - env->imbalance = busiest->load_per_task; -} -======= /* * In some cases, the group's utilization is max or even * higher than capacity because of migrations but the @@ -8811,8 +8761,7 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s env->migration_type = migrate_task; env->imbalance = 1; } ->>>>>>> v5.5-rc1 -#endif + return; } @@ -8868,23 +8817,6 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s (busiest->avg_load - sds->avg_load) * busiest->group_capacity, (sds->avg_load - local->avg_load) * local->group_capacity ) / SCHED_CAPACITY_SCALE; - - /* Boost imbalance to allow misfit task to be balanced. - * Always do this if we are doing a NEWLY_IDLE balance - * on the assumption that any tasks we have must not be - * long-running (and hence we cannot rely upon load). - * However if we are not idle, we should assume the tasks - * we have are longer running and not override load-based - * calculations above unless we are sure that the local - * group is underutilized. - */ - if (busiest->group_type == group_misfit_task && - (env->idle == CPU_NEWLY_IDLE || - local->sum_nr_running < local->group_weight)) { - env->imbalance = max_t(long, env->imbalance, - busiest->group_misfit_task_load); - } - } /******* find_busiest_group() helpers end here *********************/ @@ -9437,8 +9369,7 @@ more_balance: * excessive cache_hot migrations and active balances. */ if (idle != CPU_NEWLY_IDLE) - if (env.src_grp_nr_running > 1) - sd->nr_balance_failed++; + sd->nr_balance_failed++; if (need_active_balance(&env)) { unsigned long flags;