From: Peter Zijlstra <peterz@infradead.org>
To: Will Deacon <will.deacon@arm.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Kay Sievers <kay@vrfy.org>
Subject: Re: [RFC PATCH 1/2] printk: print initial logbuf contents before re-enabling interrupts
Date: Fri, 25 Apr 2014 16:01:20 +0200 [thread overview]
Message-ID: <20140425140120.GG11096@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20140425132937.GB10484@arm.com>
On Fri, Apr 25, 2014 at 02:29:37PM +0100, Will Deacon wrote:
> Hi all,
>
> On Thu, Apr 17, 2014 at 12:36:09PM +0100, Will Deacon wrote:
> > When running on a hideously slow system (~10Mhz FPGA) with a bunch of
Hey, still faster then the 4.77 MHz 8088 chips I started with :-)
> > debug printk invocations on the timer interrupt path, we end up filling
> > the log buffer faster than we can drain it.
> >
> > The reason is that console_unlock (which is responsible for moving
> > messages out of logbuf to hand over to the console driver) removes one
> > message at a time, briefly re-enabling interrupts between each of them.
> > If the interrupt path prints more than a single message, then we can
> > easily generate more messages than we can print for a regular, recurring
> > interrupt (e.g. a 1khz timer). This results in messages getting silently
> > dropped, leading to counter-intuitive, incomplete printk traces on the
> > console.
> >
> > Rather than run the console_unlock loop with interrupts disabled (which
> > has obvious latency problems), this patch records the sequence number of
> > the last message in the log buffer after taking the logbuf_lock. We can
> > then print this fixed amount of work before re-enabling interrupts again,
> > making sure we keep up with ourself. Other CPUs could still potentially
> > flood the buffer, but there's little that we can do to protect against
> > that.
>
> Any thoughts on these two patches? I can understand the reluctance to make
> changes to printk, but I had a horrible time debugging timers without these
> patches!
They look fine to me.
next prev parent reply other threads:[~2014-04-25 14:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-17 11:36 [RFC PATCH 1/2] printk: print initial logbuf contents before re-enabling interrupts Will Deacon
2014-04-17 11:36 ` [RFC PATCH 2/2] printk: report dropping of messages from logbuf Will Deacon
2014-04-25 13:29 ` [RFC PATCH 1/2] printk: print initial logbuf contents before re-enabling interrupts Will Deacon
2014-04-25 14:01 ` Peter Zijlstra [this message]
2014-04-25 14:20 ` Will Deacon
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=20140425140120.GG11096@twins.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=kay@vrfy.org \
--cc=linux-kernel@vger.kernel.org \
--cc=will.deacon@arm.com \
/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