From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751423AbeA2Sry (ORCPT ); Mon, 29 Jan 2018 13:47:54 -0500 Received: from mx2.suse.de ([195.135.220.15]:42472 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750959AbeA2Srx (ORCPT ); Mon, 29 Jan 2018 13:47:53 -0500 Date: Mon, 29 Jan 2018 19:47:46 +0100 From: Michal Hocko To: Eugeniu Rosca Cc: Matthew Wilcox , Andrew Morton , Catalin Marinas , Ard Biesheuvel , Steven Sistare , AKASHI Takahiro , Pavel Tatashin , Gioh Kim , Heiko Carstens , Wei Yang , Miles Chen , Vlastimil Babka , Mel Gorman , Johannes Weiner , Paul Burton , James Hartley , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v3 1/1] mm: page_alloc: skip over regions of invalid pfns on UMA Message-ID: <20180129184746.GK21609@dhcp22.suse.cz> References: <20180124143545.31963-1-erosca@de.adit-jv.com> <20180124143545.31963-2-erosca@de.adit-jv.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180124143545.31963-2-erosca@de.adit-jv.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 24-01-18 15:35:45, Eugeniu Rosca wrote: [...] > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 76c9688b6a0a..4a3d5936a9a0 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -5344,14 +5344,12 @@ void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone, > goto not_early; > > if (!early_pfn_valid(pfn)) { > -#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP > /* > * Skip to the pfn preceding the next valid one (or > * end_pfn), such that we hit a valid pfn (or end_pfn) > * on our next iteration of the loop. > */ > pfn = memblock_next_valid_pfn(pfn, end_pfn) - 1; > -#endif > continue; Wouldn't it be just simpler to have ifdef CONFIG_HAVE_MEMBLOCK rather than define memblock_next_valid_pfn for !HAVE_MEMBLOCK and then do the (pfn + 1 ) - 1 games. I am usually against ifdefs in the code but that would require a larger surgery to memmap_init_zone. To be completely honest, I would like to see HAVE_MEMBLOCK_NODE_MAP gone. Other than that, the patch looks sane to me. > } > if (!early_pfn_in_nid(pfn, nid)) > -- > 2.15.1 > -- Michal Hocko SUSE Labs