From patchwork Thu Mar 2 15:45:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Bellasi X-Patchwork-Id: 94784 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp346098obz; Thu, 2 Mar 2017 07:48:34 -0800 (PST) X-Received: by 10.99.2.139 with SMTP id 133mr8302858pgc.168.1488469714595; Thu, 02 Mar 2017 07:48:34 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x63si7759384pfb.142.2017.03.02.07.48.34; Thu, 02 Mar 2017 07:48:34 -0800 (PST) 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; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753436AbdCBPsW (ORCPT + 13 others); Thu, 2 Mar 2017 10:48:22 -0500 Received: from foss.arm.com ([217.140.101.70]:32986 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753003AbdCBPql (ORCPT ); Thu, 2 Mar 2017 10:46:41 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E792614FF; Thu, 2 Mar 2017 07:45:39 -0800 (PST) Received: from e110439-lin.cambridge.arm.com (e110439-lin.cambridge.arm.com [10.1.210.68]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 0623D3F220; Thu, 2 Mar 2017 07:45:36 -0800 (PST) From: Patrick Bellasi To: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: Patrick Bellasi , Viresh Kumar , Steven Rostedt , Vincent Guittot , John Stultz , Juri Lelli , Todd Kjos , Tim Murray , Andres Oportus , Joel Fernandes , Morten Rasmussen , Dietmar Eggemann , Chris Redpath , Ingo Molnar , Peter Zijlstra , "Rafael J . Wysocki" Subject: [PATCH 5/6] cpufreq: schedutil: avoid utilisation update when not necessary Date: Thu, 2 Mar 2017 15:45:06 +0000 Message-Id: <1488469507-32463-6-git-send-email-patrick.bellasi@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488469507-32463-1-git-send-email-patrick.bellasi@arm.com> References: <1488469507-32463-1-git-send-email-patrick.bellasi@arm.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Under certain conditions (i.e. CPU entering idle and current task being the sugov thread) we can skip a frequency update. Thus, let's postpone the collection of the FAIR utilisation when really needed. Signed-off-by: Patrick Bellasi Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Rafael J. Wysocki Cc: Viresh Kumar Cc: linux-kernel@vger.kernel.org Cc: linux-pm@vger.kernel.org --- kernel/sched/cpufreq_schedutil.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.7.4 diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c index 44bff37..c8ed645 100644 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c @@ -296,8 +296,6 @@ static void sugov_update_shared(struct update_util_data *hook, u64 time, unsigned int next_f; bool rt_mode; - sugov_get_util(&util, &max); - raw_spin_lock(&sg_policy->update_lock); /* CPU is entering IDLE, reset flags without triggering an update */ @@ -323,6 +321,7 @@ static void sugov_update_shared(struct update_util_data *hook, u64 time, else sg_cpu->flags = flags; + sugov_get_util(&util, &max); sg_cpu->util = util; sg_cpu->max = max;