[PATCH 1/2] Remove the "mem=" parameter when using the --reuse-cmdline option in kdump operation

Dave Young dyoung at redhat.com
Thu Sep 25 02:11:50 PDT 2025


Hi Youling,

On Thu, 25 Sept 2025 at 14:33, Youling Tang <youling.tang at linux.dev> wrote:
>
> From: Youling Tang <tangyouling at kylinos.cn>
>
> During kdump operations, the capture kernel cannot reuse the "mem="
> parameter from the production kernel. The "mem=" parameter is used
> to specify the available memory range for the kernel. Reusing the
> "mem=" memory range may destroy the production environment.
>
> Signed-off-by: Youling Tang <tangyouling at kylinos.cn>
> ---
>  kexec/kexec.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/kexec/kexec.c b/kexec/kexec.c
> index c9e4bcb..fadf986 100644
> --- a/kexec/kexec.c
> +++ b/kexec/kexec.c
> @@ -1256,8 +1256,10 @@ char *get_command_line(void)
>                 *p = '\0';
>
>         remove_parameter(line, "BOOT_IMAGE");
> -       if (kexec_flags & KEXEC_ON_CRASH)
> +       if (kexec_flags & KEXEC_ON_CRASH) {
>                 remove_parameter(line, "crashkernel");
> +               remove_parameter(line, "mem=");
> +       }

People can remove it from the kdump load scripts instead if it is not
useful. I do not suggest removing other cmdline in c code.  The
crashkernel is a special one which is fine.

>
>         return line;
>  }
> --
> 2.48.1
>
>

Thanks
Dave




More information about the kexec mailing list