[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200928175428.4110504-17-zi.yan@sent.com>
Date: Mon, 28 Sep 2020 13:54:14 -0400
From: Zi Yan <zi.yan@...t.com>
To: linux-mm@...ck.org
Cc: "Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
Roman Gushchin <guro@...com>, Rik van Riel <riel@...riel.com>,
Matthew Wilcox <willy@...radead.org>,
Shakeel Butt <shakeelb@...gle.com>,
Yang Shi <shy828301@...il.com>,
Jason Gunthorpe <jgg@...dia.com>,
Mike Kravetz <mike.kravetz@...cle.com>,
Michal Hocko <mhocko@...e.com>,
David Hildenbrand <david@...hat.com>,
William Kucharski <william.kucharski@...cle.com>,
Andrea Arcangeli <aarcange@...hat.com>,
John Hubbard <jhubbard@...dia.com>,
David Nellans <dnellans@...dia.com>,
linux-kernel@...r.kernel.org, Zi Yan <ziy@...dia.com>
Subject: [RFC PATCH v2 16/30] mm: debug: adapt dump_page to PUD THP.
From: Zi Yan <ziy@...dia.com>
Since the order of a PUD THP is greater than MAX_ORDER, do not consider
its tail pages corrupted. Also print sub_compound_mapcount when dumping
a PMDPageInPUD.
Signed-off-by: Zi Yan <ziy@...dia.com>
---
mm/debug.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/mm/debug.c b/mm/debug.c
index ccca576b2899..f5b035dc620d 100644
--- a/mm/debug.c
+++ b/mm/debug.c
@@ -68,7 +68,9 @@ void __dump_page(struct page *page, const char *reason)
goto hex_only;
}
- if (page < head || (page >= head + MAX_ORDER_NR_PAGES)) {
+ if (page < head ||
+ (page >= head + max_t(unsigned long, compound_nr(head),
+ (unsigned long)MAX_ORDER_NR_PAGES))) {
/*
* Corrupt page, so we cannot call page_mapping. Instead, do a
* safe subset of the steps that page_mapping() does. Caution:
@@ -109,6 +111,8 @@ void __dump_page(struct page *page, const char *reason)
head, compound_order(head),
head_compound_mapcount(head));
}
+ if (compound_order(head) == HPAGE_PUD_ORDER && PMDPageInPUD(page))
+ pr_warn("sub_compound_mapcount:%d\n", sub_compound_mapcount(page));
}
if (PageKsm(page))
type = "ksm ";
--
2.28.0
Powered by blists - more mailing lists