aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/printk.h
diff options
context:
space:
mode:
authorMike Travis <travis@sgi.com>2011-05-24 20:13:20 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-25 11:39:48 -0400
commit162a7e7500f9664636e649ba59defe541b7c2c60 (patch)
treef44d4e480975d7f2c4bd4fd8625dbdb81eb04ade /include/linux/printk.h
parent95dde501907b06e7203c74f8435acfdab9eb2659 (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.h7
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
4extern const char linux_banner[]; 6extern const char linux_banner[];
5extern const char linux_proc_banner[]; 7extern const char linux_proc_banner[];
6 8
@@ -113,6 +115,7 @@ extern int dmesg_restrict;
113extern int kptr_restrict; 115extern int kptr_restrict;
114 116
115void log_buf_kexec_setup(void); 117void log_buf_kexec_setup(void);
118void __init setup_log_buf(int early);
116#else 119#else
117static inline __attribute__ ((format (printf, 1, 0))) 120static inline __attribute__ ((format (printf, 1, 0)))
118int vprintk(const char *s, va_list args) 121int vprintk(const char *s, va_list args)
@@ -137,6 +140,10 @@ static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies,
137static inline void log_buf_kexec_setup(void) 140static inline void log_buf_kexec_setup(void)
138{ 141{
139} 142}
143
144static inline void setup_log_buf(int early)
145{
146}
140#endif 147#endif
141 148
142extern void dump_stack(void) __cold; 149extern void dump_stack(void) __cold;