mm-introduce-is_pmd_order-helper.patch removed from -mm tree
The quilt patch titled
Subject: mm: introduce is_pmd_order helper
has been removed from the -mm tree. Its filename was
mm-introduce-is_pmd_order-helper.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: introduce is_pmd_order helper
Date: Wed, 25 Mar 2026 05:40:19 -0600
In order to add mTHP support to khugepaged, we will often be checking if a given order is (or is not) a PMD order. Some places in the kernel already use this check, so lets create a simple helper function to keep the code clean and readable.
---
include/linux/huge_mm.h | 5 +++++ mm/huge_memory.c | 2 +- mm/khugepaged.c | 6 +++--- mm/memory.c | 2 +- mm/mempolicy.c | 2 +- mm/page_alloc.c | 4 ++-- mm/shmem.c | 3 +-- 7 files changed, 14 insertions(+), 10 deletions(-)
include/linux/huge_mm.h renamed from include/linux/huge_mm.h~mm-introduce-is_pmd_order-helper +5 -0
@@ -771,6 +771,11 @@ static inline bool pmd_is_huge(pmd_t pmd }#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ +static inline bool is_pmd_order (unsigned int order) +{ +return order ==HPAGE_PMD_ORDER ; +} +static inline int split_folio_to_list_to_order (struct folio *folio,struct list_head *list,int new_order) {
mm/huge_memory.c renamed from mm/huge_memory.c~mm-introduce-is_pmd_order-helper +1 -1
@@ -4159,7 +4159,7 @@ out_unlock:i_mmap_unlock_read (mapping); out:xas_destroy (&xas); -if (old_order ==HPAGE_PMD_ORDER ) +if (is_pmd_order (old_order))count_vm_event (!ret ?THP_SPLIT_PAGE :THP_SPLIT_PAGE_FAILED );count_mthp_stat (old_order, !ret ?MTHP_STAT_SPLIT :MTHP_STAT_SPLIT_FAILED );return ret;
mm/khugepaged.c renamed from mm/khugepaged.c~mm-introduce-is_pmd_order-helper +3 -3
@@ -1540,7 +1540,7 @@ static enum scan_result try_collapse_pteif (IS_ERR (folio))return SCAN_PAGE_NULL ; -if (folio_order (folio) !=HPAGE_PMD_ORDER ) { +if (!is_pmd_order (folio_order (folio))) { result =SCAN_PAGE_COMPOUND ; goto drop_folio; }
@@ -2023,7 +2023,7 @@ static enum scan_result collapse_file(st* we locked the first folio, then a THP might be there already. * This will be discovered on the first iteration. */ -if (folio_order (folio) ==HPAGE_PMD_ORDER ) { +if (is_pmd_order (folio_order (folio))) { result =SCAN_PTE_MAPPED_HUGEPAGE ; goto out_unlock; }
@@ -2351,7 +2351,7 @@ static enum scan_result hpage_collapse_scontinue ; } -if (folio_order (folio) ==HPAGE_PMD_ORDER ) { +if (is_pmd_order (folio_order (folio))) { result =SCAN_PTE_MAPPED_HUGEPAGE ;/* * PMD-sized THP implies that we can only try
mm/memory.c renamed from mm/memory.c~mm-introduce-is_pmd_order-helper +1 -1
@@ -5435,7 +5435,7 @@ vm_fault_t do_set_pmd(struct vm_fault *vif (!thp_vma_suitable_order (vma, haddr,PMD_ORDER ))return ret; -if (folio_order (folio) !=HPAGE_PMD_ORDER ) +if (!is_pmd_order (folio_order (folio)))return ret; page = &folio->page;
mm/mempolicy.c renamed from mm/mempolicy.c~mm-introduce-is_pmd_order-helper +1 -1
@@ -2449,7 +2449,7 @@ static struct page *alloc_pages_mpol(gfpif (IS_ENABLED (CONFIG_TRANSPARENT_HUGEPAGE ) &&/* filter "hugepage" allocation, unless from alloc_pages() */ - order ==HPAGE_PMD_ORDER && ilx !=NO_INTERLEAVE_INDEX ) { +is_pmd_order (order) && ilx !=NO_INTERLEAVE_INDEX ) {/* * For hugepage allocation and non-interleave policy which * allows the current node (or other explicitly preferred
mm/page_alloc.c renamed from mm/page_alloc.c~mm-introduce-is_pmd_order-helper +2 -2
@@ -651,7 +651,7 @@ static inline unsigned int order_to_pind#ifdef CONFIG_TRANSPARENT_HUGEPAGE bool movable;if (order >PAGE_ALLOC_COSTLY_ORDER ) { -VM_BUG_ON (order !=HPAGE_PMD_ORDER ); +VM_BUG_ON (!is_pmd_order (order)); movable = migratetype ==MIGRATE_MOVABLE ;
@@ -683,7 +683,7 @@ static inline bool pcp_allowed_order(unsif (order <=PAGE_ALLOC_COSTLY_ORDER )return true;#ifdef CONFIG_TRANSPARENT_HUGEPAGE -if (order ==HPAGE_PMD_ORDER ) +if (is_pmd_order (order))return true;#endif return false;
mm/shmem.c renamed from mm/shmem.c~mm-introduce-is_pmd_order-helper +1 -2
@@ -5558,8 +5558,7 @@ static ssize_t thpsize_shmem_enabled_stospin_unlock (&huge_shmem_orders_lock); }else if (sysfs_streq (buf,"inherit" )) {/* Do not override huge allocation policy with non-PMD sized mTHP */ -if (shmem_huge ==SHMEM_HUGE_FORCE && - order !=HPAGE_PMD_ORDER ) +if (shmem_huge ==SHMEM_HUGE_FORCE && !is_pmd_order (order))return -EINVAL ;spin_lock (&huge_shmem_orders_lock);
_
Patches currently in -mm which might be from [email protected] are