Re: [PATCH v1] cpufreq: intel_pstate: Rearrange checks in hybrid_get_cost()
From: srinivas pandruvada
Date: Wed Jul 01 2026 - 14:09:06 EST
On Wed, 2026-06-17 at 19:02 +0200, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
>
> Make the checks in hybrid_get_cost() more straightforward.
>
Please do the same for hwp_get_cpu_scaling()
if (hybrid_get_cpu_type(cpu) != INTEL_CPU_TYPE_ATOM)
to
if (hybrid_get_cpu_type(cpu) == INTEL_CPU_TYPE_CORE)
Thanks,
Srinivas
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
> ---
> drivers/cpufreq/intel_pstate.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> --- a/drivers/cpufreq/intel_pstate.c
> +++ b/drivers/cpufreq/intel_pstate.c
> @@ -979,12 +979,10 @@ static int hybrid_get_cost(struct device
> * capacity. Similarly, P-cores start to be populated when
> E-cores are
> * utilized above 60% of the capacity.
> */
> - if (hybrid_get_cpu_type(dev->id) == INTEL_CPU_TYPE_ATOM) {
> - if (hybrid_has_l3(dev->id)) /* E-core */
> - *cost += 1;
> - } else { /* P-core */
> + if (hybrid_get_cpu_type(dev->id) == INTEL_CPU_TYPE_CORE) /*
> P-core */
> *cost += 2;
> - }
> + else if (hybrid_has_l3(dev->id)) /* E-core */
> + *cost += 1;
>
> return 0;
> }
>
>
>