From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ashwin Chaugule Subject: [PATCH 5/6] PID: Rename counters to make them more generic Date: Tue, 9 Sep 2014 18:12:07 -0400 Message-ID: <1410300728-26637-6-git-send-email-ashwin.chaugule@linaro.org> References: <1410300728-26637-1-git-send-email-ashwin.chaugule@linaro.org> Return-path: Received: from mail-pa0-f41.google.com ([209.85.220.41]:45922 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752734AbaIIWMk (ORCPT ); Tue, 9 Sep 2014 18:12:40 -0400 Received: by mail-pa0-f41.google.com with SMTP id bj1so5003132pad.0 for ; Tue, 09 Sep 2014 15:12:39 -0700 (PDT) In-Reply-To: <1410300728-26637-1-git-send-email-ashwin.chaugule@linaro.org> Sender: linux-pm-owner@vger.kernel.org List-Id: linux-pm@vger.kernel.org To: dirk.j.brandewie@intel.com Cc: rjw@rjwysocki.net, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linaro-acpi@lists.linaro.org, Ashwin Chaugule Aperf/Mperf are very X86 specific names but effectively count Delivered and Reference Cpu performance values. Signed-off-by: Ashwin Chaugule --- drivers/cpufreq/intel_pid_ctrl.c | 12 ++++++------ drivers/cpufreq/pid_ctrl.c | 10 +++++----- drivers/cpufreq/pid_ctrl.h | 8 ++++---- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/cpufreq/intel_pid_ctrl.c b/drivers/cpufreq/intel_pid_ctrl.c index 73faaf8..e0b007d 100644 --- a/drivers/cpufreq/intel_pid_ctrl.c +++ b/drivers/cpufreq/intel_pid_ctrl.c @@ -193,14 +193,14 @@ static void intel_get_sample(struct cpudata *cpu) aperf = aperf >> FRAC_BITS; mperf = mperf >> FRAC_BITS; - cpu->sample.aperf = aperf; - cpu->sample.mperf = mperf; + cpu->sample.delivered = aperf; + cpu->sample.reference = mperf; - cpu->sample.aperf -= cpu->prev_aperf; - cpu->sample.mperf -= cpu->prev_mperf; + cpu->sample.delivered -= cpu->prev_delivered; + cpu->sample.reference -= cpu->prev_reference; - cpu->prev_aperf = aperf; - cpu->prev_mperf = mperf; + cpu->prev_delivered = aperf; + cpu->prev_reference = mperf; } static struct cpu_defaults core_params = { diff --git a/drivers/cpufreq/pid_ctrl.c b/drivers/cpufreq/pid_ctrl.c index a011f05..2c197b2 100644 --- a/drivers/cpufreq/pid_ctrl.c +++ b/drivers/cpufreq/pid_ctrl.c @@ -321,10 +321,10 @@ static inline void pid_ctrl_calc_busy(struct cpudata *cpu) int64_t core_pct; int32_t rem; - core_pct = int_tofp(sample->aperf) * int_tofp(100); - core_pct = div_u64_rem(core_pct, int_tofp(sample->mperf), &rem); + core_pct = int_tofp(sample->delivered) * int_tofp(100); + core_pct = div_u64_rem(core_pct, int_tofp(sample->reference), &rem); - if ((rem << 1) >= int_tofp(sample->mperf)) + if ((rem << 1) >= int_tofp(sample->reference)) core_pct += 1; sample->freq = fp_toint( @@ -410,8 +410,8 @@ static void pid_ctrl_timer_func(unsigned long __data) trace_pstate_sample(fp_toint(sample->core_pct_busy), fp_toint(pid_ctrl_get_scaled_busy(cpu)), cpu->pstate.current_pstate, - sample->mperf, - sample->aperf, + sample->reference, + sample->delivered, sample->freq); pid_ctrl_set_sample_time(cpu); diff --git a/drivers/cpufreq/pid_ctrl.h b/drivers/cpufreq/pid_ctrl.h index 7f732e6..65f08bc 100644 --- a/drivers/cpufreq/pid_ctrl.h +++ b/drivers/cpufreq/pid_ctrl.h @@ -24,8 +24,8 @@ struct sample { int32_t core_pct_busy; - u64 aperf; - u64 mperf; + u64 delivered; + u64 reference; int freq; ktime_t time; }; @@ -65,8 +65,8 @@ struct cpudata { struct _pid pid; ktime_t last_sample_time; - u64 prev_aperf; - u64 prev_mperf; + u64 prev_delivered; + u64 prev_reference; struct sample sample; }; -- 1.9.1