From: Liam R. Howlett Date: Thu, 7 May 2020 01:13:43 +0000 (-0400) Subject: mm/mmap: Add call to maple_destroy X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=1ecdcc215246135983bc3974a36d67e97c2f88a3;p=users%2Fjedix%2Flinux-maple.git mm/mmap: Add call to maple_destroy When tearing down a vma, destroy the maple tree as well. Also clean up some old print debugs. Signed-off-by: Liam R. Howlett --- diff --git a/mm/mmap.c b/mm/mmap.c index 327fae2b9af46..c37e74bbb95c1 100644 --- 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); }