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

Commit fcff1228 authored by Maria Yu's avatar Maria Yu Committed by Cong Zhang
Browse files

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



When there is only 2 tasks in 1 cpu and the other
task is currently running, allow load bigger task
to be balanced if the other task is currently
running.

Change-Id: I489e9624ba010f9293272a67585e8209a786b787
Signed-off-by: default avatarMaria Yu <aiquny@codeaurora.org>
Signed-off-by: default avatarCong Zhang <congzhan@codeaurora.org>
parent 6b3ddc57
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -8675,7 +8675,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);