aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/setup.c
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2013-04-30 03:36:23 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2013-05-02 09:50:25 -0400
commit67b5c3eeb4814bceb9a7e17fecb14ef59d511812 (patch)
tree3981aae6bc83fcda686865c97c4d8b55faefdf7a /arch/s390/kernel/setup.c
parent118131a2d588f4a0fb74d0f2aa7d339a03b2f64c (diff)
s390/kdump,bootmem: fix bootmem allocator bitmap size
When in kdump mode the kernel may access only the first couple of megabytes for execution, the rest contains the dump. However the size of the bitmap used by the bootmem allocator was calculated for the whole amount of memory of the machine. For very large machines this can lead to the situation that the kdump kernel will not come up because not enough memory is available. So fix this and calculate the size of the bitmap only for the piece of memory that the kdump kernel actually uses. Call reserve_oldmem() before setup_memory_end() so that the memory_chunk array already has been updated with respect to oldmem chunks. Afterwards setup_memory_end() will ignore those chunks. Reviewed-by: Michael Holzheu <holzheu@linux.vnet.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/kernel/setup.c')
-rw-r--r--arch/s390/kernel/setup.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index f1e0ba5a5c3a..555f1895972e 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -527,6 +527,8 @@ static void __init setup_memory_end(void)
527 unsigned long align; 527 unsigned long align;
528 528
529 chunk = &memory_chunk[i]; 529 chunk = &memory_chunk[i];
530 if (chunk->type == CHUNK_OLDMEM)
531 continue;
530 align = 1UL << (MAX_ORDER + PAGE_SHIFT - 1); 532 align = 1UL << (MAX_ORDER + PAGE_SHIFT - 1);
531 start = (chunk->addr + align - 1) & ~(align - 1); 533 start = (chunk->addr + align - 1) & ~(align - 1);
532 end = (chunk->addr + chunk->size) & ~(align - 1); 534 end = (chunk->addr + chunk->size) & ~(align - 1);
@@ -577,6 +579,8 @@ static void __init setup_memory_end(void)
577 for (i = 0; i < MEMORY_CHUNKS; i++) { 579 for (i = 0; i < MEMORY_CHUNKS; i++) {
578 struct mem_chunk *chunk = &memory_chunk[i]; 580 struct mem_chunk *chunk = &memory_chunk[i];
579 581
582 if (chunk->type == CHUNK_OLDMEM)
583 continue;
580 if (chunk->addr >= memory_end) { 584 if (chunk->addr >= memory_end) {
581 memset(chunk, 0, sizeof(*chunk)); 585 memset(chunk, 0, sizeof(*chunk));
582 continue; 586 continue;
@@ -1065,9 +1069,9 @@ void __init setup_arch(char **cmdline_p)
1065 1069
1066 os_info_init(); 1070 os_info_init();
1067 setup_ipl(); 1071 setup_ipl();
1072 reserve_oldmem();
1068 setup_memory_end(); 1073 setup_memory_end();
1069 setup_addressing_mode(); 1074 setup_addressing_mode();
1070 reserve_oldmem();
1071 reserve_crashkernel(); 1075 reserve_crashkernel();
1072 setup_memory(); 1076 setup_memory();
1073 setup_resources(); 1077 setup_resources();