Skip to contentSkip to conversation

mm-rmap-add-a-zone_device-folio-warning-in-folio_referenced.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Mar 29

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm: rmap: add a ZONE_DEVICE folio warning in folio_referenced()
has been removed from the -mm tree. Its filename was
mm-rmap-add-a-zone_device-folio-warning-in-folio_referenced.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: Baolin Wang <[email protected]>
Subject: mm: rmap: add a ZONE_DEVICE folio warning in folio_referenced()
Date: Fri, 6 Mar 2026 14:43:39 +0800

The folio_referenced() is used to test whether a folio was referenced during reclaim. Moreover, ZONE_DEVICE folios are controlled by their device driver, have a lifetime tied to that driver, and are never placed on the LRU list. That means we should never try to reclaim ZONE_DEVICE folios, so add a warning to catch this unexpected behavior in folio_referenced() to avoid confusion, as discussed in the previous thread[1].

[1] https://lore.kernel.org/all/[email protected]/

Cc Axel Rasmussen <[email protected]>
Cc Barry Song <[email protected]>
Cc Catalin Marinas <[email protected]>
Cc Dev Jain <[email protected]>
Cc Jann Horn <[email protected]>
Cc Johannes Weiner <[email protected]>
Cc Liam Howlett <[email protected]>
Cc Lorenzo Stoakes (Oracle) <[email protected]>
Cc Matthew Wilcox (Oracle) <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Qi Zheng <[email protected]>
Cc Rik van Riel <[email protected]>
Cc Ryan Roberts <[email protected]>
Cc Shakeel Butt <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Wei Xu <[email protected]>
Cc Will Deacon <[email protected]>
Cc Yuanchu Xie <[email protected]>

---

 mm/rmap.c |    1 +
 1 file changed, 1 insertion(+)
mm/rmap.c renamed from mm/rmap.c~mm-rmap-add-a-zone_device-folio-warning-in-folio_referenced +1 -0
@@ -1072,6 +1072,7 @@ int folio_referenced(struct folio *folio
 		.invalid_vma = invalid_folio_referenced_vma,
 	};
 
+	VM_WARN_ON_ONCE_FOLIO(folio_is_zone_device(folio), folio);
 	*vm_flags = 0;
 	if (!pra.mapcount)
 		return 0;

_

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

mm-filemap-fix-nr_pages-calculation-overflow-in-filemap_map_pages.patch mm-vmscan-fix-dirty-folios-throttling-on-cgroup-v1-for-mglru.patch