Skip to contentSkip to conversation

mm-avoid-vm_bug_on-when-try-to-map-an-anon-large-folio-to-zero-page.patch removed from -mm tree

merged mm-hotfixes-stable Andrew Morton 1 participant 1 message Oct 31, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm: avoid VM_BUG_ON when try to map an anon large folio to zero page.
has been removed from the -mm tree. Its filename was
mm-avoid-vm_bug_on-when-try-to-map-an-anon-large-folio-to-zero-page.patch

This patch was dropped because it was merged into the mm-hotfixes-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Zi Yan <[email protected]>
Subject: mm: avoid VM_BUG_ON when try to map an anon large folio to zero page.
Date: Wed, 23 Oct 2024 13:12:36 -0400

An anonymous large folio can be split into non order-0 folios, try_to_map_unused_to_zeropage() should not VM_BUG_ON compound pages but just return false. This fixes the crash when splitting anonymous large folios to non order-0 folios.

Fixes b1f202060afe ("mm: remap unused subpages to shared zeropage when splitting isolated thp")
Cc Barry Song <[email protected]>
Cc Domenico Cerasuolo <[email protected]>
Cc Johannes Weiner <[email protected]>
Cc Jonathan Corbet <[email protected]>
Cc Matthew Wilcox <[email protected]>
Cc Mike Rapoport (Microsoft) <[email protected]>
Cc Nico Pache <[email protected]>
Cc Rik van Riel <[email protected]>
Cc Roman Gushchin <[email protected]>
Cc Ryan Roberts <[email protected]>
Cc Shakeel Butt <[email protected]>
Cc Yu Zhao <[email protected]>

---

 mm/migrate.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
mm/migrate.c renamed from mm/migrate.c~mm-avoid-vm_bug_on-when-try-to-map-an-anon-large-folio-to-zero-page +2 -1
@@ -206,7 +206,8 @@ static bool try_to_map_unused_to_zeropag
 	pte_t newpte;
 	void *addr;
 
-	VM_BUG_ON_PAGE(PageCompound(page), page);
+	if (PageCompound(page))
+		return false;
 	VM_BUG_ON_PAGE(!PageAnon(page), page);
 	VM_BUG_ON_PAGE(!PageLocked(page), page);
 	VM_BUG_ON_PAGE(pte_present(*pvmw->pte), page);

_

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

mm-avoid-zeroing-user-movable-page-twice-with-init_on_alloc=1.patch mm-avoid-zeroing-user-movable-page-twice-with-init_on_alloc=1-fix.patch