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

From: Zi Yan

Date: Tue Aug 11 2026 - 16:50:26 EST


On Tue Aug 11, 2026 at 8:48 AM EDT, 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>
> ---
> mm/khugepaged.c | 44 +++++++++++++++++++++-----------------------
> 1 file changed, 21 insertions(+), 23 deletions(-)
>

Thanks.

Reviewed-by: Zi Yan <ziy@xxxxxxxxxx>


--
Best Regards,
Yan, Zi