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

Commit 364e8d57 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "sched/fair: Allow load bigger task load balance when nr_running is 2"

parents 72049e4b fcff1228
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -8745,7 +8745,17 @@ static int detach_tasks(struct lb_env *env)
		if (sched_feat(LB_MIN) && load < 16 && !env->sd->nr_balance_failed)
			goto next;

		if ((load / 2) > env->imbalance)
		/*
		 * p is not running task when we goes until here, so if p is one
		 * of the 2 task in src cpu rq and not the running one,
		 * that means it is the only task that can be balanced.
		 * So only when there is other tasks can be balanced or
		 * there is situation to ignore big task, it is needed
		 * to skip the task load bigger than 2*imbalance.
		 */
		if (((cpu_rq(env->src_cpu)->nr_running > 2) ||
			(env->flags & LBF_IGNORE_BIG_TASKS)) &&
			((load / 2) > env->imbalance))
			goto next;

		detach_task(p, env);