Tasklets are scheduled on the same cpu that triggered the tasklet. They
are just moved to other processors if the processor goes down. So that
aspect is fine. We just need a tasklet struct per cpu.
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 <[email protected]>
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
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]