Re: [patch] possible SMP races all over the place in wait_event interface

David S. Miller (davem@redhat.com)
Tue, 24 Aug 1999 03:43:10 -0700


Date: Tue, 24 Aug 1999 05:56:34 -0400 (EDT)
From: Ingo Molnar <mingo@redhat.com>

instead of:

current->state = TASK_INTERRUPTIBLE;
+ mb();

shouldnt we do:

+ xchgl(&current->state, TASK_INTERRUPTIBLE);

This 'merges' the barrier and the write. Or rather, in asm-i386 we could
do something like:

#define set_mb(addr,val) xchgl(addr,val)

and then use set_barrier().

Sure, but it costs ~8 instructions instead of 2 on ll/sc architectures.

Later,
David S. Miller
davem@redhat.com

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