All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Phil Mitchell <p.mitch@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] nanosleep not returning
Date: Wed, 21 Dec 2011 10:46:43 +0100	[thread overview]
Message-ID: <4EF1AB03.5030202@domain.hid> (raw)
In-Reply-To: <CAJZRki8mr5M2mtZbTD2H3WAGCJDpzjBA-KPxXgoPuufCHKu+qg@domain.hid>

On 12/20/2011 11:07 PM, Phil Mitchell wrote:
> 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.

Could you test if you have the same issue with 2.5.6? When this happens,
do you see with the "date" command if the timer is stopped? What about
/proc/xenomai/timer? Is there no message in the kernel logs?

-- 
					    Gilles.


      reply	other threads:[~2011-12-21  9:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-20 22:07 [Xenomai-help] nanosleep not returning Phil Mitchell
2011-12-21  9:46 ` Gilles Chanteperdrix [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EF1AB03.5030202@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=p.mitch@domain.hid \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.