From: Philippe Gerum <rpm@xenomai.org>
To: Petr Cervenka <grugh@domain.hid>
Cc: xenomai@xenomai.org, jan.kiszka@domain.hid
Subject: Re: [Xenomai-help] rt_pipe and rt_queue problems
Date: Thu, 03 Aug 2006 20:01:10 +0200 [thread overview]
Message-ID: <1154628070.5010.146.camel@domain.hid> (raw)
In-Reply-To: <200608031628.31584@domain.hid>
On Thu, 2006-08-03 at 16:28 +0200, Petr Cervenka wrote:
> >Petr Cervenka wrote:
> >> I have Xenomai snapshot (18.5.2006, 2.1.1 ~ 2.1.2) and userspace
> >> application. I need to exchange lot of data between two tasks
> >> (producer -> consumer) with some buffer in the middle. I used
> >> rt_pipe/linux device scheme, but I realised that the preformance is
> >> very low. (At least some performance monitor showed it)
> >
> >Could you elaborate on this? Does the performance monitor (which one?)
> >tell you more details? What is the characteristic of your transferred
> >data (size, frequency)?
> performace editor: KSysGuard, graphs of System Load and User Load
> Frequency: 10000Hz(100us period), cca 50-100bytes
> I tried to remove the pipe. The producer didn't send data in pipe and the consumer was synchronized by timer instead of read from pipe. The cpu load was much lower (50+% -> 10-%).
>
I'm not sure to understand which kind of impact you would expect from an
IPC that does at the very least a kernel-to-user copy of the transmitted
data, but also crosses boundaries between RT and non-RT domains.
This said, I agree that queues are likely the best way to exchange large
amount of data between RT tasks, specifically if you can prepare the
largest possible data bulks to be sent in place (i.e. directly in the
transmission buffer obtained by rt_queue_alloc), so that there is no
other copy needed for transmission.
> >
> >> So I tried to use rt_queue. But when I tried to read from queue with
> >> timeout (or TM_INFINITE), I got an EPERM error. That means: "service
> >> should block, but was called from a context, which cannot sleep.".
> >> But I want to sleep (and wait for new data). Where is the problem? Do
> >> you have any advice?
> >
> >Is the read of the queue a Xenomai thread? It has to be, even if it will
> >mostly run in secondary (Linux) mode. Check also /proc/xenomai/sched
> >when you think it should be.
> Both tasks are created by rt_task_create and started by rt_task_start. They are also in /proc/xenomai/sched:
> CPU PID PRI TIMEOUT STAT NAME
> 0 0 -1 0 R ROOT/0
> 1 0 -1 0 R ROOT/1
> 1 313 20 0 X main_task
> 1 314 30 30195788906 w hw_task
> Note: I'm still using your patch allowing to call rtdm_event_timedwait even in nrt.
>
> >Maybe what you really want is shared memory between producer and
> >consumer. If the consumer is mapped to Xenomai, you can even use normal
> >synchronisation (mutexes/semaphores) to control the access - or design
> >something lock-less.
> I think, that pipes or queues are exactly what I need (FIFO). Every atempt to use shared memory and synchronization will probably bring only more errors made by myself.
>
> Petr
>
>
> _______________________________________________
> Xenomai-help mailing list
> Xenomai-help@domain.hid
> https://mail.gna.org/listinfo/xenomai-help
--
Philippe.
next prev parent reply other threads:[~2006-08-03 18:01 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-02 16:08 [Xenomai-help] rt_pipe and rt_queue problems Petr Cervenka
2006-08-02 19:04 ` Jan Kiszka
2006-08-03 14:28 ` Petr Cervenka
2006-08-03 18:01 ` Philippe Gerum [this message]
2006-08-03 21:35 ` Jan Kiszka
2006-08-04 11:45 ` Petr Cervenka
2006-08-05 16:50 ` Jan Kiszka
2006-08-05 17:40 ` Philippe Gerum
2006-08-07 13:03 ` Dmitry Adamushko
2006-08-07 13:37 ` Jan Kiszka
2006-08-07 14:05 ` Philippe Gerum
2006-08-07 14:23 ` Dmitry Adamushko
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=1154628070.5010.146.camel@domain.hid \
--to=rpm@xenomai.org \
--cc=grugh@domain.hid \
--cc=jan.kiszka@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.