From ffaf038ccbccfac643c6a33ba99ade247cb4eb1f Mon Sep 17 00:00:00 2001 From: Salman Qazi Date: Mon, 23 Feb 2009 18:03:04 -0800 Subject: [PATCH] --- yaml --- r: 136903 b: refs/heads/master c: 30d697fa3a25fed809a873b17531a00282dc1234 h: refs/heads/master i: 136901: 26b342baf49422659c94b579fcbfc79484180feb 136899: 1fd9220227bed3cc1a5bb6572e51af012e76aa51 136895: 304161795985d520e40209b05b3c4e12b7ccefa2 v: v3 --- [refs] | 2 +- trunk/arch/x86/include/asm/uaccess_64.h | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index be18ccee88fa..8b3286feecce 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: cb425afd2183e90a481bb211ff49361a117a3ecc +refs/heads/master: 30d697fa3a25fed809a873b17531a00282dc1234 diff --git a/trunk/arch/x86/include/asm/uaccess_64.h b/trunk/arch/x86/include/asm/uaccess_64.h index 84210c479fca..987a2c10fe20 100644 --- a/trunk/arch/x86/include/asm/uaccess_64.h +++ b/trunk/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