LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Kairui Song <kasong@redhat.com>
To: Bhupesh Sharma <bhsharma@redhat.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>,
"David S . Miller" <davem@davemloft.net>,
Eric Biederman <ebiederm@xmission.com>,
Alexey Dobriyan <adobriyan@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
Dave Young <dyoung@redhat.com>,
"kexec@lists.infradead.org" <kexec@lists.infradead.org>
Subject: Re: [PATCH v2] vmcore: Add a kernel cmdline vmcore_device_dump
Date: Thu, 23 May 2019 19:04:36 +0800 [thread overview]
Message-ID: <CACPcB9fWsOHGhyF-b4emTuoTUO4twbG6of=bruBYop4Jf4rzig@mail.gmail.com> (raw)
In-Reply-To: <0c0fb7af-f386-bde1-46f6-1afa29782243@redhat.com>
On Thu, May 23, 2019 at 2:44 AM Bhupesh Sharma <bhsharma@redhat.com> wrote:
>
> On 05/20/2019 11:48 AM, Kairui Song wrote:
> > Since commit 2724273e8fd0 ('vmcore: add API to collect hardware dump in
> > second kernel'), drivers is allowed to add device related dump data to
> > vmcore as they want by using the device dump API. This have a potential
> > issue, the data is stored in memory, drivers may append too much data
> > and use too much memory. The vmcore is typically used in a kdump kernel
> > which runs in a pre-reserved small chunk of memory. So as a result it
> > will make kdump unusable at all due to OOM issues.
> >
> > So introduce new vmcore_device_dump= kernel parameter, and disable
> > device dump by default. User can enable it only if device dump data is
> > required for debugging, and have the chance to increase the kdump
> > reserved memory accordingly before device dump fails kdump.
> >
> > Signed-off-by: Kairui Song <kasong@redhat.com>
> > ---
> > Update from V1:
> > - Use bool parameter to turn it on/off instead of letting user give
> > the size limit. Size of device dump is hard to determine.
> >
> > Documentation/admin-guide/kernel-parameters.txt | 15 +++++++++++++++
> > fs/proc/vmcore.c | 13 +++++++++++++
> > 2 files changed, 28 insertions(+)
> >
> > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> > index 43176340c73d..2d48e39fd080 100644
> > --- a/Documentation/admin-guide/kernel-parameters.txt
> > +++ b/Documentation/admin-guide/kernel-parameters.txt
> > @@ -5062,6 +5062,21 @@
> > decrease the size and leave more room for directly
> > mapped kernel RAM.
> >
> > + vmcore_device_dump=
> > + [VMCORE]
> > + Format: {"off" | "on"}
> > + If CONFIG_PROC_VMCORE_DEVICE_DUMP is set,
> > + this parameter allows enable or disable device dump
> > + for vmcore.
>
> We can add a simpler description here, something like:
> Depends on CONFIG_PROC_VMCORE_DEVICE_DUMP
>
> > + Device dump allows drivers to append dump data to
> > + vmcore so you can collect driver specified debug info.
> > + Note that the drivers could append the data without
> > + any limit, and the data is stored in memory, this may
> > + bring a significant memory stress. If you want to turn
> > + on this option, make sure you have reserved enough memory
> > + with crashkernel= parameter.
> > + default: off
>
> ... and massage the rest of text accordingly.
>
> Better to also modify the help text for 'PROC_VMCORE_DEVICE_DUMP' config
> option defined in 'fs/proc/Kconfig'. Something like:
>
> config PROC_VMCORE_DEVICE_DUMP
> bool "Device Hardware/Firmware Log Collection"
> <..snip..>
> If you say Y here, the collected device dumps will be added
> as ELF notes to /proc/vmcore.
>
> If this option is selected, device dump collection can still be
> disabled by passing vmcore_device_dump=off to the kernel.
>
> See config INTEL_IOMMU_DEFAULT_ON in 'drivers/iommu/Kconfig' as an example.
>
Good suggestion! I'll update in V3.
--
Best Regards,
Kairui Song
prev parent reply other threads:[~2019-05-23 11:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-20 6:18 Kairui Song
2019-05-22 5:38 ` Dave Young
2019-05-23 11:04 ` Kairui Song
2019-05-22 18:44 ` Bhupesh Sharma
2019-05-23 11:04 ` Kairui Song [this message]
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='CACPcB9fWsOHGhyF-b4emTuoTUO4twbG6of=bruBYop4Jf4rzig@mail.gmail.com' \
--to=kasong@redhat.com \
--cc=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=bhsharma@redhat.com \
--cc=davem@davemloft.net \
--cc=dyoung@redhat.com \
--cc=ebiederm@xmission.com \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rahul.lakkireddy@chelsio.com \
--subject='Re: [PATCH v2] vmcore: Add a kernel cmdline vmcore_device_dump' \
/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
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).