Skip to content

Commit 2a1b864

Browse files
MiaoheLinakpm00
authored andcommitted
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(). Link: https://lkml.kernel.org/r/[email protected] Fixes: 5691753 ("mm: convert huge_zero_page to huge_zero_folio") Signed-off-by: Miaohe Lin <[email protected]> Cc: David Hildenbrand <[email protected]> Cc: Matthew Wilcox (Oracle) <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 98b74bb commit 2a1b864

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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)