Re: [PATCH v3 04/12] mm/collapse: add collapse.h for the collapse interface
From: David Hildenbrand (Arm)
Date: Wed Sep 23 2026 - 07:56:58 EST
On 9/16/26 11:31, Kiryl Shutsemau wrote:
> From: "Kiryl Shutsemau (Meta)" <kas@xxxxxxxxxx>
>
> khugepaged.c holds both the users of collapse and the machinery that
> performs it. The daemon's scan loop, the sysfs tunables, MADV_COLLAPSE's
> entry point and the collapse itself all sit in one file and reach into
> each other freely. Nothing marks where a user ends and the engine
> begins.
>
> Start drawing that line.
>
> Add mm/collapse.h for what the two sides have to agree on:
>
> - enum scan_result - what the engine hands back;
> - struct collapse_control - the state a request carries.
>
> And two constants move with them:
>
> - KHUGEPAGED_MAX_PTES_LIMIT -> COLLAPSE_MAX_PTES_LIMIT;
> - KHUGEPAGED_MIN_MTHP_ORDER -> COLLAPSE_MIN_MTHP_ORDER.
>
These look a bit odd when thinking about the "user" aspect. These are rather
collapse internals?
> Neither is a fact about the daemon, so both lose the KHUGEPAGED_ prefix.
Acked-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
--
Cheers,
David