Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Young <dyoung@redhat.com>
To: WANG Chao <chaowang@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 11:24:38 +0800	[thread overview]
Message-ID: <20140328032438.GD26116@dhcp-16-126.nay.redhat.com> (raw)
In-Reply-To: <1395216241-13983-3-git-send-email-chaowang@redhat.com>

>  
> +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.

memmap_p
 -> contains all the crash reserved ranges
 -> to be used by cmdline_add_memmap

The several memory ranges are twisted and somehow the funcions are duplicate.

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.

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

  parent reply	other threads:[~2014-03-28  3:23 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 [this message]
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
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=20140328032438.GD26116@dhcp-16-126.nay.redhat.com \
    --to=dyoung@redhat.com \
    --cc=chaowang@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