Re: [PATCH 1/5] mm/rmap: convert page -> folio for hwpoison checks

From: David Hildenbrand (Arm)

Date: Tue Jul 07 2026 - 10:21:02 EST


On 7/7/26 14:11, Dev Jain wrote:
> try_to_unmap() receives hugetlb folios only from the hwpoison path.
> hugetlb_update_hwpoison() sets the hugetlb folio's head-page
> hwpoison bit, and page_vma_mapped_walk() reports the hugetlb mapping at
> the head PFN, so the previous PageHWPoison(subpage) check happened to
> work for hugetlb.
>
> For non-hugetlb folios, unmap_poisoned_folio() currently rejects large
> folios before calling try_to_unmap(). Hence it is always the case that
> if try_to_unmap_one() handles an hwpoisoned folio, then the head page is
> marked with the poison bit.
>
> Therefore, convert the poisoned subpage checks to folio_test_hwpoison().
>
> No functional change intended, except that, while at it,
> convert VM_BUG_* to VM_WARN_*.
>
> Signed-off-by: Dev Jain <dev.jain@xxxxxxx>
> ---

Yes, LGTM

Acked-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>

--
Cheers,

David