From: Leo Yan <leo.yan@linaro.org>
To: Joel Fernandes <joelaf@google.com>
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>
Subject: Re: [PATCH v2 2/2] cpufreq: schedutil: consolidate capacity margin calculation
Date: Mon, 2 Oct 2017 19:13:45 +0800 [thread overview]
Message-ID: <20171002111345.GC18885@leoy-ThinkPad-T440> (raw)
In-Reply-To: <CAJWu+orQyDQah_5DwwSrx26+W5OdR0XgYKBufUwwKkngchRN2A@mail.gmail.com>
Hi Joel,
On Sun, Oct 01, 2017 at 06:02:24PM -0700, Joel Fernandes wrote:
> 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.
Yeah, thanks for the suggestion. And accept all upper comment.
Will refine for new patch.
Thanks,
Leo Yan
> > 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
prev parent reply other threads:[~2017-10-02 11:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-02 0:30 [PATCH v2 1/2] sched/fair: make capacity_margin __read_mostly Leo Yan
2017-10-02 0:30 ` [PATCH v2 2/2] cpufreq: schedutil: consolidate capacity margin calculation Leo Yan
2017-10-02 1:02 ` Joel Fernandes
2017-10-02 11:13 ` Leo Yan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171002111345.GC18885@leoy-ThinkPad-T440 \
--to=leo.yan@linaro.org \
--cc=Chris.Redpath@arm.com \
--cc=dietmar.eggemann@arm.com \
--cc=joelaf@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=morten.rasmussen@arm.com \
--cc=patrick.bellasi@arm.com \
--cc=peterz@infradead.org \
--cc=rafael.j.wysocki@intel.com \
--cc=vincent.guittot@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox