Commit d336e94e authored by Michal Hocko's avatar Michal Hocko Committed by Linus Torvalds

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.

[ fix build]
Link: default avatarMichal Hocko <>
Reported-by: default avatarJoonsoo Kim <>
Acked-by: default avatarVlastimil Babka <>
Cc: Andi Kleen <>
Cc: Andrea Arcangeli <>
Cc: Balbir Singh <>
Cc: Dan Williams <>
Cc: Daniel Kiper <>
Cc: David Rientjes <>
Cc: Heiko Carstens <>
Cc: Igor Mammedov <>
Cc: Jerome Glisse <>
Cc: Martin Schwidefsky <>
Cc: Mel Gorman <>
Cc: Reza Arbab <>
Cc: Tobias Regnery <>
Cc: Toshi Kani <>
Cc: Vitaly Kuznetsov <>
Cc: Vlastimil Babka <>
Cc: Xishi Qiu <>
Cc: Yasuaki Ishimatsu <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 2ce13640
......@@ -1223,11 +1223,10 @@ static void pagetypeinfo_showblockcount_print(struct seq_file *m,
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)
page = pfn_to_page(pfn);
/* Watch for unexpected holes punched in the memmap */
if (!memmap_valid_within(pfn, page, zone))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment