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: <CAKfTPtAYHqbbVkQdT3A6qgbehZr8Yxa-bFjOXG7oG7eaN=uckA@mail.gmail.com>
Date:   Mon, 6 Jan 2020 14:34:28 +0100
From:   Vincent Guittot <vincent.guittot@...aro.org>
To:     Peng Wang <rocking@...ux.alibaba.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>,
        Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] sched/fair: calculate delta runnable load only when it's needed

On Fri, 3 Jan 2020 at 12:45, Peng Wang <rocking@...ux.alibaba.com> wrote:
>
> Move the code of calculation for delta_sum/delta_avg to where

Maybe precise that you move delta_sum/delta_avg for runnable_load_sum/avg

> it is really needed to be done.
>
> Signed-off-by: Peng Wang <rocking@...ux.alibaba.com>

make sense to me

Reviewed-by: Vincent Guittot <vincent.guittot@...aro.org>

> ---
>  kernel/sched/fair.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index ba749f579714..6b7e6b528e9b 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -3366,16 +3366,17 @@ update_tg_cfs_runnable(struct cfs_rq *cfs_rq, struct sched_entity *se, struct cf
>
>         runnable_load_sum = (s64)se_runnable(se) * runnable_sum;
>         runnable_load_avg = div_s64(runnable_load_sum, LOAD_AVG_MAX);
> -       delta_sum = runnable_load_sum - se_weight(se) * se->avg.runnable_load_sum;
> -       delta_avg = runnable_load_avg - se->avg.runnable_load_avg;
> -
> -       se->avg.runnable_load_sum = runnable_sum;
> -       se->avg.runnable_load_avg = runnable_load_avg;
>
>         if (se->on_rq) {
> +               delta_sum = runnable_load_sum -
> +                               se_weight(se) * se->avg.runnable_load_sum;
> +               delta_avg = runnable_load_avg - se->avg.runnable_load_avg;
>                 add_positive(&cfs_rq->avg.runnable_load_avg, delta_avg);
>                 add_positive(&cfs_rq->avg.runnable_load_sum, delta_sum);
>         }
> +
> +       se->avg.runnable_load_sum = runnable_sum;
> +       se->avg.runnable_load_avg = runnable_load_avg;
>  }
>
>  static inline void add_tg_cfs_propagate(struct cfs_rq *cfs_rq, long runnable_sum)
> --
> 2.24.0
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ