diff options
author | Liam R. Howlett <[email protected]> | 2022-09-06 19:49:00 +0000 |
---|---|---|
committer | Andrew Morton <[email protected]> | 2022-09-26 19:46:23 -0700 |
commit | c4d1a92d0d3ada8a4073b8af8eff462d689d64c5 (patch) | |
tree | 727633a1da1c8d25c32aaefb9d5512fa206dad87 | |
parent | becc8cdb6cb28d9fd3ecf890d1d6e59118a6a53d (diff) |
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/[email protected]
Signed-off-by: Liam R. Howlett <[email protected]>
Reviewed-by: Davidlohr Bueso <[email protected]>
Tested-by: Yu Zhao <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: David Howells <[email protected]>
Cc: "Matthew Wilcox (Oracle)" <[email protected]>
Cc: SeongJae Park <[email protected]>
Cc: Sven Schnelle <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Cc: Will Deacon <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
-rw-r--r-- | mm/gup.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1674,10 +1674,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 |