Skip to content

Commit 7349ec0

Browse files
Philippe Longeperafaeljw
authored andcommitted
intel_pstate: Move intel_pstate_calc_busy() into get_target_pstate_use_performance()
The cpu_load algorithm doesn't need to invoke intel_pstate_calc_busy(), so move that call from intel_pstate_sample() to get_target_pstate_use_performance(). Signed-off-by: Philippe Longepe <philippe.longepe@linux.intel.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent a158bed commit 7349ec0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/cpufreq/intel_pstate.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -915,8 +915,6 @@ static inline void intel_pstate_sample(struct cpudata *cpu, u64 time)
915915
cpu->sample.mperf -= cpu->prev_mperf;
916916
cpu->sample.tsc -= cpu->prev_tsc;
917917

918-
intel_pstate_calc_busy(cpu);
919-
920918
cpu->prev_aperf = aperf;
921919
cpu->prev_mperf = mperf;
922920
cpu->prev_tsc = tsc;
@@ -945,7 +943,6 @@ static inline int32_t get_target_pstate_use_cpu_load(struct cpudata *cpu)
945943
mperf = cpu->sample.mperf + delta_iowait_mperf;
946944
cpu->prev_cummulative_iowait = cummulative_iowait;
947945

948-
949946
/*
950947
* The load can be estimated as the ratio of the mperf counter
951948
* running at a constant frequency during active periods
@@ -963,6 +960,8 @@ static inline int32_t get_target_pstate_use_performance(struct cpudata *cpu)
963960
int32_t core_busy, max_pstate, current_pstate, sample_ratio;
964961
u64 duration_ns;
965962

963+
intel_pstate_calc_busy(cpu);
964+
966965
/*
967966
* core_busy is the ratio of actual performance to max
968967
* max_pstate is the max non turbo pstate available

0 commit comments

Comments
 (0)