diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2008-07-14 03:59:18 -0400 |
---|---|---|
committer | Heiko Carstens <heiko.carstens@de.ibm.com> | 2008-07-14 04:02:16 -0400 |
commit | 421c175c4d609864350df495b34d3e99f9fb1bdd (patch) | |
tree | ea3ade04452a6a6c578ae7895b5451c1bf231bc9 | |
parent | 0788fea4d583a3b7d199696819940ff3387d79a3 (diff) |
[S390] Add support for memory hot-add.
Cc: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r-- | arch/s390/Kconfig | 4 | ||||
-rw-r--r-- | arch/s390/mm/init.c | 19 | ||||
-rw-r--r-- | include/asm-s390/sparsemem.h | 4 | ||||
-rw-r--r-- | mm/Kconfig | 2 |
4 files changed, 26 insertions, 3 deletions
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index 6d0d31651f05..5dc8f8028d52 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig | |||
@@ -313,6 +313,10 @@ config ARCH_SPARSEMEM_DEFAULT | |||
313 | config ARCH_SELECT_MEMORY_MODEL | 313 | config ARCH_SELECT_MEMORY_MODEL |
314 | def_bool y | 314 | def_bool y |
315 | 315 | ||
316 | config ARCH_ENABLE_MEMORY_HOTPLUG | ||
317 | def_bool y | ||
318 | depends on SPARSEMEM | ||
319 | |||
316 | source "mm/Kconfig" | 320 | source "mm/Kconfig" |
317 | 321 | ||
318 | comment "I/O subsystem configuration" | 322 | comment "I/O subsystem configuration" |
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c index 05598649b326..388cc7420055 100644 --- a/arch/s390/mm/init.c +++ b/arch/s390/mm/init.c | |||
@@ -202,3 +202,22 @@ void free_initrd_mem(unsigned long start, unsigned long end) | |||
202 | } | 202 | } |
203 | } | 203 | } |
204 | #endif | 204 | #endif |
205 | |||
206 | #ifdef CONFIG_MEMORY_HOTPLUG | ||
207 | int arch_add_memory(int nid, u64 start, u64 size) | ||
208 | { | ||
209 | struct pglist_data *pgdat; | ||
210 | struct zone *zone; | ||
211 | int rc; | ||
212 | |||
213 | pgdat = NODE_DATA(nid); | ||
214 | zone = pgdat->node_zones + ZONE_NORMAL; | ||
215 | rc = vmem_add_mapping(start, size); | ||
216 | if (rc) | ||
217 | return rc; | ||
218 | rc = __add_pages(zone, PFN_DOWN(start), PFN_DOWN(size)); | ||
219 | if (rc) | ||
220 | vmem_remove_mapping(start, size); | ||
221 | return rc; | ||
222 | } | ||
223 | #endif /* CONFIG_MEMORY_HOTPLUG */ | ||
diff --git a/include/asm-s390/sparsemem.h b/include/asm-s390/sparsemem.h index 06dfdab6c0e8..545d219e6a2d 100644 --- a/include/asm-s390/sparsemem.h +++ b/include/asm-s390/sparsemem.h | |||
@@ -1,15 +1,15 @@ | |||
1 | #ifndef _ASM_S390_SPARSEMEM_H | 1 | #ifndef _ASM_S390_SPARSEMEM_H |
2 | #define _ASM_S390_SPARSEMEM_H | 2 | #define _ASM_S390_SPARSEMEM_H |
3 | 3 | ||
4 | #define SECTION_SIZE_BITS 25 | ||
5 | |||
6 | #ifdef CONFIG_64BIT | 4 | #ifdef CONFIG_64BIT |
7 | 5 | ||
6 | #define SECTION_SIZE_BITS 28 | ||
8 | #define MAX_PHYSADDR_BITS 42 | 7 | #define MAX_PHYSADDR_BITS 42 |
9 | #define MAX_PHYSMEM_BITS 42 | 8 | #define MAX_PHYSMEM_BITS 42 |
10 | 9 | ||
11 | #else | 10 | #else |
12 | 11 | ||
12 | #define SECTION_SIZE_BITS 25 | ||
13 | #define MAX_PHYSADDR_BITS 31 | 13 | #define MAX_PHYSADDR_BITS 31 |
14 | #define MAX_PHYSMEM_BITS 31 | 14 | #define MAX_PHYSMEM_BITS 31 |
15 | 15 | ||
diff --git a/mm/Kconfig b/mm/Kconfig index 3aa819d628c1..4242743b981b 100644 --- a/mm/Kconfig +++ b/mm/Kconfig | |||
@@ -129,7 +129,7 @@ config MEMORY_HOTPLUG | |||
129 | bool "Allow for memory hot-add" | 129 | bool "Allow for memory hot-add" |
130 | depends on SPARSEMEM || X86_64_ACPI_NUMA | 130 | depends on SPARSEMEM || X86_64_ACPI_NUMA |
131 | depends on HOTPLUG && !HIBERNATION && ARCH_ENABLE_MEMORY_HOTPLUG | 131 | depends on HOTPLUG && !HIBERNATION && ARCH_ENABLE_MEMORY_HOTPLUG |
132 | depends on (IA64 || X86 || PPC64 || SUPERH) | 132 | depends on (IA64 || X86 || PPC64 || SUPERH || S390) |
133 | 133 | ||
134 | comment "Memory hotplug is currently incompatible with Software Suspend" | 134 | comment "Memory hotplug is currently incompatible with Software Suspend" |
135 | depends on SPARSEMEM && HOTPLUG && HIBERNATION | 135 | depends on SPARSEMEM && HOTPLUG && HIBERNATION |