All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH printk v4 0/6] printk: remove safe buffers
@ 2021-07-15 19:33 ` John Ogness
  0 siblings, 0 replies; 38+ messages in thread
From: John Ogness @ 2021-07-15 19:33 UTC (permalink / raw)
  To: Petr Mladek
  Cc: Sergey Senozhatsky, Steven Rostedt, Thomas Gleixner,
	linux-kernel, Paul E. McKenney, Michael Ellerman,
	Benjamin Herrenschmidt, Paul Mackerras, Eric Biederman,
	Nicholas Piggin, Christophe Leroy, Cédric Le Goater,
	Andrew Morton, Kees Cook, Tiezhu Yang, Alexey Kardashevskiy,
	Yue Hu, linuxppc-dev, kexec, Russell King, Ingo Molnar,
	Marc Zyngier, Valentin Schneider, Geert Uytterhoeven,
	Mike Rapoport, Wolfram Sang (Renesas),
	Anshuman Khandual, Xiongwei Song, Frederic Weisbecker,
	Peter Zijlstra, Masahiro Yamada, Nathan Chancellor,
	Nick Desaulniers, Nick Terrell, Vipin Sharma, Rasmus Villemoes,
	Daniel Borkmann, Vlastimil Babka, linux-arm-kernel

Hi,

Here is v4 of a series to remove the safe buffers. v3 can be
found here [0]. The safe buffers are no longer needed because
messages can be stored directly into the log buffer from any
context.

However, the safe buffers also provided a form of recursion
protection. For that reason, explicit recursion protection is
implemented for this series.

The safe buffers also implicitly provided serialization
between multiple CPUs executing in NMI context. This was
particularly necessary for the nmi_backtrace() output. This
serializiation is now preserved by using the printk cpulock.

With the removal of the safe buffers, there is no need for
extra NMI enter/exit tracking. So this is also removed
(which includes removing the config option CONFIG_PRINTK_NMI).

And finally, there are a few places in the kernel that need to
specify code blocks where all printk calls are to be deferred
printing. Previously the NMI tracking API was being (mis)used
for this purpose. This series introduces an official and
explicit interface for such cases. (Note that all deferred
printing will be removed anyway, once printing kthreads are
introduced.)

Changes since v3:

- Remove safe context tracking in vprintk().

- Add safe context tracking for @console_owner usage since that
  is also a component of the printing code.

- Refactor syslog_print() so that it is easier to understand
  and follow the locking logic.

- Introduce printk_deferred_enter/exit functions to be used by
  code that needs to specify code block where all printk calls
  are to be deferred printing.

John Ogness

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

John Ogness (6):
  lib/nmi_backtrace: explicitly serialize banner and regs
  printk: track/limit recursion
  printk: remove safe buffers
  printk: remove NMI tracking
  printk: convert @syslog_lock to mutex
  printk: syslog: close window between wait and read

 arch/arm/kernel/smp.c          |   4 +-
 arch/powerpc/kernel/traps.c    |   1 -
 arch/powerpc/kernel/watchdog.c |   5 -
 arch/powerpc/kexec/crash.c     |   2 +-
 include/linux/hardirq.h        |   2 -
 include/linux/printk.h         |  41 ++--
 init/Kconfig                   |   5 -
 kernel/kexec_core.c            |   1 -
 kernel/panic.c                 |   3 -
 kernel/printk/internal.h       |  25 ---
 kernel/printk/printk.c         | 268 ++++++++++++++----------
 kernel/printk/printk_safe.c    | 364 +--------------------------------
 kernel/trace/trace.c           |   4 +-
 lib/nmi_backtrace.c            |  13 +-
 14 files changed, 194 insertions(+), 544 deletions(-)


base-commit: 70333dec446292cd896cd051d2ebd6808b328949
-- 
2.20.1


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

end of thread, other threads:[~2021-09-02 16:48 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-15 19:33 [PATCH printk v4 0/6] printk: remove safe buffers John Ogness
2021-07-15 19:33 ` John Ogness
2021-07-15 19:33 ` John Ogness
2021-07-15 19:33 ` John Ogness
2021-07-15 19:33 ` [PATCH printk v4 1/6] lib/nmi_backtrace: explicitly serialize banner and regs John Ogness
2021-07-15 19:33 ` [PATCH printk v4 2/6] printk: track/limit recursion John Ogness
2021-07-15 19:33 ` [PATCH printk v4 3/6] printk: remove safe buffers John Ogness
2021-07-15 19:33   ` John Ogness
2021-07-15 19:33   ` John Ogness
2021-07-21 11:25   ` Petr Mladek
2021-07-21 11:25     ` Petr Mladek
2021-07-21 11:25     ` Petr Mladek
2021-09-02 16:48   ` Geert Uytterhoeven
2021-09-02 16:48     ` Geert Uytterhoeven
2021-09-02 16:48     ` Geert Uytterhoeven
2021-07-15 19:33 ` [PATCH printk v4 4/6] printk: remove NMI tracking John Ogness
2021-07-15 19:33   ` John Ogness
2021-07-15 19:33   ` John Ogness
2021-07-21 12:00   ` Petr Mladek
2021-07-21 12:00     ` Petr Mladek
2021-07-21 12:00     ` Petr Mladek
2021-07-21 12:46     ` John Ogness
2021-07-21 12:46       ` John Ogness
2021-07-21 12:46       ` John Ogness
2021-07-21 13:08       ` Petr Mladek
2021-07-21 13:08         ` Petr Mladek
2021-07-21 13:08         ` Petr Mladek
2021-07-21 13:23         ` John Ogness
2021-07-21 13:23           ` John Ogness
2021-07-21 13:23           ` John Ogness
2021-07-15 19:33 ` [PATCH printk v4 5/6] printk: convert @syslog_lock to mutex John Ogness
2021-07-21 12:21   ` Petr Mladek
2021-07-15 19:33 ` [PATCH printk v4 6/6] printk: syslog: close window between wait and read John Ogness
2021-07-21 12:43   ` Petr Mladek
2021-07-27  7:26 ` [PATCH printk v4 0/6] printk: remove safe buffers Petr Mladek
2021-07-27  7:26   ` Petr Mladek
2021-07-27  7:26   ` Petr Mladek
2021-07-27  7:26   ` Petr Mladek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.