Commit 152a2d19 authored by Matthew Wilcox's avatar Matthew Wilcox Committed by Linus Torvalds

mm/debug.c: provide useful debugging information for VM_BUG

With the recent addition of hashed kernel pointers, places which need to
produce useful debug output have to specify %px, not %p.  This patch
fixes all the VM debug to use %px.  This is appropriate because it's
debug output that the user should never be able to trigger, and kernel
developers need to see the actual pointers.

Link: http://lkml.kernel.org/r/20171219133236.GE13680@bombadil.infradead.orgSigned-off-by: default avatarMatthew Wilcox <mawilcox@microsoft.com>
Acked-by: default avatarMichal Hocko <mhocko@suse.com>
Cc: "Tobin C. Harding" <me@tobin.cc>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent dc8635b7
...@@ -50,7 +50,7 @@ void __dump_page(struct page *page, const char *reason) ...@@ -50,7 +50,7 @@ void __dump_page(struct page *page, const char *reason)
*/ */
int mapcount = PageSlab(page) ? 0 : page_mapcount(page); int mapcount = PageSlab(page) ? 0 : page_mapcount(page);
pr_emerg("page:%p count:%d mapcount:%d mapping:%p index:%#lx", pr_emerg("page:%px count:%d mapcount:%d mapping:%px index:%#lx",
page, page_ref_count(page), mapcount, page, page_ref_count(page), mapcount,
page->mapping, page_to_pgoff(page)); page->mapping, page_to_pgoff(page));
if (PageCompound(page)) if (PageCompound(page))
...@@ -69,7 +69,7 @@ void __dump_page(struct page *page, const char *reason) ...@@ -69,7 +69,7 @@ void __dump_page(struct page *page, const char *reason)
#ifdef CONFIG_MEMCG #ifdef CONFIG_MEMCG
if (page->mem_cgroup) if (page->mem_cgroup)
pr_alert("page->mem_cgroup:%p\n", page->mem_cgroup); pr_alert("page->mem_cgroup:%px\n", page->mem_cgroup);
#endif #endif
} }
...@@ -84,10 +84,10 @@ EXPORT_SYMBOL(dump_page); ...@@ -84,10 +84,10 @@ EXPORT_SYMBOL(dump_page);
void dump_vma(const struct vm_area_struct *vma) void dump_vma(const struct vm_area_struct *vma)
{ {
pr_emerg("vma %p start %p end %p\n" pr_emerg("vma %px start %px end %px\n"
"next %p prev %p mm %p\n" "next %px prev %px mm %px\n"
"prot %lx anon_vma %p vm_ops %p\n" "prot %lx anon_vma %px vm_ops %px\n"
"pgoff %lx file %p private_data %p\n" "pgoff %lx file %px private_data %px\n"
"flags: %#lx(%pGv)\n", "flags: %#lx(%pGv)\n",
vma, (void *)vma->vm_start, (void *)vma->vm_end, vma->vm_next, vma, (void *)vma->vm_start, (void *)vma->vm_end, vma->vm_next,
vma->vm_prev, vma->vm_mm, vma->vm_prev, vma->vm_mm,
...@@ -100,27 +100,27 @@ EXPORT_SYMBOL(dump_vma); ...@@ -100,27 +100,27 @@ EXPORT_SYMBOL(dump_vma);
void dump_mm(const struct mm_struct *mm) void dump_mm(const struct mm_struct *mm)
{ {
pr_emerg("mm %p mmap %p seqnum %d task_size %lu\n" pr_emerg("mm %px mmap %px seqnum %d task_size %lu\n"
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
"get_unmapped_area %p\n" "get_unmapped_area %px\n"
#endif #endif
"mmap_base %lu mmap_legacy_base %lu highest_vm_end %lu\n" "mmap_base %lu mmap_legacy_base %lu highest_vm_end %lu\n"
"pgd %p mm_users %d mm_count %d pgtables_bytes %lu map_count %d\n" "pgd %px mm_users %d mm_count %d pgtables_bytes %lu map_count %d\n"
"hiwater_rss %lx hiwater_vm %lx total_vm %lx locked_vm %lx\n" "hiwater_rss %lx hiwater_vm %lx total_vm %lx locked_vm %lx\n"
"pinned_vm %lx data_vm %lx exec_vm %lx stack_vm %lx\n" "pinned_vm %lx data_vm %lx exec_vm %lx stack_vm %lx\n"
"start_code %lx end_code %lx start_data %lx end_data %lx\n" "start_code %lx end_code %lx start_data %lx end_data %lx\n"
"start_brk %lx brk %lx start_stack %lx\n" "start_brk %lx brk %lx start_stack %lx\n"
"arg_start %lx arg_end %lx env_start %lx env_end %lx\n" "arg_start %lx arg_end %lx env_start %lx env_end %lx\n"
"binfmt %p flags %lx core_state %p\n" "binfmt %px flags %lx core_state %px\n"
#ifdef CONFIG_AIO #ifdef CONFIG_AIO
"ioctx_table %p\n" "ioctx_table %px\n"
#endif #endif
#ifdef CONFIG_MEMCG #ifdef CONFIG_MEMCG
"owner %p " "owner %px "
#endif #endif
"exe_file %p\n" "exe_file %px\n"
#ifdef CONFIG_MMU_NOTIFIER #ifdef CONFIG_MMU_NOTIFIER
"mmu_notifier_mm %p\n" "mmu_notifier_mm %px\n"
#endif #endif
#ifdef CONFIG_NUMA_BALANCING #ifdef CONFIG_NUMA_BALANCING
"numa_next_scan %lu numa_scan_offset %lu numa_scan_seq %d\n" "numa_next_scan %lu numa_scan_offset %lu numa_scan_seq %d\n"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment