[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1169665347.6905.3.camel@localhost.localdomain>
Date: Wed, 24 Jan 2007 11:02:27 -0800
From: john stultz <johnstul@...ibm.com>
To: John <me@...vacy.net>
Cc: linux-kernel@...r.kernel.org, tglx@...esys.com, mingo@...e.hu,
akpm@...l.org, shill@...e.fr
Subject: Re: One-shot high-resolution POSIX timer periodically late
On Wed, 2007-01-24 at 10:41 +0100, John wrote:
> I'm using the POSIX timers API. My platform is x86 running Linux
> 2.6.18.6 patched with the high-resolution timer subsystem.
>
> http://www.tglx.de/hrtimers.html
>
> I've written a small "de-jittering engine" that receives packets in
> small bursts due to network jitter (typical average rate of 1000 packets
> per second), and re-sends them at a "smooth" rate.
>
> Just before I re-send a packet, I arm a one-shot timer in order to
> receive a signal when it is time to send the next packet.
>
> I've noticed a strange phenomenon that I cannot explain.
>
> Sometimes (rarely) the one-shot timer will expire more than 50 µs later
> than expected. This would seem normal, except that it happens periodically.
>
> For example, my app had been running normally for 2 minutes when it
> started printing diagnostics (see below).
>
> The first T_NEXT_POP is the date the timer was supposed to expire,
>
> NOW is the date the timer was handled after returning from sigwaitinfo
> (I am aware that blocking signals, and handling them at a specific point
> in the code will add some latency)
>
> The second T_NEXT_POP is the date the next timer is supposed to expire.
>
> DIFF is the difference between real and expected dates.
>
> (All dates are CLOCK_MONOTONIC by the way.)
>
> As you can see, the first diagnostic came at 472.410501014... Then
> another diagnostic almost exactly two seconds apart 9 times in a row!
>
> My process is the only SCHED_FIFO process on the system. There are no
> user-space processes with a higher priority. AFAICT, only a kernel
> thread could keep the CPU away from my app.
>
> Is there a periodic kernel thread that runs every 2 seconds, cannot be
> preempted, and runs for over 50 µs??
This sounds like a BIOS SMI issue. Can you reproduce this behavior on
different hardware?
thanks
-john
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists