From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932088AbbDQJ0j (ORCPT ); Fri, 17 Apr 2015 05:26:39 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:11255 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752621AbbDQJ0b (ORCPT ); Fri, 17 Apr 2015 05:26:31 -0400 Message-ID: <5530CEBB.9030209@huawei.com> Date: Fri, 17 Apr 2015 17:13:31 +0800 From: Xishi Qiu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Xishi Qiu CC: Andrew Morton , Yasuaki Ishimatsu , Kamezawa Hiroyuki , , Tang Chen , Gu Zheng , Xiexiuqi , Mel Gorman , David Rientjes , Linux MM , LKML Subject: Re: [PATCH 1/2] memory-hotplug: fix BUG_ON in move_freepages() References: <5530B2E9.3010102@huawei.com> In-Reply-To: <5530B2E9.3010102@huawei.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.25.179] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Signed-off-by: Xishi Qiu > --- > mm/page_alloc.c | 14 ++++++++++++++ > 1 files changed, 14 insertions(+), 0 deletions(-) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index ebffa0e..1a5743e 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -4667,6 +4667,10 @@ static unsigned long __meminit zone_spanned_pages_in_node(int nid, > { > unsigned long zone_start_pfn, zone_end_pfn; > > + /* When hotadd a new node, init node's zones as empty zones */ > + if (!node_online(nid)) > + return 0; > + > /* Get the start and end of the zone */ > zone_start_pfn = arch_zone_lowest_possible_pfn[zone_type]; > zone_end_pfn = arch_zone_highest_possible_pfn[zone_type]; > @@ -4698,6 +4702,10 @@ unsigned long __meminit __absent_pages_in_range(int nid, > unsigned long start_pfn, end_pfn; I made a mistake here, should change zone_absent_pages_in_node(), sorry! I'll send V2 > int i; > > + /* When hotadd a new node, init node's zones as empty zones */ > + if (!node_online(nid)) > + return 0; > + > for_each_mem_pfn_range(i, nid, &start_pfn, &end_pfn, NULL) { > start_pfn = clamp(start_pfn, range_start_pfn, range_end_pfn); > end_pfn = clamp(end_pfn, range_start_pfn, range_end_pfn); > @@ -4746,6 +4754,9 @@ static inline unsigned long __meminit zone_spanned_pages_in_node(int nid, > unsigned long node_end_pfn, > unsigned long *zones_size) > { > + if (!node_online(nid)) > + return 0; > + > return zones_size[zone_type]; > } > > @@ -4755,6 +4766,9 @@ static inline unsigned long __meminit zone_absent_pages_in_node(int nid, > unsigned long node_end_pfn, > unsigned long *zholes_size) > { > + if (!node_online(nid)) > + return 0; > + > if (!zholes_size) > return 0; >