All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 3/5] printk/nmi: Try hard to print Oops message in NMI context
Date: Fri, 04 Dec 2015 15:27:09 +0000	[thread overview]
Message-ID: <20151204152709.GA20935@pathway.suse.cz> (raw)
In-Reply-To: <20151201234437.GA8644@n2100.arm.linux.org.uk>

On Tue 2015-12-01 23:44:37, Russell King - ARM Linux wrote:
> On Fri, Nov 27, 2015 at 12:09:30PM +0100, Petr Mladek wrote:
> > What we can do, though, is to zap all printk locks. We already do this
> > when a printk recursion is detected. This should be safe because
> > the system is crashing and there shouldn't be any printk caller
> > that would cause the deadlock.
> 
> What about serial consoles which may call out to subsystems like the
> clk subsystem to enable a clock, which would want to take their own
> spinlocks in addition to the serial console driver?

Yes, there might be more locks used by the serial console but I do
not know how to handle them all easily. IMHO, this patch is just better
than nothing.

> I don't see bust_spinlocks() dealing with any of these locks, so IMHO
> trying to make this work in NMI context strikes me as making the
> existing solution more unreliable on ARM systems.

bust_spinlocks() calls printk_nmi_flush() that would call printk()
that would zap "lockbuf_lock" and "console_sem" when in Oops and NMI.
Yes, there might be more locks blocked but we try to break at least
the first two walls. Also zapping is allowed only once per 30 seconds,
see zap_locks(). Why do you think that it might make things more
unreliable, please?


Thanks for looking,
Petr

WARNING: multiple messages have this Message-ID (diff)
From: Petr Mladek <pmladek@suse.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Daniel Thompson <daniel.thompson@linaro.org>,
	Jiri Kosina <jkosina@suse.com>, Ingo Molnar <mingo@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org, x86@kernel.org,
	linux-arm-kernel@lists.infradead.org,
	adi-buildroot-devel@lists.sourceforge.net,
	linux-cris-kernel@axis.com, linux-mips@linux-mips.org,
	linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org, sparclinux@vger.kernel.org
Subject: Re: [PATCH v2 3/5] printk/nmi: Try hard to print Oops message in NMI context
Date: Fri, 4 Dec 2015 16:27:09 +0100	[thread overview]
Message-ID: <20151204152709.GA20935@pathway.suse.cz> (raw)
In-Reply-To: <20151201234437.GA8644@n2100.arm.linux.org.uk>

On Tue 2015-12-01 23:44:37, Russell King - ARM Linux wrote:
> On Fri, Nov 27, 2015 at 12:09:30PM +0100, Petr Mladek wrote:
> > What we can do, though, is to zap all printk locks. We already do this
> > when a printk recursion is detected. This should be safe because
> > the system is crashing and there shouldn't be any printk caller
> > that would cause the deadlock.
> 
> What about serial consoles which may call out to subsystems like the
> clk subsystem to enable a clock, which would want to take their own
> spinlocks in addition to the serial console driver?

Yes, there might be more locks used by the serial console but I do
not know how to handle them all easily. IMHO, this patch is just better
than nothing.

> I don't see bust_spinlocks() dealing with any of these locks, so IMHO
> trying to make this work in NMI context strikes me as making the
> existing solution more unreliable on ARM systems.

bust_spinlocks() calls printk_nmi_flush() that would call printk()
that would zap "lockbuf_lock" and "console_sem" when in Oops and NMI.
Yes, there might be more locks blocked but we try to break at least
the first two walls. Also zapping is allowed only once per 30 seconds,
see zap_locks(). Why do you think that it might make things more
unreliable, please?


Thanks for looking,
Petr

WARNING: multiple messages have this Message-ID (diff)
From: pmladek@suse.com (Petr Mladek)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 3/5] printk/nmi: Try hard to print Oops message in NMI context
Date: Fri, 4 Dec 2015 16:27:09 +0100	[thread overview]
Message-ID: <20151204152709.GA20935@pathway.suse.cz> (raw)
In-Reply-To: <20151201234437.GA8644@n2100.arm.linux.org.uk>

On Tue 2015-12-01 23:44:37, Russell King - ARM Linux wrote:
> On Fri, Nov 27, 2015 at 12:09:30PM +0100, Petr Mladek wrote:
> > What we can do, though, is to zap all printk locks. We already do this
> > when a printk recursion is detected. This should be safe because
> > the system is crashing and there shouldn't be any printk caller
> > that would cause the deadlock.
> 
> What about serial consoles which may call out to subsystems like the
> clk subsystem to enable a clock, which would want to take their own
> spinlocks in addition to the serial console driver?

Yes, there might be more locks used by the serial console but I do
not know how to handle them all easily. IMHO, this patch is just better
than nothing.

> I don't see bust_spinlocks() dealing with any of these locks, so IMHO
> trying to make this work in NMI context strikes me as making the
> existing solution more unreliable on ARM systems.

bust_spinlocks() calls printk_nmi_flush() that would call printk()
that would zap "lockbuf_lock" and "console_sem" when in Oops and NMI.
Yes, there might be more locks blocked but we try to break at least
the first two walls. Also zapping is allowed only once per 30 seconds,
see zap_locks(). Why do you think that it might make things more
unreliable, please?


Thanks for looking,
Petr

  reply	other threads:[~2015-12-04 15:27 UTC|newest]

Thread overview: 99+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-27 11:09 [PATCH v2 0/5] Cleaning printk stuff in NMI context Petr Mladek
2015-11-27 11:09 ` Petr Mladek
2015-11-27 11:09 ` Petr Mladek
2015-11-27 11:09 ` [PATCH v2 1/5] printk/nmi: Generic solution for safe printk in NMI Petr Mladek
2015-11-27 11:09   ` Petr Mladek
2015-11-27 11:09   ` Petr Mladek
2015-11-27 11:49   ` kbuild test robot
2015-11-27 11:49     ` kbuild test robot
2015-11-27 11:49     ` kbuild test robot
2015-11-27 11:49     ` kbuild test robot
2015-11-27 11:49     ` kbuild test robot
2015-11-27 15:38     ` Petr Mladek
2015-11-27 15:38       ` Petr Mladek
2015-11-27 15:38       ` Petr Mladek
2015-11-27 15:38       ` Petr Mladek
2015-12-01 23:24       ` Jiri Kosina
2015-12-01 23:24         ` Jiri Kosina
2015-12-01 23:24         ` Jiri Kosina
2015-12-01 23:24         ` Jiri Kosina
2015-12-01 23:24         ` Jiri Kosina
2015-12-04 16:57         ` Petr Mladek
2015-12-04 16:57           ` Petr Mladek
2015-12-04 16:57           ` Petr Mladek
2016-03-17 19:35           ` Andrew Morton
2016-03-17 19:35             ` Andrew Morton
2016-03-17 19:35             ` Andrew Morton
2016-03-18 10:03             ` Petr Mladek
2016-03-18 10:03               ` Petr Mladek
2016-03-18 10:03               ` Petr Mladek
2015-11-27 12:02   ` kbuild test robot
2015-11-27 12:02     ` kbuild test robot
2015-11-27 12:02     ` kbuild test robot
2015-11-27 12:02     ` kbuild test robot
2015-11-27 14:26   ` Max Filippov
2015-11-27 14:26     ` Max Filippov
2015-11-27 14:26     ` Max Filippov
2015-11-27 14:26     ` Max Filippov
2015-11-30 14:25     ` Petr Mladek
2015-11-30 14:25       ` Petr Mladek
2015-11-30 14:25       ` Petr Mladek
2015-11-30 14:25       ` Petr Mladek
2015-12-02  2:45   ` Michael Ellerman
2015-12-02  2:45     ` Michael Ellerman
2015-12-02  2:45     ` Michael Ellerman
2015-12-02  2:45     ` Michael Ellerman
2015-12-04 15:29     ` Petr Mladek
2015-12-04 15:29       ` Petr Mladek
2015-12-04 15:29       ` Petr Mladek
2015-11-27 11:09 ` [PATCH v2 2/5] printk/nmi: Use IRQ work only when ready Petr Mladek
2015-11-27 11:09   ` Petr Mladek
2015-11-27 11:09   ` Petr Mladek
2015-11-27 11:09 ` [PATCH v2 3/5] printk/nmi: Try hard to print Oops message in NMI context Petr Mladek
2015-11-27 11:09   ` Petr Mladek
2015-11-27 11:09   ` Petr Mladek
2015-12-01 23:44   ` Russell King - ARM Linux
2015-12-01 23:44     ` Russell King - ARM Linux
2015-12-01 23:44     ` Russell King - ARM Linux
2015-12-04 15:27     ` Petr Mladek [this message]
2015-12-04 15:27       ` Petr Mladek
2015-12-04 15:27       ` Petr Mladek
2015-12-04 17:12       ` Russell King - ARM Linux
2015-12-04 17:12         ` Russell King - ARM Linux
2015-12-04 17:12         ` Russell King - ARM Linux
2015-12-07 15:48         ` David Laight
2015-12-07 15:48           ` David Laight
2015-12-07 15:48           ` David Laight
2015-12-07 15:48           ` David Laight
2015-12-07 15:48           ` David Laight
2015-12-07 15:48           ` David Laight
2015-12-08 14:49           ` Petr Mladek
2015-12-08 14:49             ` Petr Mladek
2015-12-08 14:49             ` Petr Mladek
2015-12-08 14:49             ` Petr Mladek
2015-12-08 11:21         ` Petr Mladek
2015-12-08 11:21           ` Petr Mladek
2015-12-08 11:21           ` Petr Mladek
2015-11-27 11:09 ` [PATCH v2 4/5] printk/nmi: Warn when some message has been lost " Petr Mladek
2015-11-27 11:09   ` Petr Mladek
2015-11-27 11:09   ` Petr Mladek
2015-11-27 11:09 ` [PATCH v2 5/5] printk/nmi: Increase the size of the temporary buffer Petr Mladek
2015-11-27 11:09   ` Petr Mladek
2015-11-27 11:09   ` Petr Mladek
2015-11-28 14:26   ` yalin wang
2015-11-30 16:42   ` yalin wang
2015-11-30 16:42     ` yalin wang
2015-11-30 16:42     ` yalin wang
2015-12-02 16:20     ` David Laight
2015-12-02 16:20       ` David Laight
2015-12-02 16:20       ` David Laight
2015-12-02 16:20       ` David Laight
2015-12-02 16:20       ` David Laight
2015-12-02 16:20       ` David Laight
2015-12-04 15:47       ` Petr Mladek
2015-12-04 15:47         ` Petr Mladek
2015-12-04 15:47         ` Petr Mladek
2015-12-04 15:47         ` Petr Mladek
2015-12-07 14:16     ` Petr Mladek
2015-12-07 14:16       ` Petr Mladek
2015-12-07 14:16       ` 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=20151204152709.GA20935@pathway.suse.cz \
    --to=pmladek@suse.com \
    --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 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.