aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYinghai Lu <yinghai@kernel.org>2011-05-24 20:13:19 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-25 11:39:48 -0400
commit95dde501907b06e7203c74f8435acfdab9eb2659 (patch)
tree1bbaca98ac1251f0489d283f5426a839158e9182
parentd9be9b90d6dc5e712ca5d6109691a8de753ce7f1 (diff)
memblock: add error return when CONFIG_HAVE_MEMBLOCK is not set
On larger systems, information in the kernel log is lost because there is so much early text printed, that it overflows the static log buffer before the log_buf_len kernel parameter can be processed, and a bigger log buffer allocated. Distros are relunctant to increase memory usage by increasing the size of the static log buffer, so minimize the problem by allocating the new log buffer as early as possible. This patch: Add an error return if CONFIG_HAVE_MEMBLOCK is not set instead of having to add #ifdef CONFIG_HAVE_MEMBLOCK around blocks of code calling that function. Signed-off-by: Mike Travis <travis@sgi.com> Cc: Yinghai Lu <yhlu.kernel@gmail.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Jack Steiner <steiner@sgi.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--include/linux/memblock.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index 62a10c2a11f2..7525e38c434d 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -2,6 +2,8 @@
2#define _LINUX_MEMBLOCK_H 2#define _LINUX_MEMBLOCK_H
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5#define MEMBLOCK_ERROR 0
6
5#ifdef CONFIG_HAVE_MEMBLOCK 7#ifdef CONFIG_HAVE_MEMBLOCK
6/* 8/*
7 * Logical memory blocks. 9 * Logical memory blocks.
@@ -20,7 +22,6 @@
20#include <asm/memblock.h> 22#include <asm/memblock.h>
21 23
22#define INIT_MEMBLOCK_REGIONS 128 24#define INIT_MEMBLOCK_REGIONS 128
23#define MEMBLOCK_ERROR 0
24 25
25struct memblock_region { 26struct memblock_region {
26 phys_addr_t base; 27 phys_addr_t base;
@@ -160,6 +161,12 @@ static inline unsigned long memblock_region_reserved_end_pfn(const struct memblo
160#define __initdata_memblock 161#define __initdata_memblock
161#endif 162#endif
162 163
164#else
165static inline phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align)
166{
167 return MEMBLOCK_ERROR;
168}
169
163#endif /* CONFIG_HAVE_MEMBLOCK */ 170#endif /* CONFIG_HAVE_MEMBLOCK */
164 171
165#endif /* __KERNEL__ */ 172#endif /* __KERNEL__ */