From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752830AbdLMLep (ORCPT ); Wed, 13 Dec 2017 06:34:45 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:41610 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751853AbdLMLek (ORCPT ); Wed, 13 Dec 2017 06:34:40 -0500 X-Google-Smtp-Source: ACJfBosDuOA7r/aoIUIbjeXkYOYOgcsxDToJkxMBMcmOoV6izO36U1h4SnbFzxbK5yXz0S1f4Cr0TQ== Date: Wed, 13 Dec 2017 12:34:35 +0100 From: Juri Lelli To: Viresh Kumar Cc: Rafael Wysocki , Ingo Molnar , Peter Zijlstra , linux-pm@vger.kernel.org, Vincent Guittot , dietmar.eggemann@arm.com, morten.rasmussen@arm.com, tkjos@android.com, joelaf@google.com, linux-kernel@vger.kernel.org, Patrick Bellasi Subject: Re: [PATCH 4/4] cpufreq: schedutil: Don't call sugov_get_util() unnecessarily Message-ID: <20171213113435.GF30887@localhost.localdomain> References: <7b0698a61bcb959704f58dbabe8c70d657210301.1513158452.git.viresh.kumar@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7b0698a61bcb959704f58dbabe8c70d657210301.1513158452.git.viresh.kumar@linaro.org> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 13/12/17 15:23, Viresh Kumar wrote: > sugov_update_shared() may get called to clear the scheduling class flags > and we would return immediately in that case. Calling sugov_get_util() > in that case isn't going to be of any use then. Move invocation of > sugov_get_util() after the clear flag is checked. > > Signed-off-by: Viresh Kumar > --- > kernel/sched/cpufreq_schedutil.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c > index 7edfdc59ee8f..b69c37c867fe 100644 > --- a/kernel/sched/cpufreq_schedutil.c > +++ b/kernel/sched/cpufreq_schedutil.c > @@ -349,8 +349,6 @@ static void sugov_update_shared(struct update_util_data *hook, u64 time, > unsigned long util, max; > unsigned int next_f; > > - sugov_get_util(&util, &max, sg_cpu->cpu); > - > raw_spin_lock(&sg_policy->update_lock); > > if (unlikely(flags & SCHED_CPUFREQ_CLEAR)) { > @@ -358,6 +356,8 @@ static void sugov_update_shared(struct update_util_data *hook, u64 time, > goto unlock; > } > > + sugov_get_util(&util, &max, sg_cpu->cpu); > + > sg_cpu->util = util; > sg_cpu->max = max; > sg_cpu->flags |= flags; It seems that Patrick already posted basically the same change: https://patchwork.kernel.org/patch/10084669/ Also, Cc-ing him for this.. I just noticed he wasn't Cc-ed to the series. Best, - Juri