From: Petr Mladek <pmladek@suse.com>
To: Denys Vlasenko <dvlasenk@redhat.com>
Cc: linux-kernel@vger.kernel.org, srostedt@redhat.com,
Steven Rostedt <rostedt@goodmis.org>, Tejun Heo <tj@kernel.org>,
Peter Hurley <peter@hurleysoftware.com>, Jan Kara <jack@suse.com>,
Sergey Senozhatsky <sergey.senozhatsky@gmail.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: Wed, 10 Feb 2016 17:10:16 +0100 [thread overview]
Message-ID: <20160210161016.GF12548@pathway.suse.cz> (raw)
In-Reply-To: <20160210144416.GE12548@pathway.suse.cz>
On Wed 2016-02-10 09:44:07, Steven Rostedt wrote:
> On Wed, 10 Feb 2016 15:36:49 +0100
> Petr Mladek <pmladek@suse.com> wrote:
>
> > Bcc:
> > Subject: Re: [PATCH] printk: avoid livelock if another CPU printks
> > continuously
> > Reply-To:
> > In-Reply-To: <1454963703-20433-1-git-send-email-dvlasenk@redhat.com>
> >
>
> Hmm, playing with mail headers?
Yeah. I am trying to do this reply back in the original thread.
> > > + /* Good, other CPU entered "for(;;)" loop */
> > > + goto out;
> > > + }
> > > + }
> > > + /* No one seems to be willing to take it... */
> > > + if (console_trylock())
> > > + goto again; /* we took it */
> > > + /* Nope, someone else holds console_sem! Good */
> >
> > The cycle gives a big chance other CPUs to enter console_unlock().
> > It means that more CPUs might end up in the above busy cycle.
> >
> > It gives a chance to move the printing to another CPU. It likely
> > slows down the flood of messages because the producer end up
> > here as well.
> >
> > So, it probably works but the performance is far from optimal.
> > Many CPUs might end up doing nothing. I am afraid that this is
> > not the right way to go.
>
> 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.
Best Regards,
Petr
next prev parent reply other threads:[~2016-02-10 16:10 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 [this message]
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
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=20160210161016.GF12548@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