All of lore.kernel.org
 help / color / mirror / Atom feed
From: Phil Auld <pauld@redhat.com>
To: Aubrey Li <aubrey.li@intel.com>
Cc: vincent.guittot@linaro.org, mingo@redhat.com,
	peterz@infradead.org, juri.lelli@redhat.com,
	dietmar.eggemann@arm.com, rostedt@goodmis.org,
	bsegall@google.com, mgorman@suse.de,
	linux-kernel@vger.kernel.org, tim.c.chen@linux.intel.com,
	vpillai@digitalocean.com, joel@joelfernandes.org,
	Aubrey Li <aubrey.li@linux.intel.com>
Subject: Re: [PATCH] sched/fair: Fix negative imbalance in imbalance calculation
Date: Thu, 26 Mar 2020 09:30:55 -0400	[thread overview]
Message-ID: <20200326133055.GA5537@lorien.usersys.redhat.com> (raw)
In-Reply-To: <1585201349-70192-1-git-send-email-aubrey.li@intel.com>

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@linaro.org>
> Signed-off-by: Aubrey Li <aubrey.li@linux.intel.com>
> Cc: Phil Auld <pauld@redhat.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@redhat.com>

-- 


  reply	other threads:[~2020-03-26 13:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-26  5:42 [PATCH] sched/fair: Fix negative imbalance in imbalance calculation Aubrey Li
2020-03-26 13:30 ` Phil Auld [this message]
2020-03-26 16:03 ` Vincent Guittot
2020-03-30 10:38   ` Peter Zijlstra
2020-03-27 11:48 ` Mel Gorman
2020-04-08 12:20 ` [tip: sched/urgent] " tip-bot2 for Aubrey Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200326133055.GA5537@lorien.usersys.redhat.com \
    --to=pauld@redhat.com \
    --cc=aubrey.li@intel.com \
    --cc=aubrey.li@linux.intel.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=joel@joelfernandes.org \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tim.c.chen@linux.intel.com \
    --cc=vincent.guittot@linaro.org \
    --cc=vpillai@digitalocean.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.