aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/memory_hotplug.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 616236e6343f..efe3e0ec2e61 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -339,8 +339,11 @@ EXPORT_SYMBOL_GPL(__remove_pages);
339 339
340void online_page(struct page *page) 340void online_page(struct page *page)
341{ 341{
342 unsigned long pfn = page_to_pfn(page);
343
342 totalram_pages++; 344 totalram_pages++;
343 num_physpages++; 345 if (pfn >= num_physpages)
346 num_physpages = pfn + 1;
344 347
345#ifdef CONFIG_HIGHMEM 348#ifdef CONFIG_HIGHMEM
346 if (PageHighMem(page)) 349 if (PageHighMem(page))
@@ -832,7 +835,6 @@ repeat:
832 zone->present_pages -= offlined_pages; 835 zone->present_pages -= offlined_pages;
833 zone->zone_pgdat->node_present_pages -= offlined_pages; 836 zone->zone_pgdat->node_present_pages -= offlined_pages;
834 totalram_pages -= offlined_pages; 837 totalram_pages -= offlined_pages;
835 num_physpages -= offlined_pages;
836 838
837 setup_per_zone_wmarks(); 839 setup_per_zone_wmarks();
838 calculate_zone_inactive_ratio(zone); 840 calculate_zone_inactive_ratio(zone);