From c058c711484eb416c982c0c23144fca52382461e Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Wed, 10 Oct 2012 23:04:16 +1100 Subject: [PATCH] Revert "memory-hotplug: suppress "Trying to free nonexistent resource " warning" This reverts commit d760afd4d2570653891f94e13b848e97150dc5a6. --- arch/powerpc/platforms/pseries/hotplug-memory.c | 13 ++++--------- mm/memory_hotplug.c | 4 ++-- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c index dc0a035e63bb..11d8e0544ac0 100644 --- a/arch/powerpc/platforms/pseries/hotplug-memory.c +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c @@ -77,8 +77,7 @@ static int pseries_remove_memblock(unsigned long base, unsigned int memblock_siz { unsigned long start, start_pfn; struct zone *zone; - int i, ret; - int sections_to_remove; + int ret; start_pfn = base >> PAGE_SHIFT; @@ -98,13 +97,9 @@ static int pseries_remove_memblock(unsigned long base, unsigned int memblock_siz * to sysfs "state" file and we can't remove sysfs entries * while writing to it. So we have to defer it to here. */ - sections_to_remove = (memblock_size >> PAGE_SHIFT) / PAGES_PER_SECTION; - for (i = 0; i < sections_to_remove; i++) { - unsigned long pfn = start_pfn + i * PAGES_PER_SECTION; - ret = __remove_pages(zone, start_pfn, PAGES_PER_SECTION); - if (ret) - return ret; - } + ret = __remove_pages(zone, start_pfn, memblock_size >> PAGE_SHIFT); + if (ret) + return ret; /* * Update memory regions for memory remove diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 56b758ae57d2..7d0797475a47 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -369,11 +369,11 @@ int __remove_pages(struct zone *zone, unsigned long phys_start_pfn, BUG_ON(phys_start_pfn & ~PAGE_SECTION_MASK); BUG_ON(nr_pages % PAGES_PER_SECTION); - release_mem_region(phys_start_pfn << PAGE_SHIFT, nr_pages * PAGE_SIZE); - sections_to_remove = nr_pages / PAGES_PER_SECTION; for (i = 0; i < sections_to_remove; i++) { unsigned long pfn = phys_start_pfn + i*PAGES_PER_SECTION; + release_mem_region(pfn << PAGE_SHIFT, + PAGES_PER_SECTION << PAGE_SHIFT); ret = __remove_section(zone, __pfn_to_section(pfn)); if (ret) break; -- 2.39.5