Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756090AbdGLJqi (ORCPT ); Wed, 12 Jul 2017 05:46:38 -0400 Received: from mail-pg0-f47.google.com ([74.125.83.47]:35961 "EHLO mail-pg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755861AbdGLJqg (ORCPT ); Wed, 12 Jul 2017 05:46:36 -0400 Date: Wed, 12 Jul 2017 15:16:23 +0530 From: Viresh Kumar To: Peter Zijlstra Cc: Joel Fernandes , LKML , Patrick Bellasi , Juri Lelli , Andres Oportus , Dietmar Eggemann , Srinivas Pandruvada , Len Brown , "Rafael J . Wysocki" , Ingo Molnar Subject: Re: [PATCH RFC v4] cpufreq: schedutil: Make iowait boost more energy efficient Message-ID: <20170712094623.GE1679@vireshk-i7> References: <20170709170826.29396-1-joelaf@google.com> <20170711101432.GB17115@vireshk-i7> <20170712050035.GH17115@vireshk-i7> <20170712093630.lppm7yaqeiro2276@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170712093630.lppm7yaqeiro2276@hirez.programming.kicks-ass.net> 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: 1769 Lines: 41 On 12-07-17, 11:36, Peter Zijlstra wrote: > On Wed, Jul 12, 2017 at 10:30:35AM +0530, Viresh Kumar wrote: > > On 11-07-17, 07:14, Joel Fernandes wrote: > > > > Another approach than setting min in sugov_set_iowait_boost, is, since > > > we have already retrieved the current util, we can check if flags == > > > SCHED_CPUFREQ_IOWAIT, then set initial the iowait_boost such that > > > (iowait_boost / iowait_boost_max) is aleast equal to (util / max) or > > > iowait_boost_min, which ever is lower. > > > > So my concerns weren't only about the initial min value, but also that you > > reduce the freq from sugov_set_iowait_boost(). We can discuss what the ideal > > value to start with can be. > > I'm not sure I see that. He only mucks with iowait_boost, not the actual > frequency afaict. > > And sugov_iowait_boost() picks the highest of util vs iowait_boost, > which wasn't changed. > > Or am I completely missing something? (that code is a bit hard to > follow) No, I wasn't clear enough. Sorry about that. Lemme try again: Suppose min freq is 500 MHz and Max is 2 GHz. The iowait-boost is set to 1 GHz right now (because of previous events with IOWAIT flag set), and sugov_set_iowait_boost() gets called again with IOWAIT flag, we boost the iowait-boost value to 2 GHz. We are in the rate_limit_us window right now, we return without changing the frequency. If the next call into the schedutil governor happens due to normal util-update, flags will be passed as 0. With the current patch, we will bring iowait-boost back to 1 GHz (before updating the real frequency to 2 GHz) as the prev-iowait-boost boolean would be set. And even if the task is periodically getting queued after IOWAIT, actual boosting may not happen at all in some cases. -- viresh