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: <CAKfTPtDTB0EO7_VPcONhtpzi5R=OOxz69dLNEXYKw8f2n70w_w@mail.gmail.com>
Date:   Thu, 16 Jan 2020 08:52:06 +0100
From:   Vincent Guittot <vincent.guittot@...aro.org>
To:     Dietmar Eggemann <dietmar.eggemann@....com>
Cc:     "Rafael J. Wysocki" <rjw@...ysocki.net>,
        viresh kumar <viresh.kumar@...aro.org>,
        Ingo Molnar <mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Juri Lelli <juri.lelli@...hat.com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
        linux-kernel <linux-kernel@...r.kernel.org>,
        "open list:THERMAL" <linux-pm@...r.kernel.org>
Subject: Re: [PATCH] sched/fair: remove redundant call to cpufreq_update_util

On Wed, 15 Jan 2020 at 21:20, Dietmar Eggemann <dietmar.eggemann@....com> wrote:
>
> On 15/01/2020 11:20, Vincent Guittot wrote:
> > With commit bef69dd87828 ("sched/cpufreq: Move the cfs_rq_util_change() call to cpufreq_update_util()")
> > update_load_avg() has become the central point for calling cpufreq (not
> > including the update of blocked load). This change helps to simplify
> > further the number of call to cpufreq_update_util() and to remove last
> > redundant ones. With update_load_avg(), we are now sure that
> > cpufreq_update_util() will be called after every task attachment to a
> > cfs_rq and especially after propagating this event down to the util_avg of
> > the root cfs_rq, which is the level that is used by cpufreq governors like
> > schedutil to set the frequency of a CPU.
> >
> > The SCHED_CPUFREQ_MIGRATION flag forces an early call to cpufreq when the
> > migration happens in a cgroup whereas util_avg of root cfs_rq is not yet
> > updated and this call is duplicated with the one that happens immediately
> > after when the migration event reaches the root cfs_rq. The dedicated flag
> > SCHED_CPUFREQ_MIGRATION is now useless and can be removed. The interface of
> > attach_entity_load_avg() can also be simplified accordingly.
> >
> > Signed-off-by: Vincent Guittot <vincent.guittot@...aro.org>
>
> LGTM. Doesn't this allow to get rid of the 'int flags' in
> cfs_rq_util_change() as well?

I asked myself the same question but decided to keep the same
interface as cpufreq_update_util

>
> 8<---
>
>  kernel/sched/fair.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 328d59e8afba..f82f4fde0cd3 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -3110,7 +3110,7 @@ static inline void update_cfs_group(struct sched_entity *se)
>  }
>  #endif /* CONFIG_FAIR_GROUP_SCHED */
>
> -static inline void cfs_rq_util_change(struct cfs_rq *cfs_rq, int flags)
> +static inline void cfs_rq_util_change(struct cfs_rq *cfs_rq)
>  {
>         struct rq *rq = rq_of(cfs_rq);
>
> @@ -3129,7 +3129,7 @@ static inline void cfs_rq_util_change(struct cfs_rq *cfs_rq, int flags)
>                  *
>                  * See cpu_util().
>                  */
> -               cpufreq_update_util(rq, flags);
> +               cpufreq_update_util(rq, 0);
>         }
>  }
>
> @@ -3556,7 +3556,7 @@ static void attach_entity_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *s
>
>         add_tg_cfs_propagate(cfs_rq, se->avg.load_sum);
>
> -       cfs_rq_util_change(cfs_rq, 0);
> +       cfs_rq_util_change(cfs_rq);
>
>         trace_pelt_cfs_tp(cfs_rq);
>  }
> @@ -3577,7 +3577,7 @@ static void detach_entity_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *s
>
>         add_tg_cfs_propagate(cfs_rq, -se->avg.load_sum);
>
> -       cfs_rq_util_change(cfs_rq, 0);
> +       cfs_rq_util_change(cfs_rq);
>
>         trace_pelt_cfs_tp(cfs_rq);
>  }
> @@ -3618,7 +3618,7 @@ static inline void update_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *s
>                 update_tg_load_avg(cfs_rq, 0);
>
>         } else if (decayed) {
> -               cfs_rq_util_change(cfs_rq, 0);
> +               cfs_rq_util_change(cfs_rq);
>
>                 if (flags & UPDATE_TG)
>                         update_tg_load_avg(cfs_rq, 0);
> @@ -3851,7 +3851,7 @@ static inline void update_misfit_status(struct task_struct *p, struct rq *rq)
>
>  static inline void update_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se, int not_used1)
>  {
> -       cfs_rq_util_change(cfs_rq, 0);
> +       cfs_rq_util_change(cfs_rq);
>  }
>
>  static inline void remove_entity_load_avg(struct sched_entity *se) {}
> --
> 2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ