Re: [BUG FIX] Make x86_32 uni-processor Atomic ops, Atomic

From: Michael S. Zick
Date: Fri May 22 2009 - 15:17:29 EST


On Fri May 22 2009, you wrote:
>
> * Michael S. Zick <lkml@xxxxxxxxxxxx> wrote:
>
> > Found in the bit-rot for 32-bit, x86, Uni-processor builds:
> >
> > diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alternative.h
> > index f6aa18e..3c790ef 100644
> > --- a/arch/x86/include/asm/alternative.h
> > +++ b/arch/x86/include/asm/alternative.h
> > @@ -35,7 +35,7 @@
> > "661:\n\tlock; "
> >
> > #else /* ! CONFIG_SMP */
> > -#define LOCK_PREFIX ""
> > +#define LOCK_PREFIX "\n\tlock; "
> > #endif
>
> What is your motivation for this change? At first sight this makes
> the UP kernel a bit larger and a bit smaller. Are you fixing some
> real regression/bug here?
>

Yes - but not easy to test for unless you have hardware that can
generate an interrupt flood for long enough period of time to
catch the atomic ops inbetween the read bus cycle and the write
bus cycle - a very small window.

As luck (good? bad? ugly?) would have it, I have a SDHC card and
machine organization that will trigger a flood from the ehci_hcd driver.
A poor man's test setup.

Even with that bit of luck, it takes from minutes to hours to hit the window.
The single lockdep dump I posted was the result of nearly a month's testing.
It is a _small_ window. ;)

Mike
> Ingo
>
>


--
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/