From patchwork Fri Nov 27 11:09:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Mladek X-Patchwork-Id: 7712861 X-Patchwork-Delegate: horms@verge.net.au Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 60564BF90C for ; Fri, 27 Nov 2015 11:11:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9B7E82054C for ; Fri, 27 Nov 2015 11:11:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CBD8C2054A for ; Fri, 27 Nov 2015 11:11:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754324AbbK0LKc (ORCPT ); Fri, 27 Nov 2015 06:10:32 -0500 Received: from mx2.suse.de ([195.135.220.15]:47656 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753963AbbK0LJz (ORCPT ); Fri, 27 Nov 2015 06:09:55 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 2F710AD87; Fri, 27 Nov 2015 11:08:14 +0000 (UTC) From: Petr Mladek To: Andrew Morton Cc: Peter Zijlstra , Steven Rostedt , Russell King , Daniel Thompson , Jiri Kosina , Ingo Molnar , Thomas Gleixner , linux-kernel@vger.kernel.org, x86@kernel.org, linux-arm-kernel@lists.infradead.org, adi-buildroot-devel@lists.sourceforge.net, linux-cris-kernel@axis.com, linux-mips@linux-mips.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, Petr Mladek Subject: [PATCH v2 5/5] printk/nmi: Increase the size of the temporary buffer Date: Fri, 27 Nov 2015 12:09:32 +0100 Message-Id: <1448622572-16900-6-git-send-email-pmladek@suse.com> X-Mailer: git-send-email 1.8.5.6 In-Reply-To: <1448622572-16900-1-git-send-email-pmladek@suse.com> References: <1448622572-16900-1-git-send-email-pmladek@suse.com> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. 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 --- kernel/printk/nmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/printk/nmi.c b/kernel/printk/nmi.c index 8af1e4016719..6111644d5f01 100644 --- a/kernel/printk/nmi.c +++ b/kernel/printk/nmi.c @@ -42,7 +42,7 @@ atomic_t nmi_message_lost; struct nmi_seq_buf { atomic_t len; /* length of written data */ struct irq_work work; /* IRQ work that flushes the buffer */ - unsigned char buffer[PAGE_SIZE - sizeof(atomic_t) - + unsigned char buffer[2 * PAGE_SIZE - sizeof(atomic_t) - sizeof(struct irq_work)]; }; static DEFINE_PER_CPU(struct nmi_seq_buf, nmi_print_seq);