From 9eba0235e627791c7d859c4d001e8a48a1d0f70b Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Mon, 1 Mar 2021 14:24:29 -0500 Subject: [PATCH] mm/framge_vector: Use vma_lookup() instead of find_vma_intersection() vma_lookup() is more efficient Signed-off-by: Liam R. Howlett --- mm/frame_vector.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/frame_vector.c b/mm/frame_vector.c index 10f82d5643b6..55300aabf06d 100644 --- a/mm/frame_vector.c +++ b/mm/frame_vector.c @@ -50,7 +50,7 @@ int get_vaddr_frames(unsigned long start, unsigned int nr_frames, mmap_read_lock(mm); locked = 1; - vma = find_vma_intersection(mm, start, start + 1); + vma = vma_lookup(mm, start); if (!vma) { ret = -EFAULT; goto out; @@ -98,7 +98,7 @@ int get_vaddr_frames(unsigned long start, unsigned int nr_frames, */ if (ret >= nr_frames || start < vma->vm_end) break; - vma = find_vma_intersection(mm, start, start + 1); + vma = vma_lookup(mm, start); } while (vma && vma->vm_flags & (VM_IO | VM_PFNMAP)); out: if (locked) -- 2.50.1