From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Xenomai <xenomai@xenomai.org>
Subject: Re: [Xenomai] RTDM syscalls & switching
Date: Tue, 14 Jun 2016 18:42:40 +0200 [thread overview]
Message-ID: <20160614164240.GG23680@hermes.click-hack.org> (raw)
In-Reply-To: <57603007.8010100@siemens.com>
On Tue, Jun 14, 2016 at 06:25:43PM +0200, Jan Kiszka wrote:
> On 2016-06-14 18:12, Gilles Chanteperdrix wrote:
> > On Tue, Jun 14, 2016 at 06:03:20PM +0200, Jan Kiszka wrote:
> >> On 2016-06-14 17:51, Gilles Chanteperdrix wrote:
> >>>> Sorry, there *is*: Shadowed thread (anything created by wrapped
> >>>> pthread_create) calls, say, read() on some Linux file descriptor, read()
> >>>> is wrapped, first probes the call on RTDM, which means migration to RT
> >>>> (for currently relaxed threads, like SCHED_WEAK), no RTDM match in the
> >>>> kernel, and finally the migration to NRT in order to do the Linux read()
> >>>> syscall. That didn't happen with the original design.
> >>>
> >>> The wrapped read does not get ping-pong when calling the Linux I/O
> >>> syscalls. The term syscall means something very precise, and
> >>> __wrap_read is not a syscall. It gets ping-pong because it calls
> >>> RTDM I/O. But if you call directly Linux I/O syscall, with say
> >>> __real_read, you do not get ping-pong. Linux I/O syscall work as
> >>> they have always have: they require xenomai threads to run in
> >>> secondary mode and will cause them to switch to secondary mode to
> >>> handle the syscall.
> >>
> >> __real_* are a non-portable workarounds for special cases. It's not what
> >> Xenomai developers are supposed to use in their applications.
> >
> > My argument is that you do not get ping-pong with Linux I/O
> > syscalls. And whether __real_* is portable or not does not change
> > that fact.
>
> ...or by not doing eager migration.
Once again: there is no eager migration to primary mode for Linux
I/O syscalls, this would not make any sense. Only eager migration to
secondary mode, and this has always been like that, nothing changed
with 3.x.
> > Well, actually, I have been thinking about doing exactly that when
> > not wrapping: when the application has to call __RT(read) to call
> > Xenomai read, there is no reason for this call to fall back to Linux
> > read call. The idea came to late, but who knows, I may use it for a
> > later version.
>
> Sure, such ideas existed a long time ago already, but then we rather
> moved towards seamless integration with Linux and easy porting to/from
> Xenomai. If basic things like I/O already requires special care, then we
> can indeed go back directly to requiring explicit call tagging. Not
> portable either, though a tag like __RT() can be more easily defined
> away on native real-time.
>
> That said, such a requirement will not make developers of existing
> large, complex, layered applications happy. Like in our case.
I have some experience porting POSIX applications to Xenomai, and
when I did it I knew precisely at each point in the code whether the
underlying thread was a Xenomai thread, or a Linux thread. It looks
to me like a pre-requisite for programming applications based on
dual-kernels. So, when you say "large, complex, layered
application", I just hear "badly designed". The fallback in the
"wrapped read" is to allow plain Linux threads to be able to
continue to use read, not for Xenomai threads running in secondary
mode to have a high-performance Linux read, this use of read is a
corner case, and getting that corner case to work like it worked in
2.x had really bad side effects. But this is not the point of my
e-mail at all. I will let Philippe work with you on this issue.
The original point of my mail was that your assertion that "Linux
I/O syscalls cause ping pong" is false. How Linux syscalls work, I/O
or otherwise, with Xenomai, has always been the same.
--
Gilles.
https://click-hack.org
next prev parent reply other threads:[~2016-06-14 16:42 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-12 16:06 [Xenomai] RTDM syscalls & switching Jan Kiszka
2016-05-12 16:31 ` Gilles Chanteperdrix
2016-05-12 16:50 ` Jan Kiszka
2016-05-12 16:59 ` Gilles Chanteperdrix
2016-05-12 17:12 ` Gilles Chanteperdrix
2016-05-12 17:17 ` Jan Kiszka
2016-05-12 18:20 ` Gilles Chanteperdrix
2016-05-12 18:24 ` Jan Kiszka
2016-05-12 18:30 ` Gilles Chanteperdrix
2016-05-12 18:33 ` Jan Kiszka
2016-05-12 18:35 ` Philippe Gerum
2016-05-12 18:42 ` Jan Kiszka
2016-05-12 19:08 ` Philippe Gerum
2016-05-12 19:27 ` Jan Kiszka
2016-05-12 19:47 ` Gilles Chanteperdrix
2016-05-12 22:26 ` Philippe Gerum
2016-05-13 5:54 ` Jan Kiszka
2016-05-13 13:38 ` Philippe Gerum
2016-05-13 15:32 ` Jan Kiszka
2016-06-14 15:09 ` Jan Kiszka
2016-06-14 15:23 ` Philippe Gerum
2016-06-14 15:27 ` Jan Kiszka
2016-06-14 15:38 ` Gilles Chanteperdrix
2016-06-14 15:43 ` Jan Kiszka
2016-06-14 15:51 ` Gilles Chanteperdrix
2016-06-14 16:03 ` Jan Kiszka
2016-06-14 16:12 ` Gilles Chanteperdrix
2016-06-14 16:25 ` Jan Kiszka
2016-06-14 16:42 ` Gilles Chanteperdrix [this message]
2016-06-14 16:59 ` Jan Kiszka
2016-06-14 22:12 ` Gilles Chanteperdrix
2016-06-14 15:47 ` Jan Kiszka
2016-06-14 19:48 ` Philippe Gerum
2016-06-14 20:03 ` Jan Kiszka
2016-06-14 20:13 ` Philippe Gerum
2016-06-14 17:13 ` Jan Kiszka
2016-06-14 20:11 ` Philippe Gerum
2016-06-14 20:35 ` Gilles Chanteperdrix
2016-05-12 19:11 ` Gilles Chanteperdrix
2016-05-12 19:31 ` Jan Kiszka
2016-05-12 19:39 ` Gilles Chanteperdrix
2016-05-12 17:14 ` Jan Kiszka
2016-05-12 17:38 ` Philippe Gerum
2016-05-12 17:51 ` Jan Kiszka
2016-05-12 18:22 ` Gilles Chanteperdrix
2016-05-12 18:31 ` 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=20160614164240.GG23680@hermes.click-hack.org \
--to=gilles.chanteperdrix@xenomai.org \
--cc=jan.kiszka@siemens.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.