All of lore.kernel.org
 help / color / mirror / Atom feed
From: Youling Tang <youling.tang@linux.dev>
To: Dave Young <dyoung@redhat.com>
Cc: Simon Horman <horms@kernel.org>,
	Simon Horman <horms@verge.net.au>,
	kexec@lists.infradead.org, Huacai Chen <chenhuacai@kernel.org>,
	Youling Tang <tangyouling@kylinos.cn>
Subject: Re: [PATCH 1/2] Remove the "mem=" parameter when using the --reuse-cmdline option in kdump operation
Date: Thu, 25 Sep 2025 17:25:10 +0800	[thread overview]
Message-ID: <1a04d38f-b231-483b-8a10-0d66a82b6e3d@linux.dev> (raw)
In-Reply-To: <CALu+AoTauqunUunsnpSX6_pn08PAcr=tpkzWiNJ1cOTR9-8vVA@mail.gmail.com>

Hi, Dave

On 9/25/25 17:11, Dave Young wrote:
> Hi Youling,
>
> On Thu, 25 Sept 2025 at 14:33, Youling Tang <youling.tang@linux.dev> wrote:
>> From: Youling Tang <tangyouling@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@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.
Removing it in scripts is also acceptable. However, reusing the 
production kernel's
"mem=" parameter will inevitably damage the production environment. In 
my view,
modifying it in C code can achieve a permanent solution (avoiding the 
need to
modify kdump services for each distribution, and also applicable to 
non-kdump
services scenarios where commands are executed directly).

Thanks,
Youling.
>>          return line;
>>   }
>> --
>> 2.48.1
>>
>>
> Thanks
> Dave
>


  reply	other threads:[~2025-09-25  9:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-25  6:32 [PATCH 1/2] Remove the "mem=" parameter when using the --reuse-cmdline option in kdump operation Youling Tang
2025-09-25  6:32 ` [PATCH 2/2] LoongArch: Refactor command line processing Youling Tang
2025-09-25  9:22   ` Dave Young
     [not found]     ` <5ec31e96-7157-4300-af36-daec2cee5831@linux.dev>
2025-09-25 10:23       ` Dave Young
2025-11-12  3:05         ` Youling Tang
2025-09-25  9:11 ` [PATCH 1/2] Remove the "mem=" parameter when using the --reuse-cmdline option in kdump operation Dave Young
2025-09-25  9:25   ` Youling Tang [this message]
2025-09-25  9:34     ` Dave Young

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=1a04d38f-b231-483b-8a10-0d66a82b6e3d@linux.dev \
    --to=youling.tang@linux.dev \
    --cc=chenhuacai@kernel.org \
    --cc=dyoung@redhat.com \
    --cc=horms@kernel.org \
    --cc=horms@verge.net.au \
    --cc=kexec@lists.infradead.org \
    --cc=tangyouling@kylinos.cn \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.