linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC] mm: change find_vma() function
@ 2015-12-14 11:02 yalin wang
  2015-12-14 12:11 ` Kirill A. Shutemov
  0 siblings, 1 reply; 8+ messages in thread
From: yalin wang @ 2015-12-14 11:02 UTC (permalink / raw)
  To: akpm, kirill.shutemov, oleg, gang.chen.5i5j, mhocko,
	kwapulinski.piotr, aarcange, dcashman, linux-mm, linux-kernel
  Cc: yalin wang

change find_vma() to break ealier when found the adderss
is not in any vma, don't need loop to search all vma.

Signed-off-by: yalin wang <yalin.wang2010@gmail.com>
---
 mm/mmap.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/mm/mmap.c b/mm/mmap.c
index b513f20..8294c9b 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2064,6 +2064,9 @@ struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr)
 			vma = tmp;
 			if (tmp->vm_start <= addr)
 				break;
+			if (!tmp->vm_prev || tmp->vm_prev->vm_end <= addr)
+				break;
+
 			rb_node = rb_node->rb_left;
 		} else
 			rb_node = rb_node->rb_right;
-- 
1.9.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2015-12-22  5:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-14 11:02 [RFC] mm: change find_vma() function yalin wang
2015-12-14 12:11 ` Kirill A. Shutemov
2015-12-14 17:55   ` Oleg Nesterov
2015-12-14 21:11     ` Kirill A. Shutemov
2015-12-15  6:41       ` yalin wang
2015-12-15 11:47         ` Andrea Arcangeli
2015-12-15 11:53         ` Kirill A. Shutemov
2015-12-22  5:31           ` yalin wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).