mm/page_alloc.c: remove unnecessary end_bitidx for [set|get]_pfnblock_flags_mask()
[linux-2.6-microblaze.git] / mm / memory_hotplug.c
index da374cd..ac6961a 100644 (file)
@@ -831,6 +831,14 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages,
        zone->zone_pgdat->node_present_pages += onlined_pages;
        pgdat_resize_unlock(zone->zone_pgdat, &flags);
 
+       /*
+        * When exposing larger, physically contiguous memory areas to the
+        * buddy, shuffling in the buddy (when freeing onlined pages, putting
+        * them either to the head or the tail of the freelist) is only helpful
+        * for maintaining the shuffle, but not for creating the initial
+        * shuffle. Shuffle the whole zone to make sure the just onlined pages
+        * are properly distributed across the whole freelist.
+        */
        shuffle_zone(zone);
 
        node_states_set_node(nid, &arg);
@@ -844,8 +852,6 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages,
        kswapd_run(nid);
        kcompactd_run(nid);
 
-       vm_total_pages = nr_free_pagecache_pages();
-
        writeback_set_ratelimit();
 
        memory_notify(MEM_ONLINE, &arg);
@@ -1595,7 +1601,6 @@ static int __ref __offline_pages(unsigned long start_pfn,
                kcompactd_stop(node);
        }
 
-       vm_total_pages = nr_free_pagecache_pages();
        writeback_set_ratelimit();
 
        memory_notify(MEM_OFFLINE, &arg);