From: Don Zickus <dzickus@redhat.com>
To: Seiji Aguchi <seiji.aguchi@hds.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Luck, Tony (tony.luck@intel.com)" <tony.luck@intel.com>,
"ccross@android.com" <ccross@android.com>,
"keescook@chromium.org" <keescook@chromium.org>,
"cbouatmailru@gmail.com" <cbouatmailru@gmail.com>,
Satoru Moriya <satoru.moriya@hds.com>,
"dle-develop@lists.sourceforge.net"
<dle-develop@lists.sourceforge.net>
Subject: Re: [PATCH v2 0/2] pstore,efi_pstore: Avoid deadlock in non-blocking paths
Date: Mon, 17 Dec 2012 16:45:06 -0500 [thread overview]
Message-ID: <20121217214506.GF60946@redhat.com> (raw)
In-Reply-To: <A5ED84D3BB3A384992CBB9C77DEDA4D414A22EFA@USINDEM103.corp.hds.com>
On Mon, Dec 17, 2012 at 08:56:27PM +0000, Seiji Aguchi wrote:
> Changelog v1 -> v2
> - Erase a logic checking the number of online cpus.
> - Create a patchset to fix deadlocking issue in both pstore filesystem and
> efi_pstore driver.
> - Introduce a function, is_non_blocking_path(), to check if pstore
> is in panic and emergency-restart paths (PATCH 1/2)
> - Avoid efi_pstore_driver is blocked in non-blocking paths
> such as nmi, panic and emergency-restart paths (PATCH 2/2)
This patch set seems cleaner. Though it seems most of patch2 should have
been in patch1 (except for the efi part).
The only nitpick I have is the name 'is_non_blocking_path'. I don't know
why, but the name doesn't seem exactly right to me. I was thinking
something like 'pstore_cannot_block_path' or something. But it is just a
nitpick, so it doesn't matter either way to me.
Cheers,
Don
>
> [Issue]
>
> There are some paths which shouldn't be blocked in kernel, like NMI, panic case after stopping cpus,
> emergency-restart.
>
> On the other hand, current pstore avoids blocking in a NMI path but it may be blocked in other paths.
> Also, an efi_pstore driver may be blocked in all of those paths because it simply takes a spin lock
> at writing time.
>
> If they are blocked in those paths, the system will hang up and it has a big impact for users.
>
> Here is an example scenario which pstore is blocked in panic path.
>
> - cpuA grabs psinfo->buf_lock
> - cpuB panics and calls smp_send_stop
> - smp_send_stop sends IRQ to cpuA
> after 1 second, cpuB gives up on cpuA and sends an NMI instead
> - cpuA is now in an NMI handler while still holding buf_lock.
> And then, cpuB is deadlocked by taking efi_pstore->lock again.
>
> This case may happen if a firmware has a bug and cpuA is stuck in it.
>
> [Solution]
>
> This patchset avoids that pstore and efi_pstore driver are blocked in the non-blocking paths
> like NMI, panic, and emrgency-restart by introducing a function checking if they are in those paths.
> Please see each patch for detailed explanations.
>
> Seiji Aguchi (2):
> [PATCH v2 1/2] pstore: Avoid deadlock in panic and emergency-restart path
> [PATCH v2 2/2] efi_pstore: Avoid deadlock in non-blocking paths
>
> drivers/firmware/efivars.c | 11 ++++++++++-
> fs/pstore/platform.c | 34 ++++++++++++++++++++++++++++------
> include/linux/pstore.h | 6 ++++++
> 3 files changed, 44 insertions(+), 7 deletions(-)
next prev parent reply other threads:[~2012-12-17 21:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-17 20:56 [PATCH v2 0/2] pstore,efi_pstore: Avoid deadlock in non-blocking paths Seiji Aguchi
2012-12-17 21:45 ` Don Zickus [this message]
2012-12-20 15:02 ` 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=20121217214506.GF60946@redhat.com \
--to=dzickus@redhat.com \
--cc=cbouatmailru@gmail.com \
--cc=ccross@android.com \
--cc=dle-develop@lists.sourceforge.net \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=satoru.moriya@hds.com \
--cc=seiji.aguchi@hds.com \
--cc=tony.luck@intel.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