diff options
author | Vlastimil Babka <vbabka@suse.cz> | 2016-03-15 17:56:24 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-03-15 19:55:16 -0400 |
commit | ff8e81163889ac4c7f59e7f7db6377d0c5d8d69c (patch) | |
tree | 6b6cb957fafdee49e5453d4dc556f343d0a98d56 /mm/debug.c | |
parent | 4e462112e98f9ad6dd62e160f8b14c7df5fed2fc (diff) |
mm, debug: move bad flags printing to bad_page()
Since bad_page() is the only user of the badflags parameter of
dump_page_badflags(), we can move the code to bad_page() and simplify a
bit.
The dump_page_badflags() function is renamed to __dump_page() and can
still be called separately from dump_page() for temporary debug prints
where page_owner info is not desired.
The only user-visible change is that page->mem_cgroup is printed before
the bad flags.
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Sasha Levin <sasha.levin@oracle.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Mel Gorman <mgorman@suse.de>
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 | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/mm/debug.c b/mm/debug.c index 61b1f1bb328e..df7247b0b532 100644 --- a/mm/debug.c +++ b/mm/debug.c | |||
@@ -40,8 +40,7 @@ const struct trace_print_flags vmaflag_names[] = { | |||
40 | {0, NULL} | 40 | {0, NULL} |
41 | }; | 41 | }; |
42 | 42 | ||
43 | void dump_page_badflags(struct page *page, const char *reason, | 43 | void __dump_page(struct page *page, const char *reason) |
44 | unsigned long badflags) | ||
45 | { | 44 | { |
46 | pr_emerg("page:%p count:%d mapcount:%d mapping:%p index:%#lx", | 45 | pr_emerg("page:%p count:%d mapcount:%d mapping:%p index:%#lx", |
47 | page, atomic_read(&page->_count), page_mapcount(page), | 46 | page, atomic_read(&page->_count), page_mapcount(page), |
@@ -50,15 +49,12 @@ void dump_page_badflags(struct page *page, const char *reason, | |||
50 | pr_cont(" compound_mapcount: %d", compound_mapcount(page)); | 49 | pr_cont(" compound_mapcount: %d", compound_mapcount(page)); |
51 | pr_cont("\n"); | 50 | pr_cont("\n"); |
52 | BUILD_BUG_ON(ARRAY_SIZE(pageflag_names) != __NR_PAGEFLAGS + 1); | 51 | BUILD_BUG_ON(ARRAY_SIZE(pageflag_names) != __NR_PAGEFLAGS + 1); |
52 | |||
53 | pr_emerg("flags: %#lx(%pGp)\n", page->flags, &page->flags); | 53 | pr_emerg("flags: %#lx(%pGp)\n", page->flags, &page->flags); |
54 | 54 | ||
55 | if (reason) | 55 | if (reason) |
56 | pr_alert("page dumped because: %s\n", reason); | 56 | pr_alert("page dumped because: %s\n", reason); |
57 | 57 | ||
58 | badflags &= page->flags; | ||
59 | if (badflags) | ||
60 | pr_alert("bad because of flags: %#lx(%pGp)\n", badflags, | ||
61 | &badflags); | ||
62 | #ifdef CONFIG_MEMCG | 58 | #ifdef CONFIG_MEMCG |
63 | if (page->mem_cgroup) | 59 | if (page->mem_cgroup) |
64 | pr_alert("page->mem_cgroup:%p\n", page->mem_cgroup); | 60 | pr_alert("page->mem_cgroup:%p\n", page->mem_cgroup); |
@@ -67,7 +63,7 @@ void dump_page_badflags(struct page *page, const char *reason, | |||
67 | 63 | ||
68 | void dump_page(struct page *page, const char *reason) | 64 | void dump_page(struct page *page, const char *reason) |
69 | { | 65 | { |
70 | dump_page_badflags(page, reason, 0); | 66 | __dump_page(page, reason); |
71 | dump_page_owner(page); | 67 | dump_page_owner(page); |
72 | } | 68 | } |
73 | EXPORT_SYMBOL(dump_page); | 69 | EXPORT_SYMBOL(dump_page); |