Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754744AbcCJKaT (ORCPT ); Thu, 10 Mar 2016 05:30:19 -0500 Received: from casper.infradead.org ([85.118.1.10]:58622 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753618AbcCJKaM (ORCPT ); Thu, 10 Mar 2016 05:30:12 -0500 Date: Thu, 10 Mar 2016 11:30:08 +0100 From: Peter Zijlstra To: Vincent Guittot Cc: Juri Lelli , mturquette , Linux PM list , Ingo Molnar , Srinivas Pandruvada , "Rafael J. Wysocki" , Viresh Kumar , "Rafael J. Wysocki" , Linux Kernel Mailing List , Steve Muckle , ACPI Devel Maling List Subject: Re: [PATCH 6/6] cpufreq: schedutil: New governor based on scheduler utilization data Message-ID: <20160310103008.GU6344@twins.programming.kicks-ass.net> References: <36459679.vzZnOsAVeg@vostro.rjw.lan> <20160308112759.GF6356@twins.programming.kicks-ass.net> <20160308192640.GD6344@twins.programming.kicks-ass.net> <20160309163930.GP6356@twins.programming.kicks-ass.net> <20160310100728.GT6344@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 875 Lines: 24 On Thu, Mar 10, 2016 at 05:23:54PM +0700, Vincent Guittot wrote: > > No, since its a compile time thing, we can simply do: > > > > #ifdef arch_scale_freq_capacity > > next_freq = (1 + 1/n) * max_freq * (util / max) > > #else > > next_freq = (1 + 1/n) * current_freq * (util_raw / max) > > #endif > > selecting formula at compilation is clearly better. I wrongly thought that > it can't be accepted as a solution. Well, its bound to get more 'interesting' since I forse implementations not always actually doing the invariant thing. Take for example the thing I send: lkml.kernel.org/r/20160303162829.GB6375@twins.programming.kicks-ass.net it both shows why you cannot talk about current_freq but also that the above needs a little more help (for the !X86_FEATURE_APERFMPERF case). But the !arch_scale_freq_capacity case should indeed be that simple.