Re: [PATCH v2 3/3] cpufreq: intel_pstate: Set asymmetric CPU capacity on hybrid systems
From: Ricardo Neri
Date: Mon Aug 26 2024 - 19:01:06 EST
On Mon, Aug 12, 2024 at 02:44:30PM +0200, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
[...]
> @@ -3143,6 +3341,20 @@ static int intel_pstate_register_driver(
>
> global.min_perf_pct = min_perf_pct_min();
>
> + /*
> + * On hybrid systems, use asym capacity instead of ITMT, but because
> + * the capacity of SMT threads is not deterministic even approximately,
> + * do not do that when SMT is in use.
> + */
> + if (hwp_is_hybrid && !sched_smt_active() &&
> + arch_enable_hybrid_capacity_scale()) {
> + sched_clear_itmt_support();
> +
> + hybrid_init_cpu_scaling();
> +
> + arch_rebuild_sched_domains();
sched_clear_itmt_support() also calls arch_rebuild_sched_domains(). The
latter is also called earlier via sched_set_itmt_support(), totaling 3
calls, two of which are wasted.
Perhaps at minimum hybrid_init_cpu_scaling() can be before
sched_clear_itmt_support(). The changes made by these two functions will
be picked up in a single call of arch_rebuild_sched_domains().
Moreover, ITMT can be not enabled at all if so we wish. By the time
intel_pstate_set_itmt_prio() is called, the value of hwp_is_hybrid is
already known.