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.

Revert "x86: CPU: Fix up "cpu MHz" in /proc/cpuinfo"

This reverts commit 941f5f0f6ef5338814145cf2b813cf1f98873e2f.

Sadly, it turns out that we really can't just do the cross-CPU IPI to
all CPU's to get their proper frequencies, because it's much too
expensive on systems with lots of cores.

So we'll have to revert this for now, and revisit it using a smarter
model (probably doing one system-wide IPI at open time, and doing all
the frequency calculations in parallel).

Reported-by: WANG Chao <chao.wang@ucloud.cn>
Reported-by: Ingo Molnar <mingo@kernel.org>
Cc: Rafael J Wysocki <rafael.j.wysocki@intel.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

+6 -11
+1 -1
arch/x86/kernel/cpu/Makefile
··· 22 22 obj-y += rdrand.o 23 23 obj-y += match.o 24 24 obj-y += bugs.o 25 - obj-y += aperfmperf.o 25 + obj-$(CONFIG_CPU_FREQ) += aperfmperf.o 26 26 27 27 obj-$(CONFIG_PROC_FS) += proc.o 28 28 obj-$(CONFIG_X86_FEATURE_NAMES) += capflags.o powerflags.o
+4 -7
arch/x86/kernel/cpu/aperfmperf.c
··· 42 42 s64 time_delta = ktime_ms_delta(now, s->time); 43 43 unsigned long flags; 44 44 45 + /* Don't bother re-computing within the cache threshold time. */ 46 + if (time_delta < APERFMPERF_CACHE_THRESHOLD_MS) 47 + return; 48 + 45 49 local_irq_save(flags); 46 50 rdmsrl(MSR_IA32_APERF, aperf); 47 51 rdmsrl(MSR_IA32_MPERF, mperf); ··· 74 70 75 71 unsigned int arch_freq_get_on_cpu(int cpu) 76 72 { 77 - s64 time_delta; 78 73 unsigned int khz; 79 74 80 75 if (!cpu_khz) ··· 81 78 82 79 if (!static_cpu_has(X86_FEATURE_APERFMPERF)) 83 80 return 0; 84 - 85 - /* Don't bother re-computing within the cache threshold time. */ 86 - time_delta = ktime_ms_delta(ktime_get(), per_cpu(samples.time, cpu)); 87 - khz = per_cpu(samples.khz, cpu); 88 - if (khz && time_delta < APERFMPERF_CACHE_THRESHOLD_MS) 89 - return khz; 90 81 91 82 smp_call_function_single(cpu, aperfmperf_snapshot_khz, NULL, 1); 92 83 khz = per_cpu(samples.khz, cpu);
+1 -3
arch/x86/kernel/cpu/proc.c
··· 78 78 seq_printf(m, "microcode\t: 0x%x\n", c->microcode); 79 79 80 80 if (cpu_has(c, X86_FEATURE_TSC)) { 81 - unsigned int freq = arch_freq_get_on_cpu(cpu); 81 + unsigned int freq = cpufreq_quick_get(cpu); 82 82 83 - if (!freq) 84 - freq = cpufreq_quick_get(cpu); 85 83 if (!freq) 86 84 freq = cpu_khz; 87 85 seq_printf(m, "cpu MHz\t\t: %u.%03u\n",