[PATCH 85/94] mm/oom_kill: Use maple tree iterators instead of vma linked list
From: Liam Howlett
Date: Wed Apr 28 2021 - 11:41:50 EST
Signed-off-by: Liam R. Howlett <Liam.Howlett@xxxxxxxxxx>
---
mm/oom_kill.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 54527de9cd2d..1f6491965802 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -515,6 +515,7 @@ bool __oom_reap_task_mm(struct mm_struct *mm)
{
struct vm_area_struct *vma;
bool ret = true;
+ MA_STATE(mas, &mm->mm_mt, 0, 0);
/*
* Tell all users of get_user/copy_from_user etc... that the content
@@ -524,7 +525,8 @@ bool __oom_reap_task_mm(struct mm_struct *mm)
*/
set_bit(MMF_UNSTABLE, &mm->flags);
- for (vma = mm->mmap ; vma; vma = vma->vm_next) {
+ rcu_read_lock();
+ mas_for_each(&mas, vma, ULONG_MAX) {
if (!can_madv_lru_vma(vma))
continue;
@@ -556,6 +558,7 @@ bool __oom_reap_task_mm(struct mm_struct *mm)
tlb_finish_mmu(&tlb);
}
}
+ rcu_read_unlock();
return ret;
}
--
2.30.2