Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1742920

Re: [PATCH v2 2/2] cpufreq: schedutil: consolidate capacity margin calculation

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Joel Fernandes <joelaf@google.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 2/2] cpufreq: schedutil: consolidate capacity margin calculation
Date Mon, 02 Oct 2017 03:10:01 +0200
Message-ID <uvXp7-RI-1@gated-at.bofh.it> (permalink)
References <uvWW6-sI-7@gated-at.bofh.it> <uvWW6-sI-5@gated-at.bofh.it>
X-Original-To Leo Yan <leo.yan@linaro.org>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Av5RBYeb62gnijgMarEctah+f3/6+7jMIBUrb+D/P84=; b=rG+IO/U1J/wPI+IfS5T9FmHFIc3h3xmxS+JlPNLk45OU1PtGlcjfLT/Y1A1/puvRVY 8dmMkmaEzT03Kde+NRl3niBAIIBtDHN4TOw1iWl9EzSTCwR+Yv3xUSWhpKxwVUXyCEY3 py0QY5NzZCpt2TZsd5hveNYjQufExFaWOoMv+ZwaDSwCPVKJg9nH0W1o519FnM1FHI9l Shu5Ej4Uhxr8Tfc8+Z/zpc/JpggGD39hS16M9pXDh4qpOvi9/RsqQPk5JQIlev80s6KI Og+HG4uy83H2Rf1qxjLybSSaZCGJNl1TQhXR3XSOBXwNxeG79clU8HIRUN9MPYYr9pMC LjHA==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Av5RBYeb62gnijgMarEctah+f3/6+7jMIBUrb+D/P84=; b=NrXTma62U/zOwG/S/+mFTzNK2F1mSmJEP49CWItOro2K0j0kPImnpqqnQRHuI551B/ ccPFc8BkJFrFeF0VSVidedcR0ApYk8j4dvF5c8FXLAVAl/4DX5Ec52sBCkkyQ662aUbD vQQpA74wdOlKtTdBv9xJdfxCXfQejkuPqALkLgvbDeIdnQbgIvoAxnGVdEMGPaZnfA4/ vQ1P5t6mBmHPnuXWsXhyOOZnhtao/jMrsU0t6jQ+etV+7VY07IMdMCqlu3mdCxLeIQSq H2k2HiY1T+Cao9erEUsMy13aX6UWayo5pKj78edLn5M9/Bk0Xz4lOd6vO7e0sjlrVp8r eM9w==
X-Gm-Message-State AMCzsaWeZGkuaRLN7T8j2UhdVQ7pujBSr0RSVDsgr1r49G4wLgsMmLk0 W8W1OC4xCfaqfxpc0VgDxmaIAHfUQqVy9i3cqwclCQ==
X-Google-SMTP-Source AOwi7QBJ63T9yOXGGgfaWcSoBGPM5/XDftLe7nXkfpjLHwwGq3P16WONeILcdfTutHJOAEp0wTbRvCTq4M4/M6nK3VA=
X-Received by 10.237.63.199 with SMTP id w7mr16297431qth.18.1506906144779; Sun, 01 Oct 2017 18:02:24 -0700 (PDT)
MIME-Version 1.0
Content-Type text/plain; charset="UTF-8"
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 65
Organization linux.* mail to news gateway
X-Original-Cc Ingo Molnar <mingo@redhat.com>, Peter Zijlstra <peterz@infradead.org>, LKML <linux-kernel@vger.kernel.org>, Dietmar Eggemann <dietmar.eggemann@arm.com>, Morten Rasmussen <morten.rasmussen@arm.com>, Chris Redpath <Chris.Redpath@arm.com>, Vincent Guittot <vincent.guittot@linaro.org>, Patrick Bellasi <patrick.bellasi@arm.com>, "Rafael J . Wysocki" <rafael.j.wysocki@intel.com>
X-Original-Date Sun, 1 Oct 2017 18:02:24 -0700
X-Original-Message-ID <CAJWu+orQyDQah_5DwwSrx26+W5OdR0XgYKBufUwwKkngchRN2A@mail.gmail.com>
X-Original-References <1506904212-15354-1-git-send-email-leo.yan@linaro.org> <1506904212-15354-2-git-send-email-leo.yan@linaro.org>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1742920

Show key headers only | View raw


Hi Leo,

On Sun, Oct 1, 2017 at 5:30 PM, Leo Yan <leo.yan@linaro.org> wrote:
> Scheduler CFS class has variable 'capacity_margin' to calculate the

s/calculate/represent/ ?

> capacity margin, and schedutil governor also needs to compensate the
> same margin for frequency tipping point. Below are formulas used in
> CFS class and schedutil governor separately:
>
> CFS:       U` = U * capacity_margin / 1024 = U * 1.25

You should mention in the commit message, at the moment
capacity_margin is 1280 which makes U` = 1.25.

> Schedutil: U` = U + U >> 2 = U + U * 0.25  = U * 1.25
>
> This patch consolidates the capacity margin calculation so let
> schedutil to use same formula with CFS class. As result this can avoid

As a result.

> the mismatch issue between schedutil and CFS class after change
> 'capacity_margin' to other values.

This didn't make sense to me. May be you meant:

This patch consolidates the usage of the capacity margin value and
lets schedutil use the same formula as the CFS class. Thus we can
avoid the mismatch between schedutil and CFS class if
'capacity_margin' is changed to other values in the future.

> Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
> Cc: Morten Rasmussen <morten.rasmussen@arm.com>
> Cc: Chris Redpath <Chris.Redpath@arm.com>
> Cc: Joel Fernandes <joelaf@google.com>
> Cc: Vincent Guittot <vincent.guittot@linaro.org>
> Cc: Patrick Bellasi <patrick.bellasi@arm.com>
> Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> Signed-off-by: Leo Yan <leo.yan@linaro.org>
> ---
>  kernel/sched/cpufreq_schedutil.c | 6 ++++--
>  kernel/sched/sched.h             | 1 +
>  2 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
> index 9209d83..13cc243 100644
> --- a/kernel/sched/cpufreq_schedutil.c
> +++ b/kernel/sched/cpufreq_schedutil.c
> @@ -155,7 +155,8 @@ static void sugov_update_commit(struct sugov_policy *sg_policy, u64 time,
>   *
>   * next_freq = C * curr_freq * util_raw / max
>   *
> - * Take C = 1.25 for the frequency tipping point at (util / max) = 0.8.
> + * Take C = capacity_margin / 1024 = 1.25, so it's for the frequency tipping
> + * point at (util / max) = 0.8.

The above comment assumes capacity_margin is 1280. If for any reason
the capacity_margin is changed to something else, then the comment
wont make sense anymore.

thanks,

- Joel

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 2/2] cpufreq: schedutil: consolidate capacity margin calculation Leo Yan <leo.yan@linaro.org> - 2017-10-02 02:40 +0200
  Re: [PATCH v2 2/2] cpufreq: schedutil: consolidate capacity margin calculation Joel Fernandes <joelaf@google.com> - 2017-10-02 03:10 +0200
    Re: [PATCH v2 2/2] cpufreq: schedutil: consolidate capacity margin  calculation Leo Yan <leo.yan@linaro.org> - 2017-10-02 13:20 +0200

csiph-web