lkml.org 
[lkml]   [2006]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 3/5] Use next_balance instead of last_balance
On Thu, 26 Oct 2006, Nick Piggin wrote:

> Actually, it is wrong, so nack.
>
> You didn't take into account that balance_interval may have changed,
> and so might the idle status.

Hmmmm... We change the point at which we calculate the interval relative
to load balancing. So move it after the load balance. This also avoids
having to do the calculation if the sched_domain has not expired.

Want a new rollup/testing cycle for all of this?

Index: linux-2.6.19-rc3/kernel/sched.c
===================================================================
--- linux-2.6.19-rc3.orig/kernel/sched.c 2006-10-26 11:31:04.000000000 -0500
+++ linux-2.6.19-rc3/kernel/sched.c 2006-10-26 11:41:07.129561438 -0500
@@ -2867,15 +2867,6 @@ static void rebalance_domains(unsigned l
if (!(sd->flags & SD_LOAD_BALANCE))
continue;

- interval = sd->balance_interval;
- if (idle != SCHED_IDLE)
- interval *= sd->busy_factor;
-
- /* scale ms to jiffies */
- interval = msecs_to_jiffies(interval);
- if (unlikely(!interval))
- interval = 1;
-
if (jiffies >= sd->next_balance) {
if (load_balance(this_cpu, this_rq, sd, idle)) {
/*
@@ -2885,6 +2876,14 @@ static void rebalance_domains(unsigned l
*/
idle = NOT_IDLE;
}
+ interval = sd->balance_interval;
+ if (idle != SCHED_IDLE)
+ interval *= sd->busy_factor;
+
+ /* scale ms to jiffies */
+ interval = msecs_to_jiffies(interval);
+ if (unlikely(!interval))
+ interval = 1;
sd->next_balance += interval;
}
next_balance = min(next_balance, sd->next_balance);
-
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: 2006-10-26 18:49    [W:0.123 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site