From: Nick Piggin <piggin@cyberone.com.au>

Having open coded the sched domain setup twice for NUMA and non-NUMA
made a few silly differences creep in. Add SD_SIBLING_INIT and use that.



---

 25-akpm/arch/i386/kernel/smpboot.c |   18 ++----------------
 25-akpm/include/linux/sched.h      |   16 ++++++++++++++++
 2 files changed, 18 insertions(+), 16 deletions(-)

diff -puN arch/i386/kernel/smpboot.c~sched-domain-tweak arch/i386/kernel/smpboot.c
--- 25/arch/i386/kernel/smpboot.c~sched-domain-tweak	Wed Feb 11 18:35:30 2004
+++ 25-akpm/arch/i386/kernel/smpboot.c	Wed Feb 11 18:35:30 2004
@@ -1152,15 +1152,8 @@ __init void arch_init_sched_domains(void
 		int node = cpu_to_node(i);
 		cpumask_t nodemask = node_to_cpumask(node);
 
-		/* TODO: change me to SD_SIBLING_INIT */
-		*cpu_domain = SD_CPU_INIT;
+		*cpu_domain = SD_SIBLING_INIT;
 		cpu_domain->span = cpu_sibling_map[i];
-		cpu_domain->flags |= SD_FLAG_WAKE;
-		cpu_domain->cache_hot_time = 0;
-		cpu_domain->cache_nice_tries = 0;
-		cpu_domain->max_interval = 2;
-		cpu_domain->busy_factor = 8;
-		cpu_domain->imbalance_pct = 110;
 
 		*phys_domain = SD_CPU_INIT;
 		phys_domain->span = nodemask;
@@ -1280,15 +1273,8 @@ __init void arch_init_sched_domains(void
 		struct sched_domain *cpu_domain = cpu_sched_domain(i);
 		struct sched_domain *phys_domain = &per_cpu(phys_domains, i);
 
-		/* TODO: change me to SD_SIBLING_INIT */
-		*cpu_domain = SD_CPU_INIT;
+		*cpu_domain = SD_SIBLING_INIT;
 		cpu_domain->span = cpu_sibling_map[i];
-		cpu_domain->flags |= SD_FLAG_WAKE;
-		cpu_domain->cache_hot_time = 100000;
-		cpu_domain->cache_nice_tries = 0;
-		cpu_domain->max_interval = (HZ/500 ?: 1),
-		cpu_domain->busy_factor = 8;
-		cpu_domain->imbalance_pct = 110;
 
 		*phys_domain = SD_CPU_INIT;
 		phys_domain->span = all_cpus;
diff -puN include/linux/sched.h~sched-domain-tweak include/linux/sched.h
--- 25/include/linux/sched.h~sched-domain-tweak	Wed Feb 11 18:35:30 2004
+++ 25-akpm/include/linux/sched.h	Wed Feb 11 18:35:30 2004
@@ -532,6 +532,22 @@ struct sched_domain {
 	unsigned int nr_balance_failed; /* initialise to 0 */
 };
 
+/* Common values for SMT siblings */
+#define SD_SIBLING_INIT (struct sched_domain) {		\
+	.span			= CPU_MASK_NONE,	\
+	.parent			= NULL,			\
+	.groups			= NULL,			\
+	.min_interval		= 1,			\
+	.max_interval		= 2,			\
+	.busy_factor		= 8,			\
+	.imbalance_pct		= 110,			\
+	.cache_hot_time		= 0,			\
+	.cache_nice_tries	= 0,			\
+	.flags			= SD_FLAG_FASTMIGRATE | SD_FLAG_NEWIDLE | SD_FLAG_WAKE,\
+	.balance_interval	= 1,			\
+	.nr_balance_failed	= 0,			\
+}
+
 /* Common values for CPUs */
 #define SD_CPU_INIT (struct sched_domain) {		\
 	.span			= CPU_MASK_NONE,	\

_