On 08/20/2018 02:44 AM, Quentin Perret wrote:
In order to ensure a minimal performance impact on non-energy-aware systems, introduce a static_key guarding the access to Energy-Aware Scheduling (EAS) code.The static key is set iff all the following conditions are met for at least one root domain: 1. all online CPUs of the root domain are covered by the Energy Model (EM); 2. the complexity of the root domain's EM is low enough to keep scheduling overheads low; 3. the root domain has an asymmetric CPU capacity topology (detected by looking for the SD_ASYM_CPUCAPACITY flag in the sched_domain hierarchy).
This is pretty much the list (+ is schedutil running) of conditions to set rd->pd != NULL in build_perf_domains().
So when testing 'static_branch_unlikely(&sched_energy_present) && rcu_dereference(rd->pd)' don't you test two times the same thing?
Also, if let's say somebody wants to run another EM user (e.g. a thermal governor, like IPA) but not EAS on a asymmetric CPU capacity system. This can't be achieved with the current static branch approach
So what about using a (disabled by default ?) sched_feature + rd->pd != NULL instead?
[...]

