All of lore.kernel.org
 help / color / mirror / Atom feed
* [parisc-linux] missing barrier in _raw_spin_lock?
@ 2004-01-23 15:09 Arnd Bergmann
  2004-01-24 20:52 ` Joel Soete
  0 siblings, 1 reply; 6+ messages in thread
From: Arnd Bergmann @ 2004-01-23 15:09 UTC (permalink / raw)
  To: parisc-linux

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>

static int x;
static spinlock_t lock;

void test(void)
{
        if (x) {
                spin_lock(&lock);
                if (!x)
                        x = 0x1234;
                spin_unlock(&lock);
        }
}

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-01-25  6:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-23 15:09 [parisc-linux] missing barrier in _raw_spin_lock? Arnd Bergmann
2004-01-24 20:52 ` Joel Soete
2004-01-24 21:07   ` Joel Soete
2004-01-24 21:15     ` John David Anglin
2004-01-25  1:37       ` Grant Grundler
2004-01-25  6:13         ` John David Anglin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.