public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Denys Vlasenko <dvlasenk@redhat.com>,
	linux-kernel@vger.kernel.org, srostedt@redhat.com,
	Tejun Heo <tj@kernel.org>,
	Peter Hurley <peter@hurleysoftware.com>, Jan Kara <jack@suse.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Kyle McMartin <kyle@kernel.org>,
	KY Srinivasan <kys@microsoft.com>,
	Dave Jones <davej@codemonkey.org.uk>,
	Calvin Owens <calvinowens@fb.com>
Subject: Re: [PATCH] printk: avoid livelock if another CPU printks continuously
Date: Thu, 11 Feb 2016 12:47:10 +0100	[thread overview]
Message-ID: <20160211114710.GK3305@pathway.suse.cz> (raw)
In-Reply-To: <20160211082112.GC895@swordfish>

On Thu 2016-02-11 17:21:12, Sergey Senozhatsky wrote:
> Hello,
> Thanks for Cc-ing, and sorry for long reply, I'm traveling now.
> 
> On (02/10/16 11:25), Steven Rostedt wrote:
> > On Wed, 10 Feb 2016 17:10:16 +0100
> > Petr Mladek <pmladek@suse.com> wrote:
> > 
> > > > Note, it's not that performance critical, and the loop only happens if
> > > > someone else is adding to the console, which hopefully, should be rare.  
> > > 
> > > I probably used too strong words. It is possible that the performance
> > > impact will not be critical. But the behavior is non-deterministic.
> > > I think that the approach taken by Jack is more promising.
> > > I mean the offloading of the console stuff to a workqueue.
> > 
> > My worry about that is that it never comes out. The point about printk,
> > is that it should pretty much be guaranteed to print. If the system is
> > dying, and we push it off to a work queue, and that workqueue never
> > runs, then we lose critical data.
> 
> correct, IIRC Jan agreed to switch to 'direct' (current behaviour) printk when
> one of the CPUs calls panic() (we still can use that approach even with
> workqueue based printk)
> 	http://marc.info/?l=linux-kernel&m=145200464309562

Yup.

> the other thing with workqueues based approach is that all of them can be 'blocked'
> in some OOM cases, so sort of fallback mechanism is also needed here
> 	http://marc.info/?l=linux-kernel&m=145251885502488

If this proves to be a problem. We could always use a workqueue with a
rescue worker.

Regarding the patch from Pan Xinhui. My main problem with it is that
it adds many handshakes and twists to the already complicated printk
code. Also it does not solve the problem if the flood of messages
comes entirely from an IRQ context.

Workqueues code is not trivial but mature. And the usage of the workqueues
in printk is quite straightforward.

Best Regards,
Petr

      reply	other threads:[~2016-02-11 11:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-08 20:35 [PATCH] printk: avoid livelock if another CPU printks continuously Denys Vlasenko
2016-02-08 21:11 ` Steven Rostedt
2016-02-09 14:59   ` Denys Vlasenko
2016-02-09 15:17     ` Steven Rostedt
2016-02-09 15:24       ` Denys Vlasenko
2016-02-09 15:50         ` Steven Rostedt
2016-02-09 16:07           ` Denys Vlasenko
2016-02-09 16:33             ` Steven Rostedt
2016-02-09 16:41           ` Denys Vlasenko
2016-02-09 16:57             ` Steven Rostedt
2016-02-10 14:44 ` Petr Mladek
2016-02-10 16:10   ` Petr Mladek
2016-02-10 16:25     ` Steven Rostedt
2016-02-10 16:50       ` Peter Hurley
2016-02-11  8:21       ` Sergey Senozhatsky
2016-02-11 11:47         ` Petr Mladek [this message]

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=20160211114710.GK3305@pathway.suse.cz \
    --to=pmladek@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=calvinowens@fb.com \
    --cc=davej@codemonkey.org.uk \
    --cc=dvlasenk@redhat.com \
    --cc=jack@suse.com \
    --cc=kyle@kernel.org \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter@hurleysoftware.com \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=srostedt@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox