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

Commit 0951ec0f authored by Srivatsa Vaddagiri's avatar Srivatsa Vaddagiri Committed by Steve Muckle
Browse files

sched: Influence cpu_power based on max_freq and efficiency



Update cpu_power metric of a cpu by accounting its efficiency and
max_freq factors. cpu_power is defined such that "least" performing
cpu (one with lowest efficiency and max_freq factor) gets cpu_power of
1024. Note that no single CPU may have both the lowest efficiency and
lowest max_freq. All CPUs will still have cpu_power values relative to
this combination receiving a cpu_power of 1024 however.

cpu_power differs from capacity metric of a cpu by accounting
real-time task activity.

Change-Id: I255d3ad80d8bc8237b9ffb8f6e7c0dc4c44ec10f
Signed-off-by: default avatarSrivatsa Vaddagiri <vatsa@codeaurora.org>
parent 03163c31
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -4412,7 +4412,7 @@ static inline int get_sd_load_idx(struct sched_domain *sd,

static unsigned long default_scale_freq_power(struct sched_domain *sd, int cpu)
{
	return SCHED_POWER_SCALE;
	return capacity_scale_cpu_freq(cpu);
}

unsigned long __weak arch_scale_freq_power(struct sched_domain *sd, int cpu)
@@ -4481,6 +4481,9 @@ static void update_cpu_power(struct sched_domain *sd, int cpu)

	sdg->sgp->power_orig = power;

	power *= capacity_scale_cpu_efficiency(cpu);
	power >>= SCHED_POWER_SHIFT;

	if (sched_feat(ARCH_POWER))
		power *= arch_scale_freq_power(sd, cpu);
	else