On 05/31/2018 10:33 AM, Quentin Perret wrote:
On Wednesday 30 May 2018 at 12:19:11 (-0700), Joel Fernandes wrote:
On Tue, May 29, 2018 at 01:16:17PM +0100, Chris Redpath wrote:
[...]
One thing I wanted to mention is that there are some cases where even if want_affine is set to 0 because want_energy = 1, we can still enter the select_idle_sibling path instead of energy-aware wake ups. I discovered this when I was playing with cpusets. If sched_load_balance is set to 0 in the root cpuset, then its possible that the main for_each_domain loop can be turned off. This is because all the domains would be detached from the rq. To trigger this, you could just do: mkdir /cpuset mount -t cpuset none /cpuset echo 0 > sched_load_balance
So in other words, I believe these cases shouldn't also end up in turning off the find_energy_efficient_cpu. Does that make sense or did I miss something?
Ah, right, we rely on the SD_BALANCE_WAKE flag to be set in the for loop of fbt(). It should be set by default on all domains below the domain that has SD_ASYM_CPUCAPACITY set (typically DIE in our case). I guess that "echo 0 > sched_load_balance" clears the SD_BALANCE_WAKE flag or something like that which causes the issue you see.
The v3 of the energy model that is on LKML right now is slightly different in this area. We avoid the loop in strf() entirely actually. Could you have a look and let me know what you think ? Hopefully we could do something similar in android-4.14.
I'm asking myself if this would be a legitimate use case for android (destroying all sched domains)?
(1) That's my Juno (Arm64, A53 A57 A57 A53 A53 A53) after it came up:
# cat /proc/schedstat | grep "^cpu|^domain" | awk {'print $1 " " $2} cpu0 0 domain0 39 domain1 3f cpu1 0 domain0 06 domain1 3f cpu2 0 domain0 06 domain1 3f cpu3 0 domain0 39 domain1 3f cpu4 0 domain0 39 domain1 3f cpu5 0 domain0 39
(2) Now I disable load balance system-wide (root cpuset).
# echo 0 > /sys/fs/cgroup/cpuset/cpuset.sched_load_balance [ 409.467018] CPU0 attaching NULL sched-domain. [ 409.473826] CPU1 attaching NULL sched-domain. [ 409.480500] CPU2 attaching NULL sched-domain. [ 409.485284] CPU3 attaching NULL sched-domain. [ 409.490063] CPU4 attaching NULL sched-domain. [ 409.494746] CPU5 attaching NULL sched-domain.
(3) My sched domains (sd's) are completely gone:
# cat /proc/schedstat | grep "^cpu|^domain" | awk {'print $1 " " $2} cpu0 0 cpu1 0 cpu2 0 cpu3 0 cpu4 0 cpu5 0
Now if I create cpuset foo and bar with exclusive cpusets I would have 2 distinct sd hierarchies on which strf() and lb() could operate on. (If I choose all the little for foo and all the big cpus for bar, then EAS wouldn't make much sense. We haven't tested systems with multiple root domains.) But is this really a use case for android either?
[...]