]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
parisc: remove mmap linked list from cache handling
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Wed, 20 Jul 2022 02:17:54 +0000 (02:17 +0000)
committerakpm <akpm@linux-foundation.org>
Wed, 20 Jul 2022 21:41:38 +0000 (14:41 -0700)
Use the VMA iterator instead.

Link: https://lkml.kernel.org/r/20220504011345.662299-17-Liam.Howlett@oracle.com
Link: https://lkml.kernel.org/r/20220621204632.3370049-33-Liam.Howlett@oracle.com
Link: https://lkml.kernel.org/r/20220720021727.17018-33-Liam.Howlett@oracle.com
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>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: David Howells <dhowells@redhat.com>
Cc: SeongJae Park <sj@kernel.org>
Cc: Will Deacon <will@kernel.org>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: David Hildenbrand <david@redhat.com>
Cc: Hulk Robot <hulkci@huawei.com>
Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/parisc/kernel/cache.c

index a9bc578e4c52e57caa1f3d297cee5417f18722d1..b54c7cf6fcdeaf58bd5e4c9f11a4fd8643f399d1 100644 (file)
@@ -660,15 +660,20 @@ 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 && usize < parisc_cache_flush_threshold; vma = vma->vm_next)
+       for_each_vma(vmi, vma) {
+               if (usize >= parisc_cache_flush_threshold)
+                       break;
                usize += vma->vm_end - vma->vm_start;
+       }
        return usize;
 }
 
 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
@@ -688,7 +693,7 @@ void flush_cache_mm(struct mm_struct *mm)
        }
 
        /* Flush mm */
-       for (vma = mm->mmap; vma; vma = vma->vm_next)
+       for_each_vma(vmi, vma)
                flush_cache_pages(vma, vma->vm_start, vma->vm_end);
 }