diff options
author | Cliff Wickman <cpw@sgi.com> | 2010-06-16 08:36:09 -0500 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2010-06-17 10:28:21 +0900 |
commit | 4b4b2a533e218e287ab4aed25678434ad938309e (patch) | |
tree | 3f92b853ca9c01824f86b2f2fe474f37e87c13b9 /kexec/arch | |
parent | 436f1376e1621aeba54d8253244955df4865d5e9 (diff) |
kexec: extend for large cpu count and memory
The MAX_MEMORY_RANGES of 64 is too small for a very large NUMA machine.
(A 512 processor SGI UV, for example.)
And fix a temporary workaround (hack) in load_crashdump_segments() that
assumes that 16k is sufficient for the size of the crashdump elf header.
This is too small for a machine with a large cpu count. A PT_NOTE is created
in the elf header for each cpu.
Signed-off-by: Cliff Wickman <cpw@sgi.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'kexec/arch')
-rw-r--r-- | kexec/arch/i386/kexec-x86.h | 2 | ||||
-rw-r--r-- | kexec/arch/x86_64/crashdump-x86_64.c | 15 |
2 files changed, 12 insertions, 5 deletions
diff --git a/kexec/arch/i386/kexec-x86.h b/kexec/arch/i386/kexec-x86.h index 36ed9d5..aca1841 100644 --- a/kexec/arch/i386/kexec-x86.h +++ b/kexec/arch/i386/kexec-x86.h @@ -1,7 +1,7 @@ #ifndef KEXEC_X86_H #define KEXEC_X86_H -#define MAX_MEMORY_RANGES 64 +#define MAX_MEMORY_RANGES 1024 enum coretype { CORE_TYPE_UNDEF = 0, diff --git a/kexec/arch/x86_64/crashdump-x86_64.c b/kexec/arch/x86_64/crashdump-x86_64.c index 29e9602..8b6581b 100644 --- a/kexec/arch/x86_64/crashdump-x86_64.c +++ b/kexec/arch/x86_64/crashdump-x86_64.c @@ -591,7 +591,7 @@ int load_crashdump_segments(struct kexec_info *info, char* mod_cmdline, unsigned long max_addr, unsigned long min_base) { void *tmp; - unsigned long sz, elfcorehdr; + unsigned long sz, bufsz, memsz, elfcorehdr; int nr_ranges, align = 1024, i; struct memory_range *mem_range, *memmap_p; @@ -637,9 +637,10 @@ int load_crashdump_segments(struct kexec_info *info, char* mod_cmdline, /* Create elf header segment and store crash image data. */ if (crash_create_elf64_headers(info, &elf_info, crash_memory_range, nr_ranges, - &tmp, &sz, + &tmp, &bufsz, ELF_CORE_HEADER_ALIGN) < 0) return -1; + /* the size of the elf headers allocated is returned in 'bufsz' */ /* Hack: With some ld versions (GNU ld version 2.14.90.0.4 20030523), * vmlinux program headers show a gap of two pages between bss segment @@ -648,9 +649,15 @@ int load_crashdump_segments(struct kexec_info *info, char* mod_cmdline, * elf core header segment to 16K to avoid being placed in such gaps. * This is a makeshift solution until it is fixed in kernel. */ - elfcorehdr = add_buffer(info, tmp, sz, 16*1024, align, min_base, + if (bufsz < (16*1024)) + /* bufsize is big enough for all the PT_NOTE's and PT_LOAD's */ + memsz = 16*1024; + /* memsz will be the size of the memory hole we look for */ + else + memsz = bufsz; + elfcorehdr = add_buffer(info, tmp, bufsz, memsz, align, min_base, max_addr, -1); - if (delete_memmap(memmap_p, elfcorehdr, sz) < 0) + if (delete_memmap(memmap_p, elfcorehdr, memsz) < 0) return -1; cmdline_add_memmap(mod_cmdline, memmap_p); cmdline_add_elfcorehdr(mod_cmdline, elfcorehdr); |