From: WANG Chao <chaowang@redhat.com>
To: Dave Young <dyoung@redhat.com>
Cc: kexec@lists.infradead.org, horms@verge.net.au, linn@hp.com,
hpa@zytor.com, trenn@suse.de, vgoyal@redhat.com,
ebiederm@xmission.com
Subject: Re: [PATCH v4 2/4] x86: Store memory ranges globally used for crash kernel to boot into
Date: Fri, 28 Mar 2014 14:13:53 +0800 [thread overview]
Message-ID: <20140328061353.GF2944@dhcp-17-89.nay.redhat.com> (raw)
In-Reply-To: <20140328032438.GD26116@dhcp-16-126.nay.redhat.com>
On 03/28/14 at 11:24am, Dave Young wrote:
> >
> > +static void exclude_ram(struct memory_range *mr, int *nr_mr)
> > +{
> > + int ranges, i, j, m;
> > +
> > + ranges = *nr_mr;
> > + for (i = 0, j = 0; i < ranges; i++) {
> > + if (mr[j].type == RANGE_RAM) {
> > + dbgprintf("Remove RAM %016llx-%016llxx: (%d)\n", mr[j].start, mr[j].end, mr[j].type);
> > + for (m = j; m < *nr_mr; m++)
> > + mr[m] = mr[m+1];
> > + (*nr_mr)--;
> > + } else {
> > + j++;
> > + }
> > + }
> > +
> > + dbgprint_mem_range("After remove RAM", mr, *nr_mr);
> > +}
>
> This is probably not necessary, what I understand you are doing is below:
>
> get_crash_memory_ranges()
> -> collect all SYSTEM_RAM, ACPI, ACPI_NVS ranges, exclude crash reserved ranges.
> -> the system ram ranges are used to create elf header
> -> the ACPI, ACPI_NVS ranges are used by cmdline_add_memmap_acpi etc.
Yes.
>
> memmap_p
> -> contains all the crash reserved ranges
> -> to be used by cmdline_add_memmap
There's no memmap_p. I'll reuse crash_memory_ranges structure to store
crash reserved ranges, ACPI and ACPI_NVS ranges. So after building ELF
headers for 1st kernel memory ranges, all I have to do is exclude the
SYSTEM_RAM and add crash_reserved to crash_memory_ranges. And then
crash_memory_ranges can be used as 2nd kernel memory ranges.
>
> The several memory ranges are twisted and somehow the funcions are duplicate.
These functions look like similar but each does serve for different purpose.
>
> So how about just keep one memory ranges array which contains all the ranges which
> include system_ram, acpi, acpi_nvs, crash_reserved range.
>
> In the crashdump-elf.c the function for creating elf headers will check the
> range type, it will just skip the range which is not ram.
We don't build EFL headers for crash_reserved ranges. So we can't store
system ram and crash_reserved together before building EFL header.
>
> Ditto for other functions they can also just select what range type they need instead
> of creating these different arrays which is confusing.
>
> Thanks
> Dave
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next prev parent reply other threads:[~2014-03-28 6:14 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-19 8:03 [PATCH v4 0/4] kexec-tools, x86: E820 memmap pass for kdump WANG Chao
2014-03-19 8:03 ` [PATCH v4 1/4] cleanup: add dbgprint_mem_range function WANG Chao
2014-03-20 3:49 ` Simon Horman
2014-03-19 8:03 ` [PATCH v4 2/4] x86: Store memory ranges globally used for crash kernel to boot into WANG Chao
2014-03-27 22:32 ` Vivek Goyal
2014-03-28 5:23 ` WANG Chao
2014-03-28 14:01 ` Vivek Goyal
2014-03-28 15:44 ` Thomas Renninger
2014-03-28 16:05 ` Vivek Goyal
2014-03-28 2:19 ` Dave Young
2014-03-28 5:36 ` WANG Chao
2014-03-28 3:24 ` Dave Young
2014-03-28 6:13 ` WANG Chao [this message]
2014-03-28 6:43 ` Dave Young
2014-03-28 6:51 ` Dave Young
2014-03-28 7:12 ` Dave Young
2014-04-01 7:04 ` WANG Chao
2014-04-01 8:41 ` Dave Young
2014-04-01 8:54 ` WANG Chao
2014-04-01 9:36 ` Dave Young
2014-04-01 9:52 ` WANG Chao
2014-03-19 8:04 ` [PATCH v4 3/4] x86: add --pass-memmap-cmdline option WANG Chao
2014-03-19 8:04 ` [PATCH v4 4/4] x86: Pass memory range via E820 for kdump WANG Chao
2014-03-27 22:50 ` Vivek Goyal
2014-03-28 4:52 ` WANG Chao
2014-03-28 13:53 ` Vivek Goyal
2014-03-28 3:28 ` Dave Young
2014-03-28 4:53 ` WANG Chao
2014-03-19 17:57 ` [PATCH v4 0/4] kexec-tools, x86: E820 memmap pass " Linn Crosetto
2014-03-20 3:50 ` Simon Horman
2014-03-20 5:00 ` WANG Chao
2014-03-20 15:42 ` Vivek Goyal
2014-03-27 10:31 ` WANG Chao
2014-03-27 22:23 ` Vivek Goyal
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=20140328061353.GF2944@dhcp-17-89.nay.redhat.com \
--to=chaowang@redhat.com \
--cc=dyoung@redhat.com \
--cc=ebiederm@xmission.com \
--cc=horms@verge.net.au \
--cc=hpa@zytor.com \
--cc=kexec@lists.infradead.org \
--cc=linn@hp.com \
--cc=trenn@suse.de \
--cc=vgoyal@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox