From: Sergey Senozhatsky <senozhatsky@chromium•org>
To: John Ogness <john.ogness@linutronix•de>
Cc: "Rafael Aquini" <aquini@redhat•com>,
"Peter Zijlstra" <peterz@infradead•org>,
"Paul Mackerras" <paulus@samba•org>,
"Tiezhu Yang" <yangtiezhu@loongson•cn>,
"Alexey Kardashevskiy" <aik@ozlabs•ru>,
"Yue Hu" <huyue2@yulong•com>,
"Jordan Niethe" <jniethe5@gmail•com>,
"Petr Mladek" <pmladek@suse•com>,
"Kees Cook" <keescook@chromium•org>,
"Paul E. McKenney" <paulmck@kernel•org>,
"Alistair Popple" <alistair@popple•id.au>,
"Guilherme G. Piccoli" <gpiccoli@canonical•com>,
"Nicholas Piggin" <npiggin@gmail•com>,
"Steven Rostedt" <rostedt@goodmis•org>,
"Thomas Gleixner" <tglx@linutronix•de>,
kexec@lists•infradead.org, linux-kernel@vger•kernel.org,
"Eric Biederman" <ebiederm@xmission•com>,
"Andrew Morton" <akpm@linux-foundation•org>,
linuxppc-dev@lists•ozlabs.org, "Cédric Le Goater" <clg@kaod•org>
Subject: Re: [PATCH next v1 2/3] printk: remove safe buffers
Date: Sun, 21 Mar 2021 14:26:10 +0900 [thread overview]
Message-ID: <YFbY8kF7ilYoxvYp@google.com> (raw)
In-Reply-To: <20210316233326.10778-3-john.ogness@linutronix.de>
On (21/03/17 00:33), John Ogness wrote:
[..]
> void printk_nmi_direct_enter(void)
> {
> @@ -324,27 +44,8 @@ void printk_nmi_direct_exit(void)
> this_cpu_and(printk_context, ~PRINTK_NMI_DIRECT_CONTEXT_MASK);
> }
>
> -#else
> -
> -static __printf(1, 0) int vprintk_nmi(const char *fmt, va_list args)
> -{
> - return 0;
> -}
> -
> #endif /* CONFIG_PRINTK_NMI */
>
> -/*
> - * Lock-less printk(), to avoid deadlocks should the printk() recurse
> - * into itself. It uses a per-CPU buffer to store the message, just like
> - * NMI.
> - */
> -static __printf(1, 0) int vprintk_safe(const char *fmt, va_list args)
> -{
> - struct printk_safe_seq_buf *s = this_cpu_ptr(&safe_print_seq);
> -
> - return printk_safe_log_store(s, fmt, args);
> -}
> -
> /* Can be preempted by NMI. */
> void __printk_safe_enter(void)
> {
> @@ -369,7 +70,10 @@ __printf(1, 0) int vprintk_func(const char *fmt, va_list args)
> * Use the main logbuf even in NMI. But avoid calling console
> * drivers that might have their own locks.
> */
> - if ((this_cpu_read(printk_context) & PRINTK_NMI_DIRECT_CONTEXT_MASK)) {
> + if (this_cpu_read(printk_context) &
> + (PRINTK_NMI_DIRECT_CONTEXT_MASK |
> + PRINTK_NMI_CONTEXT_MASK |
> + PRINTK_SAFE_CONTEXT_MASK)) {
Do we need printk_nmi_direct_enter/exit() and PRINTK_NMI_DIRECT_CONTEXT_MASK?
Seems like all printk_safe() paths are now DIRECT - we store messages to the
prb, but don't call console drivers.
-ss
next prev parent reply other threads:[~2021-03-21 11:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-16 23:33 [PATCH next v1 0/3] printk: remove safe buffers John Ogness
2021-03-16 23:33 ` [PATCH next v1 2/3] " John Ogness
2021-03-21 5:26 ` Sergey Senozhatsky [this message]
2021-03-22 11:16 ` John Ogness
2021-03-22 18:02 ` Petr Mladek
2021-03-22 21:58 ` John Ogness
2021-03-23 9:46 ` Petr Mladek
2021-03-23 10:47 ` Petr Mladek
2021-03-26 11:12 ` John Ogness
2021-03-29 10:04 ` Petr Mladek
2021-03-29 15:10 ` John Ogness
2021-03-29 15:13 ` John Ogness
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=YFbY8kF7ilYoxvYp@google.com \
--to=senozhatsky@chromium$(echo .)org \
--cc=aik@ozlabs$(echo .)ru \
--cc=akpm@linux-foundation$(echo .)org \
--cc=alistair@popple$(echo .)id.au \
--cc=aquini@redhat$(echo .)com \
--cc=clg@kaod$(echo .)org \
--cc=ebiederm@xmission$(echo .)com \
--cc=gpiccoli@canonical$(echo .)com \
--cc=huyue2@yulong$(echo .)com \
--cc=jniethe5@gmail$(echo .)com \
--cc=john.ogness@linutronix$(echo .)de \
--cc=keescook@chromium$(echo .)org \
--cc=kexec@lists$(echo .)infradead.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
--cc=npiggin@gmail$(echo .)com \
--cc=paulmck@kernel$(echo .)org \
--cc=paulus@samba$(echo .)org \
--cc=peterz@infradead$(echo .)org \
--cc=pmladek@suse$(echo .)com \
--cc=rostedt@goodmis$(echo .)org \
--cc=tglx@linutronix$(echo .)de \
--cc=yangtiezhu@loongson$(echo .)cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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