|
@@ -1061,6 +1061,12 @@ static inline int32_t get_avg_frequency(struct cpudata *cpu)
|
|
|
cpu->pstate.scaling, cpu->sample.mperf);
|
|
|
}
|
|
|
|
|
|
+static inline int32_t get_avg_pstate(struct cpudata *cpu)
|
|
|
+{
|
|
|
+ return div64_u64(cpu->pstate.max_pstate_physical * cpu->sample.aperf,
|
|
|
+ cpu->sample.mperf);
|
|
|
+}
|
|
|
+
|
|
|
static inline int32_t get_target_pstate_use_cpu_load(struct cpudata *cpu)
|
|
|
{
|
|
|
struct sample *sample = &cpu->sample;
|
|
@@ -1093,7 +1099,7 @@ static inline int32_t get_target_pstate_use_cpu_load(struct cpudata *cpu)
|
|
|
cpu_load = div64_u64(int_tofp(100) * mperf, sample->tsc);
|
|
|
cpu->sample.busy_scaled = cpu_load;
|
|
|
|
|
|
- return cpu->pstate.current_pstate - pid_calc(&cpu->pid, cpu_load);
|
|
|
+ return get_avg_pstate(cpu) - pid_calc(&cpu->pid, cpu_load);
|
|
|
}
|
|
|
|
|
|
static inline int32_t get_target_pstate_use_performance(struct cpudata *cpu)
|