I have been noticing unexpected intermittant large latencies. I wrote the attached test case to try and capture some information on them. The librt.h file contains convenience functions I use for writing other tests as well, so much of it is irrelevant, but the test case itself is pretty clear I believe. The test case emulates a periodic thread that wakes up on time%PERIOD=0, so rather than sleeping the same amount of time each round, it checks now against the start of its next period and sleeps for that length of time. Every so often it will miss it's period, I've captured that data and included a few of the interesting bits below. The results are from a run with a period of 5ms, although I have seen them with periods as high as 17ms. The system was under heavy network load for some of the time, but not all. One scenario is when we just sleep longer than we planned to. Note below that the actual delta is much larger that the requested sleep, so the latency is very high there, high enough that we woke up well into the next period. ITERATION DELAY(US) MAX_DELAY(US) FAILURES --------- --------- ------------- -------- 1514 11588 11588 1 PERIOD MISSED! scheduled delta: 4080 us actual delta: 15666 us latency: 11585 us --------------------------------------- previous start: 7581588 us now: 7582504 us scheduled start: 7575000 us next scheduled start is in the past! In another scenario, far more common in my experience, is to awake with a very reasonable latency (6us more than requested here), but by the time we complete the loop and look at how long we need to sleep for until the next period, we see that it's deadline has already passed (scheduled_start < now). ITERATION DELAY(US) MAX_DELAY(US) FAILURES --------- --------- ------------- -------- 1240 9 14 0 PERIOD MISSED! scheduled delta: 4072 us actual delta: 4079 us latency: 6 us --------------------------------------- previous start: 6200009 us now: 6210989 us scheduled start: 6205000 us next scheduled start is in the past! I'd appreciate any feedback on the test case, and in particular suggestions on how I can go about determining where this lost time is being spent. Thanks, -- Darren Hart IBM Linux Technology Center Realtime Linux Team Phone: 503 578 3185 T/L: 775 3185