Re: [PATCH 7.2 v16 03/13] mm/khugepaged: rework max_ptes_* handling with helper functions

From: Lance Yang

Date: Fri May 08 2026 - 07:13:48 EST



On Sun, Apr 19, 2026 at 12:57:40PM -0600, Nico Pache wrote:
>The following cleanup reworks all the max_ptes_* handling into helper
>functions. This increases the code readability and will later be used to
>implement the mTHP handling of these variables.
>
>With these changes we abstract all the madvise_collapse() special casing
>(dont respect the sysctls) away from the functions that utilize them. And
>will later in this series to cleanly restrict mTHP collapses behaviors.
>
>Suggested-by: David Hildenbrand <david@xxxxxxxxxx>
>Signed-off-by: Nico Pache <npache@xxxxxxxxxx>
>---

Nice. It should all be an equivalence-preserving refactor.

With David's suggested changes:
Reviewed-by: Lance Yang <lance.yang@xxxxxxxxx>