[PATCH v12 54/69] mm/madvise: use vma_find() instead of vma linked list

Liam Howlett liam.howlett at oracle.com
Tue Jul 19 19:18:00 PDT 2022

From: "Liam R. Howlett" <Liam.Howlett at Oracle.com>

madvise_walk_vmas() no longer uses linked list.

Link: https://lkml.kernel.org/r/20220504011345.662299-39-Liam.Howlett@oracle.com
Link: https://lkml.kernel.org/r/20220621204632.3370049-55-Liam.Howlett@oracle.com
Signed-off-by: Liam R. Howlett <Liam.Howlett at Oracle.com>
Acked-by: Vlastimil Babka <vbabka at suse.cz>
Cc: Catalin Marinas <catalin.marinas at arm.com>
Cc: David Howells <dhowells at redhat.com>
Cc: "Matthew Wilcox (Oracle)" <willy at infradead.org>
Cc: SeongJae Park <sj at kernel.org>
Cc: Will Deacon <will at kernel.org>
Cc: Davidlohr Bueso <dave at stgolabs.net>
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
 mm/madvise.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/madvise.c b/mm/madvise.c
index 0316bbc6441b..12e8010c766c 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -1238,7 +1238,7 @@ int madvise_walk_vmas(struct mm_struct *mm, unsigned long start,
 		if (start >= end)
 		if (prev)
-			vma = prev->vm_next;
+			vma = find_vma(mm, prev->vm_end);
 		else	/* madvise_remove dropped mmap_lock */
 			vma = find_vma(mm, start);

More information about the maple-tree mailing list