mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Heiko Carstens <hca@linux.ibm.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "Douglas Anderson" <dianders@chromium.org>,
	linux-kernel@vger.kernel.org,
	"Andrew Morton" <akpm@linux-foundation.org>,
	linux-s390 <linux-s390@vger.kernel.org>,
	"Andrew Chant" <achant@google.com>,
	"Sven Schnelle" <svens@linux.ibm.com>,
	"Randy Dunlap" <rdunlap@infradead.org>,
	"Alexander Shishkin" <alexander.shishkin@linux.intel.com>,
	"Brian Gerst" <brgerst@gmail.com>,
	"Christian Brauner" <brauner@kernel.org>,
	"Francesco Valla" <francesco@valla.it>,
	"Guo Weikang" <guoweikang.kernel@gmail.com>,
	"Huacai Chen" <chenhuacai@kernel.org>,
	"Ingo Molnar" <mingo@kernel.org>,
	"Jan Hendrik Farr" <kernel@jfarr.cc>,
	"Jeff Xu" <jeffxu@chromium.org>, "Kees Cook" <kees@kernel.org>,
	"Masahiro Yamada" <masahiroy@kernel.org>,
	"Masami Hiramatsu (Google)" <mhiramat@kernel.org>,
	"Michal Koutný" <mkoutny@suse.com>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Mike Rapoport (Microsoft)" <rppt@kernel.org>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Paul E. McKenney" <paulmck@kernel.org>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Shakeel Butt" <shakeel.butt@linux.dev>,
	"Tejun Heo" <tj@kernel.org>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Thomas Weißschuh" <thomas.weissschuh@linutronix.de>
Subject: Re: [PATCH v2] init/main.c: Wrap long kernel cmdline when printing to logs
Date: Wed, 22 Oct 2025 11:29:47 +0200	[thread overview]
Message-ID: <20251022092947.14504A78-hca@linux.ibm.com> (raw)
In-Reply-To: <CAMuHMdWAbMoQdeM5-F1YYOfEdcPrkTxdbsU8+TAYO=WuMzCqCw@mail.gmail.com>

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@chromium.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().

      reply	other threads:[~2025-10-22  9:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-22  0:39 Douglas Anderson
2025-10-22  2:16 ` Paul E. McKenney
2025-10-22  2:51   ` Doug Anderson
2025-10-22  3:30     ` Paul E. McKenney
2025-10-22  9:16 ` Geert Uytterhoeven
2025-10-22  9:29   ` Heiko Carstens [this message]

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=20251022092947.14504A78-hca@linux.ibm.com \
    --to=hca@linux.ibm.com \
    --cc=achant@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=brauner@kernel.org \
    --cc=brgerst@gmail.com \
    --cc=chenhuacai@kernel.org \
    --cc=dianders@chromium.org \
    --cc=francesco@valla.it \
    --cc=geert@linux-m68k.org \
    --cc=guoweikang.kernel@gmail.com \
    --cc=jeffxu@chromium.org \
    --cc=kees@kernel.org \
    --cc=kernel@jfarr.cc \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@kernel.org \
    --cc=mkoutny@suse.com \
    --cc=nathan@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rdunlap@infradead.org \
    --cc=rppt@kernel.org \
    --cc=shakeel.butt@linux.dev \
    --cc=svens@linux.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.weissschuh@linutronix.de \
    --cc=tj@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

all inboxes | Powered by JetHome®