+7
−11
Loading
Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more
In order to calculate energy difference we currently iterates CPUs under
the same sched doamin to accumulate total energy cost and compare before
and after :
for_each_domain(cpu)
total_energy_before += (cpu_util * power) >> SCHED_CAPACITY_SHIFT;
for_each_domain(cpu)
total_energy_after += (cpu_util * power) >> SCHED_CAPACITY_SHIFT;
Doing such can incorrectly calculate and report abs(delta) > 0 when
there is actually no energy delta between before and after because the
same total accumulated cpu_util of all the CPUs can be distributed
differently before and after and it causes different amount of rounding
error.
Fix such incorrectness by shifting just once with accumulated
total_energy.
Change-Id: I82f1e2e358367058960938b4ef81714f57e921cf
Signed-off-by:
Joonwoo Park <joonwoop@codeaurora.org>
(moved part to another commit)
Signed-off-by:
Chris Redpath <chris.redpath@arm.com>
(cherry picked from commit 11b618a0b2fc8598474a518add7037d4005d83e8)
[trivial cherry-pick issues]
Signed-off-by:
Quentin Perret <quentin.perret@arm.com>