[PATCH RFC 0/4] printk: nbcon: deprecate boot_delay in favour of printk_delay

From: Andrew Murray

Date: Sun May 31 2026 - 19:18:03 EST


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 <amurray@xxxxxxxxxxxxxxxxxxxx>
---
Please see the following related work for additional context:

- https://lore.kernel.org/all/20260503214214.3475670-1-rdunlap@xxxxxxxxxxxxx/
- https://lore.kernel.org/all/20260505-printk_delay-v1-1-5dba51d7f17c@xxxxxxxxxxxxxxxxxxxx/

I've marked this as RFC as I haven't performed sufficient testing on nbcon
and I'm keen for feedback on the delays added to nbcon...

nbcon_emit_next_record describes @wctxt->ctxt.backlog as an indicator of
pending records in the ringbuffer. This is then later used by nbcon_emit_one
where a comment suggests '[returns] True, when a record has been printed and
there are still pending records.'. It's callers then use this to determine
if they should continue around their loops for another attempt at printing.
However, backlog is the return value from printk_get_next_message, which
returns true if the requested record was obtained, rather than an indication
that there are additional records beyond the one about to be printed.

For this work, I needed to know if a message was printed to the console, as
far as I can tell, if nbcon_emit_next_record returns true, then it indicates
that it still has context, and if it does, then if backlog is false there were no
messages to print, if backlog was true then a message was either printed or
suppressed. Therefore I used wctxt.len to determine if the message was suppressed
or not as printk_get_next_message will not the length accordinly.

---
Andrew Murray (4):
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/printk.h | 4 ++
kernel/printk/nbcon.c | 13 +++-
kernel/printk/printk.c | 82 +++++++++++++++----------
lib/Kconfig.debug | 18 ------
6 files changed, 93 insertions(+), 56 deletions(-)
---
base-commit: e43ffb69e0438cddd72aaa30898b4dc446f664f8
change-id: 20260515-deprecate_boot_delay-72516da3845a

Best regards,
--
Andrew Murray <amurray@xxxxxxxxxxxxxxxxxxxx>