linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xose Vazquez Perez <xose.vazquez@gmail.com>
To: Ming Wang <wangming01@loongson.cn>
Cc: LINUX_ARCH-ML <linux-arch@vger.kernel.org>,
	API-ML <linux-api@vger.kernel.org>,
	KERNEL-ML <linux-kernel@vger.kernel.org>, X86-ML <x86@kernel.org>
Subject: Re: [PATCH] LoongArch: Increase COMMAND_LINE_SIZE to 4096
Date: Sun, 17 Aug 2025 09:57:40 +0200	[thread overview]
Message-ID: <4616546f-f10c-419b-a32f-ae1a059f15e4@gmail.com> (raw)

Ming Wang wrote:

> The default COMMAND_LINE_SIZE of 512, inherited from asm-generic, is
> too small for modern use cases. For example, kdump configurations or
> extensive debugging parameters can easily exceed this limit.
> 
> Therefore, increase the command line size to 4096 bytes, aligning
> LoongArch with the MIPS architecture. This change follows a broader
> trend among architectures to raise this limit to support modern needs;
> for instance, PowerPC increased its value for similar reasons in
> commit a5980d064fe2 ("powerpc: Bump COMMAND_LINE_SIZE to 2048").
> 
> Similar to the change made for RISC-V in commit 61fc1ee8be26
> ("riscv: Bump COMMAND_LINE_SIZE value to 1024"), this is considered
> a safe change. The broader kernel community has reached a consensus
> that modifying COMMAND_LINE_SIZE from UAPI headers does not
> constitute a uABI breakage, as well-behaved userspace applications
> should not rely on this macro.
> 
> Suggested-by: Huang Cun <cunhuang@tencent.com>
> Signed-off-by: Ming Wang <wangming01@loongson.cn>
> ---
>  arch/loongarch/include/uapi/asm/setup.h | 8 ++++++++
>  1 file changed, 8 insertions(+)
>  create mode 100644 arch/loongarch/include/uapi/asm/setup.h
> 
> diff --git a/arch/loongarch/include/uapi/asm/setup.h b/arch/loongarch/include/uapi/asm/setup.h
> new file mode 100644
> index 000000000000..d46363ce3e02
> --- /dev/null
> +++ b/arch/loongarch/include/uapi/asm/setup.h
> @@ -0,0 +1,8 @@
> +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
> +
> +#ifndef _UAPI_ASM_LOONGARCH_SETUP_H
> +#define _UAPI_ASM_LOONGARCH_SETUP_H
> +
> +#define COMMAND_LINE_SIZE	4096
> +
> +#endif /* _UAPI_ASM_LOONGARCH_SETUP_H */
> -- 
> 2.43.0

A bit chaotic and arbitrary sizes:

$ git grep "define.*COMMAND_LINE_SIZE"
arch/alpha/include/uapi/asm/setup.h:#define COMMAND_LINE_SIZE	256
arch/arc/include/asm/setup.h:#define COMMAND_LINE_SIZE 256
arch/arm64/include/uapi/asm/setup.h:#define COMMAND_LINE_SIZE	2048
arch/arm/include/uapi/asm/setup.h:#define COMMAND_LINE_SIZE 1024
arch/m68k/include/asm/setup.h:#define CL_SIZE COMMAND_LINE_SIZE
arch/m68k/include/uapi/asm/setup.h:#define COMMAND_LINE_SIZE 256
arch/microblaze/include/uapi/asm/setup.h:#define COMMAND_LINE_SIZE	256
arch/mips/include/uapi/asm/setup.h:#define COMMAND_LINE_SIZE	4096
arch/mips/loongson64/reset.c:#define KEXEC_ARGV_SIZE	COMMAND_LINE_SIZE
arch/parisc/include/uapi/asm/setup.h:#define COMMAND_LINE_SIZE	1024
arch/powerpc/boot/ops.h:#define	BOOT_COMMAND_LINE_SIZE	2048
arch/powerpc/include/uapi/asm/setup.h:#define COMMAND_LINE_SIZE	2048
arch/riscv/include/uapi/asm/setup.h:#define COMMAND_LINE_SIZE	1024
arch/s390/include/asm/setup.h:#define COMMAND_LINE_SIZE CONFIG_COMMAND_LINE_SIZE
arch/s390/include/asm/setup.h:#define LEGACY_COMMAND_LINE_SIZE	896
arch/sparc/include/uapi/asm/setup.h:# define COMMAND_LINE_SIZE 2048
arch/sparc/include/uapi/asm/setup.h:# define COMMAND_LINE_SIZE 256
arch/um/include/asm/setup.h:#define COMMAND_LINE_SIZE 4096
arch/x86/include/asm/setup.h:#define COMMAND_LINE_SIZE 2048
arch/xtensa/include/uapi/asm/setup.h:#define COMMAND_LINE_SIZE	256
include/uapi/asm-generic/setup.h:#define COMMAND_LINE_SIZE	512
kernel/trace/ftrace.c:#define FTRACE_FILTER_SIZE		COMMAND_LINE_SIZE
tools/power/x86/turbostat/turbostat.c:#define COMMAND_LINE_SIZE 2048
tools/testing/selftests/kho/init.c:#define COMMAND_LINE_SIZE	2048

Maybe they should be standardized ???

And for s390 it is configurable, see 622021cd6c560

             reply	other threads:[~2025-08-17  7:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-17  7:57 Xose Vazquez Perez [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-08-12 12:20 [PATCH] LoongArch: Increase COMMAND_LINE_SIZE to 4096 Ming Wang
2025-08-17  3:42 ` Huacai Chen

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=4616546f-f10c-419b-a32f-ae1a059f15e4@gmail.com \
    --to=xose.vazquez@gmail.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wangming01@loongson.cn \
    --cc=x86@kernel.org \
    /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).