[lkml]   [2006]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: Interrupts disabled for too long in printk
    On 6/3/06, Mathieu Desnoyers <> wrote:
    > Hi,
    > I ran some experiments with my kernel tracer (LTTng :
    > 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.
    > 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
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2006-06-08 03:39    [W:0.023 / U:106.172 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site