From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754215AbdESIRd (ORCPT ); Fri, 19 May 2017 04:17:33 -0400 Received: from mx2.suse.de ([195.135.220.15]:38330 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753711AbdESIR1 (ORCPT ); Fri, 19 May 2017 04:17:27 -0400 Subject: Re: [PATCH 10/14] mm, vmstat: skip reporting offline pages in pagetypeinfo To: Michal Hocko , Andrew Morton Cc: linux-mm@kvack.org, Mel Gorman , Andrea Arcangeli , Jerome Glisse , Reza Arbab , Yasuaki Ishimatsu , qiuxishi@huawei.com, Kani Toshimitsu , slaoub@gmail.com, Joonsoo Kim , Andi Kleen , David Rientjes , Daniel Kiper , Igor Mammedov , Vitaly Kuznetsov , LKML , Michal Hocko References: <20170515085827.16474-1-mhocko@kernel.org> <20170515085827.16474-11-mhocko@kernel.org> From: Vlastimil Babka Message-ID: <15260936-353e-2513-e751-2117f142bfa8@suse.cz> Date: Fri, 19 May 2017 10:17:24 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <20170515085827.16474-11-mhocko@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/15/2017 10:58 AM, Michal Hocko wrote: > From: Michal Hocko > > 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. > > Noticed-by: Joonsoo Kim > Signed-off-by: Michal Hocko (with the followup fix) Acked-by: Vlastimil Babka > --- > mm/vmstat.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/mm/vmstat.c b/mm/vmstat.c > index 571d3ec05566..c432e581f9a9 100644 > --- a/mm/vmstat.c > +++ b/mm/vmstat.c > @@ -1223,11 +1223,9 @@ 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)) > + if (!pfn_to_online_page(pfn)) > continue; > > - page = pfn_to_page(pfn); > - > /* Watch for unexpected holes punched in the memmap */ > if (!memmap_valid_within(pfn, page, zone)) > continue; >