path: root/kernel
diff options
authorPetr Mladek <>2016-05-20 17:00:39 -0700
committerLinus Torvalds <>2016-05-20 17:58:30 -0700
commit427934b8714ec130b068d1c9d88f25b24aaede32 (patch)
tree2d72fdd828f1fe84c948225b680fe26de7be2536 /kernel
parentb522deabc6f18e4f938d93a84f345f2cbf3347d1 (diff)
printk/nmi: increase the size of NMI buffer and make it configurable
Testing has shown that the backtrace sometimes does not fit into the 4kB temporary buffer that is used in NMI context. The warnings are gone when I double the temporary buffer size. This patch doubles the buffer size and makes it configurable. Note that this problem existed even in the x86-specific implementation that was added by the commit a9edc8809328 ("x86/nmi: Perform a safe NMI stack trace on all CPUs"). Nobody noticed it because it did not print any warnings. Signed-off-by: Petr Mladek <> Cc: Jan Kara <> Cc: Peter Zijlstra <> Cc: Steven Rostedt <> Cc: Russell King <> Cc: Daniel Thompson <> Cc: Jiri Kosina <> Cc: Ingo Molnar <> Cc: Thomas Gleixner <> Cc: Ralf Baechle <> Cc: Benjamin Herrenschmidt <> Cc: Martin Schwidefsky <> Cc: David Miller <> Cc: Daniel Thompson <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'kernel')
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/printk/nmi.c b/kernel/printk/nmi.c
index 572f94922230..bf08557d7e3d 100644
--- a/kernel/printk/nmi.c
+++ b/kernel/printk/nmi.c
@@ -41,7 +41,8 @@ DEFINE_PER_CPU(printk_func_t, printk_func) = vprintk_default;
static int printk_nmi_irq_ready;
atomic_t nmi_message_lost;
-#define NMI_LOG_BUF_LEN (4096 - sizeof(atomic_t) - sizeof(struct irq_work))
+ sizeof(atomic_t) - sizeof(struct irq_work))
struct nmi_seq_buf {
atomic_t len; /* length of written data */