diff -urNp 2.5.59-topo/kernel/sched.c 2.5.59-topo-succ/kernel/sched.c --- 2.5.59-topo/kernel/sched.c 2003-01-17 03:22:29.000000000 +0100 +++ 2.5.59-topo-succ/kernel/sched.c 2003-01-20 13:06:04.000000000 +0100 @@ -156,7 +156,7 @@ struct runqueue { int prev_nr_running[NR_CPUS]; #ifdef CONFIG_NUMA atomic_t *node_nr_running; - unsigned int nr_balanced; + unsigned int nr_lb_failed; int prev_node_load[MAX_NUMNODES]; #endif task_t *migration_thread; @@ -770,11 +770,11 @@ static inline unsigned long cpus_to_bala int this_node = __cpu_to_node(this_cpu); /* * Avoid rebalancing between nodes too often. - * We rebalance globally once every NODE_BALANCE_RATE load balances. + * We rebalance globally after NODE_BALANCE_RATE failed load balances. */ - if (++(this_rq->nr_balanced) == NODE_BALANCE_RATE) { + if (this_rq->nr_lb_failed == NODE_BALANCE_RATE) { int node = find_busiest_node(this_node); - this_rq->nr_balanced = 0; + this_rq->nr_lb_failed = 0; if (node >= 0) return (__node_to_cpu_mask(node) | (1UL << this_cpu)); } @@ -892,6 +892,10 @@ static inline runqueue_t *find_busiest_q busiest = NULL; } out: +#ifdef CONFIG_NUMA + if (!busiest) + this_rq->nr_lb_failed++; +#endif return busiest; }