From: Jan Kara <jack@suse.cz>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Jan Kara <jack@suse.cz>, Thomas Gleixner <tglx@linutronix.de>,
John Stultz <john.stultz@linaro.org>, Jiri Bohac <jbohac@suse.cz>,
linux-kernel@vger.kernel.org
Subject: Re: is printk() safe within a timekeeper_seq write section?
Date: Fri, 14 Mar 2014 16:13:14 +0100 [thread overview]
Message-ID: <20140314151314.GA5361@quack.suse.cz> (raw)
In-Reply-To: <20140312150617.GE27965@twins.programming.kicks-ass.net>
On Wed 12-03-14 16:06:17, Peter Zijlstra wrote:
> On Wed, Mar 12, 2014 at 03:34:56PM +0100, Jan Kara wrote:
> > On Wed 12-03-14 07:46:45, Peter Zijlstra wrote:
> > > On Tue, Mar 11, 2014 at 10:32:26PM +0100, Thomas Gleixner wrote:
> > > > > Peter/Thomas: Any thoughts on the deferred printk buffer? Does printk
> > > > > already have something like this? Any other ideas here?
> > > >
> > > > I was thinking about something like that for RT as on RT printk is a
> > > > complete nightmare. It's simple to implement that, but as we know from
> > > > the RT experience it can lead to painful loss of debug output.
> > > >
> > > > Assume you printk inside such a region, which just fills the dmesg
> > > > buffer and schedules the delayed output. Now in that same region you
> > > > run into a deadlock which causes the whole machine to freeze. Then you
> > > > won't see the debug output, which might actually give you the hint why
> > > > the system deadlocked ....
> > >
> > > Ok so I started writing a rant that I don't give a crap about klogd and
> > > that deferring that wakeup would be perfectly fine; then I looked at the
> > > code and found that we in fact do this already.
> > >
> > > wake_up_klogd() schedules a lazy irqwork to go wake up, so that's out.
> > >
> > > That leaves the console sem wakeup; but I suppose we could redo this
> > > patch:
> > >
> > > lkml.kernel.org/r/20110621153806.286257129@chello.nl
> > >
> > > to get rid of that one.
> > I don't know if you've noticed but there's also the following patch:
> > https://lkml.org/lkml/2013/12/23/310
> > which would make it pretty easy to just add messages to printk buffer in
> > timer code and schedule printing later using irq work.
>
> Yeah; I suppose that one is prettier.
JFYI, that patch has been just added to -mm tree.
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
next prev parent reply other threads:[~2014-03-14 15:13 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-06 17:45 is printk() safe within a timekeeper_seq write section? Jiri Bohac
2014-03-11 19:29 ` John Stultz
2014-03-11 21:32 ` Thomas Gleixner
2014-03-11 21:54 ` John Stultz
2014-03-12 6:49 ` Peter Zijlstra
2014-03-12 9:21 ` Jiri Bohac
2014-03-28 0:49 ` John Stultz
2014-03-12 6:46 ` Peter Zijlstra
2014-03-12 14:34 ` Jan Kara
2014-03-12 15:06 ` Peter Zijlstra
2014-03-14 15:13 ` Jan Kara [this message]
2014-03-12 13:13 ` Jan Kara
2014-03-12 9:25 ` Peter Zijlstra
2014-03-12 9:18 ` Peter Zijlstra
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=20140314151314.GA5361@quack.suse.cz \
--to=jack@suse.cz \
--cc=jbohac@suse.cz \
--cc=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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