[PATCH v10 39/69] um: remove vma linked list walk

Liam Howlett liam.howlett at oracle.com
Tue Jun 21 13:47:05 PDT 2022


From: "Matthew Wilcox (Oracle)" <willy at infradead.org>

Use the VMA iterator instead.

Link: https://lkml.kernel.org/r/20220504011345.662299-24-Liam.Howlett@oracle.com
Signed-off-by: Matthew Wilcox (Oracle) <willy at infradead.org>
Signed-off-by: Liam R. Howlett <Liam.Howlett at Oracle.com>
Cc: Catalin Marinas <catalin.marinas at arm.com>
Cc: David Howells <dhowells at redhat.com>
Cc: SeongJae Park <sj at kernel.org>
Cc: Vlastimil Babka <vbabka at suse.cz>
Cc: Will Deacon <will at kernel.org>
Cc: Davidlohr Bueso <dave at stgolabs.net>
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
---
 arch/um/kernel/tlb.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/arch/um/kernel/tlb.c b/arch/um/kernel/tlb.c
index bc38f79ca3a3..ad449173a1a1 100644
--- a/arch/um/kernel/tlb.c
+++ b/arch/um/kernel/tlb.c
@@ -584,21 +584,19 @@ void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start,
 
 void flush_tlb_mm(struct mm_struct *mm)
 {
-	struct vm_area_struct *vma = mm->mmap;
+	struct vm_area_struct *vma;
+	VMA_ITERATOR(vmi, mm, 0);
 
-	while (vma != NULL) {
+	for_each_vma(vmi, vma)
 		fix_range(mm, vma->vm_start, vma->vm_end, 0);
-		vma = vma->vm_next;
-	}
 }
 
 void force_flush_all(void)
 {
 	struct mm_struct *mm = current->mm;
-	struct vm_area_struct *vma = mm->mmap;
+	struct vm_area_struct *vma;
+	VMA_ITERATOR(vmi, mm, 0);
 
-	while (vma != NULL) {
+	for_each_vma(vmi, vma)
 		fix_range(mm, vma->vm_start, vma->vm_end, 1);
-		vma = vma->vm_next;
-	}
 }
-- 
2.35.1



More information about the maple-tree mailing list