]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm/mmap: Add call to maple_destroy
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Thu, 7 May 2020 01:13:43 +0000 (21:13 -0400)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 30 Oct 2020 19:04:43 +0000 (15:04 -0400)
When tearing down a vma, destroy the maple tree as well.

Also clean up some old print debugs.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
mm/mmap.c

index 327fae2b9af46ed3817f0c3575056d342e9a722f..c37e74bbb95c1a1884505e4a1c5dce1276601e2b 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -418,17 +418,8 @@ static void validate_mm_mt(struct mm_struct *mm,
        MA_STATE(mas, mt, 0, 0);
        rcu_read_lock();
        mas_for_each(&mas, vma_mt, ULONG_MAX) {
-               if (mas_retry(&mas, vma_mt)) {
-                       count++;
-                       if (count > 100) {
-                               printk("%s: count exceeded\n", __func__);
-                               printk("We are here %px %lu\n", mas.node,
-                                      mas.index);
-                               mt_dump(mt);
-                               count = 0;
-                       }
+               if (mas_retry(&mas, vma_mt))
                        continue;
-               }
 
                if (vma && vma == ignore)
                        vma = vma->vm_next;
@@ -871,7 +862,6 @@ __vma_link(struct mm_struct *mm, struct vm_area_struct *vma,
        __vma_mt_store(mm, vma);
        __vma_link_list(mm, vma, prev);
        __vma_link_rb(mm, vma, rb_link, rb_parent);
-       //validate_mm_mt(mm, NULL);
 }
 
 static void vma_link(struct mm_struct *mm, struct vm_area_struct *vma,
@@ -946,7 +936,6 @@ int __vma_adjust(struct vm_area_struct *vma, unsigned long start,
        validate_mm(mm);
        validate_mm_mt(mm, NULL);
 
-       //printk("%s %px %lu %lu\n", __func__, vma, start, end);
        if (next && !insert) {
                struct vm_area_struct *exporter = NULL, *importer = NULL;
 
@@ -1138,7 +1127,6 @@ again:
                 */
                /* maple tree store is done in the __vma_link call in this
                 * call graph */
-//             printk("insert %px %lu - %lu\n", insert, insert->vm_start, insert->vm_end);
                __insert_vm_struct(mm, insert);
        } else {
                if (start_changed)
@@ -3606,6 +3594,10 @@ void exit_mmap(struct mm_struct *mm)
                vma = remove_vma(vma);
                cond_resched();
        }
+#if MT_DEBUG
+       printk("mt_mod: %px DESTROY\n", mm);
+#endif
+       mtree_destroy(&mm->mm_mt);
        vm_unacct_memory(nr_accounted);
 }