Re: [PATCH 02/12] mm/khugepaged: count collapses where khugepaged makes them

From: Zi Yan

Date: Fri Sep 04 2026 - 22:27:21 EST


On Fri Sep 4, 2026 at 11:10 AM EDT, Kiryl Shutsemau wrote:
> From: "Kiryl Shutsemau (Meta)" <kas@xxxxxxxxxx>
>
> 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: Claude-Code:claude-opus-5
> Signed-off-by: Kiryl Shutsemau (Meta) <kas@xxxxxxxxxx>
> ---
> mm/khugepaged.c | 11 ++++-------
> 1 file changed, 4 insertions(+), 7 deletions(-)
>
LGTM.

Reviewed-by: Zi Yan <ziy@xxxxxxxxxx>


--
Best Regards,
Yan, Zi