Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

authored by

Pawan Gupta and committed by
Ingo Molnar
b52aaeea 4a412c70

+4 -12
+4 -12
drivers/cpufreq/intel_pstate.c
··· 2200 2200 return ret; 2201 2201 } 2202 2202 2203 - static void hybrid_get_type(void *data) 2204 - { 2205 - u8 *cpu_type = data; 2206 - 2207 - *cpu_type = get_this_hybrid_cpu_type(); 2208 - } 2209 - 2210 2203 static int hwp_get_cpu_scaling(int cpu) 2211 2204 { 2212 2205 if (hybrid_scaling_factor) { 2213 - u8 cpu_type = 0; 2214 - 2215 - smp_call_function_single(cpu, hybrid_get_type, &cpu_type, 1); 2206 + struct cpuinfo_x86 *c = &cpu_data(smp_processor_id()); 2207 + u8 cpu_type = c->topo.intel_type; 2216 2208 2217 2209 /* 2218 2210 * Return the hybrid scaling factor for P-cores and use the 2219 2211 * default core scaling for E-cores. 2220 2212 */ 2221 - if (cpu_type == 0x40) 2213 + if (cpu_type == INTEL_CPU_TYPE_CORE) 2222 2214 return hybrid_scaling_factor; 2223 2215 2224 - if (cpu_type == 0x20) 2216 + if (cpu_type == INTEL_CPU_TYPE_ATOM) 2225 2217 return core_get_scaling(); 2226 2218 } 2227 2219