Re: [PATCH 7.2 v16 06/13] mm/khugepaged: skip collapsing mTHP to smaller orders

From: Usama Arif

Date: Mon Apr 20 2026 - 12:30:48 EST


On Sun, 19 Apr 2026 12:57:43 -0600 Nico Pache <npache@xxxxxxxxxx> wrote:

> khugepaged may try to collapse a mTHP to a smaller mTHP, resulting in
> some pages being unmapped. Skip these cases until we have a way to check
> if its ok to collapse to a smaller mTHP size (like in the case of a
> partially mapped folio). This check is also not done during the scan phase
> as the current collapse order is unknown at that time.
>
> This patch is inspired by Dev Jain's work on khugepaged mTHP support [1].
>
> [1] https://lore.kernel.org/lkml/20241216165105.56185-11-dev.jain@xxxxxxx/
>
> Reviewed-by: Lorenzo Stoakes <ljs@xxxxxxxxxx>
> Reviewed-by: Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx>
> Co-developed-by: Dev Jain <dev.jain@xxxxxxx>
> Signed-off-by: Dev Jain <dev.jain@xxxxxxx>
> Signed-off-by: Nico Pache <npache@xxxxxxxxxx>
> ---
> mm/khugepaged.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>

Acked-by: Usama Arif <usama.arif@xxxxxxxxx>