Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755460AbbESI44 (ORCPT ); Tue, 19 May 2015 04:56:56 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:7106 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753688AbbESI4w (ORCPT ); Tue, 19 May 2015 04:56:52 -0400 Message-ID: <555AFAA3.5070906@huawei.com> Date: Tue, 19 May 2015 16:56:03 +0800 From: "long.wanglong" User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Petr Mladek CC: , , , , , , , , , , , Subject: Re: [RFC PATCH 16/17] x86/nmi: Perform a safe NMI stack trace on all CPUs References: <1431603304-162571-1-git-send-email-long.wanglong@huawei.com> <1431603304-162571-17-git-send-email-long.wanglong@huawei.com> <20150518141748.GE2632@pathway.suse.cz> In-Reply-To: <20150518141748.GE2632@pathway.suse.cz> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.111.88.174] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2644 Lines: 75 On 2015/5/18 22:17, Petr Mladek wrote: > On Thu 2015-05-14 11:35:03, Wang Long wrote: >> From: "Steven Rostedt (Red Hat)" >> >> commit a9edc88093287183ac934be44f295f183b2c62dd upstream. >> >> When trigger_all_cpu_backtrace() is called on x86, it will trigger an >> NMI on each CPU and call show_regs(). But this can lead to a hard lock >> up if the NMI comes in on another printk(). >> >> In order to avoid this, when the NMI triggers, it switches the printk >> routine for that CPU to call a NMI safe printk function that records the >> printk in a per_cpu seq_buf descriptor. After all NMIs have finished >> recording its data, the seq_bufs are printed in a safe context. >> >> Link: http://lkml.kernel.org/p/20140619213952.360076309@goodmis.org >> Link: http://lkml.kernel.org/r/20141115050605.055232587@goodmis.org >> >> Tested-by: Jiri Kosina >> Acked-by: Jiri Kosina >> Acked-by: Paul E. McKenney >> Reviewed-by: Petr Mladek >> [wanglong: backport to 3.10 stable >> - adjust context >> ] >> Signed-off-by: Wang Long >> Signed-off-by: Steven Rostedt >> --- >> arch/x86/kernel/apic/hw_nmi.c | 86 +++++++++++++++++++++++++++++++++++++++++-- >> 1 file changed, 83 insertions(+), 3 deletions(-) >> >> diff --git a/arch/x86/kernel/apic/hw_nmi.c b/arch/x86/kernel/apic/hw_nmi.c >> index a698d71..1eb5f90 100644 >> --- a/arch/x86/kernel/apic/hw_nmi.c >> +++ b/arch/x86/kernel/apic/hw_nmi.c >> @@ -18,6 +18,7 @@ >> #include >> #include >> #include >> +#include >> >> #ifdef CONFIG_HARDLOCKUP_DETECTOR >> u64 hw_nmi_get_sample_period(int watchdog_thresh) >> @@ -29,12 +30,33 @@ u64 hw_nmi_get_sample_period(int watchdog_thresh) >> #ifdef arch_trigger_all_cpu_backtrace >> /* For reliability, we're prepared to waste bits here. */ >> static DECLARE_BITMAP(backtrace_mask, NR_CPUS) __read_mostly; >> +static cpumask_var_t printtrace_mask; >> + >> +#define NMI_BUF_SIZE 4096 > > Please, replace spaces with tabs. > > In fact, the indentation is broken in this whole patch. > > The content looks fine, though. > > Best Regards, > Petr > Hi Petr, Thank you for your review. Sorry for the indentation broken. I will send the patch v2. Best Regards Wang Long -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/