From: "Jon Smirl" <jonsmirl@gmail.com>
To: "Mathieu Desnoyers" <compudj@krystal.dyndns.org>
Cc: linux-kernel@vger.kernel.org, ltt-dev@shafik.org
Subject: Re: Interrupts disabled for too long in printk
Date: Wed, 7 Jun 2006 21:37:25 -0400 [thread overview]
Message-ID: <9e4733910606071837l4e81c975t8d531ed9810af60f@mail.gmail.com> (raw)
In-Reply-To: <20060603111934.GA14581@Krystal>
On 6/3/06, Mathieu Desnoyers <compudj@krystal.dyndns.org> wrote:
> Hi,
>
> I ran some experiments with my kernel tracer (LTTng : http://ltt.polymtl.ca)
> that showed missing interrupts. I wrote a small paper to show how to use my
> tracer to solve this kind of problem which I presented at the CE Linux Form
> last April.
>
> http://tree.celinuxforum.org/CelfPubWiki/ELC2006Presentations?action=AttachFile&do=get&target=celf2006-desnoyers.pdf
>
> It shows that, when the serial console is activated, the following code disables
> interrupts for up to 15ms. On a system configured with a 250HZ timer (each 4ms),
> it means that 3 scheduler ticks are lost.
>
> In the current git :
>
> kernel/printk.c: release_console_sem()
>
> for ( ; ; ) {
> -----> spin_lock_irqsave(&logbuf_lock, flags);
> wake_klogd |= log_start - log_end;
> if (con_start == log_end)
> break; /* Nothing to print */
> _con_start = con_start;
> _log_end = log_end;
> con_start = log_end; /* Flush */
> spin_unlock(&logbuf_lock);
> call_console_drivers(_con_start, _log_end);
> -----> local_irq_restore(flags);
> }
You can look at this problem from the other direction too. Why is it
taking 15ms to get between the two points? If IRQs are off how is the
serial driver getting interrupts to be able to display the message? It
is probably worthwhile to take a look and see what the serial console
driver is doing.
> I guess interrupts are disabled for a good reason (to protect this spinlock for
> being taken by a nested interrupt handler. One way I am thinking to fix this
> problem would be to do a spin try lock and fail if it is already taken.
--
Jon Smirl
jonsmirl@gmail.com
next prev parent reply other threads:[~2006-06-08 1:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-03 11:19 Mathieu Desnoyers
2006-06-03 21:43 ` Steven Rostedt
2006-06-08 1:09 ` Mathieu Desnoyers
2006-06-08 1:37 ` Jon Smirl [this message]
2006-06-08 2:31 ` Mathieu Desnoyers
2006-06-08 2:35 ` Jon Smirl
2006-06-08 10:24 ` linux-os (Dick Johnson)
2006-06-08 14:38 ` Jon Smirl
2006-06-08 15:17 ` linux-os (Dick Johnson)
2006-06-08 15:45 ` Jon Smirl
2006-06-08 18:34 ` Miquel van Smoorenburg
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=9e4733910606071837l4e81c975t8d531ed9810af60f@mail.gmail.com \
--to=jonsmirl@gmail.com \
--cc=compudj@krystal.dyndns.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ltt-dev@shafik.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
all inboxes | Powered by JetHome®