Index: linux-2.6.19-rc3/include/linux/sched.h =================================================================== --- linux-2.6.19-rc3.orig/include/linux/sched.h 2006-10-26 21:27:42.722619657 -0500 +++ linux-2.6.19-rc3/include/linux/sched.h 2006-10-26 21:27:49.894092872 -0500 @@ -626,6 +626,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) @@ -668,11 +669,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-rc3/kernel/sched.c =================================================================== --- linux-2.6.19-rc3.orig/kernel/sched.c 2006-10-26 21:27:48.009176152 -0500 +++ linux-2.6.19-rc3/kernel/sched.c 2006-10-26 21:27:49.940971630 -0500 @@ -2865,6 +2865,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; if (jiffies >= sd->next_balance) { unsigned long interval; @@ -2888,6 +2891,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-rc3/include/asm-ia64/topology.h =================================================================== --- linux-2.6.19-rc3.orig/include/asm-ia64/topology.h 2006-10-26 21:27:42.624955581 -0500 +++ linux-2.6.19-rc3/include/asm-ia64/topology.h 2006-10-26 21:27:49.957574524 -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-rc3/include/linux/topology.h =================================================================== --- linux-2.6.19-rc3.orig/include/linux/topology.h 2006-10-26 21:27:42.748988958 -0500 +++ linux-2.6.19-rc3/include/linux/topology.h 2006-10-26 21:27:49.966364291 -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, \ }