linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/2] pstore,efi_pstore: Avoid deadlock in non-blocking paths
@ 2013-01-11 18:08 Seiji Aguchi
  2013-01-12  3:37 ` Anton Vorontsov
  0 siblings, 1 reply; 3+ messages in thread
From: Seiji Aguchi @ 2013-01-11 18:08 UTC (permalink / raw)
  To: linux-kernel, Luck, Tony (tony.luck@intel.com), dzickus, anton.vorontsov
  Cc: dle-develop, Satoru Moriya

Changelog 
v3 -> v4
 - Add EXPORT_SYMBOL_GPL(pstore_cannot_block_path) to build successfully
   with CONFIG_EFI_VARS=m. (PATCH 1/2)

v2 -> v3
 - Merge modifications of pstore part in 2/2 to 1/2.
 - Rename pstore_is_non_blocking_path() to pstore_cannot_block_path().

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)

[Issue]

There are some paths in kernel which shouldn't be blocked, 
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 v4 1/2] pstore: Avoid deadlock in panic and emergency-restart path
  [PATCH v4 2/2] efi_pstore: Avoid deadlock in non-blocking paths

 drivers/firmware/efivars.c |   11 ++++++++++-
 fs/pstore/platform.c       |   35 +++++++++++++++++++++++++++++------
 include/linux/pstore.h     |    6 ++++++
 3 files changed, 45 insertions(+), 7 deletions(-)


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v4 0/2] pstore,efi_pstore: Avoid deadlock in non-blocking paths
  2013-01-11 18:08 [PATCH v4 0/2] pstore,efi_pstore: Avoid deadlock in non-blocking paths Seiji Aguchi
@ 2013-01-12  3:37 ` Anton Vorontsov
  2013-01-12  4:39   ` Seiji Aguchi
  0 siblings, 1 reply; 3+ messages in thread
From: Anton Vorontsov @ 2013-01-12  3:37 UTC (permalink / raw)
  To: Seiji Aguchi
  Cc: linux-kernel, Luck, Tony (tony.luck@intel.com),
	dzickus, dle-develop, Satoru Moriya

On Fri, Jan 11, 2013 at 06:08:52PM +0000, Seiji Aguchi wrote:
> Changelog 
> v3 -> v4

I am confused. Tony already applied v3, no? Do you expect me to do
anything with these patches, or is it just an update for Tony?

Thanks,
Anton

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH v4 0/2] pstore,efi_pstore: Avoid deadlock in non-blocking paths
  2013-01-12  3:37 ` Anton Vorontsov
@ 2013-01-12  4:39   ` Seiji Aguchi
  0 siblings, 0 replies; 3+ messages in thread
From: Seiji Aguchi @ 2013-01-12  4:39 UTC (permalink / raw)
  To: Anton Vorontsov
  Cc: linux-kernel, Luck, Tony (tony.luck@intel.com),
	dzickus, dle-develop, Satoru Moriya

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1688 bytes --]

Anton,

V3 patch caused a build failure in Linux-next tree.
So, I updated to v4 patch.
Tony already applied the latest one.

You don't need to do anything.
And  I'm sorry for the confusion.

Seiji

<snip>
-----Original Message-----
From: Stephen Rothwell [mailto:sfr@canb.auug.org.au] 
Sent: Thursday, January 10, 2013 6:55 PM
To: Luck, Tony
Cc: linux-next@vger.kernel.org; linux-kernel@vger.kernel.org; Seiji Aguchi
Subject: linux-next: build failure after merge of the ia64 tree

Hi all,

After merging the ia64 tree, today's linux-next build (x86_64_allmodconfig) failed like this:

ERROR: "pstore_cannot_block_path" [drivers/firmware/efivars.ko] undefined!

Caused by commit 1a1df768ea4e ("efi_pstore: Avoid deadlock in non-blocking paths").

I have used the ia64 tree from next-20130110 for today.
--
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
<snip>

> -----Original Message-----
> From: Anton Vorontsov [mailto:anton@scarybugs.org] On Behalf Of Anton Vorontsov
> Sent: Friday, January 11, 2013 10:38 PM
> To: Seiji Aguchi
> Cc: linux-kernel@vger.kernel.org; Luck, Tony (tony.luck@intel.com); dzickus@redhat.com; dle-develop@lists.sourceforge.net; Satoru
> Moriya
> Subject: Re: [PATCH v4 0/2] pstore,efi_pstore: Avoid deadlock in non-blocking paths
> 
> On Fri, Jan 11, 2013 at 06:08:52PM +0000, Seiji Aguchi wrote:
> > Changelog
> > v3 -> v4
> 
> I am confused. Tony already applied v3, no? Do you expect me to do anything with these patches, or is it just an update for Tony?
> 
> Thanks,
> Anton
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-01-12  4:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-11 18:08 [PATCH v4 0/2] pstore,efi_pstore: Avoid deadlock in non-blocking paths Seiji Aguchi
2013-01-12  3:37 ` Anton Vorontsov
2013-01-12  4:39   ` Seiji Aguchi

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).