All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Petr Mladek <pmladek@suse.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Jan Kara <jack@suse.cz>, Tejun Heo <tj@kernel.org>,
	Calvin Owens <calvinowens@fb.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Mel Gorman <mgorman@techsingularity.net>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org,
	Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Subject: Re: [RFC][PATCHv3 0/6] printk: use printk_safe to handle printk() recursive calls
Date: Wed, 19 Oct 2016 15:34:19 +0200	[thread overview]
Message-ID: <20161019133419.GO3102@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20161019131836.GF11071@pathway.suse.cz>

On Wed, Oct 19, 2016 at 03:18:36PM +0200, Petr Mladek wrote:
> On Tue 2016-10-18 19:07:54, Peter Zijlstra wrote:

> > The entire class of deadlocks you've missed is that console->write() is
> > a piece of crap too ;-) Even the bog standard 8250 serial console driver
> > can do wakeups.
> 
> I wonder if all the hard problems are actually related to the console
> handling.
> 
> There are problems with the single logbuffer but these should get
> eliminated by the NMI/safe temporary per-CPU buffers.
> 
> All might be easier if we always offload the console handling
> into a kthread or so and trigger it via the minimalist
> irq_work. It would kill huge bunch of possible deadlocks.
> It will even allow to get rid of printk_deferred() and
> the uncertainty where it is needed.
> 
> The penalty would be "slightly" delayed console output. But is
> it a real problem? It should not be a big deal when everything works.
> We could always try hard when panicking. And there always
> might be a fallback with that direct early_console().

Right, so I've had to debug quite a few situations where that 'later'
simply never happens...

I agree that such a scenario is basically all the regular console
drivers are capable of though.

It might make sense to go there, but allow early_console to print on the
go, keeping synchronous output available. We would still need the logbuf
to become NMI safe wrt adding entries though.

It would however place hard requirements of early_console
implementations; already violated by for instance the USB3-debug-port
implementation I just looked at:

  lkml.kernel.org/r/20161019130943.GA3175@twins.programming.kicks-ass.net

  reply	other threads:[~2016-10-19 14:21 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-18 15:40 [RFC][PATCHv3 0/6] printk: use printk_safe to handle printk() recursive calls Sergey Senozhatsky
2016-10-18 15:40 ` [RFC][PATCHv3 1/6] printk: use vprintk_func in vprintk() Sergey Senozhatsky
2016-10-18 16:49   ` Steven Rostedt
2016-10-19  1:54     ` Sergey Senozhatsky
2016-10-18 15:40 ` [RFC][PATCHv3 2/6] printk: rename nmi.c and exported api Sergey Senozhatsky
2016-10-18 16:49   ` Steven Rostedt
2016-10-19  1:54     ` Sergey Senozhatsky
2016-10-18 15:40 ` [RFC][PATCHv3 3/6] printk: introduce per-cpu safe_print seq buffer Sergey Senozhatsky
2016-10-18 16:46   ` Steven Rostedt
2016-10-19  1:10     ` Sergey Senozhatsky
2016-10-19 13:42   ` Sergey Senozhatsky
2016-10-18 15:40 ` [RFC][PATCHv3 4/6] printk: report lost messages in printk safe/nmi contexts Sergey Senozhatsky
2016-10-18 15:40 ` [RFC][PATCHv3 5/6] printk: use printk_safe buffers Sergey Senozhatsky
2016-10-18 15:40 ` [RFC][PATCHv3 6/6] printk: remove zap_locks() function Sergey Senozhatsky
2016-10-18 16:45 ` [RFC][PATCHv3 0/6] printk: use printk_safe to handle printk() recursive calls Joe Perches
2016-10-19  1:14   ` Sergey Senozhatsky
2016-10-18 17:07 ` Peter Zijlstra
2016-10-19  1:53   ` Sergey Senozhatsky
2016-10-19  9:30     ` Peter Zijlstra
2016-10-19 13:18   ` Petr Mladek
2016-10-19 13:34     ` Peter Zijlstra [this message]
2016-10-20 13:18       ` Sergey Senozhatsky
2016-10-19  4:33 ` 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=20161019133419.GO3102@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=calvinowens@fb.com \
    --cc=jack@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@techsingularity.net \
    --cc=mingo@redhat.com \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky.work@gmail.com \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.