mm: dump page when hitting a VM_BUG_ON using VM_BUG_ON_PAGE
Most of the VM_BUG_ON assertions are performed on a page. Usually, when one of these assertions fails we'll get a BUG_ON with a call stack and the registers. I've recently noticed based on the requests to add a small piece of code that dumps the page to various VM_BUG_ON sites that the page dump is quite useful to people debugging issues in mm. This patch adds a VM_BUG_ON_PAGE(cond, page) which beyond doing what VM_BUG_ON() does, also dumps the page before executing the actual BUG_ON. [akpm@linux-foundation.org: fix up includes] Signed-off-by:Sasha Levin <sasha.levin@oracle.com> Cc: "Kirill A. Shutemov" <kirill@shutemov.name> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
Showing
- arch/x86/mm/gup.c 4 additions, 4 deletionsarch/x86/mm/gup.c
- include/linux/gfp.h 1 addition, 0 deletionsinclude/linux/gfp.h
- include/linux/hugetlb.h 2 additions, 1 deletioninclude/linux/hugetlb.h
- include/linux/hugetlb_cgroup.h 3 additions, 2 deletionsinclude/linux/hugetlb_cgroup.h
- include/linux/mm.h 13 additions, 16 deletionsinclude/linux/mm.h
- include/linux/mmdebug.h 9 additions, 0 deletionsinclude/linux/mmdebug.h
- include/linux/page-flags.h 5 additions, 5 deletionsinclude/linux/page-flags.h
- include/linux/pagemap.h 5 additions, 5 deletionsinclude/linux/pagemap.h
- include/linux/percpu.h 1 addition, 0 deletionsinclude/linux/percpu.h
- mm/cleancache.c 3 additions, 3 deletionsmm/cleancache.c
- mm/compaction.c 1 addition, 1 deletionmm/compaction.c
- mm/filemap.c 8 additions, 8 deletionsmm/filemap.c
- mm/huge_memory.c 18 additions, 18 deletionsmm/huge_memory.c
- mm/hugetlb.c 5 additions, 5 deletionsmm/hugetlb.c
- mm/hugetlb_cgroup.c 1 addition, 1 deletionmm/hugetlb_cgroup.c
- mm/internal.h 5 additions, 5 deletionsmm/internal.h
- mm/ksm.c 6 additions, 6 deletionsmm/ksm.c
- mm/memcontrol.c 14 additions, 14 deletionsmm/memcontrol.c
- mm/memory.c 4 additions, 4 deletionsmm/memory.c
- mm/migrate.c 3 additions, 3 deletionsmm/migrate.c
Loading
Please register or sign in to comment