From: Vivek Goyal <vgoyal@in.ibm.com>
To: Bernhard Walle <bwalle@suse.de>
Cc: kexec@lists.infradead.org, linux-arch@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [patch 1/5] Extended crashkernel command line
Date: Tue, 11 Sep 2007 11:45:22 +0530 [thread overview]
Message-ID: <20070911061522.GD5053@in.ibm.com> (raw)
In-Reply-To: <20070909083914.488571169@strauss.suse.de>
On Sun, Sep 09, 2007 at 10:39:15AM +0200, Bernhard Walle wrote:
[..]
> +
> +/*
> + * parsing the "crashkernel" commandline
> + *
> + * this code is intended to be called from architecture specific code
> + */
> +
> +
> +/*
> + * This function parses command lines in the format
> + *
> + * crashkernel=<ramsize-range>:<size>[,...][@<base>]
> + *
> + * The function returns 0 on success and -EINVAL on failure.
> + */
> +static int parse_crashkernel_mem(char *cmdline,
> + unsigned long long *crash_size,
> + unsigned long long *crash_base,
> + unsigned long system_ram)
> +{
> + char *cur = cmdline;
> +
> + *crash_size = 0;
> + *crash_base = 0;
> +
> + /* for each entry of the comma-separated list */
> + do {
> + unsigned long long start = 0, end = ULLONG_MAX;
> + unsigned long long size = -1;
> +
> + /* get the start of the range */
> + start = memparse(cur, &cur);
> + if (*cur != '-') {
> + printk(KERN_WARNING "crashkernel: '-' expected\n");
> + return -EINVAL;
> + }
> + cur++;
> +
> + /* if no ':' is here, than we read the end */
> + if (*cur != ':') {
> + end = memparse(cur, &cur);
> + if (end <= start) {
> + printk(KERN_WARNING "crashkernel: end <= start\n");
> + return -EINVAL;
> + }
> + }
> +
> + if (*cur != ':') {
> + printk(KERN_WARNING "crashkernel: ':' expected\n");
> + return -EINVAL;
> + }
> + cur++;
> +
> + size = memparse(cur, &cur);
> + if (size < 0) {
> + printk(KERN_WARNING "crashkernel: invalid size\n");
> + return -EINVAL;
> + }
> +
> + /* match ? */
> + if (system_ram >= start && system_ram <= end) {
> + *crash_size = size;
> + break;
> + }
> + } while (*cur++ == ',');
> +
> + if (*crash_size > 0) {
> + while (*cur != ' ' && *cur != '@')
> + cur++;
> + if (*cur == '@')
> + *crash_base = memparse(cur+1, &cur);
"offset" seems to be optional in the new syntax. What happens if user does
not specify offset. I think crash_base will be set to zero and system will
try to reserve x amount of memory start at zero? That would fail?
I think we should add some intelligence for automatic selection of "offset"
if user has not specified one. Automatically choose a chunk of free memory.
This takes away the headache from user for selecting a right place. In fact
one "offset" might not be valid for all the systems. I remember, somebody
had reported that ACPI tables were mapped lower in the address space and
reserving memory for kdump had failed.
Choosing the "offset" automatically should help distributions where one
command line is supposed to work on all the systems.
Thanks
Vivek
next prev parent reply other threads:[~2007-09-11 6:15 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-09 8:39 [patch 0/5] Add extended crashkernel command line syntax Bernhard Walle
2007-09-09 8:39 ` [patch 1/5] Extended crashkernel command line Bernhard Walle
2007-09-11 6:15 ` Vivek Goyal [this message]
2007-09-11 10:01 ` Bernhard Walle
2007-09-12 11:23 ` Vivek Goyal
2007-09-12 11:35 ` Bernhard Walle
2007-09-11 13:14 ` Olaf Dabrunz
2007-09-11 15:32 ` Lombard, David N
2007-09-11 17:21 ` Bernhard Walle
2007-09-09 8:39 ` [patch 2/5] Use extended crashkernel command line on i386 Bernhard Walle
2007-09-09 8:39 ` [patch 3/5] Use extended crashkernel command line on x86_64 Bernhard Walle
2007-09-09 17:27 ` [discuss] " Yinghai Lu
2007-09-09 18:52 ` Bernhard Walle
2007-09-09 21:06 ` Eric W. Biederman
2007-09-11 5:14 ` Vivek Goyal
2007-09-11 10:01 ` Bernhard Walle
2007-09-09 8:39 ` [patch 4/5] Use extended crashkernel command line on IA64 Bernhard Walle
2007-09-09 13:01 ` Matthew Wilcox
2007-09-09 19:08 ` Bernhard Walle
2007-09-09 8:39 ` [patch 5/5] Add documentation for extended crashkernel syntax Bernhard Walle
2007-09-11 6:09 ` [patch 0/5] Add extended crashkernel command line syntax Vivek Goyal
2007-09-13 15:02 ` Bernhard Walle
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=20070911061522.GD5053@in.ibm.com \
--to=vgoyal@in.ibm.com \
--cc=bwalle@suse.de \
--cc=kexec@lists.infradead.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).