[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180426014418.GB3282@jagdpanzerIV>
Date: Thu, 26 Apr 2018 10:44:18 +0900
From: Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
To: Petr Mladek <pmladek@...e.com>
Cc: Steven Rostedt <rostedt@...dmis.org>,
Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
Peter Zijlstra <peterz@...radead.org>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>
Subject: Re: [RFC][PATCH] printk: do not call console drivers from
printk_safe context
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
Powered by blists - more mailing lists