[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <27018603c7ed574451520aeeae405f7b1fcd6c4e.camel@linux.intel.com>
Date: Mon, 17 Jun 2024 02:27:02 -0700
From: srinivas pandruvada <srinivas.pandruvada@...ux.intel.com>
To: Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>, Thomas Gleixner
<tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>, Borislav Petkov
<bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org
Cc: daniel.sneddon@...ux.intel.com, tony.luck@...el.com,
linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
linux-perf-users@...r.kernel.org, Josh Poimboeuf <jpoimboe@...nel.org>,
"Rafael J. Wysocki" <rafael@...nel.org>, Ricardo Neri
<ricardo.neri-calderon@...ux.intel.com>, "Liang, Kan"
<kan.liang@...ux.intel.com>, Andrew Cooper <andrew.cooper3@...rix.com>
Subject: Re: [PATCH PATCH 2/9] cpufreq: intel_pstate: Use
topology_cpu_type() to get cpu-type
On Mon, 2024-06-17 at 02:11 -0700, Pawan Gupta wrote:
> Intel pstate driver uses hybrid_get_type() to get the cpu-type of a
> given
> CPU. It uses smp_call_function_single() which is sub-optimal and can
> be
> avoided as cpu-type is also available in the per-cpu topology
> structure.
>
> Use topology_cpu_type() to get the cpu-type.
>
> Signed-off-by: Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>
> ---
> drivers/cpufreq/intel_pstate.c | 14 +++-----------
> 1 file changed, 3 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/cpufreq/intel_pstate.c
> b/drivers/cpufreq/intel_pstate.c
> index 65d3f79104bd..40f5e5b0b45e 100644
> --- a/drivers/cpufreq/intel_pstate.c
> +++ b/drivers/cpufreq/intel_pstate.c
> @@ -1951,24 +1951,16 @@ static int knl_get_turbo_pstate(int cpu)
> return ret;
> }
>
> -static void hybrid_get_type(void *data)
> -{
> - u8 *cpu_type = data;
> -
> - *cpu_type = get_this_hybrid_cpu_type();
> -}
> -
> static int hwp_get_cpu_scaling(int cpu)
> {
> - u8 cpu_type = 0;
> + u8 cpu_type = topology_cpu_type(cpu);
>
> - smp_call_function_single(cpu, hybrid_get_type, &cpu_type,
> 1);
> /* P-cores have a smaller perf level-to-freqency scaling
> factor. */
> - if (cpu_type == 0x40)
> + if (cpu_type == X86_CPU_TYPE_INTEL_CORE)
> return hybrid_scaling_factor;
>
> /* Use default core scaling for E-cores */
> - if (cpu_type == 0x20)
> + if (cpu_type == X86_CPU_TYPE_INTEL_ATOM)
> return core_get_scaling();
>
> /*
>
Powered by blists - more mailing lists