[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190215220856.29749-17-zi.yan@sent.com>
Date: Fri, 15 Feb 2019 14:08:41 -0800
From: Zi Yan <zi.yan@...t.com>
To: linux-mm@...ck.org, linux-kernel@...r.kernel.org
Cc: Dave Hansen <dave.hansen@...ux.intel.com>,
Michal Hocko <mhocko@...nel.org>,
"Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Vlastimil Babka <vbabka@...e.cz>,
Mel Gorman <mgorman@...hsingularity.net>,
John Hubbard <jhubbard@...dia.com>,
Mark Hairgrove <mhairgrove@...dia.com>,
Nitin Gupta <nigupta@...dia.com>,
David Nellans <dnellans@...dia.com>, Zi Yan <ziy@...dia.com>
Subject: [RFC PATCH 16/31] mm: thp: check compound_mapcount of PMD-mapped PUD THPs at free time.
From: Zi Yan <ziy@...dia.com>
PMD mappings on a PUD THP should be zero when the page is freed.
Signed-off-by: Zi Yan <ziy@...dia.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
Powered by blists - more mailing lists