mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Vincent Guittot <vincent.guittot@linaro.org>
Cc: "Xuewen Yan" <xuewen.yan94@gmail.com>,
	"Dietmar Eggemann" <dietmar.eggemann@arm.com>,
	"Juri Lelli" <juri.lelli@redhat.com>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Ben Segall" <bsegall@google.com>, "Mel Gorman" <mgorman@suse.de>,
	"Daniel Bristot de Oliveira" <bristot@redhat.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	"Patrick Bellasi" <patrick.bellasi@arm.com>,
	"Chunyan Zhang" <zhang.lyra@gmail.com>,
	"王科 (Ke Wang)" <Ke.Wang@unisoc.com>,
	"Ryan Y" <xuewyan@foxmail.com>,
	"Xuewen Yan" <Xuewen.Yan@unisoc.com>
Subject: Re: [PATCH v3] sched/fair: Avoid stale CPU util_est value for schedutil in task dequeue
Date: Fri, 18 Dec 2020 15:35:49 +0100	[thread overview]
Message-ID: <20201218143549.GH3021@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <CAKfTPtC9bfoMeYhhmjQoZyPRYvWLa=4L4qFC_B4vWUMRh8nz4g@mail.gmail.com>

On Fri, Dec 18, 2020 at 02:12:50PM +0100, Vincent Guittot wrote:
> On Fri, 18 Dec 2020 at 10:28, Xuewen Yan <xuewen.yan94@gmail.com> wrote:
> >
> > From: Xuewen Yan <xuewen.yan@unisoc.com>
> >
> > CPU (root cfs_rq) estimated utilization (util_est) is currently used in
> > dequeue_task_fair() to drive frequency selection before it is updated.
> >
> > with:
> >
> > CPU_util        : rq->cfs.avg.util_avg
> > CPU_util_est    : rq->cfs.avg.util_est
> > CPU_utilization : max(CPU_util, CPU_util_est)
> > task_util       : p->se.avg.util_avg
> > task_util_est   : p->se.avg.util_est
> >
> > dequeue_task_fair():
> >
> >     /* (1) CPU_util and task_util update + inform schedutil about
> >            CPU_utilization changes */
> >     for_each_sched_entity() /* 2 loops */
> >         (dequeue_entity() ->) update_load_avg() -> cfs_rq_util_change()
> >          -> cpufreq_update_util() ->...-> sugov_update_[shared\|single]
> >          -> sugov_get_util() -> cpu_util_cfs()
> >
> >     /* (2) CPU_util_est and task_util_est update */
> >     util_est_dequeue()
> >
> > cpu_util_cfs() uses CPU_utilization which could lead to a false (too
> > high) utilization value for schedutil in task ramp-down or ramp-up
> > scenarios during task dequeue.
> >
> > To mitigate the issue split the util_est update (2) into:
> >
> >  (A) CPU_util_est update in util_est_dequeue()
> >  (B) task_util_est update in util_est_update()
> >
> > Place (A) before (1) and keep (B) where (2) is. The latter is necessary
> > since (B) relies on task_util update in (1).
> >
> 
> maybe add a
> Fixes: 7f65ea42eb00 ("sched/fair: Add util_est on top of PELT")
> 
> > Signed-off-by: Xuewen Yan <xuewen.yan@unisoc.com>
> > Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
> 
> Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>

Thanks!

  reply	other threads:[~2020-12-18 14:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-18  9:27 Xuewen Yan
2020-12-18 13:12 ` Vincent Guittot
2020-12-18 14:35   ` Peter Zijlstra [this message]
2021-01-14 11:29 ` [tip: sched/core] " tip-bot2 for 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=20201218143549.GH3021@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=Ke.Wang@unisoc.com \
    --cc=Xuewen.Yan@unisoc.com \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=patrick.bellasi@arm.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

Powered by JetHome