Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 960d2b57 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "sched/fair: Fix redundant load balancer reattempt due to LBF_ALL_PINNED"

parents 26f8474d 5ee367fc
Loading
Loading
Loading
Loading
+19 −4
Original line number Diff line number Diff line
@@ -8372,6 +8372,9 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env)
		return 0;
	}

	/* Record that we found atleast one task that could run on dst_cpu */
	env->flags &= ~LBF_ALL_PINNED;

	if (energy_aware() && !env->dst_rq->rd->overutilized &&
	    env->idle == CPU_NEWLY_IDLE) {
		long util_cum_dst, util_cum_src;
@@ -8385,9 +8388,6 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env)
			return 0;
	}

	/* Record that we found atleast one task that could run on dst_cpu */
	env->flags &= ~LBF_ALL_PINNED;

#ifdef CONFIG_SCHED_WALT
	if (env->flags & LBF_IGNORE_PREFERRED_CLUSTER_TASKS &&
			 !preferred_cluster(cpu_rq(env->dst_cpu)->cluster, p))
@@ -9648,9 +9648,24 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s
	 * a think about bumping its value to force at least one task to be
	 * moved
	 */
	if (env->imbalance < busiest->load_per_task)
	if (env->imbalance < busiest->load_per_task) {
		/*
		 * The busiest group is overloaded so it could use help
		 * from the other groups. If the local group has idle CPUs
		 * and it is not overloaded and has no imbalance with in
		 * the group, allow the load balance by bumping the
		 * imbalance.
		 */
		if (busiest->group_type == group_overloaded &&
			local->group_type <= group_misfit_task &&
			env->idle != CPU_NOT_IDLE) {
			env->imbalance = busiest->load_per_task;
			return;
		}

		return fix_small_imbalance(env, sds);
	}
}

/******* find_busiest_group() helpers end here *********************/