The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v3 0/6] printk: nbcon: deprecate boot_delay in favour of printk_delay
@ 2026-07-12 10:20 Andrew Murray
  2026-07-12 10:20 ` [PATCH v3 1/6] printk: sysctl: use unsigned int for printk_delay Andrew Murray
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Andrew Murray @ 2026-07-12 10:20 UTC (permalink / raw)
  To: Petr Mladek, Steven Rostedt, John Ogness, Sergey Senozhatsky,
	Jonathan Corbet, Shuah Khan, Russell King, Florian Fainelli,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Andrew Morton, Greg Kroah-Hartman, Sebastian Andrzej Siewior,
	Clark Williams
  Cc: linux-kernel, linux-doc, linux-arm-kernel, linux-rpi-kernel,
	linux-rt-devel, Andrew Murray

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@thegoodpenguin.co.uk>
---
Please see the following related work for additional context:

- https://lore.kernel.org/all/20260503214214.3475670-1-rdunlap@infradead.org/
- https://lore.kernel.org/all/20260505-printk_delay-v1-1-5dba51d7f17c@thegoodpenguin.co.uk/

---
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

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

---
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 <amurray@thegoodpenguin.co.uk>


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-07-12 10:32 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-12 10:20 [PATCH v3 0/6] printk: nbcon: deprecate boot_delay in favour of printk_delay Andrew Murray
2026-07-12 10:20 ` [PATCH v3 1/6] printk: sysctl: use unsigned int for printk_delay Andrew Murray
2026-07-12 10:20 ` [PATCH v3 2/6] printk: add bounds checking to boot_delay Andrew Murray
2026-07-12 10:30   ` sashiko-bot
2026-07-12 10:20 ` [PATCH v3 3/6] printk: remove BOOT_PRINTK_DELAY config option Andrew Murray
2026-07-12 10:20 ` [PATCH v3 4/6] printk: deprecate boot_delay in favour of printk_delay Andrew Murray
2026-07-12 10:20 ` [PATCH v3 5/6] printk: nbcon: move printk_delay to console emiting code Andrew Murray
2026-07-12 10:31   ` sashiko-bot
2026-07-12 10:20 ` [PATCH v3 6/6] Documentation/kernel-parameters: add/update printk_delay/boot_delay Andrew Murray
2026-07-12 10:32   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox