Skip to content

Commit dc8635b

Browse files
howlettakpm00
authored andcommitted
mm: optimize find_exact_vma() to use vma_lookup()
Use vma_lookup() to walk the tree to the start value requested. If the vma at the start does not match, then the answer is NULL and there is no need to look at the next vma the way that find_vma() would. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Liam R. Howlett <[email protected]> Reviewed-by: Vlastimil Babka <[email protected]> Tested-by: Yu Zhao <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: David Hildenbrand <[email protected]> Cc: David Howells <[email protected]> Cc: Davidlohr Bueso <[email protected]> Cc: "Matthew Wilcox (Oracle)" <[email protected]> Cc: SeongJae Park <[email protected]> Cc: Sven Schnelle <[email protected]> Cc: Will Deacon <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 7ccf089 commit dc8635b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/mm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2850,7 +2850,7 @@ static inline unsigned long vma_pages(struct vm_area_struct *vma)
28502850
static inline struct vm_area_struct *find_exact_vma(struct mm_struct *mm,
28512851
unsigned long vm_start, unsigned long vm_end)
28522852
{
2853-
struct vm_area_struct *vma = find_vma(mm, vm_start);
2853+
struct vm_area_struct *vma = vma_lookup(mm, vm_start);
28542854

28552855
if (vma && (vma->vm_start != vm_start || vma->vm_end != vm_end))
28562856
vma = NULL;

0 commit comments

Comments
 (0)