All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: huy-cong.vu@wandercraft.eu, "xenomai@xenomai.org" <xenomai@xenomai.org>
Cc: JAY KOTHARI <jaikothari10@gmail.com>
Subject: Re: [Xenomai] clock_gettime cause runaway thread
Date: Fri, 19 Sep 2014 18:53:11 +0200	[thread overview]
Message-ID: <541C5F77.8050909@xenomai.org> (raw)
In-Reply-To: <4faca0bdd03570d3af0d0af9940fe7c7.squirrel@wandercraft.eu>

On 09/19/2014 06:11 PM, huy-cong.vu@wandercraft.eu wrote:
> Hello everyone,
> I'm currently working with Xenomai in my company's project using RTNet as
> realtime ethernet driver to communicate with Elmo card via EtherCAT
> protocol and SOEM as master library.
> 
> I'm using Linux 3.8.13 patched with Xenomai 2.6.3.
> 
> I'm debugging a simple test which is a cycle of send & receive data with a
> frequency of 1 kHz. The test runs fine for a quite long time (30 mins in
> average), but still throws runaway thread after a certain time.
> 
> My loop is a periodic thread:
> 
> rt_task_set_periodic(rt_task_self(), TM_NOW, 1000000);
> while(1){
> rt_task_wait_period();
> ec_send_processdata();     //SOEM function
> ec_receive_processdata();  //SOEM function
> }
> 
> With SIGDEBUG & gdb, the error seems to start from clock_gettime (when
> ec_receive_processdata is called) with CLOCK_MONOTONIC, change to
> CLOCK_REALTIME reproduces the same issue. My processor is x86_64, I heard
> that the High Resolution Timer of Linux kernel is not supported for
> processor 64 bits, this could be the reason for such behavior?
> 

I never heard about the restriction you are referring to.

> Reading this mailing conversation:
> http://www.xenomai.org/pipermail/xenomai/2013-March/028021.html, I
> understand that I have to put thread on sleep while not running, but even
> with rt_task_sleep inserted, is not better. I don't know neither if
> something could've occupied 100% CPU (while my task normally runs with
> 0.2% CPU occupied).
> 
> I'm running out of ideas for now. I'm very grateful for any suggestions.
> Thank you in advance! (and sorry for my english)
> 

What about testing the return value of rt_task_wait_period()?

-- 
Philippe.


  parent reply	other threads:[~2014-09-19 16:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-19 11:33 [Xenomai] problem with rt_task_wait_period JAY KOTHARI
2014-09-19 11:42 ` Gilles Chanteperdrix
     [not found]   ` <CALe7ZU36HSdTihuwJ7_CBBD+eCyecPr2DvmWyGTxeonRiajmVQ@mail.gmail.com>
2014-09-19 12:03     ` Gilles Chanteperdrix
2014-09-19 16:11       ` [Xenomai] clock_gettime cause runaway thread huy-cong.vu
2014-09-19 16:39         ` Gilles Chanteperdrix
2014-09-19 16:53         ` Philippe Gerum [this message]
2014-09-19 17:14           ` Philippe Gerum
2014-09-22 10:25             ` huy-cong.vu
2014-09-22 10:48               ` Philippe Gerum
2014-09-22 11:19                 ` huy-cong.vu
2014-09-22 16:29 huy-cong.vu
2014-09-23  8:09 ` huy-cong.vu

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=541C5F77.8050909@xenomai.org \
    --to=rpm@xenomai.org \
    --cc=huy-cong.vu@wandercraft.eu \
    --cc=jaikothari10@gmail.com \
    --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.