From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758594AbdAJXsr (ORCPT ); Tue, 10 Jan 2017 18:48:47 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:52528 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756662AbdAJXsp (ORCPT ); Tue, 10 Jan 2017 18:48:45 -0500 Date: Tue, 10 Jan 2017 15:48:44 -0800 From: Andrew Morton To: James Hartley Cc: Paul Burton , , Subject: Re: [PATCH] mm: page_alloc: Skip over regions of invalid pfns where possible Message-Id: <20170110154844.e3fafdb927134b3737a6e1b0@linux-foundation.org> In-Reply-To: <0f03d5c6-182c-d30f-68ef-8d1a767bfcf8@imgtec.com> References: <20161125185518.29885-1-paul.burton@imgtec.com> <20170106144348.f7d207baa7b3190a95aaeb2e@linux-foundation.org> <0f03d5c6-182c-d30f-68ef-8d1a767bfcf8@imgtec.com> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 10 Jan 2017 23:37:53 +0000 James Hartley wrote: > > On 06/01/17 22:43, Andrew Morton wrote: > > On Fri, 25 Nov 2016 18:55:18 +0000 Paul Burton wrote: > > > >> When using a sparse memory model memmap_init_zone() when invoked with > >> the MEMMAP_EARLY context will skip over pages which aren't valid - ie. > >> which aren't in a populated region of the sparse memory map. However if > >> the memory map is extremely sparse then it can spend a long time > >> linearly checking each PFN in a large non-populated region of the memory > >> map & skipping it in turn. > >> > >> When CONFIG_HAVE_MEMBLOCK_NODE_MAP is enabled, we have sufficient > >> information to quickly discover the next valid PFN given an invalid one > >> by searching through the list of memory regions & skipping forwards to > >> the first PFN covered by the memory region to the right of the > >> non-populated region. Implement this in order to speed up > >> memmap_init_zone() for systems with extremely sparse memory maps. > > Could we have a changelog which includes some timing measurements? > > That permits others to understand the value of this patch. > > > I have tested this patch on a virtual model of a Samurai CPU with a > sparse memory map. The kernel boot time drops from 109 to 62 seconds. Thanks. Nice. I updated the changelog.