public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
To: Petr Mladek <pmladek@suse.com>
Cc: Petr Mladek <pmladek@suse.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Peter Zijlstra <peterz@infradead.org>,
	linux-kernel@vger.kernel.org,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Subject: Re: [PATCH] printk: drop in_nmi check from printk_safe_flush_on_panic()
Date: Wed, 30 May 2018 19:00:37 +0900	[thread overview]
Message-ID: <20180530100037.GE12230@jagdpanzerIV> (raw)
In-Reply-To: <20180530095504.GD12230@jagdpanzerIV>

On (05/30/18 18:55), Sergey Senozhatsky wrote:
> > 
> > I understand why you came with it but I am against this change without
> > a proper research. This would redirect too valuable messages into
> > a buffer of a limited size and postpone flushing them to the consoles.
> > 
> > We would need to really carefully compare chances where this would
> > help and where it would make things worse. There is a high chance
> > that we could come with a better solution once we have the analyze.
> 
> I agree, sure.
> 
> The thing is, we, in fact, already invoke panic() in printk_safe mode.
> Sometimes.
> 
> Namely,
> 
>   nmi_panic() -> panic()
> 
> is invoked while we are in printk_nmi(), so all printk()-s go
> to the per-CPU buffers. So, at least to some extent, panic()
> in printk_safe context is not something never seen before. Just
> saying.

Well, we have a PRINTK_NMI_DEFERRED_CONTEXT_MASK mode for
printk_nmi(). May be we can [if need be] come up with the same trick
for printk_safe_panic() mode. If logbuf spin_lock is unlocked, then
we use the main logbuf, if it is locked, we redirect printk to per-CPU
buffers and then flush it via printk_safe_flush_on_panic(), which will
re-init (unlock) the logbuf.

	-ss

  reply	other threads:[~2018-05-30 10:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-30  7:03 [PATCH] printk: drop in_nmi check from printk_safe_flush_on_panic() Sergey Senozhatsky
2018-05-30  7:24 ` Petr Mladek
2018-05-30  7:51   ` Sergey Senozhatsky
2018-05-30  8:48     ` Petr Mladek
2018-05-30  9:55       ` Sergey Senozhatsky
2018-05-30 10:00         ` Sergey Senozhatsky [this message]
2018-05-31 14:21           ` Petr Mladek
2018-05-31 14:05 ` Petr Mladek

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=20180530100037.GE12230@jagdpanzerIV \
    --to=sergey.senozhatsky.work@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky@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