From: John Ogness <john.ogness@linutronix.de>
To: Petr Mladek <pmladek@suse.com>
Cc: "Alexey Kardashevskiy" <aik@ozlabs.ru>,
"Alexei Starovoitov" <ast@kernel.org>,
"Chris Wilson" <chris@chris-wilson.co.uk>,
"Wolfram Sang (Renesas)" <wsa+renesas@sang-engineering.com>,
"Paul Mackerras" <paulus@samba.org>,
"Tiezhu Yang" <yangtiezhu@loongson.cn>,
"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>,
linux-arm-kernel@lists.infradead.org,
"Sami Tolvanen" <samitolvanen@google.com>,
"Valentin Schneider" <valentin.schneider@arm.com>,
"Kees Cook" <keescook@chromium.org>,
"Paul E. McKenney" <paulmck@kernel.org>,
"Anshuman Khandual" <anshuman.khandual@arm.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>,
kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
"Pekka Enberg" <penberg@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 v3 0/6] printk: remove safe buffers
Date: Thu, 24 Jun 2021 13:17:42 +0206 [thread overview]
Message-ID: <20210624111148.5190-1-john.ogness@linutronix.de> (raw)
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
next reply other threads:[~2021-06-24 11:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-24 11:11 John Ogness [this message]
2021-06-24 11:11 ` [PATCH printk v3 3/6] printk: remove safe buffers 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)
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=20210624111148.5190-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=ast@kernel.org \
--cc=chris@chris-wilson.co.uk \
--cc=clg@kaod.org \
--cc=ebiederm@xmission.com \
--cc=frederic@kernel.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=linuxppc-dev@lists.ozlabs.org \
--cc=masahiroy@kernel.org \
--cc=maz@kernel.org \
--cc=mingo@redhat.com \
--cc=nathan@kernel.org \
--cc=npiggin@gmail.com \
--cc=paulmck@kernel.org \
--cc=paulus@samba.org \
--cc=penberg@kernel.org \
--cc=peterz@infradead.org \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=rppt@kernel.org \
--cc=samitolvanen@google.com \
--cc=senozhatsky@chromium.org \
--cc=terrelln@fb.com \
--cc=tglx@linutronix.de \
--cc=valentin.schneider@arm.com \
--cc=vbabka@suse.cz \
--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).