lkml.org 
[lkml]   [2004]   [Feb]   [6]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] Load balancing problem in 2.6.2-mm1
DateFri, 06 Feb 2004 14:30:08 -0800
FromRick Lindsley <>
    We also shouldn't need load_diff, because if (avg_load <= this_load)
    then imbalance will be zero, so I'll fix that up.
Are we sure imbalance will be zero?  I think we still need that.  We can
turn it into a single C statement if we want to be clever but what you
save in temporary variable we'd better replace in comments to make the
cleverness plain.  We need there to be no "negative" numbers in the
min() statement in case max-avg is non-zero but avg-this is "negative".

Imagine loads of

    cpu0	0
    cpu1	0
    cpu2	3 
    cpu3	2
    cpu4	0

and we're running on cpu3.

    max_load=3
    avg_load=1
    this_load=2

min(max-avg, avg-this) will be min(3-1,1-2) or two, and we'll choose to
try to pull two to cpu3 instead of just leaving it alone which is the
right thing to do.

Rick
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:00    [from the cache]
©2003-2008