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

Commit a1dd271c authored by Leo Yan's avatar Leo Yan Committed by Joonwoo Park
Browse files

sched/fair: select busiest rq with misfit task



Current code select busiest rq mostly consider only from weighted load
this point of view; so it's possible to select one CPU with most
weighted load value but this load are contributes by some small load
tasks, on the other hand there have one another CPU with misfit task but
it may have no chance to migrate task to higher capacity CPU.

This patch is to add one more checking for selection busiest rq if find
only one misfit task on the rq and it's possible to migrate task from
lower capacity CPU to higher capacity CPU.

Change-Id: I583859b970050bb95f0d4f474896234930574bd3
Signed-off-by: default avatarLeo Yan <leo.yan@linaro.org>
Patch-mainline: eas-dev @ 12/22/16, 15:58
Signed-off-by: default avatarJoonwoo Park <joonwoop@codeaurora.org>
parent c9507ba3
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -8933,6 +8933,24 @@ static struct rq *find_busiest_queue(struct lb_env *env,
		    env->busiest_group_type != group_misfit_task)
			continue;

		/*
		 * After enable energy awared scheduling, it has higher
		 * priority to migrate misfit task rather than from most
		 * loaded CPU; E.g. one CPU with single misfit task and
		 * other CPUs with multiple lower load tasks, we should
		 * firstly make sure the misfit task can be migrated onto
		 * higher capacity CPU.
		 */
		if (energy_aware() &&
		    capacity_orig_of(i) < capacity_orig_of(env->dst_cpu) &&
		    rq->cfs.h_nr_running == 1 && rq->misfit_task &&
		    env->busiest_group_type == group_misfit_task) {
			busiest_load = wl;
			busiest_capacity = capacity;
			busiest = rq;
			break;
		}

		/*
		 * For the load comparisons with the other cpu's, consider
		 * the weighted_cpuload() scaled with the cpu capacity, so