]> git.karo-electronics.de Git - karo-tx-linux.git/commit
vmcore: allocate ELF note segment in the 2nd kernel vmalloc memory
authorHATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
Fri, 7 Jun 2013 00:07:49 +0000 (10:07 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 7 Jun 2013 05:42:12 +0000 (15:42 +1000)
commitf23ceb2559ce2212e007779c1d6b1dd09c4c5242
tree65b32179b9a60f4027674b905a3c549da84177e1
parent0aed9d63e14df46b0e28e143df581af9bbb501af
vmcore: allocate ELF note segment in the 2nd kernel vmalloc memory

The reasons why we don't allocate ELF note segment in the 1st kernel (old
memory) on page boundary is to keep backward compatibility for old
kernels, and that if doing so, we waste not a little memory due to
round-up operation to fit the memory to page boundary since most of the
buffers are in per-cpu area.

ELF notes are per-cpu, so total size of ELF note segments depends on
number of CPUs.  The current maximum number of CPUs on x86_64 is 5192, and
there's already system with 4192 CPUs in SGI, where total size amounts to
1MB.  This can be larger in the near future or possibly even now on
another architecture that has larger size of note per a single cpu.  Thus,
to avoid the case where memory allocation for large block fails, we
allocate vmcore objects on vmalloc memory.

This patch adds elfnotes_buf and elfnotes_sz variables to keep pointer to
the ELF note segment buffer and its size.  There's no longer the vmcore
object that corresponds to the ELF note segment in vmcore_list.
Accordingly, read_vmcore() has new case for ELF note segment and
set_vmcore_list_offsets_elf{64,32}() and other helper functions starts
calculating offset from sum of size of ELF headers and size of ELF note
segment.

Signed-off-by: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Atsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp>
Cc: Lisa Mitchell <lisa.mitchell@hp.com>
Cc: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/proc/vmcore.c