public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Seiji Aguchi <seiji.aguchi@hds.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"joe@perches.com" <joe@perches.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"kay@vrfy.org" <kay@vrfy.org>,
	"jim.cromie@gmail.com" <jim.cromie@gmail.com>,
	"mingo@elte.hu" <mingo@elte.hu>,
	"sboyd@codeaurora.org" <sboyd@codeaurora.org>,
	"jason.wessel@windriver.com" <jason.wessel@windriver.com>,
	"a.p.zijlstra@chello.nl" <a.p.zijlstra@chello.nl>,
	"rostedt@goodmis.org" <rostedt@goodmis.org>,
	"dle-develop@lists.sourceforge.net" 
	<dle-develop@lists.sourceforge.net>,
	Satoru Moriya <satoru.moriya@hds.com>
Subject: Re: [PATCH] Avoid dead lock of console related locks in panic case
Date: Fri, 30 Nov 2012 14:30:23 -0800	[thread overview]
Message-ID: <20121130143023.2d67d817.akpm@linux-foundation.org> (raw)
In-Reply-To: <A5ED84D3BB3A384992CBB9C77DEDA4D414A02C44@USINDEM103.corp.hds.com>

On Fri, 30 Nov 2012 17:11:07 +0000
Seiji Aguchi <seiji.aguchi@hds.com> wrote:

> If one cpu ,which is taking a logbuf_lock or console_sem, 
> receive IPI/NMI from a panicked cpu via smp_send_stop(),
> the panicked cpu hangs up in subsequent kmsg_dump()/printk()
> because logbuf_lock and console_sem are taken in the function calls.
> 
> This causes a console blank and users can't see panic messages.
> 
> [Solution]
> 
> this patch introduces a logic initializing logbuf_lock and console_sem
> just after smp_send_stop() to avoid dead locks above.

That is one nasty looking patch :(

- Makes the logic in this area even more twisty and complex, when
  what we need to do is to simplify it

- Reinitialises in-use locks

- Gives the boolean variable "yes" three states, but didn't rename
  that variable to something appropriate.

- Passes yes==2 into s390's unsuspecting bust_spinlocks() implementation.


Let's step back a bit.  Please identify with great specificity the code
sites which are stopping other CPUs before taking locks which those
other CPUs might have been holding.

Then let's see what we can do to fix up the callers, instead of trying
to tidy up after they have made this mess.


  reply	other threads:[~2012-11-30 22:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-30 17:11 [PATCH] Avoid dead lock of console related locks in panic case Seiji Aguchi
2012-11-30 22:30 ` Andrew Morton [this message]
2012-11-30 22:59   ` Seiji Aguchi
2012-11-30 23:21     ` Andrew Morton
2012-12-01  1:04       ` Seiji Aguchi

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=20121130143023.2d67d817.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=dle-develop@lists.sourceforge.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=jason.wessel@windriver.com \
    --cc=jim.cromie@gmail.com \
    --cc=joe@perches.com \
    --cc=kay@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    --cc=satoru.moriya@hds.com \
    --cc=sboyd@codeaurora.org \
    --cc=seiji.aguchi@hds.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