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

Commit 2d215218 authored by Joonwoo Park's avatar Joonwoo Park
Browse files

sched: EAS: use busy energy cost when CPU is not in a C-state



When the CPU is idle but not in a C-state, i.e. not in WFI
regardless of its load the CPU's energy cost is proportional to its
frequency rather than static.  However at present energy_diff() tends
to underestimate energy cost of CPU not in a C-state when a CPU's
load is low by assuming energy cost is static.

Use energy cost of CPU frequency rather than static idle cost when CPU
is not in a C-state.

Change-Id: I63060be34652f3a1e8f85eca235440e033e614ee
Signed-off-by: default avatarJoonwoo Park <joonwoop@codeaurora.org>
parent 90f82902
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -5602,6 +5602,11 @@ static int sched_group_energy(struct energy_env *eenv)
				idle_idx = group_idle_state(sg);
				group_util = group_norm_util(eenv, sg);
				sg_busy_energy = (group_util * sg->sge->cap_states[cap_idx].power);

				if (idle_idx == 0)
					sg_idle_energy = ((SCHED_CAPACITY_SCALE - group_util)
							* sg->sge->cap_states[cap_idx].power);
				else
					sg_idle_energy = ((SCHED_CAPACITY_SCALE - group_util)
							* sg->sge->idle_states[idle_idx].power);