linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: daniel.thompson@linaro.org (Daniel Thompson)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 4/4] printk/nmi: Increase the size of NMI buffer and make it configurable
Date: Tue, 1 Mar 2016 14:04:20 +0000	[thread overview]
Message-ID: <56D5A164.3000000@linaro.org> (raw)
In-Reply-To: <56743BA0.1030409@linaro.org>

On 18/12/15 17:00, Daniel Thompson wrote:
>>> The MCE handlers should only call printk() when they decide to panic
>>> and *after* busting the spinlocks. At this point deferring printk()
>>> until it is safe is not very helpful.
>>>
>>> When we bust the spinlocks we should probably restore the normal
>>> printk() function to give best chance of the failure messages making
>>> it out.
>>
>> The problem is that we do not know what locks need to be busted. There
>> are too many consoles and too many locks involved. Also busting locks
>> open another can of worms.
>
> Yes, I agree that busting the spinlocks doesn't avoid all risk of deadlock.
>
> Probably I've been placing too much weight on the importance of getting
> messages out when dying. You're right that surviving far enough through
> a panic to trigger kdump or reset is equally (or more) important in many
> scenarios than getting a failure message out.
>
> However on a system with nothing but "while(1) {}" hooked up to panic()
> then its worth risking a lock up. In this case restoring normal printk()
> behavior and dumping the NMI buffers would be worthwhile.

An a (much) later thread[1] Andrew Morton described this comment as 
non-committal. Sorry for that.

I don't object to the overall approach taken by Petr, merely that I 
think there are cases where the current patchset doesn't put in quite 
enough effort to issue messages.

Panic triggered during NMI is the only case I can think of and that, I 
think, could be addressed by adding an extra call to printk_nmi_flush() 
during panic(). It should probably only cover cases where we *don't* 
call kdump and the panic handler doesn't restart the machine... so just 
after the pr_emerg("...end kernel panic") would be OK for me.


Daniel.


[1]: http://thread.gmane.org/gmane.linux.ports.arm.kernel/482845

  reply	other threads:[~2016-03-01 14:04 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-09 13:21 [PATCH v3 0/4] Cleaning printk stuff in NMI context Petr Mladek
2015-12-09 13:21 ` [PATCH v3 1/4] printk/nmi: Generic solution for safe printk in NMI Petr Mladek
2015-12-09 23:50   ` Andrew Morton
2015-12-10 15:26     ` Petr Mladek
2015-12-09 13:21 ` [PATCH v3 2/4] printk/nmi: Use IRQ work only when ready Petr Mladek
2015-12-09 13:21 ` [PATCH v3 3/4] printk/nmi: Warn when some message has been lost in NMI context Petr Mladek
2015-12-09 13:21 ` [PATCH v3 4/4] printk/nmi: Increase the size of NMI buffer and make it configurable Petr Mladek
2015-12-11 11:10   ` Geert Uytterhoeven
2015-12-11 12:41     ` Petr Mladek
2015-12-11 12:47       ` Arnd Bergmann
2015-12-11 12:50       ` Geert Uytterhoeven
2015-12-11 22:57       ` Andrew Morton
2015-12-11 23:21         ` Russell King - ARM Linux
2015-12-11 23:26           ` Jiri Kosina
2015-12-18 10:18             ` Daniel Thompson
2015-12-18 11:29               ` Peter Zijlstra
2015-12-18 12:11                 ` Peter Zijlstra
2015-12-18 23:03                   ` Andrew Morton
2015-12-18 14:52               ` Petr Mladek
2015-12-18 17:00                 ` Daniel Thompson
2016-03-01 14:04                   ` Daniel Thompson [this message]
2015-12-11 23:30           ` Andrew Morton
2015-12-15 14:26             ` Petr Mladek
2015-12-17 22:38               ` Andrew Morton
2015-12-18 16:18                 ` Petr Mladek
2015-12-14 10:28           ` Daniel Thompson

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=56D5A164.3000000@linaro.org \
    --to=daniel.thompson@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).