diff options
author | H. Peter Anvin <hpa@zytor.com> | 2009-02-24 16:11:51 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2009-02-24 16:11:51 -0800 |
commit | 638bee71c83a2837b48062fdc5b222163cf53d79 (patch) | |
tree | 9c1699c07a5aa547d769138317279b8ee1ba89e8 /arch/x86/include/asm/uaccess_64.h | |
parent | 2aaa822984b97efd894d10d1e1382206ef0291a7 (diff) | |
parent | a852cbfaaf8122827602027b1614971cfd832304 (diff) |
Merge branch 'x86/core' into x86/mce2
Diffstat (limited to 'arch/x86/include/asm/uaccess_64.h')
-rw-r--r-- | arch/x86/include/asm/uaccess_64.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/arch/x86/include/asm/uaccess_64.h b/arch/x86/include/asm/uaccess_64.h index 84210c479fc..987a2c10fe2 100644 --- a/arch/x86/include/asm/uaccess_64.h +++ b/arch/x86/include/asm/uaccess_64.h @@ -192,14 +192,26 @@ static inline int __copy_from_user_nocache(void *dst, const void __user *src, unsigned size) { might_sleep(); - return __copy_user_nocache(dst, src, size, 1); + /* + * In practice this limit means that large file write()s + * which get chunked to 4K copies get handled via + * non-temporal stores here. Smaller writes get handled + * via regular __copy_from_user(): + */ + if (likely(size >= PAGE_SIZE)) + return __copy_user_nocache(dst, src, size, 1); + else + return __copy_from_user(dst, src, size); } static inline int __copy_from_user_inatomic_nocache(void *dst, const void __user *src, unsigned size) { - return __copy_user_nocache(dst, src, size, 0); + if (likely(size >= PAGE_SIZE)) + return __copy_user_nocache(dst, src, size, 0); + else + return __copy_from_user_inatomic(dst, src, size); } unsigned long |