[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200326133055.GA5537@lorien.usersys.redhat.com>
Date: Thu, 26 Mar 2020 09:30:55 -0400
From: Phil Auld <pauld@...hat.com>
To: Aubrey Li <aubrey.li@...el.com>
Cc: vincent.guittot@...aro.org, mingo@...hat.com, peterz@...radead.org,
juri.lelli@...hat.com, dietmar.eggemann@....com,
rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
linux-kernel@...r.kernel.org, tim.c.chen@...ux.intel.com,
vpillai@...italocean.com, joel@...lfernandes.org,
Aubrey Li <aubrey.li@...ux.intel.com>
Subject: Re: [PATCH] sched/fair: Fix negative imbalance in imbalance
calculation
On Thu, Mar 26, 2020 at 01:42:29PM +0800 Aubrey Li wrote:
> A negative imbalance value was observed after imbalance calculation,
> this happens when the local sched group type is group_fully_busy,
> and the average load of local group is greater than the selected
> busiest group. Fix this problem by comparing the average load of the
> local and busiest group before imbalance calculation formula.
>
> Suggested-by: Vincent Guittot <vincent.guittot@...aro.org>
> Signed-off-by: Aubrey Li <aubrey.li@...ux.intel.com>
> Cc: Phil Auld <pauld@...hat.com>
> ---
> kernel/sched/fair.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index c1217bf..4a2ba3f 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -8761,6 +8761,14 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s
>
> sds->avg_load = (sds->total_load * SCHED_CAPACITY_SCALE) /
> sds->total_capacity;
> + /*
> + * If the local group is more loaded than the selected
> + * busiest group don't try to pull any tasks.
> + */
> + if (local->avg_load >= busiest->avg_load) {
> + env->imbalance = 0;
> + return;
> + }
> }
>
> /*
> --
> 2.7.4
>
I like this one better. Thanks!
Reviewed-by: Phil Auld <pauld@...hat.com>
--
Powered by blists - more mailing lists