[PATCH v2 6/9] mm/huge_memory: remove unnecessary VM_BUG_ON_PAGE()

Lorenzo Stoakes (Oracle) posted 9 patches 2 weeks, 3 days ago
There is a newer version of this series
[PATCH v2 6/9] mm/huge_memory: remove unnecessary VM_BUG_ON_PAGE()
Posted by Lorenzo Stoakes (Oracle) 2 weeks, 3 days ago
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.

Signed-off-by: Lorenzo Stoakes (Oracle) <ljs@kernel.org>
---
 mm/huge_memory.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index c84b30461cc5..499c31bf8f83 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -2468,7 +2468,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);
 
-- 
2.53.0
Re: [PATCH v2 6/9] mm/huge_memory: remove unnecessary VM_BUG_ON_PAGE()
Posted by Baolin Wang 2 weeks, 3 days ago

On 3/19/26 9:00 PM, Lorenzo Stoakes (Oracle) wrote:
> 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.
> 
> Signed-off-by: Lorenzo Stoakes (Oracle) <ljs@kernel.org>
> ---

I think I reviewed this patch before[1]:)

Anyway, LGTM.
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>

[1] 
https://lore.kernel.org/all/07368afd-05c3-48f4-89a0-c1349784f62b@linux.alibaba.com/