diff options
-rw-r--r-- | mm/memory_hotplug.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 3ad25f9d1fc..6a5b90d0cfd 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c | |||
@@ -126,9 +126,6 @@ static void register_page_bootmem_info_section(unsigned long start_pfn) | |||
126 | struct mem_section *ms; | 126 | struct mem_section *ms; |
127 | struct page *page, *memmap; | 127 | struct page *page, *memmap; |
128 | 128 | ||
129 | if (!pfn_valid(start_pfn)) | ||
130 | return; | ||
131 | |||
132 | section_nr = pfn_to_section_nr(start_pfn); | 129 | section_nr = pfn_to_section_nr(start_pfn); |
133 | ms = __nr_to_section(section_nr); | 130 | ms = __nr_to_section(section_nr); |
134 | 131 | ||
@@ -187,9 +184,16 @@ void register_page_bootmem_info_node(struct pglist_data *pgdat) | |||
187 | end_pfn = pfn + pgdat->node_spanned_pages; | 184 | end_pfn = pfn + pgdat->node_spanned_pages; |
188 | 185 | ||
189 | /* register_section info */ | 186 | /* register_section info */ |
190 | for (; pfn < end_pfn; pfn += PAGES_PER_SECTION) | 187 | for (; pfn < end_pfn; pfn += PAGES_PER_SECTION) { |
191 | register_page_bootmem_info_section(pfn); | 188 | /* |
192 | 189 | * Some platforms can assign the same pfn to multiple nodes - on | |
190 | * node0 as well as nodeN. To avoid registering a pfn against | ||
191 | * multiple nodes we check that this pfn does not already | ||
192 | * reside in some other node. | ||
193 | */ | ||
194 | if (pfn_valid(pfn) && (pfn_to_nid(pfn) == node)) | ||
195 | register_page_bootmem_info_section(pfn); | ||
196 | } | ||
193 | } | 197 | } |
194 | #endif /* !CONFIG_SPARSEMEM_VMEMMAP */ | 198 | #endif /* !CONFIG_SPARSEMEM_VMEMMAP */ |
195 | 199 | ||