Thread (38 messages) 38 messages, 12 authors, 2012-06-14

Re: [PATCH] powerpc: Optimise the 64bit optimised __clear_user

flat view

From: Olof Johansson <hidden>
Date: 2012-06-04 13:12:35

Hi,

On Mon, Jun 4, 2012 at 12:58 AM, Anton Blanchard [off-list ref] wrote:
I blame Mikey for this. He elevated my slightly dubious testcase:

# dd if=3D/dev/zero of=3D/dev/null bs=3D1M count=3D10000

to benchmark status. And naturally we need to be number 1 at creating
zeros. So lets improve __clear_user some more.

As Paul suggests we can use dcbz for large lengths. This patch gets
the destination 128 byte aligned then uses dcbz on whole cachelines.

Before:
10485760000 bytes (10 GB) copied, 0.414744 s, 25.3 GB/s

After:
10485760000 bytes (10 GB) copied, 0.268597 s, 39.0 GB/s

39 GB/s, a new record.

Signed-off-by: Anton Blanchard <redacted>
---

Index: linux-build/arch/powerpc/lib/string_64.S
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
quoted hunk ↗ jump to hunk
--- linux-build.orig/arch/powerpc/lib/string_64.S =A0 =A0 =A0 2012-06-04 =
16:18:56.351604302 +1000
quoted hunk ↗ jump to hunk
+++ linux-build/arch/powerpc/lib/string_64.S =A0 =A02012-06-04 16:47:10.5=
38500871 +1000
quoted hunk ↗ jump to hunk
@@ -78,7 +78,7 @@ _GLOBAL(__clear_user)
[..]
quoted hunk ↗ jump to hunk
+15:
+err2; =A0dcbz =A0 =A0r0,r3
+ =A0 =A0 =A0 addi =A0 =A0r3,r3,128
+ =A0 =A0 =A0 addi =A0 =A0r4,r4,-128
+ =A0 =A0 =A0 bdnz =A0 =A015b
This breaks architecture spec (and at least one implementation); cache
lines are not guaranteed to be 128 bytes.


-Olof
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help