LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* wmb() confusion in system.h
@ 2008-03-03 11:49 Pavel Machek
  2008-03-04 12:20 ` Ingo Molnar
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Machek @ 2008-03-03 11:49 UTC (permalink / raw)
  To: kernel list, Ingo Molnar, jikos, jack

Hi!

Comment says wmb is a nop, but it is implemented as lock addl
below... Should it be compiled to nop if we know we are running on
"good" Intel cpu?

At least remove confusing comment for now.

Signed-off-by: Pavel Machek <pavel@suse.cz>

diff --git a/include/asm-x86/system.h b/include/asm-x86/system.h
index 9cff02f..428d947 100644
--- a/include/asm-x86/system.h
+++ b/include/asm-x86/system.h
@@ -296,16 +296,7 @@ void default_idle(void);
  */
 #ifdef CONFIG_X86_32
 /*
- * For now, "wmb()" doesn't actually do anything, as all
- * Intel CPU's follow what Intel calls a *Processor Order*,
- * in which all writes are seen in the program order even
- * outside the CPU.
- *
- * I expect future Intel CPU's to have a weaker ordering,
- * but I'd also expect them to finally get their act together
- * and add some real memory barriers if so.
- *
- * Some non intel clones support out of order store. wmb() ceases to be a
+ * Some non-Intel clones support out of order store. wmb() ceases to be a
  * nop for these.
  */
 #define mb() alternative("lock; addl $0,0(%%esp)", "mfence", X86_FEATURE_XMM2)

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* Re: wmb() confusion in system.h
  2008-03-03 11:49 wmb() confusion in system.h Pavel Machek
@ 2008-03-04 12:20 ` Ingo Molnar
  0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2008-03-04 12:20 UTC (permalink / raw)
  To: Pavel Machek; +Cc: kernel list, jikos, jack


* Pavel Machek <pavel@ucw.cz> wrote:

> Hi!
> 
> Comment says wmb is a nop, but it is implemented as lock addl below... 
> Should it be compiled to nop if we know we are running on "good" Intel 
> cpu?
> 
> At least remove confusing comment for now.

agreed - that comment is pretty much out of date. I've applied your 
patch.

	Ingo

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

end of thread, other threads:[~2008-03-04 12:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-03 11:49 wmb() confusion in system.h Pavel Machek
2008-03-04 12:20 ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).