diff options
author | Bernhard Walle <bwalle@suse.de> | 2008-02-07 03:15:17 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-07 11:42:25 -0500 |
commit | 72a7fe3967dbf86cb34e24fbf1d957fe24d2f246 (patch) | |
tree | c19f7d0b530577359840e959cce204939caf0649 /arch/sparc64/mm | |
parent | 25fad945a7f7ff2cf06e437381c6a1121784dbd9 (diff) |
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>
Diffstat (limited to 'arch/sparc64/mm')
-rw-r--r-- | arch/sparc64/mm/init.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c index 523e993ee90c..e726c45645ff 100644 --- a/arch/sparc64/mm/init.c +++ b/arch/sparc64/mm/init.c | |||
@@ -997,7 +997,7 @@ static unsigned long __init bootmem_init(unsigned long *pages_avail, | |||
997 | prom_printf("reserve_bootmem(initrd): base[%llx] size[%lx]\n", | 997 | prom_printf("reserve_bootmem(initrd): base[%llx] size[%lx]\n", |
998 | initrd_start, initrd_end); | 998 | initrd_start, initrd_end); |
999 | #endif | 999 | #endif |
1000 | reserve_bootmem(initrd_start, size); | 1000 | reserve_bootmem(initrd_start, size, BOOTMEM_DEFAULT); |
1001 | 1001 | ||
1002 | initrd_start += PAGE_OFFSET; | 1002 | initrd_start += PAGE_OFFSET; |
1003 | initrd_end += PAGE_OFFSET; | 1003 | initrd_end += PAGE_OFFSET; |
@@ -1007,7 +1007,7 @@ static unsigned long __init bootmem_init(unsigned long *pages_avail, | |||
1007 | #ifdef CONFIG_DEBUG_BOOTMEM | 1007 | #ifdef CONFIG_DEBUG_BOOTMEM |
1008 | prom_printf("reserve_bootmem(kernel): base[%lx] size[%lx]\n", kern_base, kern_size); | 1008 | prom_printf("reserve_bootmem(kernel): base[%lx] size[%lx]\n", kern_base, kern_size); |
1009 | #endif | 1009 | #endif |
1010 | reserve_bootmem(kern_base, kern_size); | 1010 | reserve_bootmem(kern_base, kern_size, BOOTMEM_DEFAULT); |
1011 | *pages_avail -= PAGE_ALIGN(kern_size) >> PAGE_SHIFT; | 1011 | *pages_avail -= PAGE_ALIGN(kern_size) >> PAGE_SHIFT; |
1012 | 1012 | ||
1013 | /* Add back in the initmem pages. */ | 1013 | /* Add back in the initmem pages. */ |
@@ -1024,7 +1024,7 @@ static unsigned long __init bootmem_init(unsigned long *pages_avail, | |||
1024 | prom_printf("reserve_bootmem(bootmap): base[%lx] size[%lx]\n", | 1024 | prom_printf("reserve_bootmem(bootmap): base[%lx] size[%lx]\n", |
1025 | (bootmap_pfn << PAGE_SHIFT), size); | 1025 | (bootmap_pfn << PAGE_SHIFT), size); |
1026 | #endif | 1026 | #endif |
1027 | reserve_bootmem((bootmap_pfn << PAGE_SHIFT), size); | 1027 | reserve_bootmem((bootmap_pfn << PAGE_SHIFT), size, BOOTMEM_DEFAULT); |
1028 | 1028 | ||
1029 | for (i = 0; i < pavail_ents; i++) { | 1029 | for (i = 0; i < pavail_ents; i++) { |
1030 | unsigned long start_pfn, end_pfn; | 1030 | unsigned long start_pfn, end_pfn; |
@@ -1489,7 +1489,7 @@ static void __init taint_real_pages(void) | |||
1489 | goto do_next_page; | 1489 | goto do_next_page; |
1490 | } | 1490 | } |
1491 | } | 1491 | } |
1492 | reserve_bootmem(old_start, PAGE_SIZE); | 1492 | reserve_bootmem(old_start, PAGE_SIZE, BOOTMEM_DEFAULT); |
1493 | 1493 | ||
1494 | do_next_page: | 1494 | do_next_page: |
1495 | old_start += PAGE_SIZE; | 1495 | old_start += PAGE_SIZE; |