[parisc-linux] missing barrier in _raw_spin_lock?
Joel Soete
soete.joel at tiscali.be
Sat Jan 24 13:52:22 MST 2004
Arnd Bergmann wrote:
> We stumbled over a problem on s390 that can cause random memory corruption
> under high load on SMP. It turned out to be a missing on :"memory" clobber
> on the _raw_spin_lock primitive.
>
> As far as I can see, the same problem is in the parisc spinlock definition
> in linux-2.6.1, but none of the other architectures.
>
> The code below demonstrates the problem. With the broken spinlock, the
> compiler does not emit code for the second "if" or for the assignment.
> Similar code can be found in mempool_free().
>
> Arnd <><
>
> ----
> #include <linux/spinlock.h>
>
hmm yet another stupid question of mine: what would we have to use _linux_/spinlock.h or _asm_/spinlock.h
Thanks in advance,
Joel
> static int x;
> static spinlock_t lock;
>
> void test(void)
> {
> if (x) {
> spin_lock(&lock);
> if (!x)
> x = 0x1234;
> spin_unlock(&lock);
> }
> }
>
> _______________________________________________
> parisc-linux mailing list
> parisc-linux at lists.parisc-linux.org
> http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
>
More information about the parisc-linux
mailing list