]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/lib: optimise 32 bits __clear_user()
authorChristophe Leroy <christophe.leroy@c-s.fr>
Wed, 30 May 2018 07:06:13 +0000 (07:06 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 3 Jun 2018 14:39:21 +0000 (00:39 +1000)
commit714c3e73bff78dde5eb7bd73951d6ab05abf1fbf
tree87e644ed266162108da765a94bb975443bff3f60
parent6c53f8c33b3134d58c69b1f348c8b5343e3c25c2
powerpc/lib: optimise 32 bits __clear_user()

Rewrite clear_user() on the same principle as memset(0), making use
of dcbz to clear complete cache lines.

This code is a copy/paste of memset(), with some modifications
in order to retrieve remaining number of bytes to be cleared,
as it needs to be returned in case of error.

On the same way as done on PPC64 in commit a3e51f42d9ff2
("powerpc: 64bit optimised __clear_user"), the patch moves
__clear_user() into a dedicated file string_32.S

On a MPC885, throughput is almost doubled:

Before:
~# dd if=/dev/zero of=/dev/null bs=1M count=1000
1048576000 bytes (1000.0MB) copied, 18.990779 seconds, 52.7MB/s

After:
~# dd if=/dev/zero of=/dev/null bs=1M count=1000
1048576000 bytes (1000.0MB) copied, 9.611468 seconds, 104.0MB/s

On a MPC8321, throughput is multiplied by 2.12:

Before:
root@vgoippro:~# dd if=/dev/zero of=/dev/null bs=1M count=1000
1048576000 bytes (1000.0MB) copied, 6.844352 seconds, 146.1MB/s

After:
root@vgoippro:~# dd if=/dev/zero of=/dev/null bs=1M count=1000
1048576000 bytes (1000.0MB) copied, 3.218854 seconds, 310.7MB/s

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/lib/Makefile
arch/powerpc/lib/string.S
arch/powerpc/lib/string_32.S [new file with mode: 0644]