linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH printk v3 0/6] printk: remove safe buffers
@ 2021-06-24 11:11 John Ogness
  2021-06-24 11:11 ` [PATCH printk v3 3/6] " John Ogness
  2021-06-24 11:11 ` [PATCH printk v3 4/6] printk: remove NMI tracking John Ogness
  0 siblings, 2 replies; 8+ messages in thread
From: John Ogness @ 2021-06-24 11:11 UTC (permalink / raw)
  To: Petr Mladek
  Cc: Alexey Kardashevskiy, Alexei Starovoitov, Chris Wilson,
	Wolfram Sang (Renesas), Paul Mackerras, Tiezhu Yang, Marc Zyngier,
	Masahiro Yamada, Russell King, Peter Zijlstra, Yue Hu,
	Ingo Molnar, linux-arm-kernel, Sami Tolvanen, Valentin Schneider,
	Kees Cook, Paul E. McKenney, Anshuman Khandual,
	Frederic Weisbecker, Nicholas Piggin, Nathan Chancellor,
	Nick Terrell, Steven Rostedt, Thomas Gleixner, Vlastimil Babka,
	kexec, linux-kernel, Pekka Enberg, Sergey Senozhatsky,
	Eric Biederman, Andrew Morton, linuxppc-dev, Mike Rapoport,
	Cédric Le Goater

Hi,

Here is v3 of a series to remove the safe buffers. v2 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_cpu_lock.

And finally, 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 config option CONFIG_PRINTK_NMI).

Changes since v2:

- Move irq disabling/enabling out of the
  console_lock_spinning_*() functions to simplify the patches
  keep the function prototypes simple.

- Change printk_enter_irqsave()/printk_exit_irqrestore() to
  macros to allow a more common calling convention for irq
  flags.

- Use the counter pointer from printk_enter_irqsave() in
  printk_exit_irqrestore() rather than fetching it again. This
  avoids any possible race conditions when printk's percpu
  flag is set.

- Use the printk_cpu_lock to serialize banner and regs with
  the stack dump in nmi_cpu_backtrace().

John Ogness

[0] https://lore.kernel.org/lkml/20210330153512.1182-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          |   2 -
 arch/powerpc/kernel/traps.c    |   1 -
 arch/powerpc/kernel/watchdog.c |   5 -
 arch/powerpc/kexec/crash.c     |   3 -
 include/linux/hardirq.h        |   2 -
 include/linux/printk.h         |  22 --
 init/Kconfig                   |   5 -
 kernel/kexec_core.c            |   1 -
 kernel/panic.c                 |   3 -
 kernel/printk/internal.h       |  23 ---
 kernel/printk/printk.c         | 273 +++++++++++++++----------
 kernel/printk/printk_safe.c    | 361 +--------------------------------
 kernel/trace/trace.c           |   2 -
 lib/nmi_backtrace.c            |  13 +-
 14 files changed, 176 insertions(+), 540 deletions(-)


base-commit: 48e72544d6f06daedbf1d9b14610be89dba67526
-- 
2.20.1


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

end of thread, other threads:[~2021-06-25 13:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-24 11:11 [PATCH printk v3 0/6] printk: remove safe buffers John Ogness
2021-06-24 11:11 ` [PATCH printk v3 3/6] " John Ogness
2021-06-24 14:49   ` Petr Mladek
2021-06-24 15:35     ` John Ogness
2021-06-25 12:41       ` Petr Mladek
2021-06-24 11:11 ` [PATCH printk v3 4/6] printk: remove NMI tracking John Ogness
2021-06-25 12:36   ` Petr Mladek
2021-06-25 13:34     ` Russell King (Oracle)

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