From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751154AbeAVBXF (ORCPT ); Sun, 21 Jan 2018 20:23:05 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:50319 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751125AbeAVBXE (ORCPT ); Sun, 21 Jan 2018 20:23:04 -0500 Date: Sun, 21 Jan 2018 17:21:56 -0800 From: Matthew Wilcox To: Eugeniu Rosca Cc: Andrew Morton , Michal Hocko , Catalin Marinas , Ard Biesheuvel , Steven Sistare , AKASHI Takahiro , Pavel Tatashin , Gioh Kim , Heiko Carstens , Wei Yang , Miles Chen , Vlastimil Babka , Mel Gorman , Hillf Danton , Johannes Weiner , Paul Burton , James Hartley , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v2 1/1] mm: page_alloc: skip over regions of invalid pfns on UMA Message-ID: <20180122012156.GA10428@bombadil.infradead.org> References: <20180121144753.3109-1-erosca@de.adit-jv.com> <20180121144753.3109-2-erosca@de.adit-jv.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180121144753.3109-2-erosca@de.adit-jv.com> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I like the patch. I think it could be better. > +++ b/mm/page_alloc.c > @@ -5344,7 +5344,7 @@ 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 > +#ifdef CONFIG_HAVE_MEMBLOCK > /* > * Skip to the pfn preceding the next valid one (or > * end_pfn), such that we hit a valid pfn (or end_pfn) This ifdef makes me sad. Here's more of the context: 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; } This is crying out for: #ifdef CONFIG_HAVE_MEMBLOCK unsigned long memblock_next_valid_pfn(unsigned long pfn, unsigned long max_pfn); #else static inline unsigned long memblock_next_valid_pfn(unsigned long pfn, unsigned long max_pfn) { return pfn + 1; } #endif in a header file somewhere.