Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758159AbdLRKsm (ORCPT ); Mon, 18 Dec 2017 05:48:42 -0500 Received: from foss.arm.com ([217.140.101.70]:48300 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750733AbdLRKsl (ORCPT ); Mon, 18 Dec 2017 05:48:41 -0500 Date: Mon, 18 Dec 2017 10:48:35 +0000 From: Patrick Bellasi To: "Rafael J. Wysocki" Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Ingo Molnar , Peter Zijlstra , "Rafael J . Wysocki" , Viresh Kumar , Vincent Guittot , Paul Turner , Dietmar Eggemann , Morten Rasmussen , Juri Lelli , Todd Kjos , Joel Fernandes Subject: Re: [PATCH v2 4/4] sched/cpufreq_schedutil: use util_est for OPP selection Message-ID: <20171218104835.GG19821@e110439-lin> References: <20171205171018.9203-1-patrick.bellasi@arm.com> <20171205171018.9203-5-patrick.bellasi@arm.com> <1730241.78TPuThRce@aspire.rjw.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1730241.78TPuThRce@aspire.rjw.lan> 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: 969 Lines: 39 Hi Rafael, On 16-Dec 03:35, Rafael J. Wysocki wrote: > On Tuesday, December 5, 2017 6:10:18 PM CET Patrick Bellasi wrote: [...] > > diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c > > index 2f52ec0f1539..465430d99440 100644 > > --- a/kernel/sched/cpufreq_schedutil.c > > +++ b/kernel/sched/cpufreq_schedutil.c > > @@ -183,7 +183,11 @@ static void sugov_get_util(unsigned long *util, unsigned long *max, int cpu) > > > > cfs_max = arch_scale_cpu_capacity(NULL, cpu); > > > > - *util = min(rq->cfs.avg.util_avg, cfs_max); > > + *util = rq->cfs.avg.util_avg; > > I would use a local variable here. > > That *util everywhere looks a bit dirtyish. Yes, right... will update for the next respin. > > > + if (sched_feat(UTIL_EST)) > > + *util = max(*util, rq->cfs.util_est_runnable); > > + *util = min(*util, cfs_max); > > + > > *max = cfs_max; > > } > > > > Cheers Patrick -- #include Patrick Bellasi