linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC][PATCH v2 0/3] efi_pstore: avoid losing critical message
@ 2012-07-19 21:11 Seiji Aguchi
  2012-07-21 20:52 ` valdis.kletnieks
  2012-07-23 14:13 ` Matthew Garrett
  0 siblings, 2 replies; 3+ messages in thread
From: Seiji Aguchi @ 2012-07-19 21:11 UTC (permalink / raw)
  To: linux-doc, linux-kernel, Luck, Tony (tony.luck@intel.com),
	mikew, dzickus, Matthew Garrett (mjg@redhat.com)
  Cc: dle-develop, Satoru Moriya

This patchset avoids losing a critical message like panic in NVRAM.

[Problem]
    Currently, efi_pstore driver simply overwrites existing panic messages in NVRAM.
    So, in the following scenario, we will lose 1st panic messages.

    1. kernel panics.
    2. efi_pstore is kicked and write panic messages to NVRAM.
    3. system reboots.
    4. kernel panics again before a user checks the 1st panic messages in NVRAM.

[Solution]
   To avoid losing a critical message, this patchset is based on a following concept.
     - A basic policy is _not_ to overwrite existing entries.

     - However, if kernel panics while a system is rebooting, a critical message 
       can't be saved by the policy above. 
       (In this case, panic message is critical.)

     - So, two approaches are taken by this patchset.
       - First one is holding multiple logs.
       - Second one is introducing some logic overwriting entries 
         for holding just one log.

[Patch Descriptions]
 Patch 1/3 and 2/3 take fist approach, _not_ overwriting entries.

 Patch 3/3 takes second approach, adding some logic overwriting entries.

 1/3: Avoid overwriting existing entry
  This patch just avoid overwriting entries to save the 1st critical message 
  without being influenced by subsequent events.

 2/3: Hold multiple logs
  With this patch, efi_pstore can hold multiple logs.
  We can simply avoid losing a critical message in case mutiple events happen.

 3/3: Check if existing entry is erasable
  This patch adds some logic checking if an existing entry is erasable for 
  holding just one log.

  If users decide that NVRAM size is not big enough to hold multiple logs, 
  efi_pstore have to handle just one log and avoid a critical messages by 
  overwriting existing entry.

  NVRAM size may vary among different boxes, and the appropriate log size depends
  on each user's system. efi_pstore should be flexible in preparation for various 
  user's choice.


Change v1 -> v2

1/3
  - Freshly created to avoid overwriting entries.

2/3
  - Freshly created to handle multiple logs.
  - Add an additional change passing ctime to arguments of erase_callback.

3/3
  - This is based on previous 2/2 patch
  - Add comments to kernel/printk.h in preparation for future change 
    without considering this patch.
  - Remove infinite loop to avoid potential hang up.
  - Add CFLAGS, -Wswitch-enum and remove default case from switch sentence 
    in preparation for future change without considering this patch.
  - Change a return value to -EEXIST when an erasable entry is not found. 
  - Remove KMSG_DUMP_UNDEF from kmsg_dump_reason because no one uses it.


 Documentation/kernel-parameters.txt |    6 +
 drivers/acpi/apei/erst.c            |    4 +-
 drivers/firmware/Makefile           |    2 +
 drivers/firmware/efivars.c          |  212 +++++++++++++++++++++++++++++++----
 fs/pstore/inode.c                   |    2 +-
 fs/pstore/platform.c                |    4 +-
 fs/pstore/ram.c                     |    2 +-
 include/linux/kmsg_dump.h           |    8 +-
 include/linux/pstore.h              |    7 +-
 9 files changed, 214 insertions(+), 33 deletions(-)


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

* Re: [RFC][PATCH v2 0/3] efi_pstore: avoid losing critical message
  2012-07-19 21:11 [RFC][PATCH v2 0/3] efi_pstore: avoid losing critical message Seiji Aguchi
@ 2012-07-21 20:52 ` valdis.kletnieks
  2012-07-23 14:13 ` Matthew Garrett
  1 sibling, 0 replies; 3+ messages in thread
From: valdis.kletnieks @ 2012-07-21 20:52 UTC (permalink / raw)
  To: Seiji Aguchi
  Cc: linux-doc, linux-kernel, Luck, Tony (tony.luck@intel.com),
	mikew, dzickus, Matthew Garrett (mjg@redhat.com),
	dle-develop, Satoru Moriya

[-- Attachment #1: Type: text/plain, Size: 806 bytes --]

On Thu, 19 Jul 2012 21:11:44 -0000, Seiji Aguchi said:

> [Solution]
>    To avoid losing a critical message, this patchset is based on a following concept.
>      - A basic policy is _not_ to overwrite existing entries.
>
>      - However, if kernel panics while a system is rebooting, a critical message
>        can't be saved by the policy above.
>        (In this case, panic message is critical.)

OK, system boots in "overwrite mode", and when done booting, we go into
"non-overwrite mode".  Makes sense to me.  Only part I'm missing is how/when/why
we leave overwrite mode - what makes the change, and how?

(If I missed an ioctl or /sys entry or something that userspace toggles to say "I'll
take care of it from here", please point me at it and I'll go re-read after I find
some more caffeine ;)

[-- Attachment #2: Type: application/pgp-signature, Size: 865 bytes --]

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

* Re: [RFC][PATCH v2 0/3] efi_pstore: avoid losing critical message
  2012-07-19 21:11 [RFC][PATCH v2 0/3] efi_pstore: avoid losing critical message Seiji Aguchi
  2012-07-21 20:52 ` valdis.kletnieks
@ 2012-07-23 14:13 ` Matthew Garrett
  1 sibling, 0 replies; 3+ messages in thread
From: Matthew Garrett @ 2012-07-23 14:13 UTC (permalink / raw)
  To: Seiji Aguchi
  Cc: linux-doc, linux-kernel, Luck, Tony (tony.luck@intel.com),
	mikew, dzickus, dle-develop, Satoru Moriya

On Thu, Jul 19, 2012 at 09:11:44PM +0000, Seiji Aguchi wrote:

> [Patch Descriptions]
>  Patch 1/3 and 2/3 take fist approach, _not_ overwriting entries.
> 
>  Patch 3/3 takes second approach, adding some logic overwriting entries.
> 
>  1/3: Avoid overwriting existing entry
>   This patch just avoid overwriting entries to save the 1st critical message 
>   without being influenced by subsequent events.

I think there's a good argument in favour of this approach. Userspace 
crash report tools should be taught to copy the crash data and then 
remove the existing entries. It avoids any of the complexity associated 
with other approaches and ensures that behaviour is always consistent.

-- 
Matthew Garrett | mjg59@srcf.ucam.org

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

end of thread, other threads:[~2012-07-23 14:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-19 21:11 [RFC][PATCH v2 0/3] efi_pstore: avoid losing critical message Seiji Aguchi
2012-07-21 20:52 ` valdis.kletnieks
2012-07-23 14:13 ` Matthew Garrett

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