lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 15 Oct 2020 14:06:42 +0800
From:   Yafang Shao <laoar.shao@...il.com>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     jun qian <qianjun.kernel@...il.com>,
        Ingo Molnar <mingo@...hat.com>, juri.lelli@...hat.com,
        Vincent Guittot <vincent.guittot@...aro.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/1] Sched/fair: Improve the accuracy of sched_stat_wait statistics

On Wed, Oct 14, 2020 at 9:19 PM Peter Zijlstra <peterz@...radead.org> wrote:
>
> On Fri, Oct 09, 2020 at 05:25:30PM +0800, qianjun.kernel@...il.com wrote:
> > From: jun qian <qianjun.kernel@...il.com>
> >
> > When the sched_schedstat changes from 0 to 1, some sched se maybe
> > already in the runqueue, the se->statistics.wait_start will be 0.
> > So it will let the (rq_of(cfs_rq)) - se->statistics.wait_start)
> > wrong. We need to avoid this scenario.
> >
> > Signed-off-by: jun qian <qianjun.kernel@...il.com>
> > Signed-off-by: Yafang Shao <laoar.shao@...il.com>
>
> This SoB chain isn't valid. Did Yafang's tag need to a reviewed-by or
> something?
>

This patch improves the behavior when sched_schedstat is changed from
0 to 1, so it looks good to me.

Reviewed-by: Yafang Shao <laoar.shao@...il.com>

> > ---
> >  kernel/sched/fair.c | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> >
> > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> > index 1a68a05..6f8ca0c 100644
> > --- a/kernel/sched/fair.c
> > +++ b/kernel/sched/fair.c
> > @@ -906,6 +906,15 @@ static void update_curr_fair(struct rq *rq)
> >       if (!schedstat_enabled())
> >               return;
> >
> > +     /*
> > +      * When the sched_schedstat changes from 0 to 1, some sched se
> > +      * maybe already in the runqueue, the se->statistics.wait_start
> > +      * will be 0.So it will let the delta wrong. We need to avoid this
> > +      * scenario.
> > +      */
> > +     if (unlikely(!schedstat_val(se->statistics.wait_start)))
> > +             return;
> > +
> >       delta = rq_clock(rq_of(cfs_rq)) - schedstat_val(se->statistics.wait_start);
> >
> >       if (entity_is_task(se)) {
> > --
> > 1.8.3.1
> >



-- 
Thanks
Yafang

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ