lkml.org 
[lkml]   [2020]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH v2 16/30] mm: debug: adapt dump_page to PUD THP.
Date
From: Zi Yan <ziy@nvidia.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@nvidia.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
\
 
 \ /
  Last update: 2020-09-28 20:03    [W:0.937 / U:0.448 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site