powerpc: POWER7 optimised copy_page using VMX and enhanced prefetch
authorAnton Blanchard <anton@samba.org>
Tue, 29 May 2012 19:33:12 +0000 (19:33 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 3 Jul 2012 04:14:44 +0000 (14:14 +1000)
commitfde69282b7ba2701560764b81ebb756deb98cf2b
treee350f7d55f90885e9ea9ee26dcb020f0fbcbaa4e
parent6f7839e542ee18770288be75114bd2e6771e1421
powerpc: POWER7 optimised copy_page using VMX and enhanced prefetch

Implement a POWER7 optimised copy_page using VMX and enhanced
prefetch instructions. We use enhanced prefetch hints to prefetch
both the load and store side. We copy a cacheline at a time and
fall back to regular loads and stores if we are unable to use VMX
(eg we are in an interrupt).

The following microbenchmark was used to assess the impact of
the patch:

http://ozlabs.org/~anton/junkcode/page_fault_file.c

We test MAP_PRIVATE page faults across a 1GB file, 100 times:

# time ./page_fault_file -p -l 1G -i 100

Before: 22.25s
After:  18.89s

17% faster

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/lib/Makefile
arch/powerpc/lib/copypage_64.S
arch/powerpc/lib/copypage_power7.S [new file with mode: 0644]
arch/powerpc/lib/vmx-helper.c