Commit 70fa2031 authored by Matthew Wilcox (Oracle)'s avatar Matthew Wilcox (Oracle) Committed by Andrew Morton

parisc: remove mmap linked list from cache handling

Use the VMA iterator instead.

Link: https://lkml.kernel.org/r/20220906194824.2110408-33-Liam.Howlett@oracle.comSigned-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: default avatarLiam R. Howlett <Liam.Howlett@Oracle.com>
Acked-by: default avatarVlastimil Babka <vbabka@suse.cz>
Reviewed-by: default avatarDavidlohr Bueso <dave@stgolabs.net>
Tested-by: default avatarYu Zhao <yuzhao@google.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: David Howells <dhowells@redhat.com>
Cc: SeongJae Park <sj@kernel.org>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent ef770d18
...@@ -657,15 +657,20 @@ static inline unsigned long mm_total_size(struct mm_struct *mm) ...@@ -657,15 +657,20 @@ static inline unsigned long mm_total_size(struct mm_struct *mm)
{ {
struct vm_area_struct *vma; struct vm_area_struct *vma;
unsigned long usize = 0; 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; usize += vma->vm_end - vma->vm_start;
}
return usize; return usize;
} }
void flush_cache_mm(struct mm_struct *mm) void flush_cache_mm(struct mm_struct *mm)
{ {
struct vm_area_struct *vma; struct vm_area_struct *vma;
VMA_ITERATOR(vmi, mm, 0);
/* /*
* Flushing the whole cache on each cpu takes forever on * Flushing the whole cache on each cpu takes forever on
...@@ -685,7 +690,7 @@ void flush_cache_mm(struct mm_struct *mm) ...@@ -685,7 +690,7 @@ void flush_cache_mm(struct mm_struct *mm)
} }
/* Flush 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); flush_cache_pages(vma, vma->vm_start, vma->vm_end);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment