]> www.infradead.org Git - users/willy/linux.git/commitdiff
damon: Change vma iterator to mas_for_each
authorLiam R. Howlett <Liam.Howlett@oracle.com>
Thu, 2 Sep 2021 17:45:06 +0000 (13:45 -0400)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Wed, 20 Oct 2021 20:00:34 +0000 (16:00 -0400)
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
mm/damon/vaddr.c

index 58c1fb2aafa91fcf410df608927e7b67c8f6a3e8..e3b5b5a7948ffc6473a1a68c1134f46f8a30533b 100644 (file)
@@ -132,9 +132,10 @@ static int __damon_va_three_regions(struct vm_area_struct *vma,
        struct vm_area_struct *last_vma = NULL;
        unsigned long start = 0;
        struct rb_root rbroot;
+       MA_STATE(mas, mm->mm_mt, vma->vm_start, vma->vm_start);
 
        /* Find two biggest gaps so that first_gap > second_gap > others */
-       for (; vma; vma = vma->vm_next) {
+       mas_for_each(&mas, vma, ULONG_MAX) {
                if (!last_vma) {
                        start = vma->vm_start;
                        goto next;