Re: [patch] smp-2.3.30-A1, mb(), wmb(), rmb()

Linus Torvalds (torvalds@transmeta.com)
Thu, 25 Nov 1999 09:33:55 -0800 (PST)


Ingo, I think your "mb()" could just be

#define mb() do { \
int __dummy; \
asm volatile("movl %%eax,%0":"=m" (&dummy): :"memory"); \
} while (0)

which instead of using a read-modify-write cycle and a long immediate just
uses a single write-cycle. It makes gcc allocate a word on the stack, and
sometimes that might be unnecessary, but it should be smaller and faster.
You might want to check out code generation..

Linus

-
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/