Skip to content

Commit 0496611

Browse files
MiaoheLingregkh
authored andcommitted
mm/huge_memory: ensure huge_zero_folio won't have large_rmappable flag set
commit 2a1b864 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: 5691753 ("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>
1 parent d59ebc9 commit 0496611

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

mm/huge_memory.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ static bool get_huge_zero_page(void)
220220
count_vm_event(THP_ZERO_PAGE_ALLOC_FAILED);
221221
return false;
222222
}
223+
/* Ensure zero folio won't have large_rmappable flag set. */
224+
folio_clear_large_rmappable(zero_folio);
223225
preempt_disable();
224226
if (cmpxchg(&huge_zero_folio, NULL, zero_folio)) {
225227
preempt_enable();

0 commit comments

Comments
 (0)