User a per cpu tasklet to schedule rebalancing Turns out that tasklets have a flag that only allows one instance to run on all processors. So we need a tasklet structure for each processor. Signed-off-by: Christoph Lameter Index: linux-2.6.19-rc4-mm2/kernel/sched.c =================================================================== --- linux-2.6.19-rc4-mm2.orig/kernel/sched.c 2006-11-06 13:58:38.000000000 -0600 +++ linux-2.6.19-rc4-mm2/kernel/sched.c 2006-11-07 13:05:56.236343144 -0600 @@ -2918,7 +2918,8 @@ static void rebalance_domains(unsigned l this_rq->next_balance = next_balance; } -DECLARE_TASKLET(rebalance, &rebalance_domains, 0L); +static DEFINE_PER_CPU(struct tasklet_struct, rebalance) = + { NULL, 0, ATOMIC_INIT(0), rebalance_domains, 0L }; #else /* * on UP we do not need to balance between CPUs: @@ -3171,7 +3172,7 @@ void scheduler_tick(void) #ifdef CONFIG_SMP update_load(rq); if (time_after_eq(jiffies, rq->next_balance)) - tasklet_schedule(&rebalance); + tasklet_schedule(&__get_cpu_var(rebalance)); #endif }