From patchwork Mon Jul 27 12:28:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 51519 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by patches.linaro.org (Postfix) with ESMTPS id 91ACF22918 for ; Mon, 27 Jul 2015 12:29:26 +0000 (UTC) Received: by lbvb1 with SMTP id b1sf27091380lbv.3 for ; Mon, 27 Jul 2015 05:29:25 -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: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=hfpOB5f3b0uPQXm3X3WCFzKBGKbHj5eRuqkyrHLN/3U=; b=JZE4XULBWclml7SITgUFgLPXl0Q5Q4EAaG2UAZfgKo3vplNbSmIKFqz7GrFFGPNzDG nrDLf+Wm+lCrDnMlwZOtf5w0U9tlvm2skyykpHKGQk40DtjVZYYFy/Gmsgjuh0p5HtaZ QhdcOy4UWicJC1zZ1k0tNI8YyxIAcvImRSfGUtZHPvuT7trgRncy1mcs3Fs7/S0Zet6d 5WMD+jjtiHAmzch50gYJlX0LPOyMlGY7OJfUHYNmZT6jFy2a7FE5zoUpwytC9hjkk9GS xb9V9QYwkcx/DDFkCp9ijsLjUqC8qNd/JOEdPipex5pzUOfr23wMHE9P0MzaabRQBPzm GbJg== X-Gm-Message-State: ALoCoQmcfW5J7VfzRs/mn2HNtb+9okXTm2JL/1FtXtKjfyQyb9Vv8UpmwFY351PRaonzv27ozPPL X-Received: by 10.152.120.69 with SMTP id la5mr11975703lab.7.1438000165548; Mon, 27 Jul 2015 05:29:25 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.116 with SMTP id v20ls637171lal.22.gmail; Mon, 27 Jul 2015 05:29:25 -0700 (PDT) X-Received: by 10.112.139.131 with SMTP id qy3mr26644299lbb.4.1438000165306; Mon, 27 Jul 2015 05:29:25 -0700 (PDT) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id v10si15115205lav.62.2015.07.27.05.29.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Jul 2015 05:29:25 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by laah7 with SMTP id h7so47957402laa.0 for ; Mon, 27 Jul 2015 05:29:25 -0700 (PDT) X-Received: by 10.112.120.134 with SMTP id lc6mr26791569lbb.86.1438000165170; Mon, 27 Jul 2015 05:29:25 -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.112.7.198 with SMTP id l6csp1502184lba; Mon, 27 Jul 2015 05:29:24 -0700 (PDT) X-Received: by 10.66.120.201 with SMTP id le9mr67250059pab.142.1438000161113; Mon, 27 Jul 2015 05:29:21 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rf7si28141008pdb.85.2015.07.27.05.29.20; Mon, 27 Jul 2015 05:29:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753565AbbG0M3F (ORCPT + 28 others); Mon, 27 Jul 2015 08:29:05 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:35145 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753532AbbG0M3B (ORCPT ); Mon, 27 Jul 2015 08:29:01 -0400 Received: by pabkd10 with SMTP id kd10so51131003pab.2 for ; Mon, 27 Jul 2015 05:29:01 -0700 (PDT) X-Received: by 10.66.186.138 with SMTP id fk10mr66718298pac.75.1438000141039; Mon, 27 Jul 2015 05:29:01 -0700 (PDT) Received: from localhost ([122.171.186.190]) by smtp.gmail.com with ESMTPSA id ff10sm29438400pab.13.2015.07.27.05.28.59 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 27 Jul 2015 05:29:00 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, preeti.lkml@gmail.com, Viresh Kumar , linux-kernel@vger.kernel.org (open list) Subject: [PATCH V2 7/9] cpufreq: ondemand: update sampling rate immidiately Date: Mon, 27 Jul 2015 17:58:12 +0530 Message-Id: X-Mailer: git-send-email 2.4.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@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.215.44 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: , We are immediately updating sampling rate for already queued-works, only if the new expiry is lesser than the old one. But what about the case, where the user doesn't want frequent events and want to increase sampling time? Shouldn't we cancel the works (and so their interrupts) on all policy->cpus (which might occur very shortly). This patch removes this special case and simplifies code by immediately updating the expiry. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq_ondemand.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index a6f579e40ce2..1a6f84b42441 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c @@ -231,17 +231,8 @@ static unsigned int od_dbs_timer(struct cpu_dbs_info *cdbs, static struct common_dbs_data od_dbs_cdata; /** - * update_sampling_rate - update sampling rate effective immediately if needed. + * update_sampling_rate - update sampling rate immediately. * @new_rate: new sampling rate - * - * If new rate is smaller than the old, simply updating - * dbs_tuners_int.sampling_rate might not be appropriate. For example, if the - * original sampling_rate was 1 second and the requested new sampling rate is 10 - * ms because the user needs immediate reaction from ondemand governor, but not - * sure if higher frequency will be required or not, then, the governor may - * change the sampling rate too late; up to 1 second later. Thus, if we are - * reducing the sampling rate, we need to make the new value effective - * immediately. */ static void update_sampling_rate(struct dbs_data *dbs_data, unsigned int new_rate) @@ -249,7 +240,6 @@ static void update_sampling_rate(struct dbs_data *dbs_data, struct od_dbs_tuners *od_tuners = dbs_data->tuners; struct cpufreq_policy *policy; struct od_cpu_dbs_info_s *dbs_info; - unsigned long next_sampling, appointed_at; struct cpumask cpumask; int cpu; @@ -278,12 +268,6 @@ static void update_sampling_rate(struct dbs_data *dbs_data, if (!dbs_info->cdbs.shared->policy) continue; - next_sampling = jiffies + usecs_to_jiffies(new_rate); - appointed_at = dbs_info->cdbs.dwork.timer.expires; - - if (!time_before(next_sampling, appointed_at)) - continue; - gov_queue_work(dbs_data, policy, usecs_to_jiffies(new_rate), policy->cpus); }