From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758777AbcCDIsv (ORCPT ); Fri, 4 Mar 2016 03:48:51 -0500 Received: from mx2.suse.de ([195.135.220.15]:58251 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752112AbcCDIsu (ORCPT ); Fri, 4 Mar 2016 03:48:50 -0500 Subject: Re: [PATCH RFC 1/2] mm: meminit: initialise more memory for inode/dentry hash tables in early boot To: Li Zhang , mpe@ellerman.id.au, khandual@linux.vnet.ibm.com, aneesh.kumar@linux.vnet.ibm.com, mgorman@techsingularity.net References: <1456988501-29046-1-git-send-email-zhlcindy@gmail.com> <1456988501-29046-2-git-send-email-zhlcindy@gmail.com> Cc: linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Li Zhang From: Vlastimil Babka Message-ID: <56D94BEE.1080506@suse.cz> Date: Fri, 4 Mar 2016 09:48:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <1456988501-29046-2-git-send-email-zhlcindy@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/03/2016 08:01 AM, Li Zhang wrote: > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -293,13 +293,20 @@ static inline bool update_defer_init(pg_data_t *pgdat, > unsigned long pfn, unsigned long zone_end, > unsigned long *nr_initialised) > { > + unsigned long max_initialise; > + > /* Always populate low zones for address-contrained allocations */ > if (zone_end < pgdat_end_pfn(pgdat)) > return true; > + /* > + * Initialise at least 2G of a node but also take into account that > + * two large system hashes that can take up 1GB for 0.25TB/node. > + */ The indentation is wrong here. > + max_initialise = max(2UL << (30 - PAGE_SHIFT), > + (pgdat->node_spanned_pages >> 8)); > > - /* Initialise at least 2G of the highest zone */ > (*nr_initialised)++; > - if (*nr_initialised > (2UL << (30 - PAGE_SHIFT)) && > + if ((*nr_initialised > max_initialise) && > (pfn & (PAGES_PER_SECTION - 1)) == 0) { > pgdat->first_deferred_pfn = pfn; > return false; >