From patchwork Tue Aug 5 08:09:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sanjay Singh Rawat X-Patchwork-Id: 34891 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f199.google.com (mail-ig0-f199.google.com [209.85.213.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 49B9220062 for ; Tue, 5 Aug 2014 08:09:22 +0000 (UTC) Received: by mail-ig0-f199.google.com with SMTP id l13sf3095838iga.2 for ; Tue, 05 Aug 2014 01:09:21 -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:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=Et2dqhmvZTDJyqETfwcx9qApNMfaNmw1uEtV0YOW9dA=; b=TcNbzxDP2G21rBKuTxgQYqcQUjiKirV+DZV050rYgd/q9rOTL6HBa8wh8jF83BYFDW fEBCauC4tMPuH4rZGoih64dD5etfNQwEWbax/YiFhbpi4voA/dAFX+0Mw8otK/Orwv4V K5k2USpEeuPIJAc41pQYXepNW1TCYJlQnRYP5iWm0zmy5SYLj4BNzkwIDtSUsybrFGm2 JQYrNjbA9d/tCUI5BbclWcUmLnwOpr2U9znyjl8swULnhJWNr4o+ImM3T3TqjhnVybmc atiTBDj0UjD/JDYjSlW8oF+h1hlsmBYxXatI8C2JCHUkqrH16sbMvtRY/IYce71Hih30 yEYg== X-Gm-Message-State: ALoCoQkDwyS/d/JOsR8zb49ZfVy1N898xhKJ4hdZ5miY+3qSmWOJFfP1kMIUH2C1gXDl2eV+lJLI X-Received: by 10.182.142.5 with SMTP id rs5mr1053693obb.15.1407226161856; Tue, 05 Aug 2014 01:09:21 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.25.144 with SMTP id 16ls181475qgt.45.gmail; Tue, 05 Aug 2014 01:09:21 -0700 (PDT) X-Received: by 10.220.190.197 with SMTP id dj5mr1726699vcb.19.1407226161775; Tue, 05 Aug 2014 01:09:21 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id d8si593628vdw.45.2014.08.05.01.09.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 05 Aug 2014 01:09:21 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.173 as permitted sender) client-ip=209.85.220.173; Received: by mail-vc0-f173.google.com with SMTP id hy10so879961vcb.4 for ; Tue, 05 Aug 2014 01:09:21 -0700 (PDT) X-Received: by 10.52.83.227 with SMTP id t3mr1568491vdy.20.1407226161698; Tue, 05 Aug 2014 01:09:21 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp365300vcb; Tue, 5 Aug 2014 01:09:21 -0700 (PDT) X-Received: by 10.68.65.36 with SMTP id u4mr2236514pbs.127.1407226160821; Tue, 05 Aug 2014 01:09:20 -0700 (PDT) Received: from mail-pd0-f172.google.com (mail-pd0-f172.google.com [209.85.192.172]) by mx.google.com with ESMTPS id er15si1043978pad.106.2014.08.05.01.09.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 05 Aug 2014 01:09:20 -0700 (PDT) Received-SPF: pass (google.com: domain of sanjay.rawat@linaro.org designates 209.85.192.172 as permitted sender) client-ip=209.85.192.172; Received: by mail-pd0-f172.google.com with SMTP id ft15so915255pdb.3 for ; Tue, 05 Aug 2014 01:09:20 -0700 (PDT) X-Received: by 10.70.53.42 with SMTP id y10mr2330014pdo.1.1407226160226; Tue, 05 Aug 2014 01:09:20 -0700 (PDT) Received: from ubuntu5e03.LGE.NET ([203.247.149.152]) by mx.google.com with ESMTPSA id qm11sm1675335pdb.85.2014.08.05.01.09.16 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 05 Aug 2014 01:09:19 -0700 (PDT) From: Sanjay Singh Rawat To: linaro-dev@lists.linaro.org Cc: lisa.nguyen@linaro.org, Sanjay Singh Rawat Subject: [PATCH PMQA] cpufreq: consider sampling rate to calculate scaling time Date: Tue, 5 Aug 2014 13:39:06 +0530 Message-Id: <1407226146-10533-1-git-send-email-sanjay.rawat@linaro.org> X-Mailer: git-send-email 1.8.3.2 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: sanjay.rawat@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.173 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , - add the governor sampling rate with the frequency transition latency to make sure tansition happens. - bug 77 Signed-off-by: Sanjay Singh Rawat --- include/functions.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/include/functions.sh b/include/functions.sh index 417c725..5823a81 100644 --- a/include/functions.sh +++ b/include/functions.sh @@ -123,6 +123,17 @@ wait_latency() { local dirpath=$CPU_PATH/$cpu/cpufreq local latency= local nrfreq= + local sampling_rate= + local sleep_time= + local gov=$(cat $dirpath/scaling_governor) + + # consider per-policy governor case + if [ -e $CPU_PATH/$cpu/cpufreq/$gov ]; then + sampling_rate=$(cat $CPU_PATH/$cpu/cpufreq/$gov/sampling_rate) + else + sampling_rate=$(cat $CPU_PATH/cpufreq/$gov/sampling_rate) + fi + sampling_rate=$((sampling_rate * 1000)) # unit nsec latency=$(cat $dirpath/cpuinfo_transition_latency) if [ $? -ne 0 ]; then @@ -135,7 +146,10 @@ wait_latency() { fi nrfreq=$((nrfreq + 1)) - ../utils/nanosleep $(($nrfreq * $latency)) + + sleep_time=$(($latency + $sampling_rate)) + + ../utils/nanosleep $(($nrfreq * $sleep_time)) } frequnit() {