![]() | ||||||||||
Messages in this thread Patch in this message |
On SMP systems the timer list init is done by way of a cpu_notifier call. This has two problems: 1.) Timers are started WAY before the cpu_notifier call chain is executed. In particular the console blanking timer is deleted and inserted every time printk() is called. That this does not fail is only because the kernel has yet to protect location zero. 2.) This notifier is called when a cpu comes up. I suspect that initializing the timer list when a hot swap of a cpu is done is NOT the right thing to do. In any case, if this is a desired action, the list still needs to be initialized prior to its use. The attached patch initializes all the timer lists at init_timers time and does not put code in the notify list. -- George Anzinger george@mvista.com High-res-timers: http://sourceforge.net/projects/high-res-timers/ Preemption patch: http://www.kernel.org/pub/linux/kernel/people/rml--- linux-2.5.52-bk4-org/kernel/timer.c~ Thu Dec 19 12:13:18 2002 +++ linux/kernel/timer.c Fri Dec 20 00:38:15 2002 @@ -1150,7 +1150,7 @@ return 0; } -static void __devinit init_timers_cpu(int cpu) +static void __init init_timers_cpu(int cpu) { int j; tvec_base_t *base; @@ -1167,29 +1167,12 @@ INIT_LIST_HEAD(base->tv1.vec + j); } -static int __devinit timer_cpu_notify(struct notifier_block *self, - unsigned long action, void *hcpu) -{ - long cpu = (long)hcpu; - switch(action) { - case CPU_UP_PREPARE: - init_timers_cpu(cpu); - break; - default: - break; - } - return NOTIFY_OK; -} - -static struct notifier_block __devinitdata timers_nb = { - .notifier_call = timer_cpu_notify, -}; - void __init init_timers(void) { - timer_cpu_notify(&timers_nb, (unsigned long)CPU_UP_PREPARE, - (void *)(long)smp_processor_id()); - register_cpu_notifier(&timers_nb); + int cpu; + for (cpu = 0; cpu < NR_CPUS; cpu++){ + init_timers_cpu(cpu); + } open_softirq(TIMER_SOFTIRQ, run_timer_softirq, NULL); } | |||||||||
| Last update: 2005-03-22 11:31 [from the cache] ©2003-2008 | ||||||||||