From: Matthew Garrett <mjg59@srcf.ucam.org>
To: "Luck, Tony" <tony.luck@intel.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Matt_Domsch@dell.com" <Matt_Domsch@dell.com>
Subject: Re: [PATCH v2 3/3] efi: Add support for using efivars as a pstore backend
Date: Tue, 7 Jun 2011 21:25:17 +0100 [thread overview]
Message-ID: <20110607202517.GA732@srcf.ucam.org> (raw)
In-Reply-To: <987664A83D2D224EAE907B061CE93D5301E70D8EAE@orsmsx505.amr.corp.intel.com>
On Tue, Jun 07, 2011 at 01:16:55PM -0700, Luck, Tony wrote:
> + efi_pstore_info.buf = kmalloc(4096, GFP_KERNEL);
> + if (efi_pstore_info.buf) {
> + efi_pstore_info.bufsize = 1024;
> + efi_pstore_info.data = efivars;
> + mutex_init(&efi_pstore_info.buf_mutex);
> + pstore_register(&efi_pstore_info);
> + }
>
> I'd imagined #ifdef CONFIG_PSTORE around this (and the
> efi_pstore_info definition) rather than providing stubs
> for the !PSTORE case.
We usually seem to frown on #ifdefs in the middle of functions. We could
probably make this easier by adding a pstore_enabled that's #defined to
0 in the !PSTORE case, then the compiler ought to just get rid of it
all.
> You should avoid a memory leak with:
>
> if (!pstore_register(&efi_pstore_info))
> kfree(efi_pstore_info.buf);
Ah, true.
> I've also been thinking some more about how to handle a
> system that has more than one pstore back-end available.
> I still don't have any good ideas how to make use of more
> than one backend - but it occurs to me that we may need
> a way to let the user choose which to use (e.g. in the
> unlikely event that a BIOS bug made one of ERST or EFI
> unusable by pstore). The current "whoever registers first
> gets to use it" now seems inadequate.
Mm. Given that the name of the source is in the file, there's no
namespacing issues. In an ideal world I think we'd register all of them
in order to provide a better chance of at least one of them ending up in
actual persistent storage.
--
Matthew Garrett | mjg59@srcf.ucam.org
next prev parent reply other threads:[~2011-06-07 20:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-07 18:15 [PATCH v2 0/3] Oops capture via EFI Matthew Garrett
2011-06-07 18:16 ` [PATCH v2 1/3] pstore: Extend API Matthew Garrett
2011-06-07 18:16 ` [PATCH v2 2/3] pstore: Add extra context for writes and erases Matthew Garrett
2011-06-07 18:16 ` [PATCH v2 3/3] efi: Add support for using efivars as a pstore backend Matthew Garrett
2011-06-07 20:16 ` Luck, Tony
2011-06-07 20:25 ` Matthew Garrett [this message]
2011-06-07 20:52 ` Luck, Tony
2011-06-07 20:55 ` Matthew Garrett
2011-06-07 21:35 ` Luck, Tony
2011-06-07 21:43 ` Matthew Garrett
2011-06-07 23:24 ` Luck, Tony
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=20110607202517.GA732@srcf.ucam.org \
--to=mjg59@srcf.ucam.org \
--cc=Matt_Domsch@dell.com \
--cc=linux-kernel@vger.kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.