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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKfTPtBRsZcmZ-=QXWhkL55NsONi=GAxOeu3zPkTvwfnHZsLUw@mail.gmail.com>
Date:   Fri, 31 Aug 2018 17:10:21 +0200
From:   Vincent Guittot <vincent.guittot@...aro.org>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     Ingo Molnar <mingo@...hat.com>,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] sched/pelt: fix update_blocked_averages() for dl and rt

On Fri, 31 Aug 2018 at 17:07, Peter Zijlstra <peterz@...radead.org> wrote:
>
> On Fri, Aug 31, 2018 at 04:56:19PM +0200, Vincent Guittot wrote:
> > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> > index 309c93f..bc1de21 100644
> > --- a/kernel/sched/fair.c
> > +++ b/kernel/sched/fair.c
> > @@ -7262,6 +7262,7 @@ static void update_blocked_averages(int cpu)
> >  {
> >       struct rq *rq = cpu_rq(cpu);
> >       struct cfs_rq *cfs_rq, *pos;
> > +     const struct sched_class *curr_class = rq->curr->sched_class;
> >       struct rq_flags rf;
> >       bool done = true;
>
> Can you do me a v3 where you move that rq->curr dereference under the
> rq->lock?

Yes.
sorry for all these versions
>
> I _think_ it is actually OK, but it is really dodgy. Moving it under
> rq->lock makes it obvious correct.
>
> > @@ -7298,8 +7299,8 @@ static void update_blocked_averages(int cpu)
> >               if (cfs_rq_has_blocked(cfs_rq))
> >                       done = false;
> >       }
> > -     update_rt_rq_load_avg(rq_clock_task(rq), rq, 0);
> > -     update_dl_rq_load_avg(rq_clock_task(rq), rq, 0);
> > +     update_rt_rq_load_avg(rq_clock_task(rq), rq, curr_class == &rt_sched_class);
> > +     update_dl_rq_load_avg(rq_clock_task(rq), rq, curr_class == &dl_sched_class);
> >       update_irq_load_avg(rq, 0);
> >       /* Don't need periodic decay once load/util_avg are null */
> >       if (others_have_blocked(rq))

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ