Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1558290

Re: [PATCH v4 4/5] powerpc/fadump: reuse crashkernel parameter for fadump memory reservation

From Mahesh Jagannath Salgaonkar <mahesh@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject Re: [PATCH v4 4/5] powerpc/fadump: reuse crashkernel parameter for fadump memory reservation
Date 2017-01-13 13:00 +0100
Message-ID <sZ8Gu-ol-15@gated-at.bofh.it> (permalink)
References <sWk1s-63E-25@gated-at.bofh.it> <sWkb7-66L-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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;
> 

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v4 0/5] kexec/fadump: remove dependency with CONFIG_KEXEC  and reuse crashkernel parameter for fadump Hari Bathini <hbathini@linux.vnet.ibm.com> - 2017-01-05 18:30 +0100
  [PATCH v4 5/5] powerpc/fadump: update documentation about  crashkernel parameter reuse Hari Bathini <hbathini@linux.vnet.ibm.com> - 2017-01-05 18:40 +0100
  [PATCH v4 2/5] ia64: reuse append_elf_note() and final_note()  functions Hari Bathini <hbathini@linux.vnet.ibm.com> - 2017-01-05 18:40 +0100
    Re: [PATCH v4 2/5] ia64: reuse append_elf_note() and final_note()  functions Dave Young <dyoung@redhat.com> - 2017-01-06 03:10 +0100
  [PATCH v4 1/5] crash: move crashkernel parsing and vmcore related  code under CONFIG_CRASH_CORE Hari Bathini <hbathini@linux.vnet.ibm.com> - 2017-01-05 18:40 +0100
    Re: [PATCH v4 1/5] crash: move crashkernel parsing and vmcore  related code under CONFIG_CRASH_CORE Dave Young <dyoung@redhat.com> - 2017-01-06 03:10 +0100
  [PATCH v4 3/5] powerpc/fadump: remove dependency with CONFIG_KEXEC Hari Bathini <hbathini@linux.vnet.ibm.com> - 2017-01-05 18:40 +0100
    Re: [PATCH v4 3/5] powerpc/fadump: remove dependency with  CONFIG_KEXEC Mahesh Jagannath Salgaonkar <mahesh@linux.vnet.ibm.com> - 2017-01-13 12:30 +0100
  [PATCH v4 4/5] powerpc/fadump: reuse crashkernel parameter for  fadump memory reservation Hari Bathini <hbathini@linux.vnet.ibm.com> - 2017-01-05 18:40 +0100
    Re: [PATCH v4 4/5] powerpc/fadump: reuse crashkernel parameter for  fadump memory reservation Mahesh Jagannath Salgaonkar <mahesh@linux.vnet.ibm.com> - 2017-01-13 13:00 +0100

csiph-web