Re: [PATCH v3 06/13] mm/huge_memory: remove unnecessary VM_BUG_ON_PAGE()

Suren Baghdasaryan
2026-03-28T19:09:50Z

On Fri, Mar 20, 2026 at 11:07 AM Lorenzo Stoakes (Oracle)
<ljs@kernel.org> 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.
>
> Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
> Signed-off-by: Lorenzo Stoakes (Oracle) <ljs@kernel.org>

Reviewed-by: Suren Baghdasaryan <surenb@google.com>

> ---
> mm/huge_memory.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> index b9d9acfef147..4add863cd18f 100644
> --- a/mm/huge_memory.c
> +++ b/mm/huge_memory.c
> @@ -2375,7 +2375,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
>