Skip to contentSkip to conversation

mm-huge_memory-check-new-folio-order-when-split-a-folio.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Mar 12, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/huge_memory: check new folio order when split a folio
has been removed from the -mm tree. Its filename was
mm-huge_memory-check-new-folio-order-when-split-a-folio.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: Zi Yan <[email protected]>
Subject: mm/huge_memory: check new folio order when split a folio
Date: Thu, 7 Mar 2024 13:18:53 -0500

A folio can only be split into lower orders.

Since there are no new_order checks in debugfs, any new_order can be passed via debugfs into split_huge_page_to_list_to_order().

Check new_order to make sure it is smaller than input folio order.

Fixes c010d47f107f ("mm: thp: split huge page to any lower order pages")
Cc David Hildenbrand <[email protected]>
Cc Kirill A. Shutemov <[email protected]>
Cc Matthew Wilcox (Oracle) <[email protected]>
Cc Ryan Roberts <[email protected]>
Cc Yang Shi <[email protected]>
Cc Yu Zhao <[email protected]>

---

 mm/huge_memory.c |    3 +++
 1 file changed, 3 insertions(+)
mm/huge_memory.c renamed from mm/huge_memory.c~mm-huge_memory-check-new-folio-order-when-split-a-folio +3 -0
@@ -3052,6 +3052,9 @@ int split_huge_page_to_list_to_order(str
 	VM_BUG_ON_FOLIO(!folio_test_locked(folio), folio);
 	VM_BUG_ON_FOLIO(!folio_test_large(folio), folio);
 
+	if (new_order >= folio_order(folio))
+		return -EINVAL;
+
 	/* Cannot split anonymous THP to order-1 */
 	if (new_order == 1 && folio_test_anon(folio)) {
 		VM_WARN_ONCE(1, "Cannot split to order-1 folio");

_

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