Skip to contentSkip to conversation

mm-debug-print-only-page-mapcount-excluding-folio-entire-mapcount-in-__dump_folio.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message May 6, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/debug: print only page mapcount (excluding folio entire mapcount) in __dump_folio()
has been removed from the -mm tree. Its filename was
mm-debug-print-only-page-mapcount-excluding-folio-entire-mapcount-in-__dump_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: David Hildenbrand <[email protected]>
Subject: mm/debug: print only page mapcount (excluding folio entire mapcount) in __dump_folio()
Date: Tue, 9 Apr 2024 21:23:00 +0200

Let's simplify and only print the page mapcount: we already print the large folio mapcount and the entire folio mapcount for large folios separately; that should be sufficient to figure out what's happening.

While at it, print the page mapcount also if it had an underflow, filtering out only typed pages.

Cc Chris Zankel <[email protected]>
Cc Hugh Dickins <[email protected]>
Cc John Paul Adrian Glaubitz <[email protected]>
Cc Jonathan Corbet <[email protected]>
Cc Matthew Wilcox (Oracle) <[email protected]>
Cc Max Filippov <[email protected]>
Cc Miaohe Lin <[email protected]>
Cc Muchun Song <[email protected]>
Cc Naoya Horiguchi <[email protected]>
Cc Peter Xu <[email protected]>
Cc Richard Chang <[email protected]>
Cc Rich Felker <[email protected]>
Cc Ryan Roberts <[email protected]>
Cc Yang Shi <[email protected]>
Cc Yin Fengwei <[email protected]>
Cc Yoshinori Sato <[email protected]>
Cc Zi Yan <[email protected]>

---

 mm/debug.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
mm/debug.c renamed from mm/debug.c~mm-debug-print-only-page-mapcount-excluding-folio-entire-mapcount-in-__dump_folio +2 -7
@@ -55,15 +55,10 @@ static void __dump_folio(struct folio *f
 		unsigned long pfn, unsigned long idx)
 {
 	struct address_space *mapping = folio_mapping(folio);
-	int mapcount = atomic_read(&page->_mapcount) + 1;
+	int mapcount = atomic_read(&page->_mapcount);
 	char *type = "";
 
-	/* Open-code page_mapcount() to avoid looking up a stale folio */
-	if (mapcount < 0)
-		mapcount = 0;
-	if (folio_test_large(folio))
-		mapcount += folio_entire_mapcount(folio);
-
+	mapcount = page_type_has_type(mapcount) ? 0 : mapcount + 1;
 	pr_warn("page: refcount:%d mapcount:%d mapping:%p index:%#lx pfn:%#lx\n",
 			folio_ref_count(folio), mapcount, mapping,
 			folio->index + idx, pfn);

_

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