linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
To: Petr Mladek <pmladek@suse.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Jan Kara <jack@suse.cz>, Peter Zijlstra <peterz@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Subject: Re: [PATCH] printk/nmi: restore printk_func in nmi_panic
Date: Sat, 27 Feb 2016 11:19:44 +0900	[thread overview]
Message-ID: <20160227021944.GA1621@swordfish> (raw)
In-Reply-To: <20160226145717.GZ12548@pathway.suse.cz>

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 and panic message. We also better
> > explicitly ask nmi to printk_nmi_flush() in console_flush_on_panic(),
> > because it may be too late to rely on irq work.
> > 
> > Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> > ---
> >  include/linux/kernel.h | 6 ++++--
> >  kernel/printk/printk.c | 1 +
> >  2 files changed, 5 insertions(+), 2 deletions(-)
> > 
> > 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 {									\
> >  	cpu = raw_smp_processor_id();					\
> >  	old_cpu = atomic_cmpxchg(&panic_cpu, PANIC_CPU_INVALID, cpu);	\
> >  									\
> > -	if (old_cpu == PANIC_CPU_INVALID)				\
> > +	if (old_cpu == PANIC_CPU_INVALID) {				\
> > +		printk_nmi_exit();					\
> 
> This might end up in a deadlock that printk_nmi() wanted to avoid.

aha, I see.

> 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_panic() path?
console_flush_on_panic() is happening after we send out smp_send_stop().


> PS: I am sorry for not responding much about the printk problems
> this week. I have attended a training and did not have much time
> for a real work.

no prob.

	-ss

  reply	other threads:[~2016-02-27  2:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-26  3:37 [PATCH] printk/nmi: restore printk_func in nmi_panic Sergey Senozhatsky
2016-02-26 14:57 ` Petr Mladek
2016-02-27  2:19   ` Sergey Senozhatsky [this message]
2016-02-27  3:09     ` Sergey Senozhatsky
2016-02-27  3:33       ` Sergey Senozhatsky
2016-02-28  3:52         ` Sergey Senozhatsky
2016-02-29 10:31     ` Petr Mladek
2016-02-29 11:19       ` Sergey Senozhatsky
2016-03-01  9:24         ` Sergey Senozhatsky
2016-03-01 11:05           ` Petr Mladek
2016-03-01 13:14             ` Sergey Senozhatsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160227021944.GA1621@swordfish \
    --to=sergey.senozhatsky@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=jack@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky.work@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).