Introduce flags for reserve_bootmem()
authorBernhard Walle <bwalle@suse.de>
Thu, 7 Feb 2008 08:15:17 +0000 (00:15 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 7 Feb 2008 16:42:25 +0000 (08:42 -0800)
commit72a7fe3967dbf86cb34e24fbf1d957fe24d2f246
treec19f7d0b530577359840e959cce204939caf0649
parent25fad945a7f7ff2cf06e437381c6a1121784dbd9
Introduce flags for reserve_bootmem()

This patchset adds a flags variable to reserve_bootmem() and uses the
BOOTMEM_EXCLUSIVE flag in crashkernel reservation code to detect collisions
between crashkernel area and already used memory.

This patch:

Change the reserve_bootmem() function to accept a new flag BOOTMEM_EXCLUSIVE.
If that flag is set, the function returns with -EBUSY if the memory already
has been reserved in the past.  This is to avoid conflicts.

Because that code runs before SMP initialisation, there's no race condition
inside reserve_bootmem_core().

[akpm@linux-foundation.org: coding-style fixes]
[akpm@linux-foundation.org: fix powerpc build]
Signed-off-by: Bernhard Walle <bwalle@suse.de>
Cc: <linux-arch@vger.kernel.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
43 files changed:
arch/alpha/kernel/core_irongate.c
arch/alpha/kernel/setup.c
arch/alpha/mm/numa.c
arch/arm/mm/init.c
arch/arm/mm/mmu.c
arch/arm/mm/nommu.c
arch/arm/plat-omap/fb.c
arch/avr32/kernel/setup.c
arch/blackfin/kernel/setup.c
arch/cris/kernel/setup.c
arch/frv/kernel/setup.c
arch/h8300/kernel/setup.c
arch/ia64/mm/contig.c
arch/ia64/mm/discontig.c
arch/m32r/kernel/setup.c
arch/m32r/mm/discontig.c
arch/m68k/atari/stram.c
arch/m68k/kernel/setup.c
arch/m68knommu/kernel/setup.c
arch/mips/kernel/setup.c
arch/mips/sgi-ip27/ip27-memory.c
arch/parisc/mm/init.c
arch/powerpc/mm/mem.c
arch/powerpc/mm/numa.c
arch/s390/kernel/setup.c
arch/sh/kernel/setup.c
arch/sh/mm/numa.c
arch/sparc/mm/init.c
arch/sparc64/mm/init.c
arch/v850/kernel/anna.c
arch/v850/kernel/as85ep1.c
arch/v850/kernel/rte_ma1_cb.c
arch/v850/kernel/setup.c
arch/x86/kernel/mpparse_32.c
arch/x86/kernel/setup_32.c
arch/x86/kernel/setup_64.c
arch/x86/mm/discontig_32.c
arch/x86/mm/init_64.c
arch/x86/mm/numa_64.c
arch/x86/mm/srat_64.c
include/asm-x86/mmzone_32.h
include/linux/bootmem.h
mm/bootmem.c