summaryrefslogtreecommitdiffstats
path: root/mm/debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/debug.c')
-rw-r--r--mm/debug.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/mm/debug.c b/mm/debug.c
index cdacba12e09a..0abb987dad9b 100644
--- a/mm/debug.c
+++ b/mm/debug.c
@@ -17,7 +17,7 @@
17 17
18#include "internal.h" 18#include "internal.h"
19 19
20char *migrate_reason_names[MR_TYPES] = { 20const char *migrate_reason_names[MR_TYPES] = {
21 "compaction", 21 "compaction",
22 "memory_failure", 22 "memory_failure",
23 "memory_hotplug", 23 "memory_hotplug",
@@ -44,6 +44,7 @@ const struct trace_print_flags vmaflag_names[] = {
44 44
45void __dump_page(struct page *page, const char *reason) 45void __dump_page(struct page *page, const char *reason)
46{ 46{
47 struct address_space *mapping = page_mapping(page);
47 bool page_poisoned = PagePoisoned(page); 48 bool page_poisoned = PagePoisoned(page);
48 int mapcount; 49 int mapcount;
49 50
@@ -53,7 +54,7 @@ void __dump_page(struct page *page, const char *reason)
53 * dump_page() when detected. 54 * dump_page() when detected.
54 */ 55 */
55 if (page_poisoned) { 56 if (page_poisoned) {
56 pr_emerg("page:%px is uninitialized and poisoned", page); 57 pr_warn("page:%px is uninitialized and poisoned", page);
57 goto hex_only; 58 goto hex_only;
58 } 59 }
59 60
@@ -64,27 +65,39 @@ void __dump_page(struct page *page, const char *reason)
64 */ 65 */
65 mapcount = PageSlab(page) ? 0 : page_mapcount(page); 66 mapcount = PageSlab(page) ? 0 : page_mapcount(page);
66 67
67 pr_emerg("page:%px count:%d mapcount:%d mapping:%px index:%#lx", 68 pr_warn("page:%px count:%d mapcount:%d mapping:%px index:%#lx",
68 page, page_ref_count(page), mapcount, 69 page, page_ref_count(page), mapcount,
69 page->mapping, page_to_pgoff(page)); 70 page->mapping, page_to_pgoff(page));
70 if (PageCompound(page)) 71 if (PageCompound(page))
71 pr_cont(" compound_mapcount: %d", compound_mapcount(page)); 72 pr_cont(" compound_mapcount: %d", compound_mapcount(page));
72 pr_cont("\n"); 73 pr_cont("\n");
74 if (PageAnon(page))
75 pr_warn("anon ");
76 else if (PageKsm(page))
77 pr_warn("ksm ");
78 else if (mapping) {
79 pr_warn("%ps ", mapping->a_ops);
80 if (mapping->host->i_dentry.first) {
81 struct dentry *dentry;
82 dentry = container_of(mapping->host->i_dentry.first, struct dentry, d_u.d_alias);
83 pr_warn("name:\"%pd\" ", dentry);
84 }
85 }
73 BUILD_BUG_ON(ARRAY_SIZE(pageflag_names) != __NR_PAGEFLAGS + 1); 86 BUILD_BUG_ON(ARRAY_SIZE(pageflag_names) != __NR_PAGEFLAGS + 1);
74 87
75 pr_emerg("flags: %#lx(%pGp)\n", page->flags, &page->flags); 88 pr_warn("flags: %#lx(%pGp)\n", page->flags, &page->flags);
76 89
77hex_only: 90hex_only:
78 print_hex_dump(KERN_ALERT, "raw: ", DUMP_PREFIX_NONE, 32, 91 print_hex_dump(KERN_WARNING, "raw: ", DUMP_PREFIX_NONE, 32,
79 sizeof(unsigned long), page, 92 sizeof(unsigned long), page,
80 sizeof(struct page), false); 93 sizeof(struct page), false);
81 94
82 if (reason) 95 if (reason)
83 pr_alert("page dumped because: %s\n", reason); 96 pr_warn("page dumped because: %s\n", reason);
84 97
85#ifdef CONFIG_MEMCG 98#ifdef CONFIG_MEMCG
86 if (!page_poisoned && page->mem_cgroup) 99 if (!page_poisoned && page->mem_cgroup)
87 pr_alert("page->mem_cgroup:%px\n", page->mem_cgroup); 100 pr_warn("page->mem_cgroup:%px\n", page->mem_cgroup);
88#endif 101#endif
89} 102}
90 103