lkml.org 
[lkml]   [2020]   [Dec]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3] sched/fair: Avoid stale CPU util_est value for schedutil in task dequeue
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!

\
 
 \ /
  Last update: 2020-12-18 15:39    [W:0.079 / U:0.604 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site