Re: [PATCH v2] init/main.c: Wrap long kernel cmdline when printing to logs
From: Geert Uytterhoeven
Date: Wed Oct 22 2025 - 05:24:03 EST
Hi Douglas,
On Wed, 22 Oct 2025 at 02:41, Douglas Anderson <dianders@xxxxxxxxxxxx> wrote:
> The kernel cmdline length is allowed to be longer than what printk can
> handle. When this happens the cmdline that's printed to the kernel
> ring buffer at bootup is cutoff and some kernel cmdline options are
> "hidden" from the logs. This undercuts the usefulness of the log
> message.
>
> Specifically, grepping for COMMAND_LINE_SIZE shows that 2048 is common
> and some architectures even define it as 4096. s390 allows a
> CONFIG-based maximum up to 1MB (though it's not expected that anyone
> will go over the default max of 4096 [1]).
Of course (unless the kernel crashes) you can also look at /proc/cmdline
later. However, that seems to be limited to a single page, too,
as fs/proc/cmdline.c:cmdline_proc_show() uses seq_puts*().
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds