[PATCH] vmalloc: introduce remap_vmalloc_range_partial

From: HATAYAMA Daisuke
Date: Wed Jul 03 2013 - 18:02:18 EST


We want to allocate ELF note segment buffer on the 2nd kernel in vmalloc
space and remap it to user-space in order to reduce the risk that memory
allocation fails on system with huge number of CPUs and so with huge ELF
note segment that exceeds 11-order block size.

Although there's already remap_vmalloc_range for the purpose of
remapping vmalloc memory to user-space, we need to specify user-space
range via vma.
Mmap on /proc/vmcore needs to remap range across multiple objects, so
the interface that requires vma to cover full range is problematic.

This patch introduces remap_vmalloc_range_partial that receives user-space
range as a pair of base address and size and can be used for mmap on
/proc/vmcore case.

remap_vmalloc_range is rewritten using remap_vmalloc_range_partial.

[akpm@xxxxxxxxxxxxxxxxxxxx: use PAGE_ALIGNED()]
Signed-off-by: HATAYAMA Daisuke <d.hatayama@xxxxxxxxxxxxxx>
Cc: KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx>
Cc: Vivek Goyal <vgoyal@xxxxxxxxxx>
Cc: Atsushi Kumagai <kumagai-atsushi@xxxxxxxxxxxxxxxxx>
Cc: Lisa Mitchell <lisa.mitchell@xxxxxx>
Cc: Zhang Yanfei <zhangyanfei@xxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
---

# VERSION INFO (`ver_linux` from LTP, after passing xfstests xfs/167):

NAME=Slackware
VERSION="14.0"
ID=slackware
VERSION_ID=14.0
PRETTY_NAME="Slackware 14.0"
ANSI_COLOR="0;34"
CPE_NAME="cpe:/o:slackware:slackware_linux:14.0"
HOME_URL="http://slackware.com/";
SUPPORT_URL="http://www.linuxquestions.org/questions/slackware-14/";
BUG_REPORT_URL="http://www.linuxquestions.org/questions/slackware-14/";
Linux plbearer 3.10.0+ #13 Tue Jul 9 10:56:45 EDT 2013 i686 Intel(R) Pentium(R) 4 CPU 1.80GHz GenuineIntel GNU/Linux

Gnu C gcc (GCC) 4.8.1
Gnu make 3.82
util-linux linux 2.21.2
mount linux 2.21.2 (with libblkid support)
modutils 12
e2fsprogs 1.42.8
PPP 2.4.5
Linux C Library > libc.2.17
Dynamic linker (ldd) 2.17
Linux C++ Library 6.0.18
Procps 3.2.8
Net-tools 1.60
iproute2 iproute2-ss130221
Kbd 1.15.3
Sh-utils 8.21

free reports:
total used free shared buffers cached
Mem: 764548 755164 9384 0 736 646508
-/+ buffers/cache: 107920 656628
Swap: 616444 0 616444

/proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 2
model name : Intel(R) Pentium(R) 4 CPU 1.80GHz
stepping : 7
microcode : 0x24
cpu MHz : 1794.187
cache size : 512 KB
fdiv_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe pebs bts cid
bogomips : 3589.88
clflush size : 64
cache_alignment : 128
address sizes : 36 bits physical, 32 bits virtual
power management:

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/