summaryrefslogtreecommitdiff
path: root/arch/x86/kernel/cpu/proc.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2022-04-15 21:20:04 +0200
committerThomas Gleixner <tglx@linutronix.de>2022-04-27 20:22:19 +0200
commitf3eca381bd49d708073ba1a9af4fa6ea5d5810a6 (patch)
treef5ab8f6ff5babeaa6edb0b6f9dd74d41fe21fa33 /arch/x86/kernel/cpu/proc.c
parent7d84c1ebf9ddafca27b481e6da7d24a023dacaa2 (diff)
x86/aperfmperf: Replace arch_freq_get_on_cpu()
Reading the current CPU frequency from /sys/..../scaling_cur_freq involves in the worst case two IPIs due to the ad hoc sampling. The frequency invariance infrastructure provides the APERF/MPERF samples already. Utilize them and consolidate this with the /proc/cpuinfo readout. The sample is considered valid for 20ms. So for idle or isolated NOHZ full CPUs the function returns 0, which is matching the previous behaviour. The resulting text size vs. the original APERF/MPERF plus the separate frequency invariance code: text: 2411 -> 723 init.text: 0 -> 767 Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Paul E. McKenney <paulmck@kernel.org> Link: https://lore.kernel.org/r/20220415161206.934040006@linutronix.de
Diffstat (limited to 'arch/x86/kernel/cpu/proc.c')
-rw-r--r--arch/x86/kernel/cpu/proc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c
index 4eec8889b0ff..0a0ee55830c7 100644
--- a/arch/x86/kernel/cpu/proc.c
+++ b/arch/x86/kernel/cpu/proc.c
@@ -84,7 +84,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
seq_printf(m, "microcode\t: 0x%x\n", c->microcode);
if (cpu_has(c, X86_FEATURE_TSC)) {
- unsigned int freq = aperfmperf_get_khz(cpu);
+ unsigned int freq = arch_freq_get_on_cpu(cpu);
if (!freq)
freq = cpufreq_quick_get(cpu);