All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mremap: skip page table lookup for non-faulted anonymous VMAs
@ 2011-11-07  4:21 ` Nai Xia
  0 siblings, 0 replies; 6+ messages in thread
From: Nai Xia @ 2011-11-07  4:21 UTC (permalink / raw)
  To: Andrea Arcangeli
  Cc: Hugh Dickins, Mel Gorman, Pawel Sikora, Andrew Morton, linux-mm,
	jpiszcz, arekm, linux-kernel

If an anonymous vma has not yet been faulted, move_page_tables() in move_vma()
is not necessary for it.

Signed-off-by: Nai Xia <nai.xia@gmail.com>
---
diff --git a/mm/mremap.c b/mm/mremap.c
--- a/mm/mremap.c
+++ b/mm/mremap.c
@@ -200,6 +200,10 @@ static unsigned long move_vma(struct vm_area_struct *vma,
 	if (!new_vma)
 		return -ENOMEM;
 
+	/* An anonymous vma has not been faulted, no pagetables lookup. */
+	if (!vma->vm_file && !vma->anon_vma)
+		goto page_tables_ok;
+
 	moved_len = move_page_tables(vma, old_addr, new_vma, new_addr, old_len);
 	if (moved_len < old_len) {
 		/*
@@ -213,6 +217,7 @@ static unsigned long move_vma(struct vm_area_struct *vma,
 		old_addr = new_addr;
 		new_addr = -ENOMEM;
 	}
+page_tables_ok:
 
 	/* Conceal VM_ACCOUNT so old reservation is not undone */
 	if (vm_flags & VM_ACCOUNT) {


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-11-07 16:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-07  4:21 [PATCH] mremap: skip page table lookup for non-faulted anonymous VMAs Nai Xia
2011-11-07  4:21 ` Nai Xia
2011-11-07 15:32 ` Andrea Arcangeli
2011-11-07 15:32   ` Andrea Arcangeli
2011-11-07 16:13   ` Nai Xia
2011-11-07 16:13     ` Nai Xia

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.