Index: linux-2.6.19-rc2-mm2/include/linux/sched.h =================================================================== --- linux-2.6.19-rc2-mm2.orig/include/linux/sched.h 2006-10-24 17:37:19.666526595 -0500 +++ linux-2.6.19-rc2-mm2/include/linux/sched.h 2006-10-24 22:01:34.323887292 -0500 @@ -648,6 +648,7 @@ enum idle_type #define SD_SHARE_CPUPOWER 128 /* Domain members share cpu power */ #define SD_POWERSAVINGS_BALANCE 256 /* Balance for power savings */ #define SD_SHARE_PKG_RESOURCES 512 /* Domain members share cpu pkg resources */ +#define SD_PER_NODE 1024 /* Domain is per node not per execution context */ #define BALANCE_FOR_MC_POWER \ (sched_smt_power_savings ? SD_POWERSAVINGS_BALANCE : 0) @@ -690,11 +691,12 @@ struct sched_domain { unsigned int wake_idx; unsigned int forkexec_idx; int flags; /* See SD_* */ + unsigned int balance_interval; /* initialise to 1. units in ms. */ /* Runtime fields. */ unsigned long next_balance; /* init to jiffies. units in jiffies */ - unsigned int balance_interval; /* initialise to 1. units in ms. */ unsigned int nr_balance_failed; /* initialise to 0 */ + spinlock_t balancing; /* Lock for SD_PER_NODE sched domains */ #ifdef CONFIG_SCHEDSTATS /* load_balance() stats */ Index: linux-2.6.19-rc2-mm2/kernel/sched.c =================================================================== --- linux-2.6.19-rc2-mm2.orig/kernel/sched.c 2006-10-24 17:37:19.694850230 -0500 +++ linux-2.6.19-rc2-mm2/kernel/sched.c 2006-10-24 22:01:49.590095860 -0500 @@ -2867,6 +2867,9 @@ static void rebalance_domains(unsigned l for_each_domain(this_cpu, sd) { if (!(sd->flags & SD_LOAD_BALANCE)) continue; + if ((sd->flags & SD_PER_NODE) && + !spin_trylock(&sd->balancing)) + continue; interval = sd->balance_interval; if (idle != SCHED_IDLE) @@ -2889,6 +2892,8 @@ static void rebalance_domains(unsigned l sd->next_balance += interval; } next_balance = min(next_balance, sd->next_balance); + if (sd->flags & SD_PER_NODE) + spin_unlock(&sd->balancing); } __get_cpu_var(next_balance) = next_balance; } Index: linux-2.6.19-rc2-mm2/include/asm-ia64/topology.h =================================================================== --- linux-2.6.19-rc2-mm2.orig/include/asm-ia64/topology.h 2006-10-24 17:37:19.684106783 -0500 +++ linux-2.6.19-rc2-mm2/include/asm-ia64/topology.h 2006-10-24 17:38:12.399201213 -0500 @@ -101,6 +101,7 @@ void build_cpu_to_node_map(void); | SD_BALANCE_EXEC \ | SD_BALANCE_FORK \ | SD_WAKE_BALANCE, \ + | SD_PER_NODE \ .balance_interval = 64, \ .nr_balance_failed = 0, \ } Index: linux-2.6.19-rc2-mm2/include/linux/topology.h =================================================================== --- linux-2.6.19-rc2-mm2.orig/include/linux/topology.h 2006-10-24 17:37:48.062414064 -0500 +++ linux-2.6.19-rc2-mm2/include/linux/topology.h 2006-10-24 17:38:12.406037933 -0500 @@ -191,7 +191,8 @@ .wake_idx = 0, /* unused */ \ .forkexec_idx = 0, /* unused */ \ .per_cpu_gain = 100, \ - .flags = SD_LOAD_BALANCE, \ + .flags = SD_LOAD_BALANCE \ + | SD_PER_NODE, \ .balance_interval = 64, \ .nr_balance_failed = 0, \ }