Re: [PATCH v5 9/9] mm/collapse: separate scanning a PTE table from collapsing it

From: David Hildenbrand (Arm)

Date: Mon Oct 19 2026 - 09:25:59 EST



> /*
> * Bring missing pages in from swap, to complete THP collapse.
> - * Only done if collapse_scan_pmd() believes it is worthwhile.
> + * Only done if collapse_scan_anon() believes it is worthwhile.
> *
> * For mTHP orders the function bails on the first swap entry, because
> * faulting pages back in during collapse could re-populate PTEs that
> @@ -1235,8 +1235,8 @@ static enum scan_result alloc_charge_folio(struct folio **foliop, struct mm_stru
> * while allocating a THP, as that could trigger direct reclaim/compaction.
> * Note that the VMA must be rechecked after grabbing the mmap_lock again.
> */
> -static enum scan_result collapse_huge_page(struct mm_struct *mm, unsigned long start_addr,
> - int referenced, int unmapped, struct collapse_control *cc,

Still some sub-optimally named functions around here, but we can tackle that later.

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

--
Cheers,

David