lkml.org 
[lkml]   [2000]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: spin_lock forgets to clobber memory and other smp fixes [was
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/

\
 
 \ /
  Last update: 2005-03-22 12:38    [from the cache]
©2003-2011 Jasper Spaans