tree cbae574e94c81cfc8ebf98c484c81758983f6676
parent 39e9d6dec5ddfd1c8cb5bac312ee4eea5d34d004
author Olof Johansson <[EMAIL PROTECTED]> Tue Apr 12 08:25:12 2005
committer Linus Torvalds <[EMAIL PROTECTED]> Tue Apr 12 08:25:12 2005
[PATCH] ppc64: no prefetch for NULL pointers
For prefetches of NULL (as when walking a short linked list), PPC64 will in
some cases take a performance hit. The hardware needs to do the TLB walk,
and said walk will always miss, which means (up to) two L2 misses as
penalty. This seems to hurt overall performance, so for NULL pointers skip
the prefetch alltogether.
Signed-off-by: Olof Johansson <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
processor.h | 6 ++++++
1 files changed, 6 insertions(+)
Index: include/asm-ppc64/processor.h
===================================================================
--- 5db3e7934507218698e81b2b22bed18e19fec262/include/asm-ppc64/processor.h
(mode:100644 sha1:1ac5d77d4cb615235a577aa6602fd43b832cb83e)
+++ cbae574e94c81cfc8ebf98c484c81758983f6676/include/asm-ppc64/processor.h
(mode:100644 sha1:a039d597f417b13ac11b1451163047d609129acc)
@@ -642,11 +642,17 @@
static inline void prefetch(const void *x)
{
+ if (unlikely(!x))
+ return;
+
__asm__ __volatile__ ("dcbt 0,%0" : : "r" (x));
}
static inline void prefetchw(const void *x)
{
+ if (unlikely(!x))
+ return;
+
__asm__ __volatile__ ("dcbtst 0,%0" : : "r" (x));
}
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html