From: Pierre Gondois <pierre.gondois@arm.com>
To: Xuewen Yan <xuewen.yan94@gmail.com>
Cc: Dietmar Eggemann <Dietmar.Eggemann@arm.com>,
Quentin Perret <qperret@google.com>,
Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Juri Lelli <juri.lelli@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Steven Rostedt <rostedt@goodmis.org>,
Benjamin Segall <bsegall@google.com>,
Mel Gorman <mgorman@suse.de>,
Daniel Bristot de Oliveira <bristot@redhat.com>,
linux-kernel <linux-kernel@vger.kernel.org>,
Chunyan Zhang <zhang.lyra@gmail.com>,
Ryan Y <xuewyan@foxmail.com>
Subject: Re: [PATCH] sched/fair: use signed long when compute energy delta in eas
Date: Mon, 12 Apr 2021 18:14:58 +0100 [thread overview]
Message-ID: <b4631807-9b10-ce11-c206-ba347980f771@arm.com> (raw)
In-Reply-To: <CAB8ipk8RhhBvRq3jUnP2ENfSG_L=LonnVfweymYkQJrZQyA9jQ@mail.gmail.com>
Hi
> > > >
> > > > This patch-set is not significantly improving the execution time of
> > > > feec(). The results we have so far are an improvement of 5-10% in
> > > > execution time, with feec() being executed in < 10us. So the
> gain is not
> > > > spectacular.
> > >
> > > well, I meaned to cache all util value and compute energy with
> caches,
> > > when
> > > (cpu==dst_cpu), use caches instead of updating util, and do not get
> > > util with function:
> > > "effective_cpu_util()", to compute util with cache.
> > > I add more parameters into pd_cache:
> > > struct pd_cache {
> > > unsigned long util;
> > > unsigned long util_est;
> > > unsigned long util_cfs;
> > > unsigned long util_irq;
> > > unsigned long util_rt;
> > > unsigned long util_dl;
> > > unsigned long bw_dl;
> > > unsigned long freq_util;
> > > unsigned long nrg_util;
> > > };
> > > In this way, it can avoid util update while feec. I tested with it,
> > > and the negative delta disappeared.
> > > Maybe this is not a good method, but it does work.
> > If I understand correctly, you put all the fields used by
> > core.c:effective_cpu_util() in the caches, allowing to have values not
> > subject to updates.
> Yes.
> > core.c:effective_cpu_util() isn't only called from
> > fair.c:compute_energy(). It is used in the cpufreq_schedutil.c and
> > cpufreq_cooling.c (through core.c:sched_cpu_util()).
> > Did you have to duplicate core.c:effective_cpu_util() to have a second
> > version using the caches ? If yes, I think the function was meant to be
> > unique so that all the utilization estimations go through the same path.
> >
> I defined a new function to distinguish it from the effective_cpu_util.
>
> > If your concern is to avoid negative delta, I think just bailing out
> > when this happens should be sufficient. As shown in the last message,
> > having a wrong placement should not happen that often, plus the prev_cpu
> > should be used which should be ok.
> In your patch, you didn't actually choose the prev_cpu. you return (-1);
>
> > If you want to cache the values, I think a stronger justification will
> > be asked: this seems to be a big modification compared to the initial
> > issue, knowing that another simpler solution is available (i.e. bailing
> > out). I was not able to prove there was a significant gain in the
> > find_energy_efficient_cpu() execution time, but I would be happy if you
> > can, or if you find other arguments.
> Yes, you are right, perhaps there is indeed no need for such a big
> modification.
>
> Regards
In fair.c:select_task_rq_fair(), if feec() returns a error (< 0), then
prev_cpu is selected. I think it's better to still let feec() signal
that something happened and let select_task_rq_fair() select prev_cpu by
itself.
Are you planning to submit a V2 with the bail out mechanism ?
Regards
next prev parent reply other threads:[~2021-04-12 17:15 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-30 5:21 Xuewen Yan
2021-03-30 9:45 ` Quentin Perret
2021-04-01 18:07 ` Dietmar Eggemann
2021-04-06 10:59 ` Xuewen Yan
2021-04-07 14:11 ` Pierre
2021-04-08 5:41 ` Xuewen Yan
2021-04-08 9:33 ` Pierre
2021-04-09 2:20 ` Xuewen Yan
2021-04-12 10:26 ` Pierre Gondois
2021-04-12 10:52 ` Xuewen Yan
2021-04-12 17:14 ` Pierre Gondois [this message]
2021-04-13 1:50 ` Xuewen Yan
2021-04-13 10:58 ` Pierre Gondois
2021-04-13 11:59 ` Xuewen Yan
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=b4631807-9b10-ce11-c206-ba347980f771@arm.com \
--to=pierre.gondois@arm.com \
--cc=Dietmar.Eggemann@arm.com \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=qperret@google.com \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
--cc=xuewen.yan94@gmail.com \
--cc=xuewyan@foxmail.com \
--cc=zhang.lyra@gmail.com \
/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
all inboxes | Powered by JetHome®