Re: [PATCH v4 4/7] mm/khugepaged: fix outdated comments

From: Lance Yang

Date: Mon Aug 17 2026 - 00:38:25 EST



On Tue, Aug 11, 2026 at 06:48:36AM -0600, Nico Pache (Red Hat) wrote:
>Fix comment in collapse_scan_pmd() that still described the old
>folio_mapcount() > folio_ref_count() check and a "512" false-positive
>scenario. The code now uses folio_expected_ref_count() != folio_ref_count()
>which doesn't suffer from the same limitation.
>
>Fix comment in collapse_huge_page() that referenced ptep_clear_flush,
>when the code actually uses pmdp_collapse_flush.
>
>Fix comment in __collapse_huge_page_swapin() that referenced the old
>function name khugepaged_scan_pmd, now collapse_scan_pmd.
>
>Also clean up some simple typos and stale terminology (mmap_sem ->
>mmap_lock, PG_lock -> folio lock, page -> folio, grammar).
>
>We also clarify a comment regarding where the max_ptes_none check is
>deferred to in mthp_collapse() from the original collapse_scan_pmd check.
>
>Update all comments that references a function to include parentheses.
>
>Acked-by: Usama Arif <usama.arif@xxxxxxxxx>
>Assisted-by: Cursor(claude-sonnet-4):4.6
>Acked-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
>Signed-off-by: Nico Pache (Red Hat) <nico.pache@xxxxxxxxx>
>---

Reviewed-by: Lance Yang <lance.yang@xxxxxxxxx>