* [PATCH] printk: remove BOOT_PRINTK_DELAY config
@ 2026-05-03 21:42 Randy Dunlap
2026-05-05 13:54 ` Petr Mladek
0 siblings, 1 reply; 2+ messages in thread
From: Randy Dunlap @ 2026-05-03 21:42 UTC (permalink / raw)
To: linux-kernel
Cc: Randy Dunlap, Petr Mladek, Steven Rostedt, John Ogness,
Sergey Senozhatsky, Andrew Morton, bcm-kernel-feedback-list,
linux-rpi-kernel, linux-arm-kernel
This boot option is ancient and probably not being used.
Dave Jones used it successfully maybe 15 years ago...
AFAIK it doesn't work reliably, especially on SMP.
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
---
Cc: Petr Mladek <pmladek@suse.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: John Ogness <john.ogness@linutronix.de>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: bcm-kernel-feedback-list@broadcom.com
Cc: linux-rpi-kernel@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org
Documentation/admin-guide/kernel-parameters.txt | 8 -
arch/arm/configs/bcm2835_defconfig | 1
kernel/printk/printk.c | 57 --------------
lib/Kconfig.debug | 18 ----
4 files changed, 84 deletions(-)
--- linux-next-20260429.orig/kernel/printk/printk.c
+++ linux-next-20260429/kernel/printk/printk.c
@@ -1289,61 +1289,6 @@ static bool suppress_message_printing(in
return (level >= console_loglevel && !ignore_loglevel);
}
-#ifdef CONFIG_BOOT_PRINTK_DELAY
-
-static int boot_delay; /* msecs delay after each printk during bootup */
-static unsigned long long loops_per_msec; /* based on boot_delay */
-
-static int __init boot_delay_setup(char *str)
-{
- unsigned long lpj;
-
- lpj = preset_lpj ? preset_lpj : 1000000; /* some guess */
- loops_per_msec = (unsigned long long)lpj / 1000 * HZ;
-
- get_option(&str, &boot_delay);
- if (boot_delay > 10 * 1000)
- boot_delay = 0;
-
- pr_debug("boot_delay: %u, preset_lpj: %ld, lpj: %lu, "
- "HZ: %d, loops_per_msec: %llu\n",
- boot_delay, preset_lpj, lpj, HZ, loops_per_msec);
- return 0;
-}
-early_param("boot_delay", boot_delay_setup);
-
-static void boot_delay_msec(int level)
-{
- unsigned long long k;
- unsigned long timeout;
- bool suppress = !is_printk_force_console() &&
- suppress_message_printing(level);
-
- if ((boot_delay == 0 || system_state >= SYSTEM_RUNNING) || suppress)
- return;
-
- k = (unsigned long long)loops_per_msec * boot_delay;
-
- timeout = jiffies + msecs_to_jiffies(boot_delay);
- while (k) {
- k--;
- cpu_relax();
- /*
- * use (volatile) jiffies to prevent
- * compiler reduction; loop termination via jiffies
- * is secondary and may or may not happen.
- */
- if (time_after(jiffies, timeout))
- break;
- touch_nmi_watchdog();
- }
-}
-#else
-static inline void boot_delay_msec(int level)
-{
-}
-#endif
-
static bool printk_time = IS_ENABLED(CONFIG_PRINTK_TIME);
module_param_named(time, printk_time, bool, S_IRUGO | S_IWUSR);
@@ -2121,8 +2066,6 @@ int printk_delay_msec __read_mostly;
static inline void printk_delay(int level)
{
- boot_delay_msec(level);
-
if (unlikely(printk_delay_msec)) {
int m = printk_delay_msec;
--- linux-next-20260429.orig/lib/Kconfig.debug
+++ linux-next-20260429/lib/Kconfig.debug
@@ -99,24 +99,6 @@ config MESSAGE_LOGLEVEL_DEFAULT
by default. To change that, use loglevel=<x> in the kernel bootargs,
or pick a different CONSOLE_LOGLEVEL_DEFAULT configuration value.
-config BOOT_PRINTK_DELAY
- bool "Delay each boot printk message by N milliseconds"
- depends on DEBUG_KERNEL && PRINTK && GENERIC_CALIBRATE_DELAY
- help
- This build option allows you to read kernel boot messages
- by inserting a short delay after each one. The delay is
- specified in milliseconds on the kernel command line,
- using "boot_delay=N".
-
- It is likely that you would also need to use "lpj=M" to preset
- the "loops per jiffy" value.
- See a previous boot log for the "lpj" value to use for your
- system, and then set "lpj=M" before setting "boot_delay=N".
- NOTE: Using this option may adversely affect SMP systems.
- I.e., processors other than the first one may not boot up.
- BOOT_PRINTK_DELAY also may cause LOCKUP_DETECTOR to detect
- what it believes to be lockup conditions.
-
config DYNAMIC_DEBUG
bool "Enable dynamic printk() support"
default n
--- linux-next-20260429.orig/Documentation/admin-guide/kernel-parameters.txt
+++ linux-next-20260429/Documentation/admin-guide/kernel-parameters.txt
@@ -654,14 +654,6 @@ Kernel parameters
embedded devices based on command line input.
See Documentation/block/cmdline-partition.rst
- boot_delay= [KNL,EARLY]
- Milliseconds to delay each printk during boot.
- Only works if CONFIG_BOOT_PRINTK_DELAY is enabled,
- and you may also have to specify "lpj=". Boot_delay
- values larger than 10 seconds (10000) are assumed
- erroneous and ignored.
- Format: integer
-
bootconfig [KNL,EARLY]
Extended command line options can be added to an initrd
and this will cause the kernel to look for it.
--- linux-next-20260429.orig/arch/arm/configs/bcm2835_defconfig
+++ linux-next-20260429/arch/arm/configs/bcm2835_defconfig
@@ -174,7 +174,6 @@ CONFIG_NLS_UTF8=y
CONFIG_DMA_CMA=y
CONFIG_CMA_SIZE_MBYTES=32
CONFIG_PRINTK_TIME=y
-CONFIG_BOOT_PRINTK_DELAY=y
CONFIG_DYNAMIC_DEBUG=y
CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
# CONFIG_ENABLE_MUST_CHECK is not set
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] printk: remove BOOT_PRINTK_DELAY config
2026-05-03 21:42 [PATCH] printk: remove BOOT_PRINTK_DELAY config Randy Dunlap
@ 2026-05-05 13:54 ` Petr Mladek
0 siblings, 0 replies; 2+ messages in thread
From: Petr Mladek @ 2026-05-05 13:54 UTC (permalink / raw)
To: Randy Dunlap
Cc: linux-kernel, Steven Rostedt, John Ogness, Sergey Senozhatsky,
Andrew Morton, bcm-kernel-feedback-list, linux-rpi-kernel,
linux-arm-kernel
On Sun 2026-05-03 14:42:14, Randy Dunlap wrote:
> This boot option is ancient and probably not being used.
> Dave Jones used it successfully maybe 15 years ago...
> AFAIK it doesn't work reliably, especially on SMP.
I agree that it most likely does not have many users and is not
reliable.
In addition, it was kind of obsoleted by printk_delay() which
does very similar thing except that it can only be set
at runtime via sysctl.
Which brings an idea. What about doing the obsoleting properly?
I mean to:
1. Add "printk_delay" early_param() which would allow
to set "printk_delay_msec" via command line.
2. Modify boot_delay_setup() to set "printk_delay_msec" as well.
In addition, it might print a message that it has been
obsoleted by "printk_delay" and will be removed.
Would you mind to do it this way, please?
Regarding the reliability, it might get improved by moving the delay
to console handling code. It would even allow to use sleeping wait
when the consoles are handled in kthreads. But the wait might
get multiplied when more consoles are registered and proceed
on the same CPU. Anyway, this is out of scope for this patch.
Best Regards,
Petr
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-05-05 13:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-03 21:42 [PATCH] printk: remove BOOT_PRINTK_DELAY config Randy Dunlap
2026-05-05 13:54 ` Petr Mladek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox