lkml.org 
[lkml]   [2019]   [Feb]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH 16/31] mm: thp: check compound_mapcount of PMD-mapped PUD THPs at free time.
Date
From: Zi Yan <ziy@nvidia.com>

PMD mappings on a PUD THP should be zero when the page is freed.

Signed-off-by: Zi Yan <ziy@nvidia.com>
---
mm/page_alloc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index dbcccc022b30..b87a2ca0a97c 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1007,8 +1007,10 @@ static int free_tail_pages_check(struct page *head_page, struct page *page)
/* sub_compound_map_ptr store here */
if (compound_order(head_page) == HPAGE_PUD_ORDER &&
(page - head_page) % HPAGE_PMD_NR == 3) {
- if (unlikely(atomic_read(&page->compound_mapcount) != -1))
+ if (unlikely(atomic_read(&page->compound_mapcount) != -1)) {
+ pr_err("sub_compound_mapcount: %d\n", atomic_read(&page->compound_mapcount) + 1);
bad_page(page, "nonzero sub_compound_mapcount", 0);
+ }
break;
}
if (page->mapping != TAIL_MAPPING) {
--
2.20.1
\
 
 \ /
  Last update: 2019-02-15 23:09    [W:0.167 / U:0.896 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site