From: Philippe Gerum <rpm@xenomai.org>
To: Paul Ianna <paulianna2002@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] primary mode versus secondary mode
Date: Mon, 21 Aug 2006 22:42:39 +0200 [thread overview]
Message-ID: <1156192960.4321.70.camel@domain.hid> (raw)
In-Reply-To: <75975c320608211321u5b2d9e45nfb078e9ed4d8b617@domain.hid>
On Mon, 2006-08-21 at 16:21 -0400, Paul Ianna wrote:
> Hi All,
>
> I have read (at least some of) the Xenomai docs and am a little
> unclear on the real distinction between primary and secondary mode.
>
> I have seen in the native API that I can receive a signal if a task
> has "migrated to the Linux domain".
>
> Does secondary mode mean that I am no longer a real-time task?
>
Not exactely; it means that your real-time task is entering an execution
mode controlled by the regular Linux scheduler, therefore leaving the
Xenomai one. This means that predictability regarding latencies is
limited by what the vanilla Linux kernel can achieve, in terms of
determinism (i.e. not much by our standards). Your task will switch back
to strict real-time mode automatically when issuing a Xenomai syscall
that requires it (e.g. all blocking Xenomai syscall do).
> How do I avoid dropping from primary mode to secondary mode?
>
- Avoid using plain Linux signals to send asynchronous notifications to
your RT tasks
- Avoid calling any code that could directly or indirectly issue a
regular Linux syscall (e.g. anything from the glibc that might call back
the kernel to perform the operation, like acquiring/releasing a
contended mutex, extending the data segment [malloc -> brk] etc.)
Aside of this, you can be informed of any mode transition from primary
to secondary mode using the rt_task_setmode() call, arming the T_WARNSW
bit for the current task. This will send your task a SIGXCPU signal each
time it crosses the boundary. Have a look at
ksrc/skins/native/snippets/sigxcpu.c, it's a simple illustration of this
service.
Also have a look at /proc/xenomai/stats when your application runs, the
MSW field (i.e. Mode SWitches) counts the number of transitions for each
Xenomai thread. This value should not increase over time, at least for
latency critical threads.
> Thanks in advance,
> Paul Ianna
>
> _______________________________________________
> Xenomai-help mailing list
> Xenomai-help@domain.hid
> https://mail.gna.org/listinfo/xenomai-help
--
Philippe.
next prev parent reply other threads:[~2006-08-21 20:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <75975c320608211235l79dfb17ft54df1018e7f597ff@domain.hid>
2006-08-21 20:21 ` [Xenomai-help] primary mode versus secondary mode Paul Ianna
2006-08-21 20:42 ` Philippe Gerum [this message]
2006-08-23 20:00 ` Paul Ianna
2006-08-23 20:17 ` Philippe Gerum
2006-08-21 20:44 ` Jan Kiszka
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=1156192960.4321.70.camel@domain.hid \
--to=rpm@xenomai.org \
--cc=paulianna2002@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.