From d9218d2081ec58f6b2d8832cbd02bbdd8542b674 Mon Sep 17 00:00:00 2001 From: Doug Smythies Date: Thu, 12 Jun 2014 15:39:58 -0700 Subject: [PATCH 1/4] intel_pstate: Remove sample time scaling. --- drivers/cpufreq/intel_pstate.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index db2e45b..c1178ba 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -60,7 +60,6 @@ struct sample { u64 aperf; u64 mperf; int freq; - ktime_t time; }; struct pstate_data { @@ -98,7 +97,6 @@ struct cpudata { struct vid_data vid; struct _pid pid; - ktime_t last_sample_time; u64 prev_aperf; u64 prev_mperf; struct sample sample; @@ -588,8 +586,6 @@ static inline void intel_pstate_sample(struct cpudata *cpu) aperf = aperf >> FRAC_BITS; mperf = mperf >> FRAC_BITS; - cpu->last_sample_time = cpu->sample.time; - cpu->sample.time = ktime_get(); cpu->sample.aperf = aperf; cpu->sample.mperf = mperf; cpu->sample.aperf -= cpu->prev_aperf; @@ -612,24 +608,12 @@ static inline void intel_pstate_set_sample_time(struct cpudata *cpu) static inline int32_t intel_pstate_get_scaled_busy(struct cpudata *cpu) { - int32_t core_busy, max_pstate, current_pstate, sample_ratio; - u32 duration_us; - u32 sample_time; + int32_t core_busy, max_pstate, current_pstate; core_busy = cpu->sample.core_pct_busy; max_pstate = int_tofp(cpu->pstate.max_pstate); current_pstate = int_tofp(cpu->pstate.current_pstate); core_busy = mul_fp(core_busy, div_fp(max_pstate, current_pstate)); - - sample_time = (pid_params.sample_rate_ms * USEC_PER_MSEC); - duration_us = (u32) ktime_us_delta(cpu->sample.time, - cpu->last_sample_time); - if (duration_us > sample_time * 3) { - sample_ratio = div_fp(int_tofp(sample_time), - int_tofp(duration_us)); - core_busy = mul_fp(core_busy, sample_ratio); - } - return core_busy; } -- 1.9.1