memory hotplug: release memory regions in PAGES_PER_SECTION chunks

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Monday, October 20, 2008 - 10:01 am

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=de7f0c...
Commit:     de7f0cba96786cf9ec9da4532c1b25f733da9b6f
Parent:     7a6560e02556b6f0a798c247f3a557c523d9701b
Author:     Nathan Fontenot <nfont@austin.ibm.com>
AuthorDate: Sat Oct 18 20:27:14 2008 -0700
Committer:  Linus Torvalds <torvalds@linux-foundation.org>
CommitDate: Mon Oct 20 08:52:32 2008 -0700

    memory hotplug: release memory regions in PAGES_PER_SECTION chunks
    
    During hotplug memory remove, memory regions should be released on a
    PAGES_PER_SECTION size chunks.  This mirrors the code in add_memory where
    resources are requested on a PAGES_PER_SECTION size.
    
    Attempting to release the entire memory region fails because there is not
    a single resource for the total number of pages being removed.  Instead
    the resources for the pages are split in PAGES_PER_SECTION size chunks as
    requested during memory add.
    
    Signed-off-by: Nathan Fontenot <nfont@austin.ibm.com>
    Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com>
    Acked-by: Yasunori Goto <y-goto@jp.fujitsu.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
---
 mm/memory_hotplug.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 3b49758..6837a10 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -324,11 +324,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;
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
memory hotplug: release memory regions in PAGES_PER_SECTIO ..., Linux Kernel Mailing ..., (Mon Oct 20, 10:01 am)