Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
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: Tue, 1 Apr 2014 16:54:14 +0800	[thread overview]
Message-ID: <20140401085414.GL2944@dhcp-17-89.nay.redhat.com> (raw)
In-Reply-To: <20140401084119.GB15841@dhcp-16-126.nay.redhat.com>

On 04/01/14 at 04:41pm, Dave Young wrote:
> On 04/01/14 at 03:04pm, WANG Chao wrote:
> > On 03/28/14 at 02:43pm, Dave Young wrote:
> > > On 03/28/14 at 02:13pm, WANG Chao wrote:
> > > > 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.
> > > 
> > > How about do nothing and directly use the mem_ranges:
> > >  * skip RANGE_RAM, only add the range which is not RANGE_RAM
> > >  * if the range is RANGE_CRASH_KERNEL (introduce a new type?) then use it as SYSTEM_RAM for 2nd kernel.
> > 
> > I prefer not do this change in this patchset. Since current
> > implementation is fine, it looks more like a cleanup to me and we can do
> > that later.
> 
> Ok, that's fine, but I'm still not keen about exclude_ram. Could you manage
> to drop this function? 

exclude_ram() is just a static function that my code would use and I
certainly need a function like that this time. So why are you still keen
about dropping it :(

Thanks
WANG Chao

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  reply	other threads:[~2014-04-01  8:54 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
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 [this message]
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=20140401085414.GL2944@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