Skip to contentSkip to conversation

mm-rmap-sanity-check-that-zeropages-are-not-passed-to-rmap.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Jun 25, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/rmap: sanity check that zeropages are not passed to RMAP
has been removed from the -mm tree. Its filename was
mm-rmap-sanity-check-that-zeropages-are-not-passed-to-rmap.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: David Hildenbrand <[email protected]>
Subject: mm/rmap: sanity check that zeropages are not passed to RMAP
Date: Wed, 22 May 2024 14:57:13 +0200

Using insert_page() we might have previously ended up passing the zeropage into rmap code. Make sure that won't happen again.

Note that we won't check the huge zeropage for now, which might still end up in RMAP code.

---

 include/linux/rmap.h |    3 +++
 1 file changed, 3 insertions(+)
include/linux/rmap.h renamed from include/linux/rmap.h~mm-rmap-sanity-check-that-zeropages-are-not-passed-to-rmap +3 -0
@@ -200,6 +200,9 @@ static inline void __folio_rmap_sanity_c
 	/* hugetlb folios are handled separately. */
 	VM_WARN_ON_FOLIO(folio_test_hugetlb(folio), folio);
 
+	/* When (un)mapping zeropages, we should never touch ref+mapcount. */
+	VM_WARN_ON_FOLIO(is_zero_folio(folio), folio);
+
 	/*
 	 * TODO: we get driver-allocated folios that have nothing to do with
 	 * the rmap using vm_insert_page(); therefore, we cannot assume that

_

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

mm-pass-meminit_context-to-__free_pages_core.patch mm-pass-meminit_context-to-__free_pages_core-fix.patch mm-pass-meminit_context-to-__free_pages_core-fix-2.patch mm-pass-meminit_context-to-__free_pages_core-fix-3.patch mm-memory_hotplug-initialize-memmap-of-zone_device-with-pageoffline-instead-of-pagereserved.patch mm-memory_hotplug-skip-adjust_managed_page_count-for-pageoffline-pages-when-offlining.patch mm-read-page_type-using-read_once.patch mm-migrate-make-migrate_misplaced_folio-return-0-on-success.patch mm-migrate-move-numa-hinting-fault-folio-isolation-checks-under-ptl.patch