Skip to contentSkip to conversation

mm-mm_init-add-zone-mismatch-warning-during-page-init.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Oct 24

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/mm_init: add zone mismatch warning during page init
has been removed from the -mm tree. Its filename was
mm-mm_init-add-zone-mismatch-warning-during-page-init.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: Muchun Song <[email protected]>
Subject: mm/mm_init: add zone mismatch warning during page init
Date: Sat, 10 Oct 2026 15:57:55 +0800

For vmemmap-optimized sections, tail struct pages may be backed by shared vmemmap pages. Those shared pages must carry the same page zone ID as the struct pages initialized for the section.

Warn in __init_single_page() if the shared tail page has a different page_zone_id(), which would indicate inconsistent initialization.

[[email protected]: document ordering of shared and retained struct page initialization]
Cc Madhavan Srinivasan <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Michael Ellerman <[email protected]>
Cc Nicholas Piggin <[email protected]>
Cc Christophe Leroy <[email protected]>
Cc Ritesh Harjani (IBM) <[email protected]>
Cc Shrikanth Hegde <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Liam R. Howlett <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Michal Hocko <[email protected]>

---

 mm/mm_init.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)
mm/mm_init.c renamed from mm/mm_init.c~mm-mm_init-add-zone-mismatch-warning-during-page-init +14 -0
@@ -593,6 +593,15 @@ out:
 	node_states[N_MEMORY] = saved_node_state;
 }
 
+static inline void vmemmap_optimization_verify_zone(struct page *page)
+{
+	const unsigned int order = pfn_to_section_compound_order(page_to_pfn(page));
+
+	VM_WARN_ON_ONCE(vmemmap_optimizable_order(order) &&
+			page_zone_id(page + VMEMMAP_OPTIMIZATION_NR_STRUCT_PAGES) !=
+			page_zone_id(page));
+}
+
 void __meminit __init_single_page(struct page *page, unsigned long pfn,
 				unsigned long zone, int nid)
 {
@@ -609,6 +618,11 @@ void __meminit __init_single_page(struct
 	if (!is_highmem_idx(zone))
 		set_page_address(page, __va(pfn << PAGE_SHIFT));
 #endif
+	/*
+	 * Shared tail struct pages are initialized during vmemmap population,
+	 * before retained struct pages reach here.
+	 */
+	vmemmap_optimization_verify_zone(page);
 }
 
 #ifdef CONFIG_NUMA

_

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

mm-fix-missing-page-table-destructor-in-pagetable_free.patch arm64-mm-fix-destructor-for-unconstructed-hotplug-page-tables.patch