linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH printk v2 00/18] add threaded printing + the rest
@ 2024-06-03 23:24 John Ogness
  2024-06-03 23:24 ` [PATCH printk v2 01/18] printk: Add function to replay kernel log on consoles John Ogness
                   ` (18 more replies)
  0 siblings, 19 replies; 63+ messages in thread
From: John Ogness @ 2024-06-03 23:24 UTC (permalink / raw)
  To: Petr Mladek
  Cc: Sergey Senozhatsky, Steven Rostedt, Thomas Gleixner, linux-kernel,
	Jonathan Corbet, Greg Kroah-Hartman, Jiri Slaby, Sreenath Vijayan,
	Shimoyashiki Taichi, Tomas Mudrunka, linux-doc, linux-serial,
	linux-fsdevel, Paul E. McKenney, Josh Poimboeuf,
	Borislav Petkov (AMD), Xiongwei Song

Hi,

This is v2 of a series to implement threaded console printing as well
as some other minor pieces (such as proc and sysfs support). This
series is only a subset of the original v1 [0]. In particular, this
series represents patches 11, 12, 15 of the v1 series. For information
about the motivation of the nbcon consoles, please read the cover
letter of v1.

This series provides the remaining pieces of the printk rework. All
other components are either already mainline or are currently in
linux-next. In particular this series does:

- Implement dedicated printing threads per nbcon console.

- Implement "threadprintk" boot argument to force threading of legacy
  consoles.

- Implement nbcon support for proc and sysfs console-related files.

- Provide a new helper function nbcon_reacquire() to allow nbcon
  console drivers to reacquire ownership.

Note that this series does *not* provide an nbcon console driver. That
will come in a follow-up series.

Also note that the first 3 patches of the series are either already
mainline or are queued for 6.11. They are included in this series for
completeness when applied to the printk for-next branch.

Much has changed since v1 and the patches no longer correlate
1:1. Here is an attempt to list the changes:

- Implement a special dedicated thread to force threading of legacy
  console drivers.

- Add "threadprintk" boot argument to force threading of legacy
  console drivers. (For PREEMPT_RT, this is automatically enabled.)

- Add sparse notation for console_srcu_read_lock/unlock().

- Define a dedicated wait queue for the legacy thread.

- Stop threads on shutdown/reboot for a clean transition to atomic
  printing.

- Print a replay message when a higher priority printer context takes
  over another printer context.

- Reset lockdep context for legacy printing on !PREEMPT_RT to avoid
  false positive lockdep splats.

- Use write_thread() callback if printing from console_flush_all() and
  @do_cond_resched is 1.

- Do not allocate separate pbufs for printing threads. Use the same
  pbufs that the atomic printer uses.

- Wake printing threads without considering nbcon lock state.

- Implement rcuwait_has_sleeper() to check for waiting tasks instead
  of using a custom atomic variable @kthread_waiting.

John Ogness

[0] https://lore.kernel.org/lkml/20230302195618.156940-1-john.ogness@linutronix.de

John Ogness (13):
  printk: Atomic print in printk context on shutdown
  printk: nbcon: Add context to console_is_usable()
  printk: nbcon: Stop threads on shutdown/reboot
  printk: nbcon: Start printing threads
  printk: Provide helper for message prepending
  printk: nbcon: Show replay message on takeover
  printk: Add kthread for all legacy consoles
  proc: consoles: Add notation to c_start/c_stop
  proc: Add nbcon support for /proc/consoles
  tty: sysfs: Add nbcon support for 'active'
  printk: Provide threadprintk boot argument
  printk: Avoid false positive lockdep report for legacy printing
  printk: nbcon: Add function for printers to reacquire ownership

Sreenath Vijayan (3):
  printk: Add function to replay kernel log on consoles
  tty/sysrq: Replay kernel log messages on consoles via sysrq
  printk: Rename console_replay_all() and update context

Thomas Gleixner (2):
  printk: nbcon: Introduce printing kthreads
  printk: nbcon: Add printer thread wakeups

 .../admin-guide/kernel-parameters.txt         |  12 +
 Documentation/admin-guide/sysrq.rst           |   9 +
 drivers/tty/sysrq.c                           |  13 +-
 drivers/tty/tty_io.c                          |   9 +-
 fs/proc/consoles.c                            |  16 +-
 include/linux/console.h                       |  38 ++
 include/linux/printk.h                        |   6 +-
 kernel/printk/internal.h                      |  55 +-
 kernel/printk/nbcon.c                         | 421 ++++++++++++++-
 kernel/printk/printk.c                        | 482 +++++++++++++++---
 10 files changed, 945 insertions(+), 116 deletions(-)


base-commit: f3760c80d06a838495185c0fe341c043e6495142
-- 
2.39.2


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

end of thread, other threads:[~2024-07-02 14:31 UTC | newest]

Thread overview: 63+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-03 23:24 [PATCH printk v2 00/18] add threaded printing + the rest John Ogness
2024-06-03 23:24 ` [PATCH printk v2 01/18] printk: Add function to replay kernel log on consoles John Ogness
2024-06-03 23:24 ` [PATCH printk v2 02/18] tty/sysrq: Replay kernel log messages on consoles via sysrq John Ogness
2024-06-03 23:24 ` [PATCH printk v2 03/18] printk: Rename console_replay_all() and update context John Ogness
2024-06-03 23:24 ` [PATCH printk v2 04/18] printk: nbcon: Introduce printing kthreads John Ogness
2024-06-07 13:17   ` Petr Mladek
2024-06-10 12:09     ` John Ogness
2024-06-11 14:51       ` Petr Mladek
2024-06-12  8:51         ` John Ogness
2024-06-12  9:24           ` Petr Mladek
2024-06-12 11:18             ` John Ogness
2024-06-12 11:33               ` Petr Mladek
2024-06-13 15:21           ` John Ogness
2024-06-14  7:40             ` Petr Mladek
2024-06-03 23:24 ` [PATCH printk v2 05/18] printk: Atomic print in printk context on shutdown John Ogness
2024-06-13 12:32   ` Petr Mladek
2024-06-13 12:44   ` atomic_flush vs boot consoles - was: " Petr Mladek
2024-06-13 12:52     ` [PATCH] printk: nbcon_atomic_flush_pending() is safe only when there is no boot console Petr Mladek
2024-06-13 15:10       ` Petr Mladek
2024-06-25 20:53       ` John Ogness
2024-06-28 15:51         ` how to flush consoles: was: " Petr Mladek
2024-06-03 23:24 ` [PATCH printk v2 06/18] printk: nbcon: Add context to console_is_usable() John Ogness
2024-06-13 13:22   ` Petr Mladek
2024-06-03 23:24 ` [PATCH printk v2 07/18] printk: nbcon: Add printer thread wakeups John Ogness
2024-06-13 15:08   ` Petr Mladek
2024-06-03 23:24 ` [PATCH printk v2 08/18] printk: nbcon: Stop threads on shutdown/reboot John Ogness
2024-06-17 15:21   ` Petr Mladek
2024-06-25 19:56     ` John Ogness
2024-06-26 12:14       ` Petr Mladek
2024-06-03 23:24 ` [PATCH printk v2 09/18] printk: nbcon: Start printing threads John Ogness
2024-06-18 15:34   ` Petr Mladek
2024-06-19 15:13     ` Petr Mladek
2024-06-03 23:24 ` [PATCH printk v2 10/18] printk: Provide helper for message prepending John Ogness
2024-06-20 10:28   ` Petr Mladek
2024-06-03 23:24 ` [PATCH printk v2 11/18] printk: nbcon: Show replay message on takeover John Ogness
2024-06-20 13:02   ` Petr Mladek
2024-06-03 23:24 ` [PATCH printk v2 12/18] printk: Add kthread for all legacy consoles John Ogness
2024-06-28 11:46   ` Petr Mladek
2024-06-28 12:22     ` John Ogness
2024-06-28 13:32       ` Petr Mladek
2024-06-28 14:11         ` John Ogness
2024-06-28 15:56           ` John Ogness
2024-07-01 15:33             ` Petr Mladek
2024-07-01 21:01               ` John Ogness
2024-07-02  9:11                 ` Petr Mladek
2024-07-01 14:50           ` Petr Mladek
2024-07-02  9:30             ` Petr Mladek
2024-06-03 23:24 ` [PATCH printk v2 13/18] proc: consoles: Add notation to c_start/c_stop John Ogness
2024-07-01 15:43   ` Petr Mladek
2024-06-03 23:24 ` [PATCH printk v2 14/18] proc: Add nbcon support for /proc/consoles John Ogness
2024-07-01 15:47   ` Petr Mladek
2024-06-03 23:24 ` [PATCH printk v2 15/18] tty: sysfs: Add nbcon support for 'active' John Ogness
2024-06-04 11:48   ` Greg Kroah-Hartman
2024-07-01 15:50   ` Petr Mladek
2024-06-03 23:24 ` [PATCH printk v2 16/18] printk: Provide threadprintk boot argument John Ogness
2024-07-02 12:12   ` Petr Mladek
2024-06-03 23:24 ` [PATCH printk v2 17/18] printk: Avoid false positive lockdep report for legacy printing John Ogness
2024-07-02 13:26   ` Petr Mladek
2024-06-03 23:24 ` [PATCH printk v2 18/18] printk: nbcon: Add function for printers to reacquire ownership John Ogness
2024-07-02 14:31   ` Petr Mladek
2024-06-04 13:31 ` [PATCH printk v2 00/18] add threaded printing + the rest Juri Lelli
2024-06-05  8:09   ` John Ogness
2024-06-05  9:32     ` Juri Lelli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).