diff options
author | Matthew Wilcox <mawilcox@microsoft.com> | 2018-01-04 19:17:59 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-01-04 19:45:09 -0500 |
commit | 152a2d199e1385c6ccef17c24555103b30447c91 (patch) | |
tree | c01be7a8eeadc9c101110d784f89509445a40900 /mm/debug.c | |
parent | dc8635b78cd8669c37e230058d18c33af7451ab1 (diff) |
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.org
Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: "Tobin C. Harding" <me@tobin.cc>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/debug.c')
-rw-r--r-- | mm/debug.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/mm/debug.c b/mm/debug.c index d947f3e03b0d..56e2d9125ea5 100644 --- a/mm/debug.c +++ b/mm/debug.c | |||
@@ -50,7 +50,7 @@ void __dump_page(struct page *page, const char *reason) | |||
50 | */ | 50 | */ |
51 | int mapcount = PageSlab(page) ? 0 : page_mapcount(page); | 51 | int mapcount = PageSlab(page) ? 0 : page_mapcount(page); |
52 | 52 | ||
53 | pr_emerg("page:%p count:%d mapcount:%d mapping:%p index:%#lx", | 53 | pr_emerg("page:%px count:%d mapcount:%d mapping:%px index:%#lx", |
54 | page, page_ref_count(page), mapcount, | 54 | page, page_ref_count(page), mapcount, |
55 | page->mapping, page_to_pgoff(page)); | 55 | page->mapping, page_to_pgoff(page)); |
56 | if (PageCompound(page)) | 56 | if (PageCompound(page)) |
@@ -69,7 +69,7 @@ void __dump_page(struct page *page, const char *reason) | |||
69 | 69 | ||
70 | #ifdef CONFIG_MEMCG | 70 | #ifdef CONFIG_MEMCG |
71 | if (page->mem_cgroup) | 71 | if (page->mem_cgroup) |
72 | pr_alert("page->mem_cgroup:%p\n", page->mem_cgroup); | 72 | pr_alert("page->mem_cgroup:%px\n", page->mem_cgroup); |
73 | #endif | 73 | #endif |
74 | } | 74 | } |
75 | 75 | ||
@@ -84,10 +84,10 @@ EXPORT_SYMBOL(dump_page); | |||
84 | 84 | ||
85 | void dump_vma(const struct vm_area_struct *vma) | 85 | void dump_vma(const struct vm_area_struct *vma) |
86 | { | 86 | { |
87 | pr_emerg("vma %p start %p end %p\n" | 87 | pr_emerg("vma %px start %px end %px\n" |
88 | "next %p prev %p mm %p\n" | 88 | "next %px prev %px mm %px\n" |
89 | "prot %lx anon_vma %p vm_ops %p\n" | 89 | "prot %lx anon_vma %px vm_ops %px\n" |
90 | "pgoff %lx file %p private_data %p\n" | 90 | "pgoff %lx file %px private_data %px\n" |
91 | "flags: %#lx(%pGv)\n", | 91 | "flags: %#lx(%pGv)\n", |
92 | vma, (void *)vma->vm_start, (void *)vma->vm_end, vma->vm_next, | 92 | vma, (void *)vma->vm_start, (void *)vma->vm_end, vma->vm_next, |
93 | vma->vm_prev, vma->vm_mm, | 93 | vma->vm_prev, vma->vm_mm, |
@@ -100,27 +100,27 @@ EXPORT_SYMBOL(dump_vma); | |||
100 | 100 | ||
101 | void dump_mm(const struct mm_struct *mm) | 101 | void dump_mm(const struct mm_struct *mm) |
102 | { | 102 | { |
103 | pr_emerg("mm %p mmap %p seqnum %d task_size %lu\n" | 103 | pr_emerg("mm %px mmap %px seqnum %d task_size %lu\n" |
104 | #ifdef CONFIG_MMU | 104 | #ifdef CONFIG_MMU |
105 | "get_unmapped_area %p\n" | 105 | "get_unmapped_area %px\n" |
106 | #endif | 106 | #endif |
107 | "mmap_base %lu mmap_legacy_base %lu highest_vm_end %lu\n" | 107 | "mmap_base %lu mmap_legacy_base %lu highest_vm_end %lu\n" |
108 | "pgd %p mm_users %d mm_count %d pgtables_bytes %lu map_count %d\n" | 108 | "pgd %px mm_users %d mm_count %d pgtables_bytes %lu map_count %d\n" |
109 | "hiwater_rss %lx hiwater_vm %lx total_vm %lx locked_vm %lx\n" | 109 | "hiwater_rss %lx hiwater_vm %lx total_vm %lx locked_vm %lx\n" |
110 | "pinned_vm %lx data_vm %lx exec_vm %lx stack_vm %lx\n" | 110 | "pinned_vm %lx data_vm %lx exec_vm %lx stack_vm %lx\n" |
111 | "start_code %lx end_code %lx start_data %lx end_data %lx\n" | 111 | "start_code %lx end_code %lx start_data %lx end_data %lx\n" |
112 | "start_brk %lx brk %lx start_stack %lx\n" | 112 | "start_brk %lx brk %lx start_stack %lx\n" |
113 | "arg_start %lx arg_end %lx env_start %lx env_end %lx\n" | 113 | "arg_start %lx arg_end %lx env_start %lx env_end %lx\n" |
114 | "binfmt %p flags %lx core_state %p\n" | 114 | "binfmt %px flags %lx core_state %px\n" |
115 | #ifdef CONFIG_AIO | 115 | #ifdef CONFIG_AIO |
116 | "ioctx_table %p\n" | 116 | "ioctx_table %px\n" |
117 | #endif | 117 | #endif |
118 | #ifdef CONFIG_MEMCG | 118 | #ifdef CONFIG_MEMCG |
119 | "owner %p " | 119 | "owner %px " |
120 | #endif | 120 | #endif |
121 | "exe_file %p\n" | 121 | "exe_file %px\n" |
122 | #ifdef CONFIG_MMU_NOTIFIER | 122 | #ifdef CONFIG_MMU_NOTIFIER |
123 | "mmu_notifier_mm %p\n" | 123 | "mmu_notifier_mm %px\n" |
124 | #endif | 124 | #endif |
125 | #ifdef CONFIG_NUMA_BALANCING | 125 | #ifdef CONFIG_NUMA_BALANCING |
126 | "numa_next_scan %lu numa_scan_offset %lu numa_scan_seq %d\n" | 126 | "numa_next_scan %lu numa_scan_offset %lu numa_scan_seq %d\n" |