From: Zi Yan <z...@nvidia.com>

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 <z...@nvidia.com>
---
 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

Reply via email to