[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1450090945-4020-1-git-send-email-yalin.wang2010@gmail.com>
Date: Mon, 14 Dec 2015 19:02:25 +0800
From: yalin wang <yalin.wang2010@...il.com>
To: akpm@...ux-foundation.org, kirill.shutemov@...ux.intel.com,
oleg@...hat.com, gang.chen.5i5j@...il.com, mhocko@...e.com,
kwapulinski.piotr@...il.com, aarcange@...hat.com,
dcashman@...gle.com, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Cc: yalin wang <yalin.wang2010@...il.com>
Subject: [RFC] mm: change find_vma() function
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@...il.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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists