Skip to content

Commit 6e03708

Browse files
committed
cpufreq: intel_pstate: Avoid SMP calls to get cpu-type
JIRA: https://issues.redhat.com/browse/RHEL-85517 commit b52aaee Author: Pawan Gupta <pawan.kumar.gupta@linux.intel.com> Date: Wed Dec 11 22:57:30 2024 -0800 cpufreq: intel_pstate: Avoid SMP calls to get cpu-type Intel pstate driver relies on SMP calls to get the cpu-type of a given CPU. Remove the SMP calls and instead use the cached value of cpu-type which is more efficient. [ mingo: Forward ported it. ] Suggested-by: Dave Hansen <dave.hansen@linux.intel.com> Signed-off-by: Pawan Gupta <pawan.kumar.gupta@linux.intel.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Dave Hansen <dave.hansen@linux.intel.com> Link: https://lore.kernel.org/r/20241211-add-cpu-type-v5-2-2ae010f50370@linux.intel.com Signed-off-by: David Arcari <darcari@redhat.com>
1 parent 0cb0808 commit 6e03708

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

drivers/cpufreq/intel_pstate.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2206,28 +2206,20 @@ static int knl_get_turbo_pstate(int cpu)
22062206
return ret;
22072207
}
22082208

2209-
static void hybrid_get_type(void *data)
2210-
{
2211-
u8 *cpu_type = data;
2212-
2213-
*cpu_type = get_this_hybrid_cpu_type();
2214-
}
2215-
22162209
static int hwp_get_cpu_scaling(int cpu)
22172210
{
22182211
if (hybrid_scaling_factor) {
2219-
u8 cpu_type = 0;
2220-
2221-
smp_call_function_single(cpu, hybrid_get_type, &cpu_type, 1);
2212+
struct cpuinfo_x86 *c = &cpu_data(smp_processor_id());
2213+
u8 cpu_type = c->topo.intel_type;
22222214

22232215
/*
22242216
* Return the hybrid scaling factor for P-cores and use the
22252217
* default core scaling for E-cores.
22262218
*/
2227-
if (cpu_type == 0x40)
2219+
if (cpu_type == INTEL_CPU_TYPE_CORE)
22282220
return hybrid_scaling_factor;
22292221

2230-
if (cpu_type == 0x20)
2222+
if (cpu_type == INTEL_CPU_TYPE_ATOM)
22312223
return core_get_scaling();
22322224
}
22332225

0 commit comments

Comments
 (0)