]> Git Repo - linux.git/commitdiff
mm/huge_memory: ensure huge_zero_folio won't have large_rmappable flag set
authorMiaohe Lin <[email protected]>
Sat, 14 Sep 2024 01:53:06 +0000 (09:53 +0800)
committerAndrew Morton <[email protected]>
Tue, 17 Sep 2024 07:58:04 +0000 (00:58 -0700)
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: 5691753d73a2 ("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]>
mm/huge_memory.c

index 67c86a5d64a6a9825092c54ba801c91fa30121db..99b146d16a18508ea56b0871b256a3e00918d1de 100644 (file)
@@ -220,6 +220,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();
This page took 0.058936 seconds and 4 git commands to generate.