diff options
author | Wen Congyang <wency@cn.fujitsu.com> | 2013-02-22 19:32:58 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-23 20:50:12 -0500 |
commit | 24d335ca3606b610ec69c66a1e42760c96d89470 (patch) | |
tree | 62d6157cbb273c029ea1052690725037524cbbeb /arch/powerpc | |
parent | 46c66c4b7ba0f9bb3e2ae3a3cfd40cd3472c8f80 (diff) |
memory-hotplug: introduce new arch_remove_memory() for removing page table
For removing memory, we need to remove page tables. But it depends on
architecture. So the patch introduce arch_remove_memory() for removing
page table. Now it only calls __remove_pages().
Note: __remove_pages() for some archtecuture is not implemented
(I don't know how to implement it for s390).
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Jiang Liu <jiang.liu@huawei.com>
Cc: Jianguo Wu <wujianguo@huawei.com>
Cc: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Wu Jianguo <wujianguo@huawei.com>
Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/mm/mem.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index 0dba5066c22a..09c64518b4d0 100644 --- a/arch/powerpc/mm/mem.c +++ b/arch/powerpc/mm/mem.c | |||
@@ -133,6 +133,18 @@ int arch_add_memory(int nid, u64 start, u64 size) | |||
133 | 133 | ||
134 | return __add_pages(nid, zone, start_pfn, nr_pages); | 134 | return __add_pages(nid, zone, start_pfn, nr_pages); |
135 | } | 135 | } |
136 | |||
137 | #ifdef CONFIG_MEMORY_HOTREMOVE | ||
138 | int arch_remove_memory(u64 start, u64 size) | ||
139 | { | ||
140 | unsigned long start_pfn = start >> PAGE_SHIFT; | ||
141 | unsigned long nr_pages = size >> PAGE_SHIFT; | ||
142 | struct zone *zone; | ||
143 | |||
144 | zone = page_zone(pfn_to_page(start_pfn)); | ||
145 | return __remove_pages(zone, start_pfn, nr_pages); | ||
146 | } | ||
147 | #endif | ||
136 | #endif /* CONFIG_MEMORY_HOTPLUG */ | 148 | #endif /* CONFIG_MEMORY_HOTPLUG */ |
137 | 149 | ||
138 | /* | 150 | /* |