提交 8179962b 编写于 作者: R Rafael J. Wysocki

Merge branches 'intel_pstate-fix' and 'cpufreq-x86-fix'

* intel_pstate-fix:
  cpufreq: intel_pstate: report correct CPU frequencies during trace

* cpufreq-x86-fix:
  cpufreq: x86: Disable interrupts during MSRs reading
...@@ -40,13 +40,16 @@ static void aperfmperf_snapshot_khz(void *dummy) ...@@ -40,13 +40,16 @@ static void aperfmperf_snapshot_khz(void *dummy)
struct aperfmperf_sample *s = this_cpu_ptr(&samples); struct aperfmperf_sample *s = this_cpu_ptr(&samples);
ktime_t now = ktime_get(); ktime_t now = ktime_get();
s64 time_delta = ktime_ms_delta(now, s->time); s64 time_delta = ktime_ms_delta(now, s->time);
unsigned long flags;
/* Don't bother re-computing within the cache threshold time. */ /* Don't bother re-computing within the cache threshold time. */
if (time_delta < APERFMPERF_CACHE_THRESHOLD_MS) if (time_delta < APERFMPERF_CACHE_THRESHOLD_MS)
return; return;
local_irq_save(flags);
rdmsrl(MSR_IA32_APERF, aperf); rdmsrl(MSR_IA32_APERF, aperf);
rdmsrl(MSR_IA32_MPERF, mperf); rdmsrl(MSR_IA32_MPERF, mperf);
local_irq_restore(flags);
aperf_delta = aperf - s->aperf; aperf_delta = aperf - s->aperf;
mperf_delta = mperf - s->mperf; mperf_delta = mperf - s->mperf;
......
...@@ -1613,8 +1613,7 @@ static inline bool intel_pstate_sample(struct cpudata *cpu, u64 time) ...@@ -1613,8 +1613,7 @@ static inline bool intel_pstate_sample(struct cpudata *cpu, u64 time)
static inline int32_t get_avg_frequency(struct cpudata *cpu) static inline int32_t get_avg_frequency(struct cpudata *cpu)
{ {
return mul_ext_fp(cpu->sample.core_avg_perf, return mul_ext_fp(cpu->sample.core_avg_perf, cpu_khz);
cpu->pstate.max_pstate_physical * cpu->pstate.scaling);
} }
static inline int32_t get_avg_pstate(struct cpudata *cpu) static inline int32_t get_avg_pstate(struct cpudata *cpu)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册