Commit c4d1a92d authored by Liam R. Howlett's avatar Liam R. Howlett Committed by Andrew Morton

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.

Link: https://lkml.kernel.org/r/20220906194824.2110408-52-Liam.Howlett@oracle.comSigned-off-by: default avatarLiam R. Howlett <Liam.Howlett@Oracle.com>
Reviewed-by: default avatarDavidlohr Bueso <dave@stgolabs.net>
Tested-by: default avatarYu Zhao <yuzhao@google.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: David Howells <dhowells@redhat.com>
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: SeongJae Park <sj@kernel.org>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent becc8cdb
...@@ -1674,10 +1674,11 @@ int __mm_populate(unsigned long start, unsigned long len, int ignore_errors) ...@@ -1674,10 +1674,11 @@ int __mm_populate(unsigned long start, unsigned long len, int ignore_errors)
if (!locked) { if (!locked) {
locked = 1; locked = 1;
mmap_read_lock(mm); mmap_read_lock(mm);
vma = find_vma(mm, nstart); vma = find_vma_intersection(mm, nstart, end);
} else if (nstart >= vma->vm_end) } else if (nstart >= vma->vm_end)
vma = vma->vm_next; vma = find_vma_intersection(mm, vma->vm_end, end);
if (!vma || vma->vm_start >= end)
if (!vma)
break; break;
/* /*
* Set [nstart; nend) to intersection of desired address * Set [nstart; nend) to intersection of desired address
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment