From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: stefano.franzoni@domain.hid
Cc: "xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] interrupt service routine issue
Date: Wed, 28 Jan 2009 13:38:20 +0000 [thread overview]
Message-ID: <49805FCC.4020403@domain.hid> (raw)
In-Reply-To: <20090128132017.9DDCF1C066@domain.hid>
stefano.franzoni@domain.hid wrote:
> Dear experts
>
> we are working on a systems with Ubuntu Linux 2.6.25.11 and Xenomai 2.4.4.
> The system has an Intel(R) Pentium(R) M processor 1.73GHz.
> The Xenomai installation seems to be ok and also native application tests
> give right results.
Are you sure about this ? To benchmark your system, you should let the
latency test run for some time (say 24 hours), with a sustained load. I
tend to like the "dohell" script to generate this load. What we could
suspect here is SMI issues.
>
> We developed a RT application based on an ISA IRQ.
>
> The application has two RT tasks created with rt_task_create.
> One task has maximum (99) priority waits and manages the IRQ waiting for it
> with an rt_intr_wait.
> The other task has a lower priority and manages the communication with an
> external system using TCP/IP sockets.
>
> The IRQ arrive every 1.6 msec and the interrupt service routine takes about
> 250 usec.
> The issue is that sporadically happens that the interrupt service routine
> takes about 1.7 msec.
>From what I understand, your "interrupt service routine", is in fact a
Xenomai task which you expect to run in primary mode. Did you check
whether it is always running in primary mode? You can ask Xenomai to
send a signal to your thread if ever it switches to secondary mode,
setting a special mode bit with rt_task_set_mode/pthread_set_mode_np,
see online documentation.
Note that you should let your application run with this mode set, to see
if it is indeed what causes the overrun. There are services (malloc
comes to my mind) which will only cause a mode switch from time to time.
There are also unfortunately ways to have a primary mode thread wait for
Linux without causing a mode switch. The typical example is a mutex
shared between the two RT tasks, that the low priority task would take
before calling a plain Linux services. The high priority task locking
this mutex would in fact wait for Linux.
So, this mode bit is no silver bullet, your best option is careful code
inspection.
--
Gilles.
next prev parent reply other threads:[~2009-01-28 13:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-28 13:20 [Xenomai-help] interrupt service routine issue stefano.franzoni
2009-01-28 13:38 ` Gilles Chanteperdrix [this message]
2009-01-29 15:22 ` stefano.franzoni
2009-01-29 15:39 ` Gilles Chanteperdrix
2009-01-29 15:56 ` Jan Kiszka
2009-01-29 16:00 ` Gilles Chanteperdrix
2009-01-29 16:51 ` stefano.franzoni
2009-01-29 16:54 ` Gilles Chanteperdrix
2009-01-28 13:46 ` Gilles Chanteperdrix
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=49805FCC.4020403@domain.hid \
--to=gilles.chanteperdrix@xenomai.org \
--cc=stefano.franzoni@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.