intel_pstate: Move intel_pstate_calc_busy() into get_target_pstate_use_performance()
authorPhilippe Longepe <philippe.longepe@linux.intel.com>
Sun, 6 Mar 2016 07:34:05 +0000 (08:34 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 10 Mar 2016 23:04:58 +0000 (00:04 +0100)
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>
drivers/cpufreq/intel_pstate.c

index 5b5bfc1c90f15a73256f2bb851440303a440c0b5..95cc21713bb4f2141343359e220b87c5823b4402 100644 (file)
@@ -915,8 +915,6 @@ static inline void intel_pstate_sample(struct cpudata *cpu, u64 time)
        cpu->sample.mperf -= cpu->prev_mperf;
        cpu->sample.tsc -= cpu->prev_tsc;
 
-       intel_pstate_calc_busy(cpu);
-
        cpu->prev_aperf = aperf;
        cpu->prev_mperf = mperf;
        cpu->prev_tsc = tsc;
@@ -945,7 +943,6 @@ static inline int32_t get_target_pstate_use_cpu_load(struct cpudata *cpu)
        mperf = cpu->sample.mperf + delta_iowait_mperf;
        cpu->prev_cummulative_iowait = cummulative_iowait;
 
-
        /*
         * The load can be estimated as the ratio of the mperf counter
         * running at a constant frequency during active periods
@@ -963,6 +960,8 @@ static inline int32_t get_target_pstate_use_performance(struct cpudata *cpu)
        int32_t core_busy, max_pstate, current_pstate, sample_ratio;
        u64 duration_ns;
 
+       intel_pstate_calc_busy(cpu);
+
        /*
         * core_busy is the ratio of actual performance to max
         * max_pstate is the max non turbo pstate available