Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751571AbdF1HGk (ORCPT ); Wed, 28 Jun 2017 03:06:40 -0400 Received: from mx2.suse.de ([195.135.220.15]:45693 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751522AbdF1HGd (ORCPT ); Wed, 28 Jun 2017 03:06:33 -0400 Subject: Re: [PATCH] mm/memory_hotplug: just build zonelist for new added node To: Wei Yang , akpm@linux-foundation.org, mhocko@suse.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20170626035822.50155-1-richard.weiyang@gmail.com> From: Vlastimil Babka Message-ID: <855068c0-8361-9789-4208-36d43e8fd80d@suse.cz> Date: Wed, 28 Jun 2017 09:06:31 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20170626035822.50155-1-richard.weiyang@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1944 Lines: 67 On 06/26/2017 05:58 AM, Wei Yang wrote: > In commit (9adb62a5df9c0fbef7) "mm/hotplug: correctly setup fallback > zonelists when creating new pgdat" tries to build the correct zonelist for > a new added node, while it is not necessary to rebuild it for already exist > nodes. > > In build_zonelists(), it will iterate on nodes with memory. For a new added > node, it will have memory until node_states_set_node() is called in it will not have memory right? > online_pages(). > > This patch will avoid to rebuild the zonelists for already exist nodes. > > Signed-off-by: Wei Yang Sounds correct, as far as the memory hotplug mess allows. Acked-by: Vlastimil Babka Some style nitpicks below: > --- > mm/page_alloc.c | 16 +++++++++------- > 1 file changed, 9 insertions(+), 7 deletions(-) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 560eafe8234d..fc8181b44fd8 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -5200,15 +5200,17 @@ static int __build_all_zonelists(void *data) > memset(node_load, 0, sizeof(node_load)); > #endif > > - if (self && !node_online(self->node_id)) { > + /* This node is hotadded and no memory preset yet. On multiline comments, the first line should be empty after "/*" But I see Andrew already fixed that. > + * So just build zonelists is fine, no need to touch other nodes. > + */ > + if (self && !node_online(self->node_id)) > build_zonelists(self); > - } > - > - for_each_online_node(nid) { > - pg_data_t *pgdat = NODE_DATA(nid); > + else > + for_each_online_node(nid) { > + pg_data_t *pgdat = NODE_DATA(nid); > > - build_zonelists(pgdat); > - } > + build_zonelists(pgdat); > + } Personally I would use { } for the else block, and thus leave them also for the if block, not sure if this is recommended by the style guide though. > /* > * Initialize the boot_pagesets that are going to be used >