From: Nick Piggin <npiggin@suse.de>
To: linuxppc-dev@ozlabs.org
Cc: Paul Mackerras <paulus@samba.org>
Subject: [patch 1/2] powerpc: smp_wmb speedup
Date: Tue, 21 Aug 2007 04:16:52 +0200 [thread overview]
Message-ID: <20070821021652.GC2909@wotan.suse.de> (raw)
In-Reply-To: <20070821021143.GB2909@wotan.suse.de>
This one is perhaps not as straightforward. I'm pretty limited in the types
of powerpc machines I can test with, so I don't actually know whether this
is the right thing to do on power5/6 etc. I can supply the simple test program
I used if anybody is interested.
---
On my dual G5, lwsync is over 5 times faster than eieio when used in a simple
test case (that actually makes real use of lwsync to provide write ordering).
This is not surprising, as it avoids the IO access synchronisation of eieio,
and still permits the important relaxation of executing loads before stores.
The on sub-architectures where lwsync is unavailable, eieio is retained, as
it should be faster than the alternative full sync (eieio is a proper subset
of sync).
Signed-off-by: Nick Piggin <npiggin@suse.de>
Index: linux-2.6/include/asm-powerpc/system.h
===================================================================
--- linux-2.6.orig/include/asm-powerpc/system.h
+++ linux-2.6/include/asm-powerpc/system.h
@@ -43,7 +43,11 @@
#ifdef CONFIG_SMP
#define smp_mb() mb()
#define smp_rmb() __asm__ __volatile__ (__stringify(LWSYNC) : : : "memory")
+#ifdef __SUBARCH_HAS_LWSYNC
+#define smp_wmb() __asm__ __volatile__ (__stringify(LWSYNC) : : : "memory")
+#else
#define smp_wmb() eieio()
+#endif
#define smp_read_barrier_depends() read_barrier_depends()
#else
#define smp_mb() barrier()
next prev parent reply other threads:[~2007-08-21 2:16 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-21 2:11 [patch 1/2] powerpc: rmb fix Nick Piggin
2007-08-21 2:16 ` Nick Piggin [this message]
2007-08-21 2:21 ` [patch 1/2] powerpc: smp_wmb speedup Nick Piggin
2007-08-21 19:07 ` [patch 1/2] powerpc: rmb fix Joel Schopp
2007-08-21 19:43 ` Segher Boessenkool
2007-08-21 21:42 ` Linas Vepstas
2007-08-22 1:16 ` Nick Piggin
2007-08-22 3:29 ` Segher Boessenkool
2007-08-22 3:55 ` Nick Piggin
2007-08-23 17:57 ` Segher Boessenkool
2007-08-24 2:47 ` Nick Piggin
2007-08-22 3:15 ` Nick Piggin
2007-08-22 3:33 ` Segher Boessenkool
2007-08-22 4:05 ` Nick Piggin
2007-08-23 17:49 ` Segher Boessenkool
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070821021652.GC2909@wotan.suse.de \
--to=npiggin@suse.de \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).