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

Commit 0cd30997 authored by Maria Yu's avatar Maria Yu
Browse files

sched/fair: Improve no-hz idle balance kicking in misfit task scenario



When there is only 1 misfit task in this runqueue,
it is in vain to do nohz idle balance for same capacity
CPU, so prefer a CPU in the other domain which may have
higher capacity CPUs. if there is no such CPU and the
current CPU has only 1 running task, avoid no-hz idle
balance kick. When there is more than 1 tasks in this
runqueue along with misfit task, choose non current sched
domain idle cpus firstly and current sched domain cpus secondly
for nohz idle balance.

Change-Id: I752e736e282ee9265c5654df3e0c9578416edd0d
Signed-off-by: default avatarMaria Yu <aiquny@codeaurora.org>
parent 7cc55261
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -10540,6 +10540,10 @@ static inline int find_new_ilb(int type)
	rcu_read_lock();
	sd = rcu_dereference_check_sched_domain(rq->sd);
	if (sd) {
		if (energy_aware() && rq->misfit_task)
			cpumask_andnot(&cpumask, nohz.idle_cpus_mask,
				sched_domain_span(sd));
		else
			cpumask_and(&cpumask, nohz.idle_cpus_mask,
				    sched_domain_span(sd));
		cpumask_andnot(&cpumask, &cpumask,
@@ -10552,7 +10556,7 @@ static inline int find_new_ilb(int type)
		if (!energy_aware() ||
		    (capacity_orig_of(cpu) ==
		     cpu_rq(cpu)->rd->max_cpu_capacity.val ||
		     cpu_overutilized(cpu))) {
		     (cpu_overutilized(cpu) && rq->nr_running > 1))) {
			cpumask_andnot(&cpumask, nohz.idle_cpus_mask,
			    cpu_isolated_mask);
			ilb = cpumask_first(&cpumask);