public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: "weiqi (C)" <weiqi4@huawei.com>
Cc: linux-kernel@vger.kernel.org,
	Zhanghailiang <zhang.zhanghailiang@huawei.com>
Subject: Re: [Question] load balance move tasks not suitable ?
Date: Mon, 30 Jul 2018 17:59:33 +0200	[thread overview]
Message-ID: <20180730155933.GK2494@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <8513a5c1-2067-cdf6-285f-3fb422274c05@huawei.com>


A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

On Mon, Jul 30, 2018 at 09:42:27PM +0800, weiqi (C) wrote:
> in latest  linux kernel version,  load-balance's  detach_tasks() keeps
> "load/2"  behavior:
> 
> """
> 
>         if (( load / 2 ) > env->imbalance)
>                 goto next;
> """
> 
> It  means  a task  "p",  which  load  is 1.5 times than "env->imbalance" can
> move from "src_rq" to "dst_rq".
> after this move,  imbalance between  "src_rq"  and "dst_rq" may larger than
> before.

imbalance is how much we should move to get in balance. So if we move 1
imbalance we'll end up being just right. If we move 1.5 we end up
slightly better then before, but imbalanced the other way.

If we move 2 imbalance, we're exactly where we were, just the other way
around.

> but if use "load*2" here,  It means we can pick a task "p" , which load is
> half of "env->imbalance", and after move,
> "src_rq" and "dst_rq"  is balanced.

We might not move anything and not improve even if we could.

      reply	other threads:[~2018-07-30 15:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <6e782fa5-de1d-93a9-ed11-5b43b65b20c9@huawei.com>
2018-07-30 12:56 ` [Question] load balance move tasks not suitable ? Peter Zijlstra
2018-07-30 13:42   ` weiqi (C)
2018-07-30 15:59     ` Peter Zijlstra [this message]

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=20180730155933.GK2494@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=weiqi4@huawei.com \
    --cc=zhang.zhanghailiang@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox