Re: spin_lock forgets to clobber memory and other smp fixes [was

From: Jamie Lokier (lk@tantalophile.demon.co.uk)
Date: Fri Sep 08 2000 - 05:05:06 EST


kuznet@ms2.inr.ac.ru wrote:
> > Well, now GCC does CSE across "asm" and will eliminate memory loads,
> > even though it may not move them! I suspect it always did CSE across
> > "asm" and we just never got hit by the bug.
>
> dummy_lock trick is equivalent to "memory" clobber.

For GCC 2.7.2 yes. For current compilers with -fstrict-aliasing, no:
the dummy_lock type doesn't alias with some other memory accesses.

Longer term the compiler may well take into account the array size.

Of course we still need the dummy_lock trick anyway.

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



This archive was generated by hypermail 2b29 : Fri Sep 15 2000 - 21:00:10 EST