OpenCloudOS-Kernel/arch/s390/lib
Heiko Carstens f5c8b96010 s390/uaccess: use sane length for __strncpy_from_user()
The average string that is copied from user space to kernel space is
rather short. E.g. booting a system involves about 50.000
strncpy_from_user() calls where the NULL terminated string has an
average size of 27 bytes.

By default our s390 specific strncpy_from_user() implementation
however copies up to 4096 bytes, which is a waste of cpu cycles and
cache lines. Therefore reduce the default length to L1_CACHE_BYTES
(256 bytes), which also reduces the average execution time of
strncpy_from_user() by 30-40%.

Alternatively we could have switched to the generic
strncpy_from_user() implementation, however it turned out that that
variant would be slower than the now optimized s390 variant.

Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2017-05-09 10:43:24 +02:00
..
Makefile s390/xor: optimized xor routing using the XC instruction 2016-02-23 08:56:17 +01:00
delay.c s390: Audit and remove any remaining unnecessary uses of module.h 2017-02-17 07:40:41 +01:00
find.c s390/bitops: remove 31 bit related comments 2015-10-14 14:32:15 +02:00
mem.S s390/lib: improve memmove, memset and memcpy 2017-01-16 07:27:51 +01:00
probes.c s390/uprobes: fix compile for !KPROBES 2017-05-03 09:08:57 +02:00
spinlock.c s390/spinlock: remove compare and delay instruction 2017-04-12 08:43:33 +02:00
string.c s390: Audit and remove any remaining unnecessary uses of module.h 2017-02-17 07:40:41 +01:00
uaccess.c s390/uaccess: use sane length for __strncpy_from_user() 2017-05-09 10:43:24 +02:00
xor.c s390: Audit and remove any remaining unnecessary uses of module.h 2017-02-17 07:40:41 +01:00