mm-khugepaged-skip-collapsing-mthp-to-smaller-orders.patch removed from -mm tree
The quilt patch titled
Subject: mm/khugepaged: skip collapsing mTHP to smaller orders
has been removed from the -mm tree. Its filename was
mm-khugepaged-skip-collapsing-mthp-to-smaller-orders.patch
This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Nico Pache <[email protected]>
Subject: mm/khugepaged: skip collapsing mTHP to smaller orders
Date: Fri, 5 Jun 2026 10:14:14 -0600
khugepaged may try to collapse a mTHP to a folio of equal or smaller size, possibly resulting in a partially mapped source folio, which is undesired. 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 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].
---
mm/khugepaged.c | 8 ++++++++ 1 file changed, 8 insertions(+)
mm/khugepaged.c renamed from mm/khugepaged.c~mm-khugepaged-skip-collapsing-mthp-to-smaller-orders +8 -0
@@ -697,6 +697,14 @@ static enum scan_result __collapse_huge_ goto out; } } +/* +* TODO: In some cases of partially-mapped folios, we'd actually +* want to collapse. +*/ +if (!is_pmd_order (order) &&folio_order (folio) >= order) { + result =SCAN_PTE_MAPPED_HUGEPAGE ; + goto out; + }if (folio_test_large (folio)) {struct folio *f;
_
Patches currently in -mm which might be from [email protected] are