mm/memory_hotplug.c: don't allow to online/offline memory blocks with holes
[linux-2.6-microblaze.git] / mm / page_alloc.c
index f391c0c..c289b02 100644 (file)
@@ -8261,7 +8261,7 @@ bool has_unmovable_pages(struct zone *zone, struct page *page, int count,
                 * The HWPoisoned page may be not in buddy system, and
                 * page_count() is not 0.
                 */
-               if ((flags & SKIP_HWPOISON) && PageHWPoison(page))
+               if ((flags & MEMORY_OFFLINE) && PageHWPoison(page))
                        continue;
 
                if (__PageMovable(page))
@@ -8477,7 +8477,7 @@ int alloc_contig_range(unsigned long start, unsigned long end,
        }
 
        /* Make sure the range is really isolated. */
-       if (test_pages_isolated(outer_start, end, false)) {
+       if (test_pages_isolated(outer_start, end, 0)) {
                pr_info_ratelimited("%s: [%lx, %lx) PFNs busy\n",
                        __func__, outer_start, end);
                ret = -EBUSY;
@@ -8560,7 +8560,7 @@ __offline_isolated_pages(unsigned long start_pfn, unsigned long end_pfn)
 {
        struct page *page;
        struct zone *zone;
-       unsigned int order, i;
+       unsigned int order;
        unsigned long pfn;
        unsigned long flags;
        unsigned long offlined_pages = 0;
@@ -8588,7 +8588,6 @@ __offline_isolated_pages(unsigned long start_pfn, unsigned long end_pfn)
                 */
                if (unlikely(!PageBuddy(page) && PageHWPoison(page))) {
                        pfn++;
-                       SetPageReserved(page);
                        offlined_pages++;
                        continue;
                }
@@ -8602,8 +8601,6 @@ __offline_isolated_pages(unsigned long start_pfn, unsigned long end_pfn)
                        pfn, 1 << order, end_pfn);
 #endif
                del_page_from_free_area(page, &zone->free_area[order]);
-               for (i = 0; i < (1 << order); i++)
-                       SetPageReserved((page+i));
                pfn += (1 << order);
        }
        spin_unlock_irqrestore(&zone->lock, flags);