Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752703AbcCOVRt (ORCPT ); Tue, 15 Mar 2016 17:17:49 -0400 Received: from casper.infradead.org ([85.118.1.10]:38598 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750701AbcCOVRn (ORCPT ); Tue, 15 Mar 2016 17:17:43 -0400 Date: Tue, 15 Mar 2016 22:17:40 +0100 From: Peter Zijlstra To: Michael Turquette Cc: rjw@rjwysocki.net, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Juri.Lelli@arm.com, steve.muckle@linaro.org, morten.rasmussen@arm.com, dietmar.eggemann@arm.com, vincent.guittot@linaro.org, Michael Turquette Subject: Re: [PATCH 3/8] sched/cpufreq: new cfs capacity margin helpers Message-ID: <20160315211740.GD6344@twins.programming.kicks-ass.net> References: <1457932932-28444-1-git-send-email-mturquette+renesas@baylibre.com> <1457932932-28444-4-git-send-email-mturquette+renesas@baylibre.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1457932932-28444-4-git-send-email-mturquette+renesas@baylibre.com> 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: 1018 Lines: 24 On Sun, Mar 13, 2016 at 10:22:07PM -0700, Michael Turquette wrote: > +/** > + * cpufreq_set_cfs_capacity_margin - Set global cfs enqueue capacity margin > + * @margin: new capacity margin > + * > + * margin is a percentage of capacity that is applied to the current > + * utilization when selecting a new capacity state or cpu frequency. The value > + * should be normalized to the range of [0..SCHED_CAPACITY_SCALE], where > + * SCHED_CAPACITY_SCALE is 100% of the normalized capacity, or equivalent to > + * multiplying the utilization by one. > + * > + * For instance, to add a 25% margin to a utilization, margin should be 1280, > + * which is 1.25x 1024, the default for SCHED_CAPACITY_SCALE. > + */ > +void cpufreq_set_cfs_capacity_margin(unsigned long margin) > +{ > + cfs_capacity_margin = margin; > +} > +EXPORT_SYMBOL_GPL(cpufreq_set_cfs_capacity_margin); I don't like this as an interface; what's wrong with using percentiles as per the discussion I had with Rafael last week? Also, why is this exported?