Skip to contentSkip to conversation

mm, vmstat: skip reporting offline pages in pagetypeinfo

PATCH New [email protected] 1 participant 1 message Jul 6, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 52/108 mm, vmstat: skip reporting offline pages in pagetypeinfo

From: Michal Hocko <[email protected]>
Subject: mm, vmstat: skip reporting offline pages in pagetypeinfo

pagetypeinfo_showblockcount_print skips over invalid pfns but it would report pages which are offline because those have a valid pfn. Their migrate type is misleading at best. Now that we have pfn_to_online_page() we can use it instead of pfn_valid() and fix this.

[[email protected]: fix build]
Cc Andi Kleen <[email protected]>
Cc Andrea Arcangeli <[email protected]>
Cc Balbir Singh <[email protected]>
Cc Dan Williams <[email protected]>
Cc Daniel Kiper <[email protected]>
Cc David Rientjes <[email protected]>
Cc Heiko Carstens <[email protected]>
Cc Igor Mammedov <[email protected]>
Cc Jerome Glisse <[email protected]>
Cc Martin Schwidefsky <[email protected]>
Cc Mel Gorman <[email protected]>
Cc Reza Arbab <[email protected]>
Cc Tobias Regnery <[email protected]>
Cc Toshi Kani <[email protected]>
Cc Vitaly Kuznetsov <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Xishi Qiu <[email protected]>
Cc Yasuaki Ishimatsu <[email protected]>

---

 mm/vmstat.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
mm/vmstat.c renamed from mm/vmstat.c~mm-vmstat-skip-reporting-offline-pages-in-pagetypeinfo +2 -2
diff -puN mm/vmstat.c~mm-vmstat-skip-reporting-offline-pages-in-pagetypeinfo mm/vmstat.c
@@ -1223,11 +1223,10 @@ static void pagetypeinfo_showblockcount_
 	for (pfn = start_pfn; pfn < end_pfn; pfn += pageblock_nr_pages) {
 		struct page *page;
 
-		if (!pfn_valid(pfn))
+		page = pfn_to_online_page(pfn);
+		if (!page)
 			continue;
 
-		page = pfn_to_page(pfn);