[PATCH v3 0/6] printk: nbcon: deprecate boot_delay in favour of printk_delay
From: Andrew Murray <hidden>
Date: 2026-07-12 10:20:50
Also in:
linux-doc, linux-rt-devel, lkml
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. However, since the introduction of nbcon and the legacy printer thread for PREEMPT_RT kernels, printk records are now emited to the console asynchronously to the caller of printk. Thus, any printk delay added by boot_delay/printk_delay continues to slow down the calling process but may not have any impact to the rate in which records are emited to the console, especially for slow consoles. To address these issues, let's deprecate boot_delay, extend printk_delay to be useable from kernel start and ensure that delays occur at the point where console messages are printed rather than queued. Please note that this patchset results in delays occuring after a message is printed rather than, as it is now, before. Signed-off-by: Andrew Murray <redacted> --- Please see the following related work for additional context: - https://lore.kernel.org/all/20260503214214.3475670-1-rdunlap@infradead.org/ (local) - https://lore.kernel.org/all/20260505-printk_delay-v1-1-5dba51d7f17c@thegoodpenguin.co.uk/ (local) --- Changes in v1: - Rebased onto v7.2-rc2 - Moved emitted field from nbcon_write_context to nbcon_context - Fixed comparison of char field that used > operator - Used unsigned int and bounds checking for printk/boot delay - Moved delays prior to allowing handover - Added additional information into commit messages - Link to v2: https://lore.kernel.org/lkml/20260630-deprecate_boot_delay-v2-0-f9883d36aa4b@thegoodpenguin.co.uk (local) Changes in v2: - Rebased onto v7.2-rc1 - Correctly handle negative values for printk_delay_msec (patch 2) - Add missing newline in pr_warn (patch 2) - Improved patch descriptions for (patches 2 and 3) - Use new emitted flag in nbcon_context/nbcon_write_context in place of backlog && wctxt.len checks (patch 3) - Use unsigned char for unsafe_takeover field instead of bool in nbcon_write_context (patch 3) - Move printk_delay_msec and printk_delay from printk.h to internal.h (patch 3) - Revert regression added in v1 to __nbcon_atomic_flush_pending_con (patch 3) - Move printk_delay later in console_emit_next_record ensuring delay is always after emit (across nbcon/legacy) (patch 3) - Fixed typo in documentation s/boot_delay/printk_delay/g in printk_delay= section (patch 4) - Link to v1: https://lore.kernel.org/r/20260601-deprecate_boot_delay-v1-0-c34c187142a6@thegoodpenguin.co.uk (local) --- Andrew Murray (6): printk: sysctl: use unsigned int for printk_delay printk: add bounds checking to boot_delay printk: remove BOOT_PRINTK_DELAY config option printk: deprecate boot_delay in favour of printk_delay printk: nbcon: move printk_delay to console emiting code Documentation/kernel-parameters: add/update printk_delay/boot_delay Documentation/admin-guide/kernel-parameters.txt | 31 +++++++-- arch/arm/configs/bcm2835_defconfig | 1 - include/linux/console.h | 5 +- include/linux/printk.h | 1 - kernel/printk/internal.h | 6 ++ kernel/printk/nbcon.c | 13 ++++ kernel/printk/printk.c | 89 ++++++++++++++++--------- kernel/printk/sysctl.c | 4 +- lib/Kconfig.debug | 18 ----- 9 files changed, 108 insertions(+), 60 deletions(-) --- base-commit: 8cdeaa50eae8dad34885515f62559ee83e7e8dda change-id: 20260711-printkcleanup-cbe3fda4a2bc Best regards, -- Andrew Murray [off-list ref]