diff options
author | Mike Travis <travis@sgi.com> | 2011-05-24 20:13:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-25 11:39:48 -0400 |
commit | 162a7e7500f9664636e649ba59defe541b7c2c60 (patch) | |
tree | f44d4e480975d7f2c4bd4fd8625dbdb81eb04ade /include/linux/printk.h | |
parent | 95dde501907b06e7203c74f8435acfdab9eb2659 (diff) |
printk: allocate kernel log buffer earlier
On larger systems, because of the numerous ACPI, Bootmem and EFI messages,
the static log buffer overflows before the larger one specified by the
log_buf_len param is allocated. Minimize the overflow by allocating the
new log buffer as soon as possible.
On kernels without memblock, a later call to setup_log_buf from
kernel/init.c is the fallback.
[akpm@linux-foundation.org: coding-style fixes]
[akpm@linux-foundation.org: fix CONFIG_PRINTK=n build]
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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/printk.h')
-rw-r--r-- | include/linux/printk.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/printk.h b/include/linux/printk.h index ee048e77e1ae..0101d55d9651 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef __KERNEL_PRINTK__ | 1 | #ifndef __KERNEL_PRINTK__ |
2 | #define __KERNEL_PRINTK__ | 2 | #define __KERNEL_PRINTK__ |
3 | 3 | ||
4 | #include <linux/init.h> | ||
5 | |||
4 | extern const char linux_banner[]; | 6 | extern const char linux_banner[]; |
5 | extern const char linux_proc_banner[]; | 7 | extern const char linux_proc_banner[]; |
6 | 8 | ||
@@ -113,6 +115,7 @@ extern int dmesg_restrict; | |||
113 | extern int kptr_restrict; | 115 | extern int kptr_restrict; |
114 | 116 | ||
115 | void log_buf_kexec_setup(void); | 117 | void log_buf_kexec_setup(void); |
118 | void __init setup_log_buf(int early); | ||
116 | #else | 119 | #else |
117 | static inline __attribute__ ((format (printf, 1, 0))) | 120 | static inline __attribute__ ((format (printf, 1, 0))) |
118 | int vprintk(const char *s, va_list args) | 121 | int vprintk(const char *s, va_list args) |
@@ -137,6 +140,10 @@ static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, | |||
137 | static inline void log_buf_kexec_setup(void) | 140 | static inline void log_buf_kexec_setup(void) |
138 | { | 141 | { |
139 | } | 142 | } |
143 | |||
144 | static inline void setup_log_buf(int early) | ||
145 | { | ||
146 | } | ||
140 | #endif | 147 | #endif |
141 | 148 | ||
142 | extern void dump_stack(void) __cold; | 149 | extern void dump_stack(void) __cold; |