From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Hoeun Ryu <hoeun.ryu@lge.com.com>,
Kees Cook <keescook@chromium.org>, Borislav Petkov <bp@suse.de>,
Andi Kleen <ak@linux.intel.com>,
Josh Poimboeuf <jpoimboe@redhat.com>,
"Steven Rostedt (VMware)" <rostedt@goodmis.org>,
Hoeun Ryu <hoeun.ryu@lge.com>,
linux-kernel@vger.kernel.org,
Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
Petr Mladek <pmladek@suse.com>
Subject: Re: [PATCH] panic: move bust_spinlocks(0) after console_flush_on_panic() to avoid deadlocks
Date: Thu, 21 Jun 2018 10:23:23 +0900 [thread overview]
Message-ID: <20180621012323.GB15462@jagdpanzerIV> (raw)
In-Reply-To: <20180620143004.9dd0cf834acfcff5bd1bcb58@linux-foundation.org>
On (06/20/18 14:30), Andrew Morton wrote:
> > From: Hoeun Ryu <hoeun.ryu@lge.com>
> >
> > Many console device drivers hold the uart_port->lock spinlock with irq enabled
> > (using spin_lock()) while the device drivers are writing characters to their devices,
> > but the device drivers just try to hold the spin lock (using spin_trylock()) if
> > "oops_in_progress" is equal or greater than 1 to avoid deadlocks.
> >
> > There is a case ocurring a deadlock related to the lock and oops_in_progress. A CPU
> > could be stopped by smp_send_stop() while it was holding the port lock because irq was
> > enabled. Once a CPU stops, it doesn't respond interrupts anymore and the lock stays
> > locked forever.
> >
> > console_flush_on_panic() is called during panic() and it eventually holds the uart
> > lock but the lock is held by another stopped CPU and it is a deadlock. By moving
> > bust_spinlocks(0) after console_flush_on_panic(), let the console device drivers
> > think the Oops is still in progress to call spin_trylock() instead of spin_lock() to
> > avoid the deadlock.
>
> hm. Sergey, is this at all related to the UART printk deadlock change
> which you're presently discussing in
> http://lkml.kernel.org/r/20180615093919.559-1-sergey.senozhatsky@gmail.com?
Hi Andrew,
Not exactly. The change I'm discussing is a little different - it's about
re-entrant UART [+ circular locking in TTY], when UART deadlocks us because
of printk()-s issued by MM/tty/WQ/sched/other core kernel stuff/etc
Example:
IRQ -> uart -> tty -> WQ -> printk -> uart
-ss
prev parent reply other threads:[~2018-06-21 1:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-04 5:45 Hoeun Ryu
2018-06-05 1:44 ` Steven Rostedt
2018-06-05 2:23 ` Hoeun Ryu
2018-06-20 21:30 ` Andrew Morton
2018-06-21 1:23 ` 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=20180621012323.GB15462@jagdpanzerIV \
--to=sergey.senozhatsky.work@gmail.com \
--cc=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=bp@suse.de \
--cc=hoeun.ryu@lge.com \
--cc=hoeun.ryu@lge.com.com \
--cc=jpoimboe@redhat.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.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
all inboxes | Powered by JetHome®