Messages in this thread | | | Date | Fri, 17 Apr 2015 17:13:31 +0800 | From | Xishi Qiu <> | Subject | Re: [PATCH 1/2] memory-hotplug: fix BUG_ON in move_freepages() |
| |
> Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
> --- > 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; >
| |