Thread (69 messages) 69 messages, 3 authors, 2021-08-31
STALE1755d

[PATCH v2 47/61] mm/gup: Use maple tree navigation instead of linked list

From: Liam Howlett <hidden>
Date: 2021-08-17 15:56:13
Also in: lkml
Subsystem: memory management, memory management - gup (get user pages), the rest · Maintainers: Andrew Morton, David Hildenbrand, Linus Torvalds

From: "Liam R. Howlett" <redacted>

Signed-off-by: Liam R. Howlett <redacted>
---
 mm/gup.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/mm/gup.c b/mm/gup.c
index 2630ed1bb4f4..7a34765d28d8 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -1580,7 +1580,6 @@ int __mm_populate(unsigned long start, unsigned long len, int ignore_errors)
 	long ret = 0;
 
 	end = start + len;
-
 	for (nstart = start; nstart < end; nstart = nend) {
 		/*
 		 * We want to fault in pages for [nstart; end) address range.
@@ -1589,10 +1588,10 @@ 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, start, end);
 		} else if (nstart >= vma->vm_end)
-			vma = vma->vm_next;
-		if (!vma || vma->vm_start >= end)
+			vma = vma_next(mm, vma);
+		if (!vma)
 			break;
 		/*
 		 * Set [nstart; nend) to intersection of desired address
-- 
2.30.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help