]> 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)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Tue, 16 Aug 2022 16:00:03 +0000 (12:00 -0400)
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 3feb7694e0ca4fc3737898e9abea0ead3bbf6462..1d3b8bc8a6233641c4eeea6d8b775887b0de9a4e 100644 (file)
@@ -657,15 +657,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
@@ -685,7 +690,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);
 }