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

Commit 6906a408 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar
Browse files

sched/fair: Optimize find_busiest_queue()



Use for_each_cpu_and() and thereby avoid computing the capacity for
CPUs we know we're not interested in.

Reviewed-by: default avatarPaul Turner <pjt@google.com>
Reviewed-by: default avatarPreeti U Murthy <preeti@linux.vnet.ibm.com>
Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/n/tip-lppceyv6kb3a19g8spmrn20b@git.kernel.org


Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 3ae11c90
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -4946,7 +4946,7 @@ static struct rq *find_busiest_queue(struct lb_env *env,
	unsigned long busiest_load = 0, busiest_power = 1;
	int i;

	for_each_cpu(i, sched_group_cpus(group)) {
	for_each_cpu_and(i, sched_group_cpus(group), env->cpus) {
		unsigned long power = power_of(i);
		unsigned long capacity = DIV_ROUND_CLOSEST(power,
							   SCHED_POWER_SCALE);
@@ -4955,9 +4955,6 @@ static struct rq *find_busiest_queue(struct lb_env *env,
		if (!capacity)
			capacity = fix_small_capacity(env->sd, group);

		if (!cpumask_test_cpu(i, env->cpus))
			continue;

		rq = cpu_rq(i);
		wl = weighted_cpuload(i);