From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [PATCH 2/2] mm/sparse: add common helper to mark all memblocks present Date: Wed, 7 Nov 2018 12:12:07 -0800 Message-ID: <20181107121207.62cb37cf58484b7cc80a8fd8@linux-foundation.org> References: <20181107173859.24096-1-logang@deltatee.com> <20181107173859.24096-3-logang@deltatee.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20181107173859.24096-3-logang@deltatee.com> Sender: linux-kernel-owner@vger.kernel.org To: Logan Gunthorpe Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-sh@vger.kernel.org, Stephen Bates , Palmer Dabbelt , Albert Ou , Christoph Hellwig , Arnd Bergmann , Michal Hocko , Vlastimil Babka , Oscar Salvador List-Id: linux-arch.vger.kernel.org On Wed, 7 Nov 2018 10:38:59 -0700 Logan Gunthorpe wrote: > Presently the arches arm64, arm and sh have a function which loops through > each memblock and calls memory present. riscv will require a similar > function. > > Introduce a common memblocks_present() function that can be used by > all the arches. Subsequent patches will cleanup the arches that > make use of this. > > ... > > --- a/mm/sparse.c > +++ b/mm/sparse.c > @@ -239,6 +239,17 @@ void __init memory_present(int nid, unsigned long start, unsigned long end) > } > } > > +void __init memblocks_present(void) > +{ > + struct memblock_region *reg; > + > + for_each_memblock(memory, reg) { > + memory_present(memblock_get_region_node(reg), > + memblock_region_memory_base_pfn(reg), > + memblock_region_memory_end_pfn(reg)); > + } > +} > + I don't like the name much. To me, memblocks_present means "are memblocks present" whereas this actually means "memblocks are present". But whatever. A little covering comment which describes what this does and why it does it would be nice. Acked-by: Andrew Morton I can grab both patches and shall sneak them into 4.20-rcX, but feel free to merge them into some git tree if you'd prefer. If I see them turn up in linux-next I shall drop my copy. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:60600 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726352AbeKHFoF (ORCPT ); Thu, 8 Nov 2018 00:44:05 -0500 Date: Wed, 7 Nov 2018 12:12:07 -0800 From: Andrew Morton Subject: Re: [PATCH 2/2] mm/sparse: add common helper to mark all memblocks present Message-ID: <20181107121207.62cb37cf58484b7cc80a8fd8@linux-foundation.org> In-Reply-To: <20181107173859.24096-3-logang@deltatee.com> References: <20181107173859.24096-1-logang@deltatee.com> <20181107173859.24096-3-logang@deltatee.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-arch-owner@vger.kernel.org List-ID: To: Logan Gunthorpe Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-sh@vger.kernel.org, Stephen Bates , Palmer Dabbelt , Albert Ou , Christoph Hellwig , Arnd Bergmann , Michal Hocko , Vlastimil Babka , Oscar Salvador Message-ID: <20181107201207.IaVOcrF_9agO3L2zWqmqthKlOQilD3HA6JGLKJo7d1I@z> On Wed, 7 Nov 2018 10:38:59 -0700 Logan Gunthorpe wrote: > Presently the arches arm64, arm and sh have a function which loops through > each memblock and calls memory present. riscv will require a similar > function. > > Introduce a common memblocks_present() function that can be used by > all the arches. Subsequent patches will cleanup the arches that > make use of this. > > ... > > --- a/mm/sparse.c > +++ b/mm/sparse.c > @@ -239,6 +239,17 @@ void __init memory_present(int nid, unsigned long start, unsigned long end) > } > } > > +void __init memblocks_present(void) > +{ > + struct memblock_region *reg; > + > + for_each_memblock(memory, reg) { > + memory_present(memblock_get_region_node(reg), > + memblock_region_memory_base_pfn(reg), > + memblock_region_memory_end_pfn(reg)); > + } > +} > + I don't like the name much. To me, memblocks_present means "are memblocks present" whereas this actually means "memblocks are present". But whatever. A little covering comment which describes what this does and why it does it would be nice. Acked-by: Andrew Morton I can grab both patches and shall sneak them into 4.20-rcX, but feel free to merge them into some git tree if you'd prefer. If I see them turn up in linux-next I shall drop my copy.