summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiaohe Lin <linmiaohe@huawei.com>2024-09-14 09:53:06 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-10-04 16:33:48 +0200
commit721aa7c9984e05b3bbff53fc4c914e395a24ded2 (patch)
tree13490eed446fb3853e70440325fe5625285efd37
parente897d184a8dd4a4e1f39c8c495598e4d9472776c (diff)
mm/huge_memory: ensure huge_zero_folio won't have large_rmappable flag set
commit 2a1b8648d9be9f37f808a36c0f74adb8c53d06e6 upstream. Ensure huge_zero_folio won't have large_rmappable flag set. So it can be reported as thp,zero correctly through stable_page_flags(). Link: https://lkml.kernel.org/r/20240914015306.3656791-1-linmiaohe@huawei.com Fixes: 5691753d73a2 ("mm: convert huge_zero_page to huge_zero_folio") Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Cc: David Hildenbrand <david@redhat.com> Cc: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--mm/huge_memory.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 4d9c1277e5e4..cedc93028894 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -214,6 +214,8 @@ retry:
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();