Re: [PATCH] mm/rmap: remove stale hugetlb check in try_to_unmap_one

From: Lorenzo Stoakes (ARM)

Date: Mon Aug 31 2026 - 05:31:10 EST


On Mon, Aug 31, 2026 at 08:28:47AM +0000, Dev Jain wrote:
> Post commit d4ec5572825a ("mm/rmap: add try_to_unmap_poisoned_hugetlb_one")
> try_to_unmap_one() cannot be called with a hugetlb folio. Therefore remove
> the folio_test_hugetlb() check.
>
> Signed-off-by: Dev Jain <dev.jain@xxxxxxx>

LGTM so:

Reviewed-by: Lorenzo Stoakes (ARM) <ljs@xxxxxxxxxx>

> ---
> Rebase soup - my huge_ptep_get() fixes landed after the refactoring.
>
> This patch applies on Linux 7.3-rc1.
>
> mm/rmap.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/mm/rmap.c b/mm/rmap.c
> index d1819fd699380..606c8ecf31302 100644
> --- a/mm/rmap.c
> +++ b/mm/rmap.c
> @@ -2299,11 +2299,8 @@ static bool try_to_unmap_one(struct folio *folio, struct vm_area_struct *vma,
> VM_BUG_ON_FOLIO(!pvmw.pte, folio);
>
> address = pvmw.address;
> - if (folio_test_hugetlb(folio)) {
> - pteval = huge_ptep_get(mm, address, pvmw.pte);
> - } else {
> - pteval = ptep_get(pvmw.pte);
> - }
> + pteval = ptep_get(pvmw.pte);
> +
> if (likely(pte_present(pteval))) {
> pfn = pte_pfn(pteval);
> } else {
> --
> 2.43.0
>

--
Cheers, Lorenzo