Return-Path: Received: from mx2.suse.de ([195.135.220.15]:55912 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751426AbeCNGw5 (ORCPT ); Wed, 14 Mar 2018 02:52:57 -0400 Date: Wed, 14 Mar 2018 07:52:54 +0100 From: Michal Hocko To: Daniel Vacek Cc: Linus Torvalds , Andrew Morton , Mel Gorman , Paul Burton , Pavel Tatashin , Vlastimil Babka , stable@vger.kernel.org Subject: Re: [PATCH] mm/memblock: cleanup redundant argument in memblock_next_valid_pfn Message-ID: <20180314065254.GE4811@dhcp22.suse.cz> References: <20180309174739.843680a85abbfb64324658e3@linux-foundation.org> <20180310021756.24717-1-neelx@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180310021756.24717-1-neelx@redhat.com> Sender: stable-owner@vger.kernel.org List-ID: I am sorry, I am still not back up to speed yet but the below patch should also update the comment claiming: * Skip to the pfn preceding the next valid one (or * end_pfn), such that we hit a valid pfn (or end_pfn) I will double check whether that is still true but I got lost in the follow up fixups during the original patch development. On Sat 10-03-18 03:17:56, Daniel Vacek wrote: > max_pfn is not used anymore but survived due to mismerge. Remove > it for good. > > Link: http://lkml.kernel.org/r/0485727b2e82da7efbce5f6ba42524b429d0391a.1520011945.git.neelx@redhat.com > Fixes: b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns where possible") > Signed-off-by: Daniel Vacek > Cc: Linus Torvalds > Cc: Andrew Morton > Cc: Mel Gorman > Cc: Michal Hocko > Cc: Paul Burton > Cc: Pavel Tatashin > Cc: Vlastimil Babka > Cc: > --- > mm/memblock.c | 3 +-- > mm/page_alloc.c | 2 +- > 2 files changed, 2 insertions(+), 3 deletions(-) > > diff --git a/mm/memblock.c b/mm/memblock.c > index b6ba6b7adadc..2a5facd236bb 100644 > --- a/mm/memblock.c > +++ b/mm/memblock.c > @@ -1101,8 +1101,7 @@ void __init_memblock __next_mem_pfn_range(int *idx, int nid, > *out_nid = r->nid; > } > > -unsigned long __init_memblock memblock_next_valid_pfn(unsigned long pfn, > - unsigned long max_pfn) > +unsigned long __init_memblock memblock_next_valid_pfn(unsigned long pfn) > { > struct memblock_type *type = &memblock.memory; > unsigned int right = type->cnt; > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 3d974cb2a1a1..efb290268479 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -5365,7 +5365,7 @@ void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone, > * the valid region but still depends on correct page > * metadata. > */ > - pfn = (memblock_next_valid_pfn(pfn, end_pfn) & > + pfn = (memblock_next_valid_pfn(pfn) & > ~(pageblock_nr_pages-1)) - 1; > #endif > continue; > -- > 2.16.2 > -- Michal Hocko SUSE Labs