From 1ecdcc215246135983bc3974a36d67e97c2f88a3 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Wed, 6 May 2020 21:13:43 -0400 Subject: [PATCH] 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 --- mm/mmap.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index 327fae2b9af4..c37e74bbb95c 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); } -- 2.50.1