Re: [PATCH] printk/nmi: restore printk_func in nmi_panic

2016-03-01 Thread Sergey Senozhatsky
On (03/01/16 12:05), Petr Mladek wrote: [..] > > > yes, well, that's true for panic() in general. > > > > Petr, what do you think of this (added PRINTK_NMI_FLUSH_ON_PANIC)? > > > > 1) zap_locks() in console_flush_on_panic() > > 2) add PRINTK_NMI_FLUSH_ON_PANIC symbols > > 3) add printk_nmi_flush_

Re: [PATCH] printk/nmi: restore printk_func in nmi_panic

2016-03-01 Thread Petr Mladek
On Tue 2016-03-01 18:24:26, Sergey Senozhatsky wrote: > Hello, > > On (02/29/16 20:19), Sergey Senozhatsky wrote: > [..] > > > That is the problem. zap_locks() is not a solution. > > > > > > First, it handles only lockbuf_lock and console_sem. There are other > > > locks used by particular consol

Re: [PATCH] printk/nmi: restore printk_func in nmi_panic

2016-03-01 Thread Sergey Senozhatsky
Hello, On (02/29/16 20:19), Sergey Senozhatsky wrote: [..] > > That is the problem. zap_locks() is not a solution. > > > > First, it handles only lockbuf_lock and console_sem. There are other > > locks used by particular consoles that might cause a deadlock. > > yes, well, that's true for panic(

Re: [PATCH] printk/nmi: restore printk_func in nmi_panic

2016-02-29 Thread Sergey Senozhatsky
On (02/29/16 11:31), Petr Mladek wrote: > > > > diff --git a/include/linux/kernel.h b/include/linux/kernel.h > > > > index f4fa2b2..3ee33d5 100644 > > > > --- a/include/linux/kernel.h > > > > +++ b/include/linux/kernel.h > > > > @@ -469,10 +469,12 @@ do {

Re: [PATCH] printk/nmi: restore printk_func in nmi_panic

2016-02-29 Thread Petr Mladek
On Sat 2016-02-27 11:19:44, Sergey Senozhatsky wrote: > Hello Petr, > > On (02/26/16 15:57), Petr Mladek wrote: > > On Fri 2016-02-26 12:37:20, Sergey Senozhatsky wrote: > > > When watchdog detects a hardlockup and calls nmi_panic() `printk_func' > > > must be restored via printk_nmi_exit() call,

Re: [PATCH] printk/nmi: restore printk_func in nmi_panic

2016-02-27 Thread Sergey Senozhatsky
Petr, what do you think about this? 1) __zap_locks() in console_flush_on_panic() 2) add printk_nmi_flush_on_panic() -- disable irq work, exit nmi, flush nmi --- include/linux/printk.h | 2 ++ kernel/printk/nmi.c| 28 +++- kernel/printk/printk.c | 27

Re: [PATCH] printk/nmi: restore printk_func in nmi_panic

2016-02-26 Thread Sergey Senozhatsky
On (02/27/16 12:09), Sergey Senozhatsky wrote: > On (02/27/16 11:19), Sergey Senozhatsky wrote: > [..] > > > I think about a compromise. We should try to get the messages > > > out only when kdump is not enabled. > > > > can we zap_locks() if we are on > > nmi_panic()->panic()->console_flush_on_p

Re: [PATCH] printk/nmi: restore printk_func in nmi_panic

2016-02-26 Thread Sergey Senozhatsky
_on_panic() is happening after we send out smp_send_stop(). can something like this do the trick? 8< >From 4186873bb4574b4bbb227e7448d56599849de0bd Mon Sep 17 00:00:00 2001 From: Sergey Senozhatsky Subject: [PATCH] printk/nmi: restore printk_func in nmi_panic When watchdog dete

Re: [PATCH] printk/nmi: restore printk_func in nmi_panic

2016-02-26 Thread Sergey Senozhatsky
Hello Petr, On (02/26/16 15:57), Petr Mladek wrote: > On Fri 2016-02-26 12:37:20, Sergey Senozhatsky wrote: > > When watchdog detects a hardlockup and calls nmi_panic() `printk_func' > > must be restored via printk_nmi_exit() call, so panic() will be able > > to flush nmi buf and show backtrace an

Re: [PATCH] printk/nmi: restore printk_func in nmi_panic

2016-02-26 Thread Petr Mladek
On Fri 2016-02-26 12:37:20, Sergey Senozhatsky wrote: > When watchdog detects a hardlockup and calls nmi_panic() `printk_func' > must be restored via printk_nmi_exit() call, so panic() will be able > to flush nmi buf and show backtrace and panic message. We also better > explicitly ask nmi to print

[PATCH] printk/nmi: restore printk_func in nmi_panic

2016-02-25 Thread Sergey Senozhatsky
When watchdog detects a hardlockup and calls nmi_panic() `printk_func' must be restored via printk_nmi_exit() call, so panic() will be able to flush nmi buf and show backtrace and panic message. We also better explicitly ask nmi to printk_nmi_flush() in console_flush_on_panic(), because it may be t