diff options
author | Yasunori Goto <y-goto@jp.fujitsu.com> | 2008-04-28 05:13:34 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-28 11:58:26 -0400 |
commit | 0c0a4a517a31e05efb38304668198a873bfec6ca (patch) | |
tree | 3d02fe9dbf160cd5d328c1e2cf4b40ce37426c5f /mm/memory_hotplug.c | |
parent | 86f6dae1377523689bd8468fed2f2dd180fc0560 (diff) |
memory hotplug: free memmaps allocated by bootmem
This patch is to free memmaps which is allocated by bootmem.
Freeing usemap is not necessary. The pages of usemap may be necessary for
other sections.
If removing section is last section on the node, its section is the final user
of usemap page. (usemaps are allocated on its section by previous patch.) But
it shouldn't be freed too, because the section must be logical offline state
which all pages are isolated against page allocater. If it is freed, page
alloctor may use it which will be removed physically soon. It will be
disaster. So, this patch keeps it as it is.
Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
Cc: Badari Pulavarty <pbadari@us.ibm.com>
Cc: Yinghai Lu <yhlu.kernel@gmail.com>
Cc: 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>
Diffstat (limited to 'mm/memory_hotplug.c')
-rw-r--r-- | mm/memory_hotplug.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index cba36ef0d506..c4ba85c8cb00 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c | |||
@@ -198,6 +198,16 @@ static int __add_section(struct zone *zone, unsigned long phys_start_pfn) | |||
198 | return register_new_memory(__pfn_to_section(phys_start_pfn)); | 198 | return register_new_memory(__pfn_to_section(phys_start_pfn)); |
199 | } | 199 | } |
200 | 200 | ||
201 | #ifdef CONFIG_SPARSEMEM_VMEMMAP | ||
202 | static int __remove_section(struct zone *zone, struct mem_section *ms) | ||
203 | { | ||
204 | /* | ||
205 | * XXX: Freeing memmap with vmemmap is not implement yet. | ||
206 | * This should be removed later. | ||
207 | */ | ||
208 | return -EBUSY; | ||
209 | } | ||
210 | #else | ||
201 | static int __remove_section(struct zone *zone, struct mem_section *ms) | 211 | static int __remove_section(struct zone *zone, struct mem_section *ms) |
202 | { | 212 | { |
203 | unsigned long flags; | 213 | unsigned long flags; |
@@ -216,6 +226,7 @@ static int __remove_section(struct zone *zone, struct mem_section *ms) | |||
216 | pgdat_resize_unlock(pgdat, &flags); | 226 | pgdat_resize_unlock(pgdat, &flags); |
217 | return 0; | 227 | return 0; |
218 | } | 228 | } |
229 | #endif | ||
219 | 230 | ||
220 | /* | 231 | /* |
221 | * Reasonably generic function for adding memory. It is | 232 | * Reasonably generic function for adding memory. It is |