Linux Documentation
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: Andrew Murray <amurray@thegoodpenguin.co.uk>
Cc: Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Russell King <linux@armlinux.org.uk>,
	Florian Fainelli <florian.fainelli@broadcom.com>,
	Broadcom internal kernel review list
	<bcm-kernel-feedback-list@broadcom.com>,
	Ray Jui <rjui@broadcom.com>,
	Scott Branden <sbranden@broadcom.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	John Ogness <john.ogness@linutronix.de>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Clark Williams <clrkwllms@kernel.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rpi-kernel@lists.infradead.org,
	linux-rt-devel@lists.linux.dev
Subject: Re: [PATCH RFC 2/4] printk: deprecate boot_delay in favour of printk_delay
Date: Mon, 8 Jun 2026 16:07:43 +0200	[thread overview]
Message-ID: <aibMr16r55xE26rU@pathway.suse.cz> (raw)
In-Reply-To: <20260601-deprecate_boot_delay-v1-2-c34c187142a6@thegoodpenguin.co.uk>

On Mon 2026-06-01 00:17:38, Andrew Murray wrote:
> The boot_delay (BOOT_PRINTK_DELAY) kernel parameter and printk_delay sysctl
> are two distinct mechanisms for providing similar functionality which add a
> delay prior to each printed printk message.
> 
> boot_delay provides a kernel parameter for delaying printk output from
> kernel start through to boot (SYSTEM_RUNNING), whereas printk_delay is
> configurable only via sysctl and thus is only used post boot.
> 
> Let's deprecate the boot_delay feature in favour of printk_delay. In order
> to preserve functionality, we'll also extend printk_delay such that it can
> additionally configured via a kernel parameter.

I would make it clear and say: "via an early kernel parameter".

Note that there are also kernel parameters which can be modified at runtime
via /sys/module/kernel/paramters/<parameter>

Also I would make it clear that this changes the behavior, for
example:

<proposal>
Behavior change:

The delay enabled by both "boot_delay" and "printk_delay" continues
working even in SYSTEM_RUNNING state. It must be explicitly stopped
by setting printk_delay=0 via sysctl.

The delay is skipped when the message is suppressed in all system
states. It used to skipped only for the boot_delay.
</proposal>

> --- a/kernel/printk/printk.c
> +++ b/kernel/printk/printk.c
> @@ -1339,11 +1327,34 @@ static void boot_delay_msec(int level)
>  	}
>  }
>  #else
> -static inline void boot_delay_msec(int level)
> +static inline void __init printk_delay_calculate(void)
> +{
> +}
> +
> +static inline void early_boot_delay_msec(void)
>  {

It would be nice to print a warning that the early boot delay
does not work, something like:

	pr_warn_once("Early boot delay does not work without CONFIG_GENERIC_CALIBRATE_DELAY enabled.\n");

>  }
>  #endif
>  
> +static int __init printk_delay_setup(char *str)
> +{
> +	get_option(&str, &printk_delay_msec);
> +	if (printk_delay_msec > 10 * 1000)
> +		printk_delay_msec = 0;

Sashiko AI warns that this code accepts negative values.
It might cause long delays, see
https://sashiko.dev/#/patchset/20260601-deprecate_boot_delay-v1-0-c34c187142a6%40thegoodpenguin.co.uk

The problem has already been there even before. But it would be nice
to fix it.

> +
> +	printk_delay_calculate();
> +
> +	return 0;
> +}
> +early_param("printk_delay", printk_delay_setup);
> +
> +static int __init boot_delay_setup(char *str)
> +{
> +	pr_warn("boot_delay will soon be deprecated, please use printk_delay instead");
> +	return printk_delay_setup(str);
> +}
> +early_param("boot_delay", boot_delay_setup);
> +
>  static bool printk_time = IS_ENABLED(CONFIG_PRINTK_TIME);
>  module_param_named(time, printk_time, bool, S_IRUGO | S_IWUSR);

Otherwise, it looks good to me.

Best Regards,
Petr

  reply	other threads:[~2026-06-08 14:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-31 23:17 [PATCH RFC 0/4] printk: nbcon: deprecate boot_delay in favour of printk_delay Andrew Murray
2026-05-31 23:17 ` [PATCH RFC 1/4] printk: remove BOOT_PRINTK_DELAY config option Andrew Murray
2026-06-08 13:22   ` Petr Mladek
2026-05-31 23:17 ` [PATCH RFC 2/4] printk: deprecate boot_delay in favour of printk_delay Andrew Murray
2026-06-08 14:07   ` Petr Mladek [this message]
2026-05-31 23:17 ` [PATCH RFC 3/4] printk: nbcon: move printk_delay to console emiting code Andrew Murray
2026-06-08 15:25   ` Petr Mladek
2026-05-31 23:17 ` [PATCH RFC 4/4] Documentation/kernel-parameters: add/update printk_delay/boot_delay Andrew Murray
2026-06-08 15:26   ` Petr Mladek

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=aibMr16r55xE26rU@pathway.suse.cz \
    --to=pmladek@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=amurray@thegoodpenguin.co.uk \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=bigeasy@linutronix.de \
    --cc=clrkwllms@kernel.org \
    --cc=corbet@lwn.net \
    --cc=florian.fainelli@broadcom.com \
    --cc=john.ogness@linutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=linux-rt-devel@lists.linux.dev \
    --cc=linux@armlinux.org.uk \
    --cc=rdunlap@infradead.org \
    --cc=rjui@broadcom.com \
    --cc=rostedt@goodmis.org \
    --cc=sbranden@broadcom.com \
    --cc=senozhatsky@chromium.org \
    --cc=skhan@linuxfoundation.org \
    --cc=torvalds@linux-foundation.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