[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240914015306.3656791-1-linmiaohe@huawei.com>
Date: Sat, 14 Sep 2024 09:53:06 +0800
From: Miaohe Lin <linmiaohe@...wei.com>
To: <akpm@...ux-foundation.org>
CC: <willy@...radead.org>, <david@...hat.com>, <linmiaohe@...wei.com>,
<linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH] mm/huge_memory: ensure huge_zero_folio won't have large_rmappable flag set
Ensure huge_zero_folio won't have large_rmappable flag set. So it can be
reported as thp,zero correctly through stable_page_flags().
Fixes: 5691753d73a2 ("mm: convert huge_zero_page to huge_zero_folio")
Signed-off-by: Miaohe Lin <linmiaohe@...wei.com>
---
mm/huge_memory.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 2a73efea02d7..4e34b7f89daf 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -218,6 +218,8 @@ static bool get_huge_zero_page(void)
count_vm_event(THP_ZERO_PAGE_ALLOC_FAILED);
return false;
}
+ /* Ensure zero folio won't have large_rmappable flag set. */
+ folio_clear_large_rmappable(zero_folio);
preempt_disable();
if (cmpxchg(&huge_zero_folio, NULL, zero_folio)) {
preempt_enable();
--
2.33.0
Powered by blists - more mailing lists