From: Lorenzo Stoakes (Oracle) Date: Fri, 20 Mar 2026 18:07:23 +0000 (+0000) Subject: mm/huge_memory: remove unnecessary VM_BUG_ON_PAGE() X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=07f264680ac875725ca12e6adadd9e3def2e30f2;p=thirdparty%2Fkernel%2Flinux.git mm/huge_memory: remove unnecessary VM_BUG_ON_PAGE() This has been around since the beginnings of the THP implementation. I think we can safely assume that, if we have a THP folio, it will have a head page. Link: https://lkml.kernel.org/r/f3fa8eb4634ccb2e78209f570cc1a769a02ce93e.1774029655.git.ljs@kernel.org Signed-off-by: Lorenzo Stoakes (Oracle) Reviewed-by: Baolin Wang Reviewed-by: Suren Baghdasaryan Cc: Barry Song Cc: David Hildenbrand Cc: Dev Jain Cc: Lance Yang Cc: Liam Howlett Cc: Michal Hocko Cc: Mike Rapoport Cc: Nico Pache Cc: Qi Zheng Cc: Ryan Roberts Cc: Zi Yan Signed-off-by: Andrew Morton --- diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 283685dd6d9fe..f072acd5b2799 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -2452,7 +2452,6 @@ bool zap_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma, folio = page_folio(page); folio_remove_rmap_pmd(folio, page, vma); WARN_ON_ONCE(folio_mapcount(folio) < 0); - VM_BUG_ON_PAGE(!PageHead(page), page); } else if (pmd_is_valid_softleaf(orig_pmd)) { const softleaf_t entry = softleaf_from_pmd(orig_pmd);