Re: [PATCH] i386/x86-64: Fix timer SMP bootup race

From: Andi Kleen
Date: Sat Jan 15 2005 - 01:46:20 EST


On Fri, Jan 14, 2005 at 10:28:41PM -0800, Andrew Morton wrote:
> Andi Kleen <ak@xxxxxxx> wrote:
> >
> > This fixes a long standing race in 2.6 i386/x86-64 SMP boot.
> > The per CPU timers would only get initialized after an secondary
> > CPU was running. But during initialization the secondary CPU would
> > already enable interrupts to compute the jiffies. When a per
> > CPU timer fired in this window it would run into a BUG in timer.c
> > because the timer heap for that CPU wasn't fully initialized.
>
> Why don't we just not call calibrate_delay() on the secondaries? It
> doesn't seem to do anything. That way we can leave local interrupts
> disabled.

It's used for the "accumulative bogomips". To quote Alan:

/*
* Allow the user to impress friends.
*/

But taking it away doesn't help because the timer startup on the BP
and the secondaries going into the idle loop isn't synchronized.
You could add a synchronization step, but it would be far more
complicated than fixing the ordering like I did.

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/