]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm/oom_kill: Use maple tree iterators instead of vma linked list
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Mon, 4 Jan 2021 20:06:25 +0000 (15:06 -0500)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Thu, 24 Jun 2021 20:04:24 +0000 (16:04 -0400)
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
mm/oom_kill.c

index c729a4c4a1ace9ae4b97fb9602d3a48d726f177e..8057ebf013f1dd2aeab4b33cba1c224468e6087c 100644 (file)
@@ -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;
 }