Re: [RFC][PATCH v021 4/9] sched/topology: Adjust cpufreq checks for EAS

From: Dietmar Eggemann
Date: Mon Dec 16 2024 - 09:50:16 EST


On 29/11/2024 17:00, Rafael J. Wysocki wrote:

[...]

> @@ -261,11 +262,14 @@ static bool sched_is_eas_possible(const
> }
> return false;
> }
> + /* Require schedutil or a "setpolicy" driver */
> gov = policy->governor;
> + cpufreq_ok = gov == &schedutil_gov ||
> + (!gov && policy->policy != CPUFREQ_POLICY_UNKNOWN);
> cpufreq_cpu_put(policy);
> - if (gov != &schedutil_gov) {
> + if (!cpufreq_ok) {
> if (sched_debug()) {
> - pr_info("rd %*pbl: Checking EAS, schedutil is mandatory\n",
> + pr_info("rd %*pbl: Checking EAS, unsuitable cpufreq governor\n",
> cpumask_pr_args(cpu_mask));
> }
> return false;

build_perf_domains() which calls sched_is_eas_possible() has schedutil
(4) mentioned in the function header as well:

/*
* EAS can be used on a root domain if it meets all the following
conditions:
* 1. an Energy Model (EM) is available;
* 2. the SD_ASYM_CPUCAPACITY flag is set in the sched_domain hierarchy.
* 3. no SMT is detected.
* 4. schedutil is driving the frequency of all CPUs of the rd; <-- !
* 5. frequency invariance support is present;
*/

IMHO, his patch should remove the function header since the conditions
in sched_is_eas_possible() have comments already or are self-explanatory.