Hi Andi,

On x86-64 one inefficiency that shows up on profiles is the handling of 
struct page conversion to/from idx and addresses.  This is mostly due to 
the fact that struct page is currently 56 bytes on x86-64, so gcc has to 
emit a slow division or multiplication to convert.  By switching to using 
WANT_PAGE_VIRTUAL in asm/page.h, struct page grows to 64 bytes.  Address 
calculation becomes cheaper because it is a memory load from the already 
hot struct page.  For netperf, this shows up as a ~150 Mbit/s improvement.

FYI, I also tested with the 64 byte page but no WANT_PAGE_VIRTUAL, but it 
wasn't quite as much of an improvement on the P4.

Before:
 87380  16384  16384    10.01      9516.38   92.26    92.26    1.588   1.588 
 87380  16384  16384    10.01      9459.36   70.43    70.43    1.220   1.220 
 87380  16384  16384    10.00      9509.38   67.55    67.55    1.164   1.164 
 87380  16384  16384    10.00      9432.95   68.91    68.91    1.197   1.197 
 87380  16384  16384    10.01      9479.88   69.32    69.32    1.198   1.198 
 87380  16384  16384    10.01      9466.74   70.37    70.37    1.218   1.218 
 87380  16384  16384    10.01      9493.93   69.18    69.18    1.194   1.194 
 87380  16384  16384    10.00      9486.44   71.06    71.06    1.227   1.227 
 87380  16384  16384    10.01      9477.95   70.67    70.67    1.222   1.222 
 87380  16384  16384    10.00      9477.33   70.20    70.20    1.214   1.214 


After:
 87380  16384  16384    10.01      9629.42   92.01    92.01    1.565   1.565
 87380  16384  16384    10.01      9641.69   90.16    90.16    1.532   1.532
 87380  16384  16384    10.01      9650.40   90.16    90.16    1.531   1.531
 87380  16384  16384    10.00      9638.69   90.60    90.60    1.540   1.540
 87380  16384  16384    10.01      9667.15   89.36    89.36    1.514   1.514
 87380  16384  16384    10.01      9684.13   89.86    89.86    1.520   1.520
 87380  16384  16384    10.01      9642.38   90.31    90.31    1.534   1.534
 87380  16384  16384    10.00      9669.24   90.90    90.90    1.540   1.540
 87380  16384  16384    10.00      9676.82   90.25    90.25    1.528   1.528
 87380  16384  16384    10.00      9711.26   90.80    90.80    1.532   1.532

                -ben
-- 
"Time is of no importance, Mr. President, only life is important."
Don't Email: <[EMAIL PROTECTED]>.

Signed-off-by: Benjamin LaHaise <[EMAIL PROTECTED]>
diff --git a/include/asm-x86_64/page.h b/include/asm-x86_64/page.h
index 615e3e4..2c16c62 100644
--- a/include/asm-x86_64/page.h
+++ b/include/asm-x86_64/page.h
@@ -3,6 +3,8 @@
 
 #include <linux/config.h>
 
+#define WANT_PAGE_VIRTUAL      1
+
 /* PAGE_SHIFT determines the page size */
 #define PAGE_SHIFT     12
 #ifdef __ASSEMBLY__

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to