[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAKfTPtApQOGNLQBEGPF5UTFig2+ZbEoOVfK4GMD6uHXoeJNtzA@mail.gmail.com>
Date: Thu, 19 Mar 2020 09:06:51 +0100
From: Vincent Guittot <vincent.guittot@...aro.org>
To: Tao Zhou <ouwen210@...mail.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>,
Hillf Danton <hdanton@...a.com>, "T. Zhou" <t1zhou@....com>
Subject: Re: [PATCH] sched/fair: fix condition of avg_load calculation
On Thu, 19 Mar 2020 at 04:36, Tao Zhou <ouwen210@...mail.com> wrote:
>
> In update_sg_wakeup_stats(), the comment says:
>
> Computing avg_load makes sense only when group is fully
> busy or overloaded.
>
> But, the code below this comment does not check like this.
>
> From reading the code about avg_load in other functions, I
> confirm that avg_load should be calculated in fully busy or
> overloaded case. The comment is correct and the checking
> condition is wrong. So, change that condition.
>
> Fixes: 57abff067a08 ("sched/fair: Rework find_idlest_group()")
> Signed-off-by: Tao Zhou <ouwen210@...mail.com>
Reviewed-by: Vincent Guittot <vincent.guittot@...aro.org>
Thanks
> ---
> kernel/sched/fair.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 1dea8554ead0..9cae03676b0d 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -8613,7 +8613,8 @@ static inline void update_sg_wakeup_stats(struct sched_domain *sd,
> * Computing avg_load makes sense only when group is fully busy or
> * overloaded
> */
> - if (sgs->group_type < group_fully_busy)
> + if (sgs->group_type == group_fully_busy ||
> + sgs->group_type == group_overloaded)
> sgs->avg_load = (sgs->group_load * SCHED_CAPACITY_SCALE) /
> sgs->group_capacity;
> }
> --
> 2.24.1
Powered by blists - more mailing lists