From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
To: Petr Mladek <pmladek@suse.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
Peter Zijlstra <peterz@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org,
Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Subject: Re: [RFC][PATCH] printk: do not call console drivers from printk_safe context
Date: Thu, 26 Apr 2018 10:44:18 +0900 [thread overview]
Message-ID: <20180426014418.GB3282@jagdpanzerIV> (raw)
In-Reply-To: <20180425144813.lfhvuwsf2cebwarm@pathway.suse.cz>
On (04/25/18 16:48), Petr Mladek wrote:
[..]
>
> The above paragraph is not easy to understand. I wonder if the
> following might be more clear:
>
> "Calling console drivers from printk_safe() context does not really
> make call_console_drivers() any safer. They are never called
> recursively thanks to console_trylock() in vprintk_emit()."
Yes, looks good.
[..]
> Unfortunately printk_safe context helps only when console_unlock() is
> called with IRQs disabled. Otherwise, the per-CPU buffer is flushed
> in every for(;;) cycle.
Right. I thought about it. If console_unlock() is called with IRQs
disabled then we postpone flush until we return from console_unlock()
and enable local IRQs. But then we have printk_safe() flush, which
uses printk_deferred() -> queue irq_work -> irq work -> console_unlock(),
so quite likely we still print out printk_safe() buffer from atomic
context (from irq in this case).
> So I agree that printk_safe context does not help much. And I fine
> with this patch.
Thanks.
-ss
next prev parent reply other threads:[~2018-04-26 1:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-24 2:28 [RFC][PATCH] printk: do not call console drivers from printk_safe context Sergey Senozhatsky
2018-04-24 14:51 ` Steven Rostedt
2018-04-25 1:59 ` Sergey Senozhatsky
2018-04-25 14:48 ` Petr Mladek
2018-04-26 1:44 ` Sergey Senozhatsky [this message]
2018-06-18 6:39 ` Sergey Senozhatsky
2018-06-18 9:59 ` Petr Mladek
2018-06-18 10:10 ` Sergey Senozhatsky
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=20180426014418.GB3282@jagdpanzerIV \
--to=sergey.senozhatsky.work@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=sergey.senozhatsky@gmail.com \
/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