mirror of
https://github.com/adulau/aha.git
synced 2024-12-29 12:16:20 +00:00
x86: usercopy: check for total size when deciding non-temporal cutoff
Impact: make more types of copies non-temporal
This change makes the following simple fix:
30d697f
: x86: fix performance regression in write() syscall
A bit more sophisticated: we check the 'total' number of bytes
written to decide whether to copy in a cached or a non-temporal
way.
This will for example cause the tail (modulo 4096 bytes) chunk
of a large write() to be non-temporal too - not just the page-sized
chunks.
Cc: Salman Qazi <sqazi@google.com>
Cc: Nick Piggin <npiggin@suse.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
3255aa2eb6
commit
95108fa34a
1 changed files with 2 additions and 2 deletions
|
@ -198,7 +198,7 @@ static inline int __copy_from_user_nocache(void *dst, const void __user *src,
|
|||
* non-temporal stores here. Smaller writes get handled
|
||||
* via regular __copy_from_user():
|
||||
*/
|
||||
if (likely(size >= PAGE_SIZE))
|
||||
if (likely(total >= PAGE_SIZE))
|
||||
return __copy_user_nocache(dst, src, size, 1);
|
||||
else
|
||||
return __copy_from_user(dst, src, size);
|
||||
|
@ -207,7 +207,7 @@ static inline int __copy_from_user_nocache(void *dst, const void __user *src,
|
|||
static inline int __copy_from_user_inatomic_nocache(void *dst,
|
||||
const void __user *src, unsigned size, unsigned total)
|
||||
{
|
||||
if (likely(size >= PAGE_SIZE))
|
||||
if (likely(total >= PAGE_SIZE))
|
||||
return __copy_user_nocache(dst, src, size, 0);
|
||||
else
|
||||
return __copy_from_user_inatomic(dst, src, size);
|
||||
|
|
Loading…
Reference in a new issue