[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251022092947.14504A78-hca@linux.ibm.com>
Date: Wed, 22 Oct 2025 11:29:47 +0200
From: Heiko Carstens <hca@...ux.ibm.com>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: Douglas Anderson <dianders@...omium.org>, linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
linux-s390 <linux-s390@...r.kernel.org>,
Andrew Chant <achant@...gle.com>, Sven Schnelle <svens@...ux.ibm.com>,
Randy Dunlap <rdunlap@...radead.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Brian Gerst <brgerst@...il.com>,
Christian Brauner <brauner@...nel.org>,
Francesco Valla <francesco@...la.it>,
Guo Weikang <guoweikang.kernel@...il.com>,
Huacai Chen <chenhuacai@...nel.org>, Ingo Molnar <mingo@...nel.org>,
Jan Hendrik Farr <kernel@...rr.cc>, Jeff Xu <jeffxu@...omium.org>,
Kees Cook <kees@...nel.org>, Masahiro Yamada <masahiroy@...nel.org>,
"Masami Hiramatsu (Google)" <mhiramat@...nel.org>,
Michal Koutný <mkoutny@...e.com>,
Miguel Ojeda <ojeda@...nel.org>,
"Mike Rapoport (Microsoft)" <rppt@...nel.org>,
Nathan Chancellor <nathan@...nel.org>,
"Paul E. McKenney" <paulmck@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Shakeel Butt <shakeel.butt@...ux.dev>, Tejun Heo <tj@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Thomas Weißschuh <thomas.weissschuh@...utronix.de>
Subject: Re: [PATCH v2] init/main.c: Wrap long kernel cmdline when printing
to logs
On Wed, Oct 22, 2025 at 11:16:06AM +0200, Geert Uytterhoeven wrote:
> Hi Douglas,
>
> On Wed, 22 Oct 2025 at 02:41, Douglas Anderson <dianders@...omium.org> 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*().
proc seq_files are not PAGE_SIZE limited. If the output doesn't fit
into a single page the size of the buffer is doubled, until the output
fits into the buffer. See the while(1) loop in seq_read_iter().
Powered by blists - more mailing lists