From ff78d06268da86d525e8889f5d352220635b46f9 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Fri, 8 May 2020 21:02:27 -0400 Subject: [PATCH] maple_tree and mm/mmap: Try to stop tracepoints on BUG_ON Restore printk's until we know it happens. Signed-off-by: Liam R. Howlett --- include/trace/events/mm_mt.h | 17 ++++++++++++++--- mm/mmap.c | 9 +++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/include/trace/events/mm_mt.h b/include/trace/events/mm_mt.h index 989386cdca11..88cd76573345 100644 --- a/include/trace/events/mm_mt.h +++ b/include/trace/events/mm_mt.h @@ -11,6 +11,13 @@ struct mm_struct; struct vm_area_struct; +/** + * __vma_mt_erase - called to erase an entry from the mm_mt + * + * @mm: the mm_struct which contains the mt + * @vma: the vma that is to be erased. + * + */ TRACE_EVENT(__vma_mt_erase, TP_PROTO(struct mm_struct *mm, struct vm_area_struct *vma), @@ -31,13 +38,17 @@ TRACE_EVENT(__vma_mt_erase, __entry->vm_end = vma->vm_end - 1; ), - TP_printk("mt_mod %p, (%p), ERASE, %lu, %lu\n", + TP_printk("mt_mod %p, (%p), ERASE, %lu, %lu", __entry->mm, __entry->vma, (unsigned long) __entry->vm_start, (unsigned long) __entry->vm_end ) ); +/** + * __vma_mt_szero - Called to set a range to NULL in the mm_mt + * + */ TRACE_EVENT(__vma_mt_szero, TP_PROTO(struct mm_struct *mm, unsigned long start, unsigned long end), @@ -56,7 +67,7 @@ TRACE_EVENT(__vma_mt_szero, __entry->end = end - 1; ), - TP_printk("mt_mod %p, (NULL), SNULL, %lu, %lu\n", + TP_printk("mt_mod %p, (NULL), SNULL, %lu, %lu", __entry->mm, (unsigned long) __entry->start, (unsigned long) __entry->end @@ -82,7 +93,7 @@ TRACE_EVENT(__vma_mt_store, __entry->vm_end = vma->vm_end - 1; ), - TP_printk("mt_mod %p, (%p), STORE, %lu, %lu\n", + TP_printk("mt_mod %p, (%p), STORE, %lu, %lu", __entry->mm, __entry->vma, (unsigned long) __entry->vm_start, (unsigned long) __entry->vm_end - 1 diff --git a/mm/mmap.c b/mm/mmap.c index ec18db4437b5..3baee65348a3 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -823,16 +823,25 @@ static void __vma_link_file(struct vm_area_struct *vma) } static void __vma_mt_erase(struct mm_struct *mm, struct vm_area_struct *vma) { + trace___vma_mt_erase(mm, vma); + printk("mt_mod %px, (%px), ERASE, %lu, %lu", mm, vma, vma->vm_start, + vma->vm_end); mtree_erase(&mm->mm_mt, vma->vm_start); mt_validate(&mm->mm_mt); } static void __vma_mt_szero(struct mm_struct *mm, unsigned long start, unsigned long end) { + printk("mt_mod %px, (NULL), SNULL, %lu, %lu", mm, start, + end); + trace___vma_mt_szero(mm, start, end); mtree_store_range(&mm->mm_mt, start, end - 1, NULL, GFP_KERNEL); } static void __vma_mt_store(struct mm_struct *mm, struct vm_area_struct *vma) { + trace___vma_mt_store(mm, vma); + printk("mt_mod %px, (%px), STORE, %lu, %lu", mm, vma, vma->vm_start, + vma->vm_end); mtree_store_range(&mm->mm_mt, vma->vm_start, vma->vm_end - 1, vma, GFP_KERNEL); mt_validate(&mm->mm_mt); -- 2.50.1