Hi Zachariah,
On Tue, Sep 12 2017 at 23:09, Zachariah Kennedy wrote:
Good day!
Been really enjoying watching development of eas on Android Gerrit and in other places so first let me say thanks again for all the great work.
With that, I had a couple questions about idle states in the energy model. I am mainly curious about the number of tuples used for the idle states. On the Pixel they used "2 2 0" for the CPU Idle States, I would think that would be for:
wfi fpc-def fpc
But for Cluster Idle states they used "0 0" but I would think there should be 3 tuples since the Cluster Idle States are:
l2-wfi l2-gdhs l2-fpc
So why only the two "0 0" for the Pixel EM?
I believe there may have been a bug here at some point, that happened not to make any difference - anyone else remember?
Now this leads up to my ultimate question and that is about the SD835 (from the OnePlus5)
For CPU Idle States we have:
wfi ret pc
But we disable idle_enable for "ret". So would this mean that in my own EM for the OP5 I should only have 2 tuples?
And for Cluster Idle States we have:
l2-wfi l2-dynret l2-ret l2-pc
But on the OP5 we disable l2-dynret and l2-ret. So once again, should I only have 2 tuples for the number of idle states used or a tuple for each physical idle state possible?
The index into the idle states array that is used by the energy model calculation is derived from idle_get_state_idx (plus some heuristics) as you can see here:
https://android.googlesource.com/kernel/common/+/android-4.4/kernel/sched/fa...
So the number of entries in your idle-states array depends on range of that' function's return value - I guess you'll need to dig into cpuidle to figure out what that actually means for your case.
One of the important things to note in the code I linked above is:
/* Take non-cpuidle idling into account (active idle/arch_cpu_idle()) */ state++;
What that is referring to is that idle_get_state_idx will return -1 if the CPU is currently not idle, and what EAS does is treat that as the shallowest idle state when calculating the idle power component. That means that if there are 3 idle states (i.e. idle_get_state_idx can return 0, 1 or 2) then you actually need 4 entries in your idle states array, where the first and second are the exact same. This isn't the prettiest corner of EAS I'm afraid :)
Hope that's helpful..
Brendan