From mboxrd@z Thu Jan 1 00:00:00 1970 From: Patrick Bellasi Subject: Re: [PATCH v6 09/16] sched/cpufreq: uclamp: Add utilization clamping for RT tasks Date: Wed, 23 Jan 2019 14:33:27 +0000 Message-ID: <20190123143327.whlyx2223xzchbkl@e110439-lin> References: <20190115101513.2822-1-patrick.bellasi@arm.com> <20190115101513.2822-10-patrick.bellasi@arm.com> <20190123102821.GW27931@hirez.programming.kicks-ass.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20190123102821.GW27931@hirez.programming.kicks-ass.net> Sender: linux-kernel-owner@vger.kernel.org To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-api@vger.kernel.org, Ingo Molnar , Tejun Heo , "Rafael J . Wysocki" , Vincent Guittot , Viresh Kumar , Paul Turner , Quentin Perret , Dietmar Eggemann , Morten Rasmussen , Juri Lelli , Todd Kjos , Joel Fernandes , Steve Muckle , Suren Baghdasaryan List-Id: linux-api@vger.kernel.org On 23-Jan 11:28, Peter Zijlstra wrote: > On Tue, Jan 15, 2019 at 10:15:06AM +0000, Patrick Bellasi wrote: > > - util = (type == ENERGY_UTIL) > > - ? util_cfs > > - : uclamp_util(rq, util_cfs); > > - util += cpu_util_rt(rq); > > + util = cpu_util_rt(rq); > > + if (type == FREQUENCY_UTIL) { > > + util += cpu_util_cfs(rq); > > + util = uclamp_util(rq, util); > > + } else { > > + util += util_cfs; > > + } > > Or the combined thing: > > - util = util_cfs; > - util += cpu_util_rt(rq); > + util = cpu_util_rt(rq); > + if (type == FREQUENCY_UTIL) { > + util += cpu_util_cfs(rq); > + util = uclamp_util(rq, util); > + } else { > + util += util_cfs; > + } > > > Leaves me confused. > > When type == FREQ, util_cfs should already be cpu_util_cfs(), per > sugov_get_util(). > > So should that not end up like: > > util = util_cfs; > util += cpu_util_rt(rq); > + if (type == FREQUENCY_UTIL) > + util = uclamp_util(rq, util); > > instead? You right, I get to that core after the patches which integrate compute_energy(). The chuck above was the version before the EM got merged but I missed to backport the change once I rebased on tip/sched/core with the EM in. Sorry for the confusion, will fix in v7. Cheers -- #include Patrick Bellasi