summaryrefslogtreecommitdiffstats
path: root/arch/s390/include/asm/sysinfo.h
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2017-05-03 09:15:07 +0200
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2017-05-09 10:43:24 +0200
commitf5c8b9601036869e162cb278aaafbf003dc4e5a0 (patch)
tree7e2919e64adf6b4f5b3da7ac77803b52f46ec6e7 /arch/s390/include/asm/sysinfo.h
parentdb55947dd2d09cd3e6f722d1205934fec793ee63 (diff)
downloadlinux-f5c8b9601036869e162cb278aaafbf003dc4e5a0.tar.gz
linux-f5c8b9601036869e162cb278aaafbf003dc4e5a0.tar.bz2
linux-f5c8b9601036869e162cb278aaafbf003dc4e5a0.zip
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>
Diffstat (limited to 'arch/s390/include/asm/sysinfo.h')
0 files changed, 0 insertions, 0 deletions