summaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorVlastimil Babka <vbabka@suse.cz>2016-03-15 17:56:24 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-03-15 19:55:16 -0400
commitff8e81163889ac4c7f59e7f7db6377d0c5d8d69c (patch)
tree6b6cb957fafdee49e5453d4dc556f343d0a98d56 /mm/page_alloc.c
parent4e462112e98f9ad6dd62e160f8b14c7df5fed2fc (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/page_alloc.c')
-rw-r--r--mm/page_alloc.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index d98672d33752..0691403aed93 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -430,7 +430,7 @@ static void bad_page(struct page *page, const char *reason,
430 goto out; 430 goto out;
431 } 431 }
432 if (nr_unshown) { 432 if (nr_unshown) {
433 printk(KERN_ALERT 433 pr_alert(
434 "BUG: Bad page state: %lu messages suppressed\n", 434 "BUG: Bad page state: %lu messages suppressed\n",
435 nr_unshown); 435 nr_unshown);
436 nr_unshown = 0; 436 nr_unshown = 0;
@@ -440,9 +440,13 @@ static void bad_page(struct page *page, const char *reason,
440 if (nr_shown++ == 0) 440 if (nr_shown++ == 0)
441 resume = jiffies + 60 * HZ; 441 resume = jiffies + 60 * HZ;
442 442
443 printk(KERN_ALERT "BUG: Bad page state in process %s pfn:%05lx\n", 443 pr_alert("BUG: Bad page state in process %s pfn:%05lx\n",
444 current->comm, page_to_pfn(page)); 444 current->comm, page_to_pfn(page));
445 dump_page_badflags(page, reason, bad_flags); 445 __dump_page(page, reason);
446 bad_flags &= page->flags;
447 if (bad_flags)
448 pr_alert("bad because of flags: %#lx(%pGp)\n",
449 bad_flags, &bad_flags);
446 dump_page_owner(page); 450 dump_page_owner(page);
447 451
448 print_modules(); 452 print_modules();