From: Liam R. Howlett <Liam.Howlett@Oracle.com> Date: Thu, 14 Apr 2022 06:07:21 +0000 (-0700) Subject: mm/gup: use maple tree navigation instead of linked list X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=7ba6baf18b7388e5ba52776d6b9f85409fbb4caf;p=users%2Fjedix%2Flinux-maple.git mm/gup: use maple tree navigation instead of linked list Use find_vma_intersection() to locate the VMAs in __mm_populate() instead of using find_vma() and the linked list. Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com> --- diff --git a/mm/gup.c b/mm/gup.c index 5c17d4816441..d6dd04b8d803 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -1609,10 +1609,11 @@ int __mm_populate(unsigned long start, unsigned long len, int ignore_errors) if (!locked) { locked = 1; mmap_read_lock(mm); - vma = find_vma(mm, nstart); + vma = find_vma_intersection(mm, nstart, end); } else if (nstart >= vma->vm_end) - vma = vma->vm_next; - if (!vma || vma->vm_start >= end) + vma = find_vma_intersection(mm, vma->vm_end, end); + + if (!vma) break; /* * Set [nstart; nend) to intersection of desired address