lkml.org 
[lkml]   [2015]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 16/17] x86/nmi: Perform a safe NMI stack trace on all CPUs
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)" <rostedt@goodmis.org>
>>
>> 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 <jkosina@suse.cz>
>> Acked-by: Jiri Kosina <jkosina@suse.cz>
>> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
>> Reviewed-by: Petr Mladek <pmladek@suse.cz>
>> [wanglong: backport to 3.10 stable
>> - adjust context
>> ]
>> Signed-off-by: Wang Long <long.wanglong@huawei.com>
>> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
>> ---
>> 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 <linux/nmi.h>
>> #include <linux/module.h>
>> #include <linux/delay.h>
>> +#include <linux/seq_buf.h>
>>
>> #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




\
 
 \ /
  Last update: 2015-05-19 11:41    [W:0.166 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site