+ optimize-follow_pages.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     optimize follow_pages()

has been added to the -mm tree.  Its filename is

     optimize-follow_pages.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this


From: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>

Christoph Lameter suggested I pull set_page_dirty() out from under the pte
lock.

I reviewed the current calls and found the one in follow_page() a candidate
for the same treatment.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Cc: Nick Piggin <nickpiggin@xxxxxxxxxxxx>
Cc: Hugh Dickins <hugh@xxxxxxxxxxx>
Cc: Christoph Lameter <clameter@xxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 include/linux/mm.h |    1 +
 mm/memory.c        |   17 ++++++++++++++---
 2 files changed, 15 insertions(+), 3 deletions(-)

diff -puN include/linux/mm.h~optimize-follow_pages include/linux/mm.h
--- devel/include/linux/mm.h~optimize-follow_pages	2006-05-11 02:22:01.000000000 -0700
+++ devel-akpm/include/linux/mm.h	2006-05-11 02:22:01.000000000 -0700
@@ -1060,6 +1060,7 @@ struct page *follow_page(struct vm_area_
 #define FOLL_TOUCH	0x02	/* mark page accessed */
 #define FOLL_GET	0x04	/* do get_page on page */
 #define FOLL_ANON	0x08	/* give ZERO_PAGE if no pgtable */
+#define FOLL_DIRTY	0x10	/* the page was dirtied */
 
 #ifdef CONFIG_PROC_FS
 void vm_stat_account(struct mm_struct *, unsigned long, struct file *, long);
diff -puN mm/memory.c~optimize-follow_pages mm/memory.c
--- devel/mm/memory.c~optimize-follow_pages	2006-05-11 02:22:01.000000000 -0700
+++ devel-akpm/mm/memory.c	2006-05-11 02:22:01.000000000 -0700
@@ -948,18 +948,28 @@ struct page *follow_page(struct vm_area_
 	if (unlikely(!page))
 		goto unlock;
 
-	if (flags & FOLL_GET)
+	if (flags & (FOLL_GET | FOLL_TOUCH))
 		get_page(page);
 	if (flags & FOLL_TOUCH) {
 		if ((flags & FOLL_WRITE) &&
 		    !pte_dirty(pte) && !PageDirty(page))
+			flags |= FOLL_DIRTY;
+	}
+
+	pte_unmap_unlock(ptep, ptl);
+
+	if (flags & FOLL_TOUCH) {
+		if (flags & FOLL_DIRTY)
 			set_page_dirty(page);
 		mark_page_accessed(page);
 	}
+	if (!(flags & FOLL_GET))
+		put_page(page);
+	goto out;
+
 unlock:
 	pte_unmap_unlock(ptep, ptl);
-out:
-	return page;
+	goto out;
 
 no_page_table:
 	/*
@@ -972,6 +982,7 @@ no_page_table:
 			get_page(page);
 		BUG_ON(flags & FOLL_WRITE);
 	}
+out:
 	return page;
 }
 
_

Patches currently in -mm which might be from a.p.zijlstra@xxxxxxxxx are

buglet-in-radix_tree_tag_set.patch
tracking-dirty-pages-in-shared-mappings-v4.patch
tracking-dirty-pages-in-shared-mappings-v4-fix.patch
throttle-writers-of-shared-mappings.patch
throttle-writers-of-shared-mappings-tidy.patch
optimize-follow_pages.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux