
From: Andrew Theurer <habanero@us.ibm.com>

Allow idle_balance to search an incresingly larger span of cpus to find a
cpu.  Minor change, NODE_SD_INIT gets SD_BALANCE_NEWIDLE flag.  This is
critical for x86_64, where there is only one cpu oer node.  In the current
code, idle_balance for Opteron -never- works.

Signed-off-by: <habanero@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/include/asm-i386/topology.h   |    1 +
 25-akpm/include/asm-ia64/topology.h   |    1 +
 25-akpm/include/asm-ppc64/topology.h  |    1 +
 25-akpm/include/asm-x86_64/topology.h |    1 +
 4 files changed, 4 insertions(+)

diff -puN include/asm-i386/topology.h~sched-newidle-fix include/asm-i386/topology.h
--- 25/include/asm-i386/topology.h~sched-newidle-fix	Wed Oct 27 15:20:30 2004
+++ 25-akpm/include/asm-i386/topology.h	Wed Oct 27 15:20:30 2004
@@ -83,6 +83,7 @@ static inline cpumask_t pcibus_to_cpumas
 	.per_cpu_gain		= 100,			\
 	.flags			= SD_LOAD_BALANCE	\
 				| SD_BALANCE_EXEC	\
+				| SD_BALANCE_NEWIDLE	\
 				| SD_WAKE_IDLE		\
 				| SD_WAKE_BALANCE,	\
 	.last_balance		= jiffies,		\
diff -puN include/asm-ia64/topology.h~sched-newidle-fix include/asm-ia64/topology.h
--- 25/include/asm-ia64/topology.h~sched-newidle-fix	Wed Oct 27 15:20:30 2004
+++ 25-akpm/include/asm-ia64/topology.h	Wed Oct 27 15:20:30 2004
@@ -56,6 +56,7 @@ void build_cpu_to_node_map(void);
 	.per_cpu_gain		= 100,			\
 	.flags			= SD_LOAD_BALANCE	\
 				| SD_BALANCE_EXEC	\
+				| SD_BALANCE_NEWIDLE	\
 				| SD_WAKE_IDLE		\
 				| SD_WAKE_BALANCE,	\
 	.last_balance		= jiffies,		\
diff -puN include/asm-ppc64/topology.h~sched-newidle-fix include/asm-ppc64/topology.h
--- 25/include/asm-ppc64/topology.h~sched-newidle-fix	Wed Oct 27 15:20:30 2004
+++ 25-akpm/include/asm-ppc64/topology.h	Wed Oct 27 15:20:30 2004
@@ -51,6 +51,7 @@ static inline int node_to_first_cpu(int 
 	.per_cpu_gain		= 100,			\
 	.flags			= SD_LOAD_BALANCE	\
 				| SD_BALANCE_EXEC	\
+				| SD_BALANCE_NEWIDLE	\
 				| SD_WAKE_IDLE		\
 				| SD_WAKE_BALANCE,	\
 	.last_balance		= jiffies,		\
diff -puN include/asm-x86_64/topology.h~sched-newidle-fix include/asm-x86_64/topology.h
--- 25/include/asm-x86_64/topology.h~sched-newidle-fix	Wed Oct 27 15:20:30 2004
+++ 25-akpm/include/asm-x86_64/topology.h	Wed Oct 27 15:20:30 2004
@@ -46,6 +46,7 @@ static inline cpumask_t __pcibus_to_cpum
 	.cache_nice_tries	= 1,			\
 	.per_cpu_gain		= 100,			\
 	.flags			= SD_LOAD_BALANCE	\
+				| SD_BALANCE_NEWIDLE	\
 				| SD_BALANCE_EXEC	\
 				| SD_WAKE_IDLE		\
 				| SD_WAKE_BALANCE,	\
_
