All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] nanosleep not returning
@ 2011-12-20 22:07 Phil Mitchell
  2011-12-21  9:46 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 2+ messages in thread
From: Phil Mitchell @ 2011-12-20 22:07 UTC (permalink / raw)
  To: xenomai

Hello,

I am having a problem with code never returning from the nanosleep
function call. I have 3 pthreads running, the threads all
have nanosleeps before executing their main looping task. The
program runs fine for hours and I can kill it and start it again
without issue. However, occasionally I enter a state where my 3
threads are all waiting on nanosleep.

Once this nanosleep problem occurs then the only way to fix it is
to reboot the system. Then everything works ok again.

The exact sleep times are 1, 1 and 60 seconds. If I look at
/proc/xenomai/sched when in the failed state I can see that instead
of counting down from 1 second to zero they are all counting down
from ~250msec down to ~zero and then back to ~250msec again. I can
even see that the 60 second delay initially goes down to ~zero and
then it keeps restarting from ~250msec. It seems like nanosleep
is correctly counting down to ~zero, never exits and then starts
again with a ~250msec delay.

If I debug the code (GDB) when in this strange state nothing seems out
of place, all the time values passed into nanosleep look correct. The
function is called once and never returns.

I am running Xenomai-2.5.5.2 with a 2.6.34.5 Kernel and using
a dual core Atom processor.

The latency program works correctly giving ~6usecs results prior to
encountering this problem and afterwards it stalls at  "warming up".

root@domain.hid# ./latency
== Sampling period: 100 us
== Test mode: periodic user-mode task
== All results in microseconds
warming up...
^C---|-----------|-----------|-----------|--------|------|-------------------------
RTS|   6250.000|      0.000|  -6250.000|       0|     0|    00:00:06/00:00:06
root@domain.hid#

Please let me know if anyone has suggestions.

Thanks,
Phil


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-12-21  9:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-20 22:07 [Xenomai-help] nanosleep not returning Phil Mitchell
2011-12-21  9:46 ` Gilles Chanteperdrix

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.