Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=674b892ede247ef4fb8d00918f02e29c32b9bbaf
Commit:     674b892ede247ef4fb8d00918f02e29c32b9bbaf
Parent:     8268f5a7415d914fc855a86aa2284ac819dc6b2e
Author:     Nick Piggin <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 16 01:25:03 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue Oct 16 09:42:55 2007 -0700

    mm: restore KERNEL_DS optimisations
    
    Restore the KERNEL_DS optimisation, especially helpful to the 2copy write
    path.
    
    This may be a pretty questionable gain in most cases, especially after the
    legacy 2copy write path is removed, but it doesn't cost much.
    
    Signed-off-by: Nick Piggin <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 mm/filemap.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/mm/filemap.c b/mm/filemap.c
index ec25ba1..ca04226 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -2061,7 +2061,7 @@ static ssize_t generic_perform_write_2copy(struct file 
*file,
                 * cannot take a pagefault with the destination page locked.
                 * So pin the source page to copy it.
                 */
-               if (!PageUptodate(page)) {
+               if (!PageUptodate(page) && !segment_eq(get_fs(), KERNEL_DS)) {
                        unlock_page(page);
 
                        src_page = alloc_page(GFP_KERNEL);
@@ -2186,6 +2186,13 @@ static ssize_t generic_perform_write(struct file *file,
        const struct address_space_operations *a_ops = mapping->a_ops;
        long status = 0;
        ssize_t written = 0;
+       unsigned int flags = 0;
+
+       /*
+        * Copies from kernel address space cannot fail (NFSD is a big user).
+        */
+       if (segment_eq(get_fs(), KERNEL_DS))
+               flags |= AOP_FLAG_UNINTERRUPTIBLE;
 
        do {
                struct page *page;
@@ -2217,7 +2224,7 @@ again:
                        break;
                }
 
-               status = a_ops->write_begin(file, mapping, pos, bytes, 0,
+               status = a_ops->write_begin(file, mapping, pos, bytes, flags,
                                                &page, &fsdata);
                if (unlikely(status))
                        break;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to