All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	Petr Mladek <pmladek@suse.com>, Jan Kara <jack@suse.cz>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] printk/nmi: avoid direct printk()-s from __printk_nmi_flush()
Date: Thu, 1 Sep 2016 09:55:53 +0900	[thread overview]
Message-ID: <20160901005553.GA438@swordfish> (raw)
In-Reply-To: <20160831131550.b058472416e1f3219c52b726@linux-foundation.org>

On (08/31/16 13:15), Andrew Morton wrote:
> > On (08/30/16 15:03), Andrew Morton wrote:
> > > > __printk_nmi_flush() can be called from nmi_panic(), therefore it has to
> > > > test whether it's executed in NMI context and thus must route the messages
> > > > through deferred printk() or via direct printk().
> > > 
> > > Why?  What misbehaviour does the current code cause?
> > 
> > the reasoning behind the `if in_nmi()' in print_nmi_seq_line()
> > 
> >        if (in_nmi())
> >                printk_deferred("%.*s", (end - start) + 1, buf);
> >        else
> >                printk("%.*s", (end - start) + 1, buf);
> > 
> > was as follows (per Petr's commit message)
> 
> OK, thanks, I altered the changelog thusly and scheduled the patch for 4.8:

thanks!

	-ss

> 
> --- txt/printk-nmi-avoid-direct-printk-s-from-__printk_nmi_flush.txt
> +++ txt/printk-nmi-avoid-direct-printk-s-from-__printk_nmi_flush.txt
> @@ -3,8 +3,13 @@
>  
>  __printk_nmi_flush() can be called from nmi_panic(), therefore it has to
>  test whether it's executed in NMI context and thus must route the messages
> -through deferred printk() or via direct printk(). Except for two places
> -where __printk_nmi_flush() does unconditional direct printk() calls:
> +through deferred printk() or via direct printk().  This is to avoid
> +potential deadlocks, as described in cf9b1106c81c45cde ("printk/nmi: flush
> +NMI messages on the system panic").
> +
> +However there remain two places where __printk_nmi_flush() does
> +unconditional direct printk() calls:
> +
>   - pr_err("printk_nmi_flush: internal error ...")
>   - pr_cont("\n")
>  
> 

      reply	other threads:[~2016-09-01  0:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-30 16:13 [PATCH v2] printk/nmi: avoid direct printk()-s from __printk_nmi_flush() Sergey Senozhatsky
2016-08-30 22:03 ` Andrew Morton
2016-08-31  1:44   ` Sergey Senozhatsky
2016-08-31 20:15     ` Andrew Morton
2016-09-01  0:55       ` Sergey Senozhatsky [this message]

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=20160901005553.GA438@swordfish \
    --to=sergey.senozhatsky.work@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=jack@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmladek@suse.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.