]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
parisc: Remove mmap linked list from cache handling
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Mon, 4 Jan 2021 19:25:19 +0000 (14:25 -0500)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Mon, 14 Mar 2022 18:49:45 +0000 (14:49 -0400)
Use the VMA iterator instead.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
arch/parisc/kernel/cache.c

index 94150b91c96fb66e9c08e683991959f1a98d620a..c3a8d29b6f9fea10910c11419f0480e0ee84c303 100644 (file)
@@ -519,9 +519,11 @@ static inline unsigned long mm_total_size(struct mm_struct *mm)
 {
        struct vm_area_struct *vma;
        unsigned long usize = 0;
+       VMA_ITERATOR(vmi, mm, 0);
 
-       for (vma = mm->mmap; vma; vma = vma->vm_next)
+       for_each_vma(vmi, vma)
                usize += vma->vm_end - vma->vm_start;
+
        return usize;
 }
 
@@ -570,6 +572,7 @@ static void flush_user_cache_tlb(struct vm_area_struct *vma,
 void flush_cache_mm(struct mm_struct *mm)
 {
        struct vm_area_struct *vma;
+       VMA_ITERATOR(vmi, mm, 0);
 
        /* Flushing the whole cache on each cpu takes forever on
           rp3440, etc.  So, avoid it if the mm isn't too big.  */
@@ -583,13 +586,13 @@ void flush_cache_mm(struct mm_struct *mm)
 
        preempt_disable();
        if (mm->context == mfsp(3)) {
-               for (vma = mm->mmap; vma; vma = vma->vm_next)
+               for_each_vma(vmi, vma)
                        flush_user_cache_tlb(vma, vma->vm_start, vma->vm_end);
                preempt_enable();
                return;
        }
 
-       for (vma = mm->mmap; vma; vma = vma->vm_next)
+       for_each_vma(vmi, vma)
                flush_cache_pages(vma, mm, vma->vm_start, vma->vm_end);
        preempt_enable();
 }