public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [Question] load balance move tasks not suitable ?
       [not found] <6e782fa5-de1d-93a9-ed11-5b43b65b20c9@huawei.com>
@ 2018-07-30 12:56 ` Peter Zijlstra
  2018-07-30 13:42   ` weiqi (C)
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Zijlstra @ 2018-07-30 12:56 UTC (permalink / raw)
  To: weiqi (C); +Cc: linux-kernel, Zhanghailiang

On Mon, Jul 30, 2018 at 08:08:55PM +0800, weiqi (C) wrote:
> Hi Peter,
> 
> After  Commits 5d6523ebd(sched: Fix load-balance wreckage),

That's a _6_ year old patch... and I can barely remember last week.

> The jugement whether imbalance reached changed from twice to one-half.
> 
> from
> 
> (1) if((load * 2)> rem_load_move)
>         goto next;
> 
> to
> 
> (2) if((load / 2)> env-> load_move)
>         goto next;
> 
> I'm confused about this change.
> 
> "load*2" may be more appropriate, because if a task whose load more than
> env->imbalance is moved from high load cpu to low load cpu,
> 
> will make more imbalance.

It basically goes back to what it was before (see 367456c), in that
patch I (inadvertently) replaced (load.weight >> 1) with (load * 2)
instead of (load / 2).

I'm not entirely sure I can explain that logic at this time. Doing
software archeology on it might clarify where it came from.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Question] load balance move tasks not suitable ?
  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
  0 siblings, 1 reply; 3+ messages in thread
From: weiqi (C) @ 2018-07-30 13:42 UTC (permalink / raw)
  To: Peter Zijlstra; +Cc: linux-kernel, Zhanghailiang

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.
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.

Am I right?


在 2018/7/30 20:56, Peter Zijlstra 写道:
> On Mon, Jul 30, 2018 at 08:08:55PM +0800, weiqi (C) wrote:
>> Hi Peter,
>>
>> After  Commits 5d6523ebd(sched: Fix load-balance wreckage),
> That's a _6_ year old patch... and I can barely remember last week.
>
>> The jugement whether imbalance reached changed from twice to one-half.
>>
>> from
>>
>> (1) if((load * 2)> rem_load_move)
>>          goto next;
>>
>> to
>>
>> (2) if((load / 2)> env-> load_move)
>>          goto next;
>>
>> I'm confused about this change.
>>
>> "load*2" may be more appropriate, because if a task whose load more than
>> env->imbalance is moved from high load cpu to low load cpu,
>>
>> will make more imbalance.
> It basically goes back to what it was before (see 367456c), in that
> patch I (inadvertently) replaced (load.weight >> 1) with (load * 2)
> instead of (load / 2).
>
> I'm not entirely sure I can explain that logic at this time. Doing
> software archeology on it might clarify where it came from.
> .
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Question] load balance move tasks not suitable ?
  2018-07-30 13:42   ` weiqi (C)
@ 2018-07-30 15:59     ` Peter Zijlstra
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Zijlstra @ 2018-07-30 15:59 UTC (permalink / raw)
  To: weiqi (C); +Cc: linux-kernel, Zhanghailiang


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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-30 15:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox