Re: [PATCH v5 2/9] mm/khugepaged: count collapses where khugepaged makes them

From: Lance Yang

Date: Thu Oct 15 2026 - 00:37:05 EST



On Wed, Oct 14, 2026 at 06:11:35PM +0100, Kiryl Shutsemau (Meta) wrote:
>collapse_single_pmd() bumps khugepaged_pages_collapsed for its caller, and
>tests cc->is_khugepaged to know whether it should: the counter belongs to
>the daemon, and MADV_COLLAPSE must not touch it.
>
>The daemon sees every result of every collapse it asks for, so it can keep
>its own counter without the shared path testing who called.
>
>Assisted-by: LLM
>Acked-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
>Reviewed-by: Zi Yan <ziy@xxxxxxxxxx>
>Reviewed-by: Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx>
>Signed-off-by: Kiryl Shutsemau (Meta) <kas@xxxxxxxxxx>
>---

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