diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2008-07-14 09:59:18 +0200 |
---|---|---|
committer | Heiko Carstens <heiko.carstens@de.ibm.com> | 2008-07-14 10:02:16 +0200 |
commit | 421c175c4d609864350df495b34d3e99f9fb1bdd (patch) | |
tree | ea3ade04452a6a6c578ae7895b5451c1bf231bc9 /arch/s390 | |
parent | 0788fea4d583a3b7d199696819940ff3387d79a3 (diff) | |
download | op-kernel-dev-421c175c4d609864350df495b34d3e99f9fb1bdd.zip op-kernel-dev-421c175c4d609864350df495b34d3e99f9fb1bdd.tar.gz |
[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>
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/Kconfig | 4 | ||||
-rw-r--r-- | arch/s390/mm/init.c | 19 |
2 files changed, 23 insertions, 0 deletions
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index 6d0d3165..5dc8f80 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig @@ -313,6 +313,10 @@ config ARCH_SPARSEMEM_DEFAULT config ARCH_SELECT_MEMORY_MODEL def_bool y +config ARCH_ENABLE_MEMORY_HOTPLUG + def_bool y + depends on SPARSEMEM + source "mm/Kconfig" comment "I/O subsystem configuration" diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c index 0559864..388cc74 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) } } #endif + +#ifdef CONFIG_MEMORY_HOTPLUG +int arch_add_memory(int nid, u64 start, u64 size) +{ + struct pglist_data *pgdat; + struct zone *zone; + int rc; + + pgdat = NODE_DATA(nid); + zone = pgdat->node_zones + ZONE_NORMAL; + rc = vmem_add_mapping(start, size); + if (rc) + return rc; + rc = __add_pages(zone, PFN_DOWN(start), PFN_DOWN(size)); + if (rc) + vmem_remove_mapping(start, size); + return rc; +} +#endif /* CONFIG_MEMORY_HOTPLUG */ |