Skip to contentSkip to conversation

mm-huge_memory-merge-uniform_split_supported-and-non_uniform_split_supported.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Nov 24, 2025 Stable branch

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/huge_memory: merge uniform_split_supported() and non_uniform_split_supported()
has been removed from the -mm tree. Its filename was
mm-huge_memory-merge-uniform_split_supported-and-non_uniform_split_supported.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: Wei Yang <[email protected]>
Subject: mm/huge_memory: merge uniform_split_supported() and non_uniform_split_supported()
Date: Thu, 6 Nov 2025 03:41:55 +0000

uniform_split_supported() and non_uniform_split_supported() share significantly similar logic.

The only functional difference is that uniform_split_supported() includes an additional check on the requested @new_order.

The reason for this check comes from the following two aspects:

* some file system or swap cache just supports order-0 folio
* the behavioral difference between uniform/non-uniform split

The behavioral difference between uniform split and non-uniform:

* uniform split splits folio directly to @new_order
* non-uniform split creates after-split folios with orders from folio_order(folio) - 1 to new_order.

This means for non-uniform split or !new_order split we should check the file system and swap cache respectively.

This commit unifies the logic and merge the two functions into a single combined helper, removing redundant code and simplifying the split support checking mechanism.

Fixes c010d47f107f ("mm: thp: split huge page to any lower order pages")
Cc Zi Yan <[email protected]>
Cc "David Hildenbrand (Red Hat)" <[email protected]>
Cc Baolin Wang <[email protected]>
Cc Barry Song <[email protected]>
Cc Dev Jain <[email protected]>
Cc Lance Yang <[email protected]>
Cc Liam Howlett <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Nico Pache <[email protected]>
Cc Ryan Roberts <[email protected]>

---

 include/linux/huge_mm.h |    8 +---
 mm/huge_memory.c        |   71 ++++++++++++++++----------------------
 2 files changed, 33 insertions(+), 46 deletions(-)
include/linux/huge_mm.h renamed from include/linux/huge_mm.h~mm-huge_memory-merge-uniform_split_supported-and-non_uniform_split_supported +3 -5
@@ -374,10 +374,8 @@ int __split_huge_page_to_list_to_order(s
 		unsigned int new_order, bool unmapped);
 int min_order_for_split(struct folio *folio);
 int split_folio_to_list(struct folio *folio, struct list_head *list);
-bool uniform_split_supported(struct folio *folio, unsigned int new_order,
-		bool warns);
-bool non_uniform_split_supported(struct folio *folio, unsigned int new_order,
-		bool warns);
+bool folio_split_supported(struct folio *folio, unsigned int new_order,
+		enum split_type split_type, bool warns);
 int folio_split(struct folio *folio, unsigned int new_order, struct page *page,
 		struct list_head *list);
 
@@ -408,7 +406,7 @@ static inline int split_huge_page_to_ord
 static inline int try_folio_split_to_order(struct folio *folio,
 		struct page *page, unsigned int new_order)
 {
-	if (!non_uniform_split_supported(folio, new_order, /* warns= */ false))
+	if (!folio_split_supported(folio, new_order, SPLIT_TYPE_NON_UNIFORM, /* warns= */ false))
 		return split_huge_page_to_order(&folio->page, new_order);
 	return folio_split(folio, new_order, page, NULL);
 }
mm/huge_memory.c renamed from mm/huge_memory.c~mm-huge_memory-merge-uniform_split_supported-and-non_uniform_split_supported +30 -41

97 lines not on this page · raw message

_

Patches currently in -mm which might be from [email protected] are