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

Commit 79830a25 authored by Pavankumar Kondeti's avatar Pavankumar Kondeti
Browse files

sched/fair: Don't assume higher capacity means higher power



Apply the load balancer restrictions based on the power
instead of capacity. There is no change in behavior for
a big.LITTLE system on which higher capacity means higher
power.

Change-Id: Ia4d4ad7deb9e26e6e41033f53555fb6b1aca59b9
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
parent 4356e199
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -9301,7 +9301,7 @@ static struct sched_group *find_busiest_group(struct lb_env *env)
	if (energy_aware() && !env->dst_rq->rd->overutilized) {
		int cpu_local, cpu_busiest;
		long util_cum;
		unsigned long capacity_local, capacity_busiest;
		unsigned long energy_local, energy_busiest;

		if (env->idle != CPU_NEWLY_IDLE)
			goto out_balanced;
@@ -9312,12 +9312,12 @@ static struct sched_group *find_busiest_group(struct lb_env *env)
		cpu_local = group_first_cpu(sds.local);
		cpu_busiest = group_first_cpu(sds.busiest);

		 /* TODO: don't assume same cap cpus are in same domain */
		capacity_local = capacity_orig_of(cpu_local);
		capacity_busiest = capacity_orig_of(cpu_busiest);
		if (capacity_local > capacity_busiest) {
		 /* TODO: don't assume same energy cpus are in same domain */
		energy_local = cpu_max_power_cost(cpu_local);
		energy_busiest = cpu_max_power_cost(cpu_busiest);
		if (energy_local > energy_busiest) {
			goto out_balanced;
		} else if (capacity_local == capacity_busiest) {
		} else if (energy_local == energy_busiest) {
			if (cpu_rq(cpu_busiest)->nr_running < 2)
				goto out_balanced;

+5 −0
Original line number Diff line number Diff line
@@ -2816,6 +2816,11 @@ static inline unsigned long thermal_cap(int cpu)
{
	return cpu_rq(cpu)->cpu_capacity_orig;
}

static inline int cpu_max_power_cost(int cpu)
{
	return capacity_orig_of(cpu);
}
#endif

static inline void clear_walt_request(int cpu) { }