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:   Fri, 6 Mar 2020 08:59:06 +0100
From:   Vincent Guittot <vincent.guittot@...aro.org>
To:     Ben Segall <bsegall@...gle.com>
Cc:     Ingo Molnar <mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Juri Lelli <juri.lelli@...hat.com>,
        Dietmar Eggemann <dietmar.eggemann@....com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Mel Gorman <mgorman@...e.de>,
        linux-kernel <linux-kernel@...r.kernel.org>,
        Phil Auld <pauld@...hat.com>, Parth Shah <parth@...ux.ibm.com>,
        Valentin Schneider <valentin.schneider@....com>,
        Hillf Danton <hdanton@...a.com>, Tao Zhou <zhout@...aldi.net>
Subject: Re: [PATCH v2] sched/fair : fix reordering of enqueue_task_fair

On Thu, 5 Mar 2020 at 19:39, <bsegall@...gle.com> wrote:
>
> Vincent Guittot <vincent.guittot@...aro.org> writes:
>
> > Even when a cgroup is throttled, the group se of a child cgroup can still
> > be enqueued and its gse->on_rq stays true. When a task is enqueued on such
> > child, we still have to update the load_avg and increase
> > h_nr_running of the throttled cfs. Nevertheless, the 1st
> > for_each_sched_entity loop is skipped because of gse->on_rq == true and the
> > 2nd loop because the cfs is throttled whereas we have to update both
> > load_avg with the old h_nr_running and increase h_nr_running in such case.
> > Note that the update of load_avg will effectively happen only once in order
> > to sync up to the throttled time. Next call for updating load_avg will stop
> > early because the clock stays unchanged.
> >
> > Fixes: 6d4d22468dae ("sched/fair: Reorder enqueue/dequeue_task_fair path")
> > Signed-off-by: Vincent Guittot <vincent.guittot@...aro.org>
> > ---
> >  kernel/sched/fair.c | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> > index fcc968669aea..5b232d261842 100644
> > --- a/kernel/sched/fair.c
> > +++ b/kernel/sched/fair.c
> > @@ -5431,16 +5431,16 @@ enqueue_task_fair(struct rq *rq, struct task_struct *p, int flags)
> >       for_each_sched_entity(se) {
> >               cfs_rq = cfs_rq_of(se);
> >
> > -             /* end evaluation on encountering a throttled cfs_rq */
> > -             if (cfs_rq_throttled(cfs_rq))
> > -                     goto enqueue_throttle;
> > -
> >               update_load_avg(cfs_rq, se, UPDATE_TG);
> >               se_update_runnable(se);
> >               update_cfs_group(se);
> >
> >               cfs_rq->h_nr_running++;
> >               cfs_rq->idle_h_nr_running += idle_h_nr_running;
> > +
> > +             /* end evaluation on encountering a throttled cfs_rq */
> > +             if (cfs_rq_throttled(cfs_rq))
> > +                     goto enqueue_throttle;
> >       }
> >
> >  enqueue_throttle:
>
>
> I think there's an equivalent issue on dequeue as well, though that's
> much rarer to trigger (but still possible). I think the same fix works
> there too?

I thought it was not needed because we don't have the "if (se->on_rq)
break" in dequeue but :
  /* Avoid re-evaluating load for this entity: */
  se = parent_entity(se);
It creates similar behavior for the parent

I'm going to add it.
Thanks

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ