Lines Matching defs:imbalance
1617 static inline long adjust_numa_imbalance(int imbalance, int nr_running);
1990 * imbalance that would be overruled by the load balancer.
1993 unsigned int imbalance;
1997 * Would movement cause an imbalance? Note that if src has
1998 * more running tasks that the imbalance is ignored as the
1999 * move improves the imbalance from the perspective of the
2004 imbalance = max(0, dst_running - src_running);
2005 imbalance = adjust_numa_imbalance(imbalance, dst_running);
2006 /* Use idle CPU if there is no imbalance */
2007 if (!imbalance) {
2064 * imbalance and would be the first to start moving tasks about.
7714 * To achieve this balance we define a measure of imbalance which follows
7719 * We them move tasks around to minimize the imbalance. In the continuous
7730 * In order to solve the imbalance equation (4), and avoid the obvious O(n^2)
7868 long imbalance;
8138 * detach_tasks() -- tries to detach up to imbalance load/util/tasks from
8155 if (env->imbalance <= 0) {
8199 * value. Make sure that env->imbalance decreases
8215 if (shr_bound(load, env->sd->nr_balance_failed) > env->imbalance) {
8219 env->imbalance -= load;
8224 if (util > env->imbalance) {
8228 env->imbalance -= util;
8232 env->imbalance--;
8241 env->imbalance = 0;
8265 if (env->imbalance <= 0) {
8774 * Group imbalance indicates (and tries to solve) the problem where balancing
8795 * to create an effective group imbalance.
8798 * group imbalance and decide the groups need to be balanced again. A most
8804 return group->sgc->imbalance;
9052 * internally or be covered by avg_load imbalance (eventually).
9356 unsigned long imbalance;
9367 imbalance = scale_load_down(NICE_0_LOAD) * (sd->imbalance_pct - FAIR_ONEHUNDRED) / FAIR_ONEHUNDRED;
9428 * remote domains but "imbalance" skews the comparison making
9430 * cross-domain, add imbalance to the load on the remote node
9434 if ((sd->flags & SD_NUMA) && ((idlest_sgs.avg_load + imbalance) >= local_sgs.avg_load)) {
9442 if (idlest_sgs.avg_load >= (local_sgs.avg_load + imbalance)) {
9589 static inline long adjust_numa_imbalance(int imbalance, int nr_running)
9594 * Allow a small imbalance based on a simple pair of communicating
9602 return imbalance;
9606 * calculate_imbalance - Calculate the amount of imbalance present within the
9609 * @sds: statistics of the sched_domain whose imbalance is to be calculated.
9619 /* Set imbalance to allow misfit tasks to be balanced. */
9621 env->imbalance = 1;
9631 env->imbalance = busiest->sum_h_nr_running;
9639 * the imbalance. The next load balance will take care of
9643 env->imbalance = 1;
9662 env->imbalance = max(local->group_capacity, local->group_util) - local->group_util;
9671 if (env->idle != CPU_NOT_IDLE && env->imbalance == 0) {
9673 env->imbalance = 1;
9687 env->imbalance = nr_diff >> 1;
9694 env->imbalance = max_t(long, 0, (local->idle_cpus - busiest->idle_cpus) >> 1);
9697 /* Consider allowing a small imbalance between NUMA groups */
9699 env->imbalance = adjust_numa_imbalance(env->imbalance, busiest->sum_nr_running);
9723 env->imbalance = 0;
9734 * the minimum possible imbalance.
9737 env->imbalance = min((busiest->avg_load - sds->avg_load) * busiest->group_capacity,
9758 * force : Calculate the imbalance as load migration is probably needed.
9759 * avg_load : Only if imbalance is significant enough.
9766 * if there is an imbalance.
9773 * Return: - The busiest group if imbalance exists.
9883 * and there is no imbalance between this and busiest
9884 * group wrt idle CPUs, it is balanced. The imbalance
9886 * otherwise we might end up to just move the imbalance
9902 /* Looks like there is an imbalance. Compute it */
9904 return env->imbalance ? sds.busiest : NULL;
9907 env->imbalance = 0;
9972 * When comparing with load imbalance, use cpu_load()
9976 if (nr_running == 1 && load > env->imbalance && !check_cpu_capacity(rq, env->sd)) {
10149 * tasks if there is an imbalance.
10197 schedstat_add(sd->lb_imbalance[idle], env.imbalance);
10206 * an imbalance but busiest->nr_running <= 1, the group is
10208 * correctly treated as an imbalance.
10264 if ((env.flags & LBF_DST_PINNED) && env.imbalance > 0) {
10285 int *group_imbalance = &sd_parent->groups->sgc->imbalance;
10287 if ((env.flags & LBF_SOME_PINNED) && env.imbalance > 0) {
10384 * constraints. Clear the imbalance flag only if other tasks got
10385 * a chance to move and fix the imbalance.
10388 int *group_imbalance = &sd_parent->groups->sgc->imbalance;
10398 * we can't migrate them. Let the imbalance flag set so parent level
10913 * If there is an imbalance between LLC domains (IOW we could