linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Mahesh Jagannath Salgaonkar <mahesh@linux.vnet.ibm.com>
To: Hari Bathini <hbathini@linux.vnet.ibm.com>, linux-kernel@vger.kernel.org
Cc: fenghua.yu@intel.com, tony.luck@intel.com,
	linux-ia64@vger.kernel.org, dyoung@redhat.com,
	kexec@lists.infradead.org, ebiederm@xmission.com,
	Michael Ellerman <mpe@ellerman.id.au>,
	linuxppc-dev@lists.ozlabs.org, vgoyal@redhat.com
Subject: Re: [PATCH v4 4/5] powerpc/fadump: reuse crashkernel parameter for fadump memory reservation
Date: Fri, 13 Jan 2017 17:21:13 +0530	[thread overview]
Message-ID: <ca056a82-65c0-c2e0-bc30-8dc8644452de@linux.vnet.ibm.com> (raw)
In-Reply-To: <148363754236.11570.1527409032997316662.stgit@hbathini.in.ibm.com>

On 01/05/2017 11:02 PM, Hari Bathini wrote:
> fadump supports specifying memory to reserve for fadump's crash kernel
> with fadump_reserve_mem kernel parameter. This parameter currently
> supports passing a fixed memory size, like fadump_reserve_mem=<size>
> only. This patch aims to add support for other syntaxes like range-based
> memory size <range1>:<size1>[,<range2>:<size2>,<range3>:<size3>,...]
> which allows using the same parameter to boot the kernel with different
> system RAM sizes.
> 
> As crashkernel parameter already supports the above mentioned syntaxes,
> this patch deprecates fadump_reserve_mem parameter and reuses crashkernel
> parameter instead, to specify memory for fadump's crash kernel memory
> reservation as well. If any offset is provided in crashkernel parameter,
> it will be ignored in case of fadump, as fadump reserves memory at end
> of RAM.
> 
> Advantages using crashkernel parameter instead of fadump_reserve_mem
> parameter are one less kernel parameter overall, code reuse and support
> for multiple syntaxes to specify memory.
> 
> Suggested-by: Dave Young <dyoung@redhat.com>
> Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>

Reviewed-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>

> ---
>  arch/powerpc/kernel/fadump.c |   23 ++++++++++-------------
>  1 file changed, 10 insertions(+), 13 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
> index db0b339..de7d39a 100644
> --- a/arch/powerpc/kernel/fadump.c
> +++ b/arch/powerpc/kernel/fadump.c
> @@ -210,14 +210,20 @@ static unsigned long init_fadump_mem_struct(struct fadump_mem_struct *fdm,
>   */
>  static inline unsigned long fadump_calculate_reserve_size(void)
>  {
> -	unsigned long size;
> +	int ret;
> +	unsigned long long base, size;
> 
>  	/*
> -	 * Check if the size is specified through fadump_reserve_mem= cmdline
> -	 * option. If yes, then use that.
> +	 * Check if the size is specified through crashkernel= cmdline
> +	 * option. If yes, then use that but ignore base as fadump
> +	 * reserves memory at end of RAM.
>  	 */
> -	if (fw_dump.reserve_bootvar)
> +	ret = parse_crashkernel(boot_command_line, memblock_phys_mem_size(),
> +				&size, &base);
> +	if (ret == 0 && size > 0) {
> +		fw_dump.reserve_bootvar = (unsigned long)size;
>  		return fw_dump.reserve_bootvar;
> +	}
> 
>  	/* divide by 20 to get 5% of value */
>  	size = memblock_end_of_DRAM() / 20;
> @@ -353,15 +359,6 @@ static int __init early_fadump_param(char *p)
>  }
>  early_param("fadump", early_fadump_param);
> 
> -/* Look for fadump_reserve_mem= cmdline option */
> -static int __init early_fadump_reserve_mem(char *p)
> -{
> -	if (p)
> -		fw_dump.reserve_bootvar = memparse(p, &p);
> -	return 0;
> -}
> -early_param("fadump_reserve_mem", early_fadump_reserve_mem);
> -
>  static void register_fw_dump(struct fadump_mem_struct *fdm)
>  {
>  	int rc;
> 

  reply	other threads:[~2017-01-13 11:51 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-05 17:28 [PATCH v4 0/5] kexec/fadump: remove dependency with CONFIG_KEXEC and reuse crashkernel parameter for fadump Hari Bathini
2017-01-05 17:29 ` [PATCH v4 1/5] crash: move crashkernel parsing and vmcore related code under CONFIG_CRASH_CORE Hari Bathini
2017-01-06  2:02   ` Dave Young
2017-03-23 15:54   ` Hari Bathini
2017-01-05 17:31 ` [PATCH v4 2/5] ia64: reuse append_elf_note() and final_note() functions Hari Bathini
2017-01-06  2:03   ` Dave Young
2017-01-17 17:06     ` Hari Bathini
2017-01-24 18:11       ` Hari Bathini
2017-01-24 18:23         ` Tony Luck
2017-01-25 19:15           ` Hari Bathini
2017-01-31 22:21             ` Tony Luck
2017-02-01  1:11               ` Michael Ellerman
2017-01-20  5:47   ` Michael Ellerman
2017-01-24 18:08     ` Hari Bathini
2017-01-05 17:32 ` [PATCH v4 3/5] powerpc/fadump: remove dependency with CONFIG_KEXEC Hari Bathini
2017-01-13 11:27   ` Mahesh Jagannath Salgaonkar
2017-01-05 17:32 ` [PATCH v4 4/5] powerpc/fadump: reuse crashkernel parameter for fadump memory reservation Hari Bathini
2017-01-13 11:51   ` Mahesh Jagannath Salgaonkar [this message]
2017-01-05 17:32 ` [PATCH v4 5/5] powerpc/fadump: update documentation about crashkernel parameter reuse Hari Bathini

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=ca056a82-65c0-c2e0-bc30-8dc8644452de@linux.vnet.ibm.com \
    --to=mahesh@linux.vnet.ibm.com \
    --cc=dyoung@redhat.com \
    --cc=ebiederm@xmission.com \
    --cc=fenghua.yu@intel.com \
    --cc=hbathini@linux.vnet.ibm.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=tony.luck@intel.com \
    --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;
as well as URLs for NNTP newsgroup(s).