Skip to content

Commit d336e94

Browse files
Michal Hockotorvalds
Michal Hocko
authored andcommitted
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] Link: http://lkml.kernel.org/r/[email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Michal Hocko <[email protected]> Reported-by: Joonsoo Kim <[email protected]> Acked-by: Vlastimil Babka <[email protected]> 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]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 2ce1364 commit d336e94

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

mm/vmstat.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,11 +1223,10 @@ static void pagetypeinfo_showblockcount_print(struct seq_file *m,
12231223
for (pfn = start_pfn; pfn < end_pfn; pfn += pageblock_nr_pages) {
12241224
struct page *page;
12251225

1226-
if (!pfn_valid(pfn))
1226+
page = pfn_to_online_page(pfn);
1227+
if (!page)
12271228
continue;
12281229

1229-
page = pfn_to_page(pfn);
1230-
12311230
/* Watch for unexpected holes punched in the memmap */
12321231
if (!memmap_valid_within(pfn, page, zone))
12331232
continue;

0 commit comments

Comments
 (0)