[RFC PATCH 11/31] mm: debug: print compound page order in dump_page().

From: Zi Yan
Date: Fri Feb 15 2019 - 17:11:10 EST


From: Zi Yan <ziy@xxxxxxxxxx>

Since we have more than just PMD-level THPs, printing compound page
order is helpful to check the actual compound page sizes.

Signed-off-by: Zi Yan <ziy@xxxxxxxxxx>
---
mm/debug.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/mm/debug.c b/mm/debug.c
index 0abb987dad9b..21d211d7776c 100644
--- a/mm/debug.c
+++ b/mm/debug.c
@@ -68,8 +68,12 @@ void __dump_page(struct page *page, const char *reason)
pr_warn("page:%px count:%d mapcount:%d mapping:%px index:%#lx",
page, page_ref_count(page), mapcount,
page->mapping, page_to_pgoff(page));
- if (PageCompound(page))
- pr_cont(" compound_mapcount: %d", compound_mapcount(page));
+ if (PageCompound(page)) {
+ struct page *head = compound_head(page);
+
+ pr_cont(" compound_mapcount: %d, order: %d", compound_mapcount(page),
+ compound_order(head));
+ }
pr_cont("\n");
if (PageAnon(page))
pr_warn("anon ");
--
2.20.1