linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: John Ogness <john.ogness@linutronix.de>
To: Petr Mladek <pmladek@suse.com>
Cc: "Alexey Kardashevskiy" <aik@ozlabs.ru>,
	"Rasmus Villemoes" <linux@rasmusvillemoes.dk>,
	"Wolfram Sang (Renesas)" <wsa+renesas@sang-engineering.com>,
	"Paul Mackerras" <paulus@samba.org>,
	"Tiezhu Yang" <yangtiezhu@loongson.cn>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	"Marc Zyngier" <maz@kernel.org>,
	"Masahiro Yamada" <masahiroy@kernel.org>,
	"Russell King" <linux@armlinux.org.uk>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Yue Hu" <huyue2@yulong.com>, "Ingo Molnar" <mingo@redhat.com>,
	"Geert Uytterhoeven" <geert@linux-m68k.org>,
	linux-arm-kernel@lists.infradead.org,
	"Valentin Schneider" <valentin.schneider@arm.com>,
	"Kees Cook" <keescook@chromium.org>,
	"Paul E. McKenney" <paulmck@kernel.org>,
	"Anshuman Khandual" <anshuman.khandual@arm.com>,
	"Vipin Sharma" <vipinsh@google.com>,
	"Frederic Weisbecker" <frederic@kernel.org>,
	"Nicholas Piggin" <npiggin@gmail.com>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Nick Terrell" <terrelln@fb.com>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Vlastimil Babka" <vbabka@suse.cz>,
	"Nick Desaulniers" <ndesaulniers@google.com>,
	"Xiongwei Song" <sxwjean@gmail.com>,
	kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
	"Sergey Senozhatsky" <senozhatsky@chromium.org>,
	"Eric Biederman" <ebiederm@xmission.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	linuxppc-dev@lists.ozlabs.org, "Mike Rapoport" <rppt@kernel.org>,
	"Cédric Le Goater" <clg@kaod.org>
Subject: [PATCH printk v4 0/6] printk: remove safe buffers
Date: Thu, 15 Jul 2021 21:39:53 +0206	[thread overview]
Message-ID: <20210715193359.25946-1-john.ogness@linutronix.de> (raw)

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


             reply	other threads:[~2021-07-15 19:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-15 19:33 John Ogness [this message]
2021-07-15 19:33 ` [PATCH printk v4 3/6] printk: remove safe buffers John Ogness
2021-07-21 11:25   ` Petr Mladek
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-21 12:00   ` Petr Mladek
2021-07-21 12:46     ` John Ogness
2021-07-21 13:08       ` Petr Mladek
2021-07-21 13:23         ` John Ogness
2021-07-27  7:26 ` [PATCH printk v4 0/6] printk: remove safe buffers Petr Mladek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210715193359.25946-1-john.ogness@linutronix.de \
    --to=john.ogness@linutronix.de \
    --cc=aik@ozlabs.ru \
    --cc=akpm@linux-foundation.org \
    --cc=anshuman.khandual@arm.com \
    --cc=clg@kaod.org \
    --cc=daniel@iogearbox.net \
    --cc=ebiederm@xmission.com \
    --cc=frederic@kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=huyue2@yulong.com \
    --cc=keescook@chromium.org \
    --cc=kexec@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=linux@rasmusvillemoes.dk \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=masahiroy@kernel.org \
    --cc=maz@kernel.org \
    --cc=mingo@redhat.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=npiggin@gmail.com \
    --cc=paulmck@kernel.org \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=rppt@kernel.org \
    --cc=senozhatsky@chromium.org \
    --cc=sxwjean@gmail.com \
    --cc=terrelln@fb.com \
    --cc=tglx@linutronix.de \
    --cc=valentin.schneider@arm.com \
    --cc=vbabka@suse.cz \
    --cc=vipinsh@google.com \
    --cc=wsa+renesas@sang-engineering.com \
    --cc=yangtiezhu@loongson.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).