Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751413AbdGRLZz (ORCPT ); Tue, 18 Jul 2017 07:25:55 -0400 Received: from mail-pf0-f172.google.com ([209.85.192.172]:36296 "EHLO mail-pf0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751322AbdGRLZy (ORCPT ); Tue, 18 Jul 2017 07:25:54 -0400 Date: Tue, 18 Jul 2017 16:55:50 +0530 From: Viresh Kumar To: Juri Lelli Cc: Rafael Wysocki , Ingo Molnar , Peter Zijlstra , linux-pm@vger.kernel.org, Vincent Guittot , joelaf@google.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] cpufreq: schedutil: Update last_update from sugov_set_iowait_boost() Message-ID: <20170718112550.GZ352@vireshk-i7> References: <4927469221fa6b2ea7efffb2da923dac930ab313.1500353473.git.viresh.kumar@linaro.org> <20170718112025.iujrikdrf2sechtp@e106622-lin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170718112025.iujrikdrf2sechtp@e106622-lin> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1871 Lines: 54 On 18-07-17, 12:20, Juri Lelli wrote: > Hi Viresh, > > On 18/07/17 10:24, Viresh Kumar wrote: > > sg_cpu->last_update is always updated right after we call > > sugov_set_iowait_boost() and its better to update it from that routine > > itself. This makes it more readable. > > > > 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 29a397067ffa..63557b9f36b6 100644 > > --- a/kernel/sched/cpufreq_schedutil.c > > +++ b/kernel/sched/cpufreq_schedutil.c > > @@ -177,6 +177,8 @@ static void sugov_set_iowait_boost(struct sugov_cpu *sg_cpu, u64 time, > > if (delta_ns > TICK_NSEC) > > sg_cpu->iowait_boost = 0; > > } > > + > > + sg_cpu->last_update = time; > > } > > > > static void sugov_iowait_boost(struct sugov_cpu *sg_cpu, unsigned long *util, > > @@ -219,7 +221,6 @@ static void sugov_update_single(struct update_util_data *hook, u64 time, > > bool busy; > > > > sugov_set_iowait_boost(sg_cpu, time, flags); > > - sg_cpu->last_update = time; > > > > if (!sugov_should_update_freq(sg_policy, time)) > > return; > > @@ -299,7 +300,6 @@ static void sugov_update_shared(struct update_util_data *hook, u64 time, > > sg_cpu->flags = flags; > > > > sugov_set_iowait_boost(sg_cpu, time, flags); > > - sg_cpu->last_update = time; > > It actually belongs here, IMHO. We update other fields (util, max, > flags) Yeah, because they have bigger roles and aren't specific to iowait boost. > before looking at iowait. Why hiding the time update into a > function dealing with only one of such fields? But last_update is very much specific to iowait_boost only and so it should be updated from sugov_set_iowait_boost() IMHO. -- viresh