public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH printk v8 00/35] wire up write_atomic() printing
@ 2024-08-20  6:29 John Ogness
  2024-08-20  6:29 ` [PATCH printk v8 01/35] printk: Add notation to console_srcu locking John Ogness
                   ` (35 more replies)
  0 siblings, 36 replies; 84+ messages in thread
From: John Ogness @ 2024-08-20  6:29 UTC (permalink / raw)
  To: Petr Mladek
  Cc: Sergey Senozhatsky, Steven Rostedt, Thomas Gleixner, linux-kernel,
	Miguel Ojeda, Paul E. McKenney, Greg Kroah-Hartman, Jiri Slaby,
	linux-serial, Russell King, Tony Lindgren, Andy Shevchenko,
	Geert Uytterhoeven, Arnd Bergmann, Uwe Kleine-König,
	Théo Lebrun, Linus Walleij, Lino Sanfilippo,
	Ilpo Järvinen, Konrad Dybcio, Sebastian Andrzej Siewior,
	Andrew Morton, Jani Nikula, Ryo Takakura, Uros Bizjak,
	Joel Granados, Lukas Wunner, Feng Tang, Baoquan He,
	Frederic Weisbecker, Neeraj Upadhyay, Joel Fernandes,
	Josh Triplett, Boqun Feng, Uladzislau Rezki, Mathieu Desnoyers,
	Lai Jiangshan, Zqiang, rcu, Peter Zijlstra, Ingo Molnar,
	Will Deacon, Waiman Long

Hi,

This is v8 of a series to wire up the nbcon consoles so that
they actually perform printing using their write_atomic()
callback. v7 is here [0]. For information about the motivation
of the atomic consoles, please read the cover letter of v1 [1].

The main focus of this series:

- For nbcon consoles, always call write_atomic() directly from
  printk() caller context for the panic CPU.

- For nbcon consoles, call write_atomic() when unlocking the
  console lock.

- Only perform the console lock/unlock dance if legacy or boot
  consoles are registered.

- For legacy consoles, if nbcon consoles are registered, do not
  attempt to print from printk() caller context for the panic
  CPU until nbcon consoles have had a chance to print the most
  significant messages.

- Mark emergency sections. In these sections, every printk()
  call will attempt to directly flush to the consoles using the
  EMERGENCY priority.

This series does _not_ include threaded printing or nbcon
drivers. Those features will be added in separate follow-up
series.

The changes since v7:

- Change printk_get_console_flush_type() to set preferred flush
  types.

- Change printk_get_console_flush_type() to also check for
  legacy consoles before seting @legacy_direct.

- Change vprintk_emit() to hack the struct console_flush_type
  for LOGLEVEL_SCHED rather than using local variables.

- Change console_cpu_notify() to also flush nbcon atomic
  consoles.

- Remove unnecessary flush type check in
  nbcon_atomic_flush_pending_con(). It is not needed until the
  threaded series.

- Fix compiling issues related to @legacy_allow_panic_sync for
  !CONFIG_PRINTK.

John Ogness

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

John Ogness (30):
  printk: Add notation to console_srcu locking
  printk: nbcon: Consolidate alloc() and init()
  printk: nbcon: Clarify rules of the owner/waiter matching
  printk: nbcon: Remove return value for write_atomic()
  printk: nbcon: Add detailed doc for write_atomic()
  printk: nbcon: Add callbacks to synchronize with driver
  printk: nbcon: Use driver synchronization while (un)registering
  serial: core: Provide low-level functions to lock port
  serial: core: Introduce wrapper to set @uart_port->cons
  console: Improve console_srcu_read_flags() comments
  nbcon: Add API to acquire context for non-printing operations
  serial: core: Acquire nbcon context in port->lock wrapper
  printk: nbcon: Do not rely on proxy headers
  printk: Make console_is_usable() available to nbcon.c
  printk: Let console_is_usable() handle nbcon
  printk: Add @flags argument for console_is_usable()
  printk: nbcon: Add helper to assign priority based on CPU state
  printk: Track registered boot consoles
  printk: nbcon: Use nbcon consoles in console_flush_all()
  printk: Add is_printk_legacy_deferred()
  printk: nbcon: Flush new records on device_release()
  printk: Flush nbcon consoles first on panic
  printk: nbcon: Add unsafe flushing on panic
  printk: Avoid console_lock dance if no legacy or boot consoles
  printk: Track nbcon consoles
  printk: Coordinate direct printing in panic
  printk: Add helper for flush type logic
  panic: Mark emergency section in oops
  rcu: Mark emergency sections in rcu stalls
  lockdep: Mark emergency sections in lockdep splats

Petr Mladek (1):
  printk: Properly deal with nbcon consoles on seq init

Sebastian Andrzej Siewior (1):
  printk: Check printk_deferred_enter()/_exit() usage

Thomas Gleixner (3):
  printk: nbcon: Provide function to flush using write_atomic()
  printk: nbcon: Implement emergency sections
  panic: Mark emergency section in warn

 drivers/tty/serial/8250/8250_core.c |   6 +-
 drivers/tty/serial/amba-pl011.c     |   2 +-
 drivers/tty/serial/serial_core.c    |  16 +-
 include/linux/console.h             | 110 +++++-
 include/linux/printk.h              |  33 +-
 include/linux/serial_core.h         | 117 +++++-
 kernel/locking/lockdep.c            |  83 ++++-
 kernel/panic.c                      |   9 +
 kernel/printk/internal.h            | 137 ++++++-
 kernel/printk/nbcon.c               | 556 +++++++++++++++++++++++++---
 kernel/printk/printk.c              | 251 ++++++++++---
 kernel/printk/printk_ringbuffer.h   |   2 +
 kernel/printk/printk_safe.c         |  23 +-
 kernel/rcu/tree_exp.h               |   7 +
 kernel/rcu/tree_stall.h             |   9 +
 15 files changed, 1210 insertions(+), 151 deletions(-)


base-commit: bcc954c6caba01fca143162d5fbb90e46aa1ad80
-- 
2.39.2


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

end of thread, other threads:[~2024-09-09 17:28 UTC | newest]

Thread overview: 84+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-20  6:29 [PATCH printk v8 00/35] wire up write_atomic() printing John Ogness
2024-08-20  6:29 ` [PATCH printk v8 01/35] printk: Add notation to console_srcu locking John Ogness
2024-08-20 17:49   ` Paul E. McKenney
2024-09-09 17:28   ` [tip: sched/rt] " tip-bot2 for John Ogness
2024-08-20  6:29 ` [PATCH printk v8 02/35] printk: nbcon: Consolidate alloc() and init() John Ogness
2024-09-09 17:27   ` [tip: sched/rt] " tip-bot2 for John Ogness
2024-08-20  6:29 ` [PATCH printk v8 03/35] printk: Properly deal with nbcon consoles on seq init John Ogness
2024-09-09 17:27   ` [tip: sched/rt] " tip-bot2 for Petr Mladek
2024-08-20  6:29 ` [PATCH printk v8 04/35] printk: Check printk_deferred_enter()/_exit() usage John Ogness
2024-09-09 17:27   ` [tip: sched/rt] " tip-bot2 for Sebastian Andrzej Siewior
2024-08-20  6:29 ` [PATCH printk v8 05/35] printk: nbcon: Clarify rules of the owner/waiter matching John Ogness
2024-09-09 17:27   ` [tip: sched/rt] " tip-bot2 for John Ogness
2024-08-20  6:29 ` [PATCH printk v8 06/35] printk: nbcon: Remove return value for write_atomic() John Ogness
2024-09-09 17:27   ` [tip: sched/rt] " tip-bot2 for John Ogness
2024-08-20  6:29 ` [PATCH printk v8 07/35] printk: nbcon: Add detailed doc " John Ogness
2024-09-09 17:27   ` [tip: sched/rt] " tip-bot2 for John Ogness
2024-08-20  6:29 ` [PATCH printk v8 08/35] printk: nbcon: Add callbacks to synchronize with driver John Ogness
2024-09-09 17:27   ` [tip: sched/rt] " tip-bot2 for John Ogness
2024-08-20  6:29 ` [PATCH printk v8 09/35] printk: nbcon: Use driver synchronization while (un)registering John Ogness
2024-09-09 17:27   ` [tip: sched/rt] " tip-bot2 for John Ogness
2024-08-20  6:29 ` [PATCH printk v8 10/35] serial: core: Provide low-level functions to lock port John Ogness
2024-09-09 17:27   ` [tip: sched/rt] " tip-bot2 for John Ogness
2024-08-20  6:29 ` [PATCH printk v8 11/35] serial: core: Introduce wrapper to set @uart_port->cons John Ogness
2024-08-20 11:12   ` Ilpo Järvinen
2024-09-09 17:27   ` [tip: sched/rt] " tip-bot2 for John Ogness
2024-08-20  6:29 ` [PATCH printk v8 12/35] console: Improve console_srcu_read_flags() comments John Ogness
2024-09-09 17:27   ` [tip: sched/rt] " tip-bot2 for John Ogness
2024-08-20  6:29 ` [PATCH printk v8 13/35] nbcon: Add API to acquire context for non-printing operations John Ogness
2024-09-09 17:27   ` [tip: sched/rt] " tip-bot2 for John Ogness
2024-08-20  6:29 ` [PATCH printk v8 14/35] serial: core: Acquire nbcon context in port->lock wrapper John Ogness
2024-09-09 17:27   ` [tip: sched/rt] " tip-bot2 for John Ogness
2024-08-20  6:29 ` [PATCH printk v8 15/35] printk: nbcon: Do not rely on proxy headers John Ogness
2024-09-09 17:27   ` [tip: sched/rt] " tip-bot2 for John Ogness
2024-08-20  6:29 ` [PATCH printk v8 16/35] printk: Make console_is_usable() available to nbcon.c John Ogness
2024-09-09 17:27   ` [tip: sched/rt] " tip-bot2 for John Ogness
2024-08-20  6:29 ` [PATCH printk v8 17/35] printk: Let console_is_usable() handle nbcon John Ogness
2024-09-09 17:27   ` [tip: sched/rt] " tip-bot2 for John Ogness
2024-08-20  6:29 ` [PATCH printk v8 18/35] printk: Add @flags argument for console_is_usable() John Ogness
2024-09-09 17:27   ` [tip: sched/rt] " tip-bot2 for John Ogness
2024-08-20  6:29 ` [PATCH printk v8 19/35] printk: nbcon: Add helper to assign priority based on CPU state John Ogness
2024-09-09 17:27   ` [tip: sched/rt] " tip-bot2 for John Ogness
2024-08-20  6:29 ` [PATCH printk v8 20/35] printk: nbcon: Provide function to flush using write_atomic() John Ogness
2024-09-09 17:27   ` [tip: sched/rt] " tip-bot2 for Thomas Gleixner
2024-08-20  6:29 ` [PATCH printk v8 21/35] printk: Track registered boot consoles John Ogness
2024-09-09 17:27   ` [tip: sched/rt] " tip-bot2 for John Ogness
2024-08-20  6:29 ` [PATCH printk v8 22/35] printk: nbcon: Use nbcon consoles in console_flush_all() John Ogness
2024-09-09 17:27   ` [tip: sched/rt] " tip-bot2 for John Ogness
2024-08-20  6:29 ` [PATCH printk v8 23/35] printk: Add is_printk_legacy_deferred() John Ogness
2024-09-09 17:27   ` [tip: sched/rt] " tip-bot2 for John Ogness
2024-08-20  6:29 ` [PATCH printk v8 24/35] printk: nbcon: Flush new records on device_release() John Ogness
2024-09-09 17:27   ` [tip: sched/rt] " tip-bot2 for John Ogness
2024-08-20  6:29 ` [PATCH printk v8 25/35] printk: Flush nbcon consoles first on panic John Ogness
2024-09-09 17:27   ` [tip: sched/rt] " tip-bot2 for John Ogness
2024-08-20  6:29 ` [PATCH printk v8 26/35] printk: nbcon: Add unsafe flushing " John Ogness
2024-09-09 17:27   ` [tip: sched/rt] " tip-bot2 for John Ogness
2024-08-20  6:29 ` [PATCH printk v8 27/35] printk: Avoid console_lock dance if no legacy or boot consoles John Ogness
2024-09-09 17:27   ` [tip: sched/rt] " tip-bot2 for John Ogness
2024-08-20  6:29 ` [PATCH printk v8 28/35] printk: Track nbcon consoles John Ogness
2024-09-09 17:27   ` [tip: sched/rt] " tip-bot2 for John Ogness
2024-08-20  6:29 ` [PATCH printk v8 29/35] printk: Coordinate direct printing in panic John Ogness
2024-08-20 15:21   ` Petr Mladek
2024-09-09 17:27   ` [tip: sched/rt] " tip-bot2 for John Ogness
2024-08-20  6:29 ` [PATCH printk v8 30/35] printk: Add helper for flush type logic John Ogness
2024-08-21  9:11   ` Petr Mladek
2024-08-23  5:25     ` John Ogness
2024-09-09 17:27   ` [tip: sched/rt] " tip-bot2 for John Ogness
2024-08-20  6:29 ` [PATCH printk v8 31/35] printk: nbcon: Implement emergency sections John Ogness
2024-08-27 14:19   ` John Ogness
2024-09-04 10:34     ` Petr Mladek
2024-09-09 17:27     ` [tip: sched/rt] printk: nbcon: Use raw_cpu_ptr() instead of open coding tip-bot2 for John Ogness
2024-09-09 17:27   ` [tip: sched/rt] printk: nbcon: Implement emergency sections tip-bot2 for Thomas Gleixner
2024-08-20  6:29 ` [PATCH printk v8 32/35] panic: Mark emergency section in warn John Ogness
2024-09-09 17:27   ` [tip: sched/rt] " tip-bot2 for Thomas Gleixner
2024-08-20  6:29 ` [PATCH printk v8 33/35] panic: Mark emergency section in oops John Ogness
2024-09-09 17:27   ` [tip: sched/rt] " tip-bot2 for John Ogness
2024-08-20  6:30 ` [PATCH printk v8 34/35] rcu: Mark emergency sections in rcu stalls John Ogness
2024-08-20 17:48   ` Paul E. McKenney
2024-09-09 17:27   ` [tip: sched/rt] " tip-bot2 for John Ogness
2024-08-20  6:30 ` [PATCH printk v8 35/35] lockdep: Mark emergency sections in lockdep splats John Ogness
2024-09-09 17:27   ` [tip: sched/rt] " tip-bot2 for John Ogness
2024-08-21  9:21 ` [PATCH printk v8 00/35] wire up write_atomic() printing Petr Mladek
2024-08-21  9:28   ` Sebastian Andrzej Siewior
2024-08-21 14:09     ` Petr Mladek
2024-08-21 14:20       ` Sebastian Andrzej Siewior

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