Re: /proc/stat btime accuracy problem

From: john stultz
Date: Wed Jun 01 2011 - 20:49:22 EST


On Wed, 2011-06-01 at 18:31 -0600, Bjorn Helgaas wrote:
> On Wed, Jun 1, 2011 at 5:58 PM, john stultz <johnstul@xxxxxxxxxx> wrote:
> > My first instinct is "don't do that!" to whatever driver is disabling
> > irqs for so long. Do you know what's actually causing these long irq off
> > periods?
> >
> > I assume you're noticing this offset by seeing that CLOCK_REALTIME is
> > off from the RTC right after boot? How severe is this? The RTC read is
> > only second granular, so there's a fair amount of error (~1 second)
> > possible right at boot, so this then must be many seconds worth of lost
> > ticks to be noticeable, right?
>
> I'm using 2.6.34, so not really new. I think the major offender is
> kernel serial printk, which is done in polled mode. A *lot* of it,
> e.g., 30+ seconds' worth.

CC'ing the linux-serial list and Alan for their thoughts: Does the
serial port is disabling irqs for 30+ seconds during boot seem at all
sane?

I would think it would periodically enable irqs in the polling loop to
let things be processed, but maybe not?

> I wonder if there's some reasonably clean
> way to resync with the RTC, say at the time we register a clocksource
> better than jiffies, or in clocksource_done_booting(), or something.

I definitely think we need to address the long irq disable periods
instead of trying to hack around the issue in the timekeeping code.

thanks
-john



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/