aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiam R. Howlett <[email protected]>2022-09-06 19:49:04 +0000
committerAndrew Morton <[email protected]>2022-09-26 19:46:25 -0700
commit208c09db6d88f4442fb755d20cfb237a37a49f48 (patch)
treedcceec9d554829c6655a4b3867588e973d3d0e4d
parent9ec08f30f86d70b8891c25642df7d1f16647fde4 (diff)
mm/swapfile: use vma iterator instead of vma linked list
unuse_mm() no longer needs to reference the linked list. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Liam R. Howlett <[email protected]> Acked-by: Vlastimil Babka <[email protected]> Reviewed-by: Davidlohr Bueso <[email protected]> Tested-by: Yu Zhao <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: David Hildenbrand <[email protected]> Cc: David Howells <[email protected]> Cc: "Matthew Wilcox (Oracle)" <[email protected]> Cc: SeongJae Park <[email protected]> Cc: Sven Schnelle <[email protected]> Cc: Will Deacon <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
-rw-r--r--mm/swapfile.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 263b19e693cf..469d9af86be2 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -1994,14 +1994,16 @@ static int unuse_mm(struct mm_struct *mm, unsigned int type)
{
struct vm_area_struct *vma;
int ret = 0;
+ VMA_ITERATOR(vmi, mm, 0);
mmap_read_lock(mm);
- for (vma = mm->mmap; vma; vma = vma->vm_next) {
+ for_each_vma(vmi, vma) {
if (vma->anon_vma) {
ret = unuse_vma(vma, type);
if (ret)
break;
}
+
cond_resched();
}
mmap_read_unlock(mm);