From patchwork Tue Sep 9 22:12:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashwin Chaugule X-Patchwork-Id: 37158 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f197.google.com (mail-yk0-f197.google.com [209.85.160.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9F0C220566 for ; Tue, 9 Sep 2014 22:13:22 +0000 (UTC) Received: by mail-yk0-f197.google.com with SMTP id 131sf10492695ykp.0 for ; Tue, 09 Sep 2014 15:13:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=q6GdLrXpksWpbWWTwoNKBxwDQDDPSmVQXG0Xh6A+Rzg=; b=XUd+zDJbDHDcpfa4CZfIU9mVx4bkv7JXsIAn8VB7S8+fu4z+qXTKgNmxrT7Na7It6d 4Hb22SOA/tSGqrVBs+KaGnzOl9j84xH//OCPTvyxIM5PeaUSGjDGi4V2Qz62OLw2FIts tJEeLnjIfeKcv3Sh7hY008UvgvxqlsWbEYxqXbgBs0kciTmIXv26XqmQI8moma10tmU1 MGRjZMmu6MdMwz4a35fGtaPy8Wyve4rNqjgRcFSc6qW1c3hEs4OhO/h2ZW3ekN51TT0L uXvQ5PYx4Z5Kk9sL/V2S7dcHS+/OG/+/HMEf768mwnGwAR/zP9B3tmRVRRMCkF7ZYTh6 KAug== X-Gm-Message-State: ALoCoQkSTnSoCr3bii1DB9qQLdu/ZY7mqtcaVe6BNV6Gqk/K81wObhjL6UOeSh2oD+V9/9e2HMhP X-Received: by 10.236.19.52 with SMTP id m40mr23115345yhm.35.1410300802424; Tue, 09 Sep 2014 15:13:22 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.95.50 with SMTP id h47ls2396633qge.43.gmail; Tue, 09 Sep 2014 15:13:22 -0700 (PDT) X-Received: by 10.220.182.1 with SMTP id ca1mr32629804vcb.21.1410300802343; Tue, 09 Sep 2014 15:13:22 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id v9si5713544vcs.20.2014.09.09.15.13.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 09 Sep 2014 15:13:22 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.179 as permitted sender) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id im17so3309839vcb.24 for ; Tue, 09 Sep 2014 15:13:22 -0700 (PDT) X-Received: by 10.52.138.210 with SMTP id qs18mr27638205vdb.18.1410300802261; Tue, 09 Sep 2014 15:13:22 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp349869vcb; Tue, 9 Sep 2014 15:13:21 -0700 (PDT) X-Received: by 10.68.95.196 with SMTP id dm4mr33516415pbb.95.1410300801330; Tue, 09 Sep 2014 15:13:21 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f8si25254786pdp.85.2014.09.09.15.13.20 for ; Tue, 09 Sep 2014 15:13:21 -0700 (PDT) Received-SPF: none (google.com: linux-pm-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752765AbaIIWMm (ORCPT + 15 others); Tue, 9 Sep 2014 18:12:42 -0400 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) X-Received: by 10.66.231.200 with SMTP id ti8mr38199191pac.27.1410300759512; Tue, 09 Sep 2014 15:12:39 -0700 (PDT) Received: from esagroth.qualcomm.com (rrcs-67-52-130-30.west.biz.rr.com. [67.52.130.30]) by mx.google.com with ESMTPSA id gr5sm12524216pbc.33.2014.09.09.15.12.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Sep 2014 15:12:38 -0700 (PDT) From: Ashwin Chaugule 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 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> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1410300728-26637-1-git-send-email-ashwin.chaugule@linaro.org> References: <1410300728-26637-1-git-send-email-ashwin.chaugule@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ashwin.chaugule@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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; };