From patchwork Mon Jun 22 08:02:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 50140 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 ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 11AA421594 for ; Mon, 22 Jun 2015 08:03:44 +0000 (UTC) Received: by lbcui10 with SMTP id ui10sf1932625lbc.0 for ; Mon, 22 Jun 2015 01:03:43 -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=MsA+KbWHTt6LSgQV9/Nyer+xCIRruMJu4BQYNVgR6TM=; b=JEJm6PRGYYlFzzZwTUoaTAE0rfbxSKcKId1EyNlgFvFqPfTvdgBHP68OfJfvCFMSc6 KkM74/UTv2wxDnxwkx6ZSZQqbbzFBxSJU6KivWt2Y8WGAmJy/xTEIHFlY9wYgW1mgQHn qJPxI1jbakUm5TtWa9xMTSgR5lF7rrGU2MdkgVSNWt6zbSYaZS70ubOmaUdlj1a9/lBf avZI9j42WGo8VvFAHlKCTPuBrjbtVK7HiyEYiWJ+4R2FPdRAqwd5UqZhK2wCidS5P9tq /7BbNyARvZXYEU96qeQPzFbi2GwlSx0YutykeRMSQzVoH3cxAlWDQcexzeU1fVxQa02K qUsw== X-Gm-Message-State: ALoCoQlHiB0H3KqE5HcBuir3RjXM/uNPdGl8y8qKYSb7Sv68lYUWFlHiA8kWtaKFZ9NEgyDy8/Jt X-Received: by 10.112.189.131 with SMTP id gi3mr26911593lbc.6.1434960223043; Mon, 22 Jun 2015 01:03:43 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.164 with SMTP id az4ls392510lab.16.gmail; Mon, 22 Jun 2015 01:03:42 -0700 (PDT) X-Received: by 10.152.1.4 with SMTP id 4mr28919646lai.25.1434960222886; Mon, 22 Jun 2015 01:03:42 -0700 (PDT) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id qf12si15923114lbc.6.2015.06.22.01.03.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Jun 2015 01:03:42 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by lbbti3 with SMTP id ti3so103604973lbb.1 for ; Mon, 22 Jun 2015 01:03:42 -0700 (PDT) X-Received: by 10.152.42.177 with SMTP id p17mr7449705lal.29.1434960222440; Mon, 22 Jun 2015 01:03:42 -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.108.230 with SMTP id hn6csp2208886lbb; Mon, 22 Jun 2015 01:03:41 -0700 (PDT) X-Received: by 10.70.45.168 with SMTP id o8mr56232158pdm.152.1434960219230; Mon, 22 Jun 2015 01:03:39 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n11si28457864pdl.134.2015.06.22.01.03.38; Mon, 22 Jun 2015 01:03:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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 S1756198AbbFVIDh (ORCPT + 11 others); Mon, 22 Jun 2015 04:03:37 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:34902 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755999AbbFVIDg (ORCPT ); Mon, 22 Jun 2015 04:03:36 -0400 Received: by pacyo7 with SMTP id yo7so25723486pac.2 for ; Mon, 22 Jun 2015 01:03:35 -0700 (PDT) X-Received: by 10.66.154.111 with SMTP id vn15mr55870514pab.108.1434960215616; Mon, 22 Jun 2015 01:03:35 -0700 (PDT) Received: from localhost ([122.167.71.211]) by mx.google.com with ESMTPSA id do16sm18970170pac.15.2015.06.22.01.03.34 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 22 Jun 2015 01:03:35 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Preeti U Murthy Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, Viresh Kumar Subject: [PATCH 08/10] cpufreq: ondemand: update sampling rate immidiately Date: Mon, 22 Jun 2015 13:32:55 +0530 Message-Id: <815b545c726fa214a4bc17db72306e78bf78b615.1434959517.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.4.0 In-Reply-To: References: In-Reply-To: References: 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: 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.217.177 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 cfecd3b67cb3..98ad38a350b2 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; @@ -281,12 +271,6 @@ static void update_sampling_rate(struct dbs_data *dbs_data, if (!delayed_work_pending(&dbs_info->cdbs.dwork)) 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); }