]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm/gup: use maple tree navigation instead of linked list
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Thu, 14 Apr 2022 06:07:21 +0000 (23:07 -0700)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Wed, 11 May 2022 13:09:56 +0000 (09:09 -0400)
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>
mm/gup.c

index f598a037eb04f75799cb7adba885c96d1a2e1ec3..28fd5d5aa55738148f27e099c0952805e0a7111d 100644 (file)
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -1533,10 +1533,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