aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/mm
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2013-05-02 03:15:58 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2013-05-02 09:50:27 -0400
commite5d709bb5fb758281b5a5dbda50823bb68b3a066 (patch)
tree16c3c985549433a74b7e2e4d507a3bc51adb27f9 /arch/s390/mm
parentdf1bd59c5cc247d1d02588ff0a4e86a0cc5f9733 (diff)
s390/memory hotplug: provide memory_block_size_bytes() function
Commit 0c2c99b1b "memory hotplug: Allow memory blocks to span multiple memory sections" introduced a weak memory_block_size_bytes() function which can be used to set the size of a memory block as seen in sysfs. Provide an s390 specific override which makes sure that each memory block has at least a size of 256MB or the increment size of of a memory increment, whatever is larger. This way we can make sure that the number of memory sysfs objects doesn't explode for very large memory configurations. Reported-by: 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/mm')
-rw-r--r--arch/s390/mm/init.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c
index 0b09b2342302..89ebae4008f2 100644
--- a/arch/s390/mm/init.c
+++ b/arch/s390/mm/init.c
@@ -21,6 +21,7 @@
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/pagemap.h> 22#include <linux/pagemap.h>
23#include <linux/bootmem.h> 23#include <linux/bootmem.h>
24#include <linux/memory.h>
24#include <linux/pfn.h> 25#include <linux/pfn.h>
25#include <linux/poison.h> 26#include <linux/poison.h>
26#include <linux/initrd.h> 27#include <linux/initrd.h>
@@ -36,6 +37,7 @@
36#include <asm/tlbflush.h> 37#include <asm/tlbflush.h>
37#include <asm/sections.h> 38#include <asm/sections.h>
38#include <asm/ctl_reg.h> 39#include <asm/ctl_reg.h>
40#include <asm/sclp.h>
39 41
40pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((__aligned__(PAGE_SIZE))); 42pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((__aligned__(PAGE_SIZE)));
41 43
@@ -214,6 +216,15 @@ int arch_add_memory(int nid, u64 start, u64 size)
214 return rc; 216 return rc;
215} 217}
216 218
219unsigned long memory_block_size_bytes(void)
220{
221 /*
222 * Make sure the memory block size is always greater
223 * or equal than the memory increment size.
224 */
225 return max_t(unsigned long, MIN_MEMORY_BLOCK_SIZE, sclp_get_rzm());
226}
227
217#ifdef CONFIG_MEMORY_HOTREMOVE 228#ifdef CONFIG_MEMORY_HOTREMOVE
218int arch_remove_memory(u64 start, u64 size) 229int arch_remove_memory(u64 start, u64 size)
219{ 230{